需要用到工具opensll(現在版本的kali里面會自帶openssl)
Pem文件分析:其中每個元素對應的RSA中的元素
私鑰
RSAPrivateKey ::= SEQUENCE {
version Version,
modulus INTEGER, -- n
publicExponent INTEGER, -- e
privateExponent INTEGER, -- d
prime1 INTEGER, -- p
prime2 INTEGER, -- q
exponent1 INTEGER, -- d mod (p-1)
exponent2 INTEGER, -- d mod (q-1)
coefficient INTEGER, -- (inverse of q) mod p
otherPrimeInfos OtherPrimeInfos OPTIONAL
}
公鑰
RSAPublicKey ::= SEQUENCE {
modulus INTEGER, -- n #合數n
publicExponent INTEGER – e #公開冪e
}
因此可以通過openssl對pem文件進行查看分析【基本查看方式openssl rsa –pubin –in pubkey.pem –text -modulus】,比如medium的結果如下
Hard的結果如下