Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. sub decrypt {
  2. my $my_string=@_;
  3. my $cipher = Crypt::CBC->new(
  4. {
  5. 'key' => 'length16length16',
  6. 'cipher' => 'Rijndael',
  7. 'iv' => '1234567890abcdef',
  8. 'literal_key' => 1,
  9. 'padding' => 'null',
  10. 'header' => 'none',
  11. keysize => 128 / 8
  12. }
  13. );
  14. my $return = $cipher->decrypt($my_string);
  15. return $return;
  16. }
  17.  
  18. sub encrypt {
  19. my $my_string=@_;
  20. my $cipher = Crypt::CBC->new(
  21. {
  22. 'key' => 'length16length16',
  23. 'cipher' => 'Rijndael',
  24. 'iv' => '1234567890abcdef',
  25. 'literal_key' => 1,
  26. 'padding' => 'null',
  27. 'header' => 'none',
  28. keysize => 128 / 8
  29. }
  30. );
  31. my $return = encode_base64($cipher->encrypt($my_string));
  32. return $return;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement