[HTML] 纯文本查看 复制代码This library simply takes keys in the following format, and translates it to those variables needed to perform the encryptions used in Tom Wu's library.
Here are some good resources to investigate further.
[url=http://etherhack.co.uk/asymmetric/docs/rsa_key_breakdown.html]http://etherhack.co.uk/asymmetric/docs/rsa_key_breakdown.html[/url]
[url=http://www.di-mgt.com.au/rsa_alg.html]http://www.di-mgt.com.au/rsa_alg.html[/url]
[url=https://polarssl.org/kb/cryptography/asn1-key-structures-in-der-and-pem]https://polarssl.org/kb/cryptogr ... ures-in-der-and-pem[/url]
With this information, we can translate a private key format to the variables required with the jsbn library from Tom Wu by using the following mappings.
modulus => n
public exponent => e
private exponent => d
prime1 => p
prime2 => q
exponent1 => dmp1
exponent2 => dmq1
coefficient => coeff