Guest User

Untitled

a guest
May 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. use Crypt::RSA;
  2.  
  3. use Crypt::RSA::ES::OAEP;
  4.  
  5. use Crypt::RSA::Key::Private;
  6.  
  7. use Crypt::RSA::Key;
  8.  
  9. use Math::Pari ':int';
  10.  
  11.  
  12.  
  13. use Crypt::RSA;
  14.  
  15. my $rsa = new Crypt::RSA;
  16.  
  17. my $privkey = bless( {
  18. 'p' => 'NUMBER',
  19. 'q' => 'NUMBER',
  20. 'd' => 'NUMBER',
  21. 'e' => '66537',
  22. 'n' => 'NUMBER',
  23. 'phi' => 'NUMBER',
  24. 'dp' => 'NUMBER',
  25. 'dq' => 'NUMBER',
  26. 'Version' => '1.99',
  27. 'Identity' => ''
  28. }, 'Crypt::RSA::Key::Private' );
  29.  
  30. my $plaintext = $rsa->decrypt (
  31. Cyphertext => "- -----BEGIN COMPRESSED RSA ENCRYPTED MESSAGE-----
  32. Version: 1.99
  33. Scheme: Crypt::RSA::ES::OAEP
  34.  
  35. CRYPTEDDATABLOCK
  36. - -----END COMPRESSED RSA ENCRYPTED MESSAGE-----",
  37. Key => $privkey,
  38. Armour => 1,
  39. ) or die $rsa->errstr();
  40.  
  41. print $plaintext;
Add Comment
Please, Sign In to add comment