Crypt::Cipher::Camellia - Symmetric cipher Camellia, key size: 128/192/256 bits
| Use Case | Command | Description |
|---|---|---|
| Create cipher object | $c = Crypt::Cipher::Camellia->new($key); | Instantiate with just a key |
| Create cipher object with rounds | $c = Crypt::Cipher::Camellia->new($key, $rounds); | Instantiate with key and custom rounds |
| Encrypt one block | $ciphertext = $c->encrypt($plaintext); | Raw block encryption (16 bytes) |
| Decrypt one block | $plaintext = $c->decrypt($ciphertext); | Raw block decryption (16 bytes) |
| Get key size | $c->keysize; / Crypt::Cipher::Camellia->keysize; | Returns key length in bytes |
| Get block size | $c->blocksize; / Crypt::Cipher::Camellia->blocksize; | Returns block size (16 bytes) |
| Get max key size | $c->max_keysize; | Returns maximum key length (32 bytes) |
| Get min key size | $c->min_keysize; | Returns minimum key length (16 bytes) |
| Get default rounds | $c->default_rounds; | Returns the default number of rounds |
### example 1
use Crypt::Mode::CBC;
my $key = '...'; # length has to be valid key size for this cipher
my $iv = '...'; # 16 bytes
my $cbc = Crypt::Mode::CBC->new('Camellia');
my $ciphertext = $cbc->encrypt("secret data", $key, $iv);
### example 2 (slower)
use Crypt::CBC;
use Crypt::Cipher::Camellia;
my $key = '...'; # length has to be valid key size for this cipher
my $iv = '...'; # 16 bytes
my $cbc = Crypt::CBC->new( -cipher=>'Cipher::Camellia', -key=>$key, -iv=>$iv );
my $ciphertext = $cbc->encrypt("secret data");
This module implements the Camellia cipher. Provided interface is compliant with Crypt::CBC module.
BEWARE: This module implements just elementary "one-block-(en|de)cryption" operation - if you want to encrypt/decrypt generic data you have to use some of the cipher block modes - check for example Crypt::Mode::CBC, Crypt::Mode::CTR or Crypt::CBC (which will be slower).
$c = Crypt::Cipher::Camellia->new($key);$c = Crypt::Cipher::Camellia->new($key, $rounds); — Create a new cipher object. $key length must match one of the allowed sizes (128, 192, or 256 bits). Optional $rounds parameter overrides the default round count.$ciphertext = $c->encrypt($plaintext); — Encrypts a single block (16 bytes) of data and returns the ciphertext.$plaintext = $c->decrypt($ciphertext); — Decrypts a single block and returns the plaintext.$c->keysize; / Crypt::Cipher::Camellia->keysize; / Crypt::Cipher::Camellia::keysize; — Returns the key size in bytes for the current object or class.$c->blocksize; / Crypt::Cipher::Camellia->blocksize; / Crypt::Cipher::Camellia::blocksize; — Returns the block size (always 16 bytes).$c->max_keysize; / Crypt::Cipher::Camellia->max_keysize; / Crypt::Cipher::Camellia::max_keysize; — Returns the maximum supported key size (32 bytes).$c->min_keysize; / Crypt::Cipher::Camellia->min_keysize; / Crypt::Cipher::Camellia::min_keysize; — Returns the minimum supported key size (16 bytes).$c->default_rounds; / Crypt::Cipher::Camellia->default_rounds; / Crypt::Cipher::Camellia::default_rounds; — Returns the default number of rounds used by the cipher.Generated by phpman v4.9.25-4-g0d844aa · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-07 09:11 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format