Crypt::...::Anubis(3)

πŸ’œ Crypt::Cipher::Anubis β€” the perl manpage, but make it bestie πŸ’œ

okay so this is the page for Crypt::Cipher::Anubis, straight out of the User Contributed Perl Documentation crew 🫢 β€” and no, the manual name isn't a typo-scream, that's literally how it's filed, Crypt::...::Anubis(3). slay.


✨ NAME ✨

Crypt::Cipher::Anubis β€” it's the Symmetric cipher Anubis, and its key size is 128-320 bits. that's the whole vibe. πŸ”₯


🌸 SYNOPSIS 🌸

okay so here's how you actually use it, two ways, pick your fighter:

### example 1
use Crypt::Mode::CBC;

my $key = '...'; # length must be a valid key size for this cipher
my $iv = '...';  # 16 bytes
my $cbc = Crypt::Mode::CBC->new('Anubis');
my $ciphertext = $cbc->encrypt("secret data", $key, $iv);

### example 2 (slower)
use Crypt::CBC;
use Crypt::Cipher::Anubis;

my $key = '...'; # length must be a valid key size for this cipher
my $iv = '...';  # 16 bytes
my $cbc = Crypt::CBC->new( -cipher=>'Cipher::Anubis', -key=>$key, -iv=>$iv );
my $ciphertext = $cbc->encrypt("secret data");

note the ### example 2 (slower) β€” that one's literally labeled slower by the module itself, not me being shady 😭 iykyk.


πŸ¦‹ DESCRIPTION πŸ¦‹

so this module implements the Anubis cipher, and its interface is compatible with Crypt::CBC. matching energies, no drama. πŸŽ€

⚠️ the big note, do not skip this one bestie: This module only implements single-block encryption and decryption. For general data, use a block mode such as Crypt::Mode::CBC, Crypt::Mode::CTR, or Crypt::CBC (which is slower). don't rawdog your real data through one block, fr fr πŸ’€

πŸ‘‘ METHODS πŸ‘‘

unless it says otherwise, just assume $c is an existing cipher object you made with "new", like this:

my $c = Crypt::Cipher::Anubis->new($key);

🌈 new

my $c = Crypt::Cipher::Anubis->new($key);
#or
my $c = Crypt::Cipher::Anubis->new($key, $rounds);

# $key .... [binary string] key of an accepted length (see keysize, min_keysize, max_keysize)
# $rounds . [integer] optional, number of rounds (if supported by the cipher; croaks on invalid value)

so $key is a binary string and it's gotta be an accepted length β€” check keysize, min_keysize, max_keysize for the deets. πŸ’– and $rounds is optional, an integer, the number of rounds β€” if the cipher supports it. give it a bad value and it croaks, so like… be normal about it πŸ™ˆ


πŸŽ€ encrypt

encrypts exactly one block of plaintext. periodt. the length of $plaintext must equal "blocksize" β€” otherwise it croaks. an empty string is accepted and returned unchanged (iconic, no notes).

my $ciphertext = $c->encrypt($plaintext);

returns the encrypted block as a binary string (raw bytes). ✨


πŸ“ decrypt

the reverse bestie: decrypts exactly one block of ciphertext. the length of $ciphertext must equal "blocksize" β€” otherwise it croaks. an empty string is accepted and returned unchanged.

my $plaintext = $c->decrypt($ciphertext);

returns the decrypted block as a binary string (raw bytes). πŸ’…


⭐ keysize

literally just an alias for "max_keysize". that's it, that's the method.

$c->keysize;
#or
Crypt::Cipher::Anubis->keysize;
#or
Crypt::Cipher::Anubis::keysize;

πŸ’€ blocksize

returns the cipher block size (in bytes).

$c->blocksize;
#or
Crypt::Cipher::Anubis->blocksize;
#or
Crypt::Cipher::Anubis::blocksize;

🌸 max_keysize

returns the maximum key size (in bytes).

$c->max_keysize;
#or
Crypt::Cipher::Anubis->max_keysize;
#or
Crypt::Cipher::Anubis::max_keysize;

🧚 min_keysize

returns the minimum key size (in bytes).

$c->min_keysize;
#or
Crypt::Cipher::Anubis->min_keysize;
#or
Crypt::Cipher::Anubis::min_keysize;

🫢 default_rounds

returns the cipher's default round count. the factory setting. the no-thoughts-just-vibes number of rounds. 😌

$c->default_rounds;
#or
Crypt::Cipher::Anubis->default_rounds;
#or
Crypt::Cipher::Anubis::default_rounds;

πŸ”₯ SEE ALSO πŸ”₯


and that's the page!! 🌈 this whole thing is perl v5.42.0, dated 2026-05-11 β€” so when you cite it in the group chat, cite it right: perl v5.42.0, 2026-05-11, Crypt::...::Anubis(3). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from