Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Crypt::RSA;
- use Crypt::RSA::ES::OAEP;
- use Crypt::RSA::Key::Private;
- use Crypt::RSA::Key;
- use Math::Pari ':int';
- use Crypt::RSA;
- my $rsa = new Crypt::RSA;
- my $keychain = new Crypt::RSA::Key;
- my ($public, $private) = $keychain->generate (
- 'p' => '99554414790940424414351515490472769096534141749790794321708050837',
- 'q' => '104593961812606247801193807142122161186583731774511103180935025763',
- 'e' => '65537',
- ) or die $keychain->errstr();
- my $plaintext = $rsa->decrypt (
- Cyphertext => "-----BEGIN COMPRESSED RSA ENCRYPTED MESSAGE-----
- Version: 1.99
- Scheme: Crypt::RSA::ES::OAEP
- eJwBRgC5/zEwADU0AEN5cGhlcnRleHTCFSi7dhQG4Pgmh50LyX1mGRFKbuZmdMkJW/iL5YJZHnww
- ECaj7l2udOqtc9L8qlsvZh24DSzKYh3A
- =+3dVm5h8VAg/3eTrYvDjNw==
- -----END COMPRESSED RSA ENCRYPTED MESSAGE-----",
- Key => $private,
- Armour => 1,
- ) or die $rsa->errstr();
- print $plaintext;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement