README
1NAME
2 Crypt::Rijndael - Crypt::CBC compliant Rijndael encryption
3 module
4
5SYNOPSIS
6 use Crypt::Rijndael;
7
8 # keysize() is 32, but 24 and 16 are also possible
9 # blocksize() is 16
10
11 $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC() );
12
13 $cipher->set_iv($iv);
14 $crypted = $cipher->encrypt($plaintext);
15 # - OR -
16 $plaintext = $cipher->decrypt($crypted);
17
18DESCRIPTION
19 This module implements the Rijndael cipher, which has just been
20 selected as the Advanced Encryption Standard.
21
22 keysize
23 Returns the keysize, which is 32 (bytes). The Rijndael
24 cipher actually supports keylengths of 16, 24 or 32 bytes,
25 but there is no way to communicate this to `Crypt::CBC'.
26
27 blocksize
28 The blocksize for Rijndael is 16 bytes (128 bits), although
29 the algorithm actually supports any blocksize that is any
30 multiple of our bytes. 128 bits, is however, the AES-
31 specified block size, so this is all we support.
32
33 $cipher = Crypt::Rijndael->new( $key [, $mode] )
34 Create a new `Crypt::Rijndael' cipher object with the given
35 key (which must be 128, 192 or 256 bits long). The
36 additional `$mode' argument is the encryption mode, either
37 `MODE_ECB' (electronic codebook mode, the default),
38 `MODE_CBC' (cipher block chaining, the same that
39 `Crypt::CBC' does), `MODE_CFB' (128-bit cipher feedback),
40 `MODE_OFB' (128-bit output feedback), or `MODE_CTR' (counter
41 mode).
42
43 ECB mode is very insecure (read a book on cryptography if
44 you dont know why!), so you should probably use CBC mode.
45
46 $cipher->set_iv($iv)
47 This allows you to change the initial value vector used by
48 the chaining modes. It is not relevant for ECB mode.
49
50 $cipher->encrypt($data)
51 Encrypt data. The size of `$data' must be a multiple of
52 `blocksize' (16 bytes), otherwise this function will croak.
53 Apart from that, it can be of (almost) any length.
54
55 $cipher->decrypt($data)
56 Decrypts `$data'.
57
58 Encryption modes
59
60 Use these constants to select the cipher type:
61
62 MODE_CBC - Cipher Block Chaining
63 MODE_CFB - Cipher feedback
64 MODE_CTR - Counter mode
65 MODE_ECB - Electronic cookbook mode
66 MODE_OFB - Output feedback
67 MODE_PCBC - ignore this one for now :)
68SEE ALSO
69 the Crypt::CBC manpage, http://www.csrc.nist.gov/encryption/aes/
70
71BUGS
72 Should EXPORT or EXPORT_OK the MODE constants.
73
74AUTHOR
75 Currently maintained by brian d foy, `< <bdfoy@cpan.org' >>.
76
77 Original code by Rafael R. Sevilla.
78
79 The Rijndael Algorithm was developed by Vincent Rijmen and Joan
80 Daemen, and has been selected as the US Government's Advanced
81 Encryption Standard.
82
83SOURCE
84 This code is in Github:
85
86 git://github.com/briandfoy/crypt-rijndael.git
87
88 =head1 LICENSE
89
90 This software is licensed under the Lesser GNU Public License.
91 See the included COPYING file for details.
92
93