Util::Medley::Crypt - Class for simple encrypt/descrypt of strings.
version 0.041
my $key = 'abcdefghijklmnopqrstuvwxyz'; my $str = 'foobar'; my $crypt = Util::Medley::Crypt->new; # # positional # my $encryptedStr = $crypt->encryptStr($str, $key); my $decryptedStr = $crypt->decryptStr($encryptedStr, $key); # # named pair # my $encryptedStr = $crypt->encryptStr( str => $str, key => $key ); my $decryptedStr = $crypt->decryptStr( str => $encryptedStr, key => $key );
This class provides a thin wrapper around Crypt::CBC.
All methods confess on error.
Key to use for encrypting/decrypting methods when one isn't provided through the method calls.
Decrypts the provided string.
my $decryptedStr = $crypt->decryptStr($encryptedStr, $key); my $decryptedStr = $crypt->decryptStr( str => $encryptedStr, [ key => $key ] );
String you wish to decrypt.
Key that was used to encrypt the string.
Encrypts the provided string.
my $encryptedStr = $crypt->encryptStr($str, $key); my $encryptedStr = $crypt->encryptStr( str => $str, [ key => $key ] );
String you wish to encrypt.
Key used to encrypt the string.
To install Util::Medley, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Util::Medley
CPAN shell
perl -MCPAN -e shell install Util::Medley
For more information on module installation, please visit the detailed CPAN module installation guide.