NAME
Util::Medley::Crypt - Class for simple encrypt/descrypt of strings.
VERSION
version 0.016
SYNOPSIS
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
);
DESCRIPTION
This class provides a thin wrapper around Crypt::CBC.
All methods confess on error.
ATTRIBUTES
key (optional)
Key to use for encrypting/decrypting methods when one isn't provided through the method calls.
METHODS
decryptStr
Decrypts the provided string.
- usage:
-
my $decryptedStr = $crypt->decryptStr($encryptedStr, $key); my $decryptedStr = $crypt->decryptStr( str => $encryptedStr, [ key => $key ] );
- args:
encryptStr
Encrypts the provided string.