26 Jan 2022 18:57:37 UTC
- Distribution: Crypt-Cipher-Vigenere
- Module version: 0.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (266 / 0 / 11)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: artistic_2
- Perl: v5.20.0
- Activity24 month
- Download (4.33KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Crypt::Cipher::Vigenere - implementation of Vigenere cipher
use Crypt::Cipher::Vigenere; my $vigenere = Crypt::Cipher::Vigenere->new( $key ); # encode plaintext my $cipher_text = $vigenere->encode( $plain_text ); # decode ciphertext my $plain_text = $vigenere->decode( $cipher_rtext ); # reset internal position in the key $vigenere->reset;
Perl implementation of the Vigenere cipher. Cipher key is specified as argument to the constructor and it should only contain letters A to Z (case is ignored). Using anything but ASCII letters will result in undefined behaviour.
Plaintext can be any sequence of characters, but anything but letters A to Z is passed through unenciphered. Letters preserve their case through the enciphering/deciphering.
The instance keeps track of the last position in the key, so subsequent call properly continue in the enciphering process. If need to reset the position, use the 'reset' method. Please note, that this key position is shared for both enciphering and deciphering, so when you want to use the same instance for deciphering text you just enciphered, you must reset it.
Returns new instance with key specified as the only argument. The key is a character string where only [A-Za-z] characters are allowed. Case has no bearing on the enciphering/deciphering process.
Takes plaintext as argument and returns ciphertext. Subsequent calls to this method do not reset the position in the key, but continue where the last call left off.
Takes ciphertext as argument and returns plaintext. Subsequent calls to this method do not reset the position in the key, but continue where the last call left off.
Reset the internal position to the start of the key.
Borek Lupomesky <email@example.com>
Module Install Instructions
To install Crypt::Cipher::Vigenere, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Crypt::Cipher::Vigenere
For more information on module installation, please visit the detailed CPAN module installation guide.