Crypt::CBC

Crypt::CBC is a Perl module to encrypt data with Cipher Block Chaining mode.
Download

Crypt::CBC Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Lincoln Stein
  • Publisher web site:
  • http://search.cpan.org/~lds/Crypt-CBC-2.29/CBC.pm

Crypt::CBC Tags


Crypt::CBC Description

Crypt::CBC is a Perl module to encrypt data with Cipher Block Chaining mode. Crypt::CBC is a Perl module to encrypt data with Cipher Block Chaining mode.SYNOPSIS use Crypt::CBC; $cipher = Crypt::CBC->new( -key => 'my secret key', -cipher => 'Blowfish' ); $ciphertext = $cipher->encrypt("This data is hush hush"); $plaintext = $cipher->decrypt($ciphertext); $cipher->start('encrypting'); open(F,"./BIG_FILE"); while (read(F,$buffer,1024)) { print $cipher->crypt($buffer); } print $cipher->finish; # do-it-yourself mode -- specify key, initialization vector yourself $key = Crypt::CBC->random_bytes(8); # assuming a 8-byte block cipher $iv = Crypt::CBC->random_bytes(8); $cipher = Crypt::CBC->new(-literal_key => 1, -key => $key, -iv => $iv, -header => 'none'); $ciphertext = $cipher->encrypt("This data is hush hush"); $plaintext = $cipher->decrypt($ciphertext); # RANDOMIV-compatible mode $cipher = Crypt::CBC->new(-key => 'Super Secret!' -header => 'randomiv');This module is a Perl-only implementation of the cryptographic cipher block chaining mode (CBC). In combination with a block cipher such as DES or IDEA, you can encrypt and decrypt messages of arbitrarily long length. The encrypted messages are compatible with the encryption format used by the OpenSSL package.To use this module, you will first create a Crypt::CBC cipher object with new(). At the time of cipher creation, you specify an encryption key to use and, optionally, a block encryption algorithm. You will then call the start() method to initialize the encryption or decryption process, crypt() to encrypt or decrypt one or more blocks of data, and lastly finish(), to pad and encrypt the final block. For your convenience, you can call the encrypt() and decrypt() methods to operate on a whole data value at once. Requirements: · Perl


Crypt::CBC Related Software