Advertisement
Anakthewolf

AES - Advanced Encryption Standard

May 11th, 2014
522
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5. use feature 'say';
  6.  
  7. use Crypt::AES::CTR;
  8.  
  9. my $key='01234567890abcdef';
  10. my $bit=256;
  11.  
  12. my $aes = Crypt::AES::CTR->new(
  13.     key =>$key,
  14.     nbits=>$bit
  15. );
  16.  
  17. my $plainText='AES on Workshop@UNINA2014';
  18. say '-> stringa in chiaro: '.$plainText."\n";
  19.  
  20. my $encryptedText=$aes->encrypt($plainText);
  21. say '-> stringa criptata con AES: '.$encryptedText;
  22.  
  23. my $decryptedText=$aes->decrypt($encryptedText);
  24. say '-> stringa decriptata con AES: '.$decryptedText;
Advertisement
RAW Paste Data Copied
Advertisement