Advertisement
Anakthewolf

Vigenere algorithm implementation

May 11th, 2014
298
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.51 KB | None
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5. use feature 'say';
  6.  
  7. use Crypt::Vigenere;
  8.  
  9. my $keyWord='bruto';
  10. my $vigenere = Crypt::Vigenere->new($keyWord);
  11.  
  12. # cripta stringa
  13. my $plainText='anakvaincampagna';
  14. my $encryptedText = $vigenere->encodeMessage($plainText);
  15.  
  16. # decripta stringa
  17. my $decryptedText = $vigenere->decodeMessage($encryptedText);
  18.  
  19. say '-> Vigenere - testo in chiaro: '.$plainText;
  20. say '-> Vigenere - testo criptato: '.$encryptedText;
  21. say '-> Vigenere - testo decriptato: '.$decryptedText;
Advertisement
RAW Paste Data Copied
Advertisement