Crypt::Vernam - Perl implementation of the Vernam cipher
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);
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.
- vernam_encrypt($mode, $plaintext)
vernam_encryptmethod is called to encrypt the $plaintext string, using $mode (mod26 or xor).
- vernam_decrypt($mode, $ciphertext, $key)
vernam_decryptmethod is called to decrypt the $ciphertext string, using $mode (mod26 or xor) and decryption key $key.
Manuel Gebele, <forensixs[at]gmx.de>
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.