Crypt::...::Rabbit(3)
π NAME π
Crypt::Stream::Rabbit β Stream cipher Rabbit. Also hiiii, you're on the Crypt::...::Rabbit(3) page from User Contributed Perl Documentation, and we are gonna get you comfy with it π«Άβ¨
π SYNOPSIS π
use Crypt::Stream::Rabbit;
# encrypt
my $key = "1234567890123456";
my $iv = "12345678";
my $enc_stream = Crypt::Stream::Rabbit->new($key, $iv);
my $ct = $enc_stream->crypt("plain message");
# decrypt
my $dec_stream = Crypt::Stream::Rabbit->new($key, $iv);
my $pt = $dec_stream->crypt($ct);
π DESCRIPTION π
This gives you an interface to the Rabbit stream cipher. That's the whole vibe of the module, bestie β it's the Rabbit stream cipher hookup π.
β¨ METHODS β¨
Unless a method says otherwise, assume $stream is an existing stream object created via new, like:
my $stream = Crypt::Stream::Rabbit->new($key, $iv);
new β constructor o'clock π°
my $stream = Crypt::Stream::Rabbit->new($key, $iv);
# $key .. [binary string] key length must be at most 16 bytes
# $iv .. [binary string] IV length must be at most 8 bytes
my $stream = Crypt::Stream::Rabbit->new($key);
# note: new($key) skips IV setup entirely, while new($key, "") performs
# IV setup with a zero-length IV. These produce different keystreams.
Okay so $key is a binary string and its length must be at most 16 bytes; $iv is also a binary string and its length must be at most 8 bytes. And the little note above is highkey important: new($key) skips IV setup entirely, while new($key, "") performs IV setup with a zero-length IV β and those produce different keystreams, no cap π.
crypt β encrypt/decrypt era π
Encrypts or decrypts data. The output has the same length as the input. Returns a binary string (raw bytes) β very "here are your raw bytes, bestie" π .
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 β gimme bytes π
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 β so don't be out here trying to manifest a giant unsigned length, it's not gonna slay π.
my $random_key = $stream->keystream($length);
clone β duplicate the vibe π§¬
Returns a copy of the stream cipher object in its current state.
my $stream2 = $stream->clone();
π SEE ALSO π
Crypt::Stream::RC4,Crypt::Stream::ChaCha,Crypt::Stream::Salsa20,Crypt::Stream::Sober128<https://en.wikipedia.org/wiki/Rabbit_(cipher)><https://www.rfc-editor.org/rfc/rfc4503>
mwah π β this page is signed perl v5.42.0, dated 2026-05-11, and filed under Crypt::...::Rabbit(3). bye bestie, go encrypt something cute β¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms