![]() |
![]()
| ![]() |
![]()
NAMECrypt::CFB - Encrypt Data in Cipher Feedback Mode SYNOPSISuse Crypt::CFB; my $cipher = new Crypt::CFB $key, 'Crypt::Rijndael'; ## Or: my $iv = ''; map { $iv .= chr(rand(256)) } (0..16); my $cipher = new Crypt::CFB $key, 'Crypt::Rijndael', $iv; my $ciphertext = $cipher->encrypt($plaintext); my $plaintext = $cipher->decrypt($ciphertext); my $cipher2 = new Crypt::CFB $key, 'Digest::MD5'; $ciphertext = $cipher->encrypt($plaintext); $plaintext = $cipher->decrypt($ciphertext); DESCRIPTIONGeneric CFB implementation in pure Perl. The Cipher Feedback Mode module constructs a stream cipher from a block cipher or cryptographic hash funtion and returns it as an object. Any block cipher in the "Crypt::" class can be used, as long as it supports the "blocksize" and "keysize" methods. Any hash function in the "Digest::" class can be used, as long as it supports the "add" method. METHODS
BUGSThis is awfully slow. Some classes in "Digest::" do not provide the "add" method, so they will fail. The implementation is a little baroque. AUTHORMatthias Bauer <matthiasb@acm.org> CHANGESAdded the use of an IV. AUTHORKees Jan Hermans <kees@phoezo.com>
|