Advertisement
Guest User

Untitled

a guest
Nov 29th, 2013
2,108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use Crypt::RSA;
  4.  
  5. use Crypt::RSA::ES::OAEP;
  6.  
  7. use Crypt::RSA::Key::Private;
  8.  
  9. use Crypt::RSA::Key;
  10.  
  11. use Math::Pari ':int';
  12.  
  13. use Crypt::RSA;
  14.  
  15. my $rsa = new Crypt::RSA;
  16.  
  17. my $keychain = new Crypt::RSA::Key;
  18. my ($public, $private) = $keychain->generate (
  19. 'p' => '99554414790940424414351515490472769096534141749790794321708050837',
  20. 'q' => '104593961812606247801193807142122161186583731774511103180935025763',
  21. 'e' => '65537',
  22. ) or die $keychain->errstr();
  23.  
  24. my $plaintext = $rsa->decrypt (
  25. Cyphertext => "-----BEGIN COMPRESSED RSA ENCRYPTED MESSAGE-----
  26. Version: 1.99
  27. Scheme: Crypt::RSA::ES::OAEP
  28.  
  29. eJwBRgC5/zEwADU0AEN5cGhlcnRleHTCFSi7dhQG4Pgmh50LyX1mGRFKbuZmdMkJW/iL5YJZHnww
  30. ECaj7l2udOqtc9L8qlsvZh24DSzKYh3A
  31. =+3dVm5h8VAg/3eTrYvDjNw==
  32. -----END COMPRESSED RSA ENCRYPTED MESSAGE-----",
  33. Key => $private,
  34. Armour => 1,
  35. ) or die $rsa->errstr();
  36.  
  37. print $plaintext;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement