Crypt::Stream::Sosemanuk(3) User Contributed Perl Documentation NAME Crypt::Stream::Sosemanuk - Stream cipher Sosemanuk SYNOPSIS use Crypt::Stream::Sosemanuk; # encrypt my $key = "1234567890123456"; my $iv = "123456789012"; my $enc_stream = Crypt::Stream::Sosemanuk->new($key, $iv); my $ct = $enc_stream->crypt("plain message"); # decrypt my $dec_stream = Crypt::Stream::Sosemanuk->new($key, $iv); my $pt = $dec_stream->crypt($ct); DESCRIPTION Provides an interface to the Sosemanuk stream cipher. METHODS Unless noted otherwise, assume $stream is an existing stream object created via "new", for example: my $stream = Crypt::Stream::Sosemanuk->new($key, $iv); new my $stream = Crypt::Stream::Sosemanuk->new($key, $iv); # $key .. [binary string] keylen must be multiple of 4 bytes # $iv .. [binary string] ivlen must be multiple of 4 bytes (OPTIONAL - simply omit to skip IV setup) crypt Encrypts or decrypts data. The output has the same length as the input. Returns a binary string (raw bytes). The input is converted using Perl's usual scalar stringification. Passing "undef" is treated as an empty string with the usual warning, and numeric scalars are stringified before processing. my $ciphertext = $stream->crypt($plaintext); #or my $plaintext = $stream->crypt($ciphertext); keystream Returns $length bytes of raw keystream as a binary string. The length is taken using Perl's usual numeric coercion. Values that coerce to an oversized unsigned length are rejected as too large. my $random_key = $stream->keystream($length); clone Returns a copy of the stream cipher object in its current state. my $stream2 = $stream->clone(); SEE ALSO o Crypt::Stream::RC4, Crypt::Stream::ChaCha, Crypt::Stream::Salsa20, Crypt::Stream::Sober128 o perl v5.42.2 2026-08-10 Crypt::Stream::Sosemanuk(3)