NAME
Crypt::Vernam - Perl implementation of the Vernam cipher
SYNOPSIS
use Crypt::Vernam;
# mod26 mode
my ($ciphertext, $key) = vernam_encrypt('mod26', 'Vernam');
my $plaintext = vernam_decrypt('mod26', $ciphertext, $key);
# xor mode
($ciphertext, $key) = vernam_encrypt('xor', 'Vernam');
$plaintext = vernam_decrypt('xor', $ciphertext, $key);
DESCRIPTION
The Crypt::Vernam module allows you to do a simple but robust encryption/decryption, with the algorithm of Gilbert Sandford, Vernam. This kind of encryption is truly unbreakable as long the key is maintained a secret.
See the README file that came with the Crypt::Vigenere package for more information.
Public methods
- vernam_encrypt($mode, $plaintext)
-
The
vernam_encrypt
method is called to encrypt the $plaintext string, using $mode (mod26 or xor). - vernam_decrypt($mode, $ciphertext, $key)
-
The
vernam_decrypt
method is called to decrypt the $ciphertext string, using $mode (mod26 or xor) and decryption key $key.
EXPORT
vernam_encrypt vernam_decrypt
AUTHOR
Manuel Gebele, <forensixs[at]gmx.de>
COPYRIGHT AND LICENSE
Copyright (C) 2008 by Manuel Gebele.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.