我正在尝试使用Crypt::RSA
解密邮件(我收到了n
,然后我将其p
和q
考虑在内,我也获得了e
{1}}。我计算了d
。programmatically generate `d` from `p` and `q` (RSA)),但遇到了一些困难。每次运行以下代码时,我都会得到Incomplete key.
这是一个无用的错误信息。
use Crypt::RSA;
my $rsa = new Crypt::RSA;
my $privkey = bless( {
'p' => 'NUMBER',
'q' => 'NUMBER',
'n' => 'NUMBER',
'Version' => '1.99',
'Identity' => '<email>' #put your email here?
}, 'Crypt::RSA::Key::Private' );
my $plaintext = $rsa->decrypt (
Cyphertext => "- -----BEGIN COMPRESSED RSA ENCRYPTED MESSAGE-----
Version: 1.99
Scheme: Crypt::RSA::ES::OAEP
block_message_here
- -----END COMPRESSED RSA ENCRYPTED MESSAGE-----",
Key => $privkey,
Armour => 1,
) or die $rsa->errstr();
print $plaintext;