Crypt::...::KASUMI(3)

πŸ’– NAME πŸ’–

okay so bestie, this is the manual page for Crypt::...::KASUMI(3) β€” straight from the User Contributed Perl Documentation. It's all about Crypt::Cipher::KASUMI, the Symmetric cipher KASUMI, key size: 128 bits. slay. πŸ¦‹


🌸 SYNOPSIS 🌸

Two whole examples, literally right here β€” keep the code exactly as-is, okay?

### 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('KASUMI');
my $ciphertext = $cbc->encrypt("secret data", $key, $iv);

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

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

🌈 DESCRIPTION 🌈

This module implements the KASUMI cipher. Its interface is compatible with Crypt::CBC. iykyk πŸ’…

⚠️ Note: 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).

πŸŽ€ METHODS πŸŽ€

Unless noted otherwise, assume $c is an existing cipher object created via new, for example:

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

✨ new ✨

Here's the signature, bestie β€” the comments are part of the lore:

my $c = Crypt::Cipher::KASUMI->new($key);
#or
my $c = Crypt::Cipher::KASUMI->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 of an accepted length (check keysize, min_keysize, max_keysize), and $rounds is optional β€” an integer number of rounds if the cipher supports it, and it croaks on an invalid value. 🫢

πŸ” encrypt πŸ”

Encrypts exactly one block of plaintext. The length of $plaintext must equal blocksize; croaks otherwise. An empty string is accepted and returned unchanged.

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

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

πŸ”“ decrypt πŸ”“

Decrypts exactly one block of ciphertext. The length of $ciphertext must equal blocksize; croaks otherwise. An empty string is accepted and returned unchanged.

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

Returns the decrypted block as a binary string (raw bytes). πŸ’–

πŸ”‘ keysize πŸ”‘

Just an alias for max_keysize.

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

🧱 blocksize 🧱

Returns the cipher block size (in bytes).

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

πŸ“ max_keysize πŸ“

Returns the maximum key size (in bytes).

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

πŸ“ min_keysize πŸ“

Returns the minimum key size (in bytes).

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

πŸ” default_rounds πŸ”

Returns the cipher's default round count.

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

🫢 SEE ALSO 🫢

that's the whole page, bestie πŸ’… β€” this cutie comes from perl v5.42.0, dated 2026-05-11, and it's filed under Crypt::...::KASUMI(3). periodt. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from