At the time of cipher creation, you specify an encryption key to use and, optionally, a block encryption algorithm. To use this module, you will first create a Crypt::CBC cipher object with new(). The encrypted messages are compatible with the encryption format used by the OpenSSL package. ![]() In combination with a block cipher such as AES or Blowfish, you can encrypt and decrypt messages of arbitrarily long length. This module is a Perl-only implementation of the cryptographic cipher block chaining mode (CBC). $fh = Crypt::CBC->filehandle(-pass => 'secret') # encrypting via a filehandle (requires Crypt::FileHandle> $cipher = Crypt::CBC->new(-pbkdf => 'none', $key = Crypt::CBC->random_bytes(8) # assuming a 8-byte block cipher # do-it-yourself mode - specify key & initialization vector yourself ![]() $plaintext = $cipher->decrypt($ciphertext) $ciphertext = $cipher->encrypt("This data is hush hush") $cipher = Crypt::CBC->new( -pass => 'my secret password',
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |