NAME
HandyCrypt - self-sufficient module that contains four functions: one-way
hash function, RC4-compatible encryption algorithm, binary to ascii and
ascii to binary conversion functions.
SYNOPSIS
my $encoded = &rc4('cryptkey','This is unencrypted data');
my $ascii_encoded = &b2a($encoded);
my $ascii_sign = &b2a(&easy_sign('cryptkey',$encoded));
my $decoded = &rc4('cryptkey',&a2b($ascii_encoded));
DESCRIPTION
- rc4($key,$data)
-
This is symmetric encryption/decryption algorithm compatible with RC4.
rc4($key,rc4($key,$data)) is always equal to $data!
rc4($key,$data) encrypt $data by key $key. If
$data was previously encoded string, then the same call
decrypts it!
- easy_sign($key,$data)
-
This is not well-known one-way function to convert data to its fingerprint,
but for systems that has difficulties to install well-proven Digest::MD5
module this one can be good work-around. Returns 16-byte long string.
- b2a($binary)
-
Converts binary string
$binary to ASCII one, using base64
encoding: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+*
Resulting string is 4/3 times greater than input.
- a2b($string)
-
Reverse of b2a.
|