本文转自【[crypto]-51.2-从rsa公钥中提取N和E_代码改变世界ctw的博客-CSDN博客】
CONTENTS
如何从RSA公钥中提取N和E
python实现
#!/usr/bin/env python3 from Crypto.PublicKey import RSA path = '<key file path here>' with open(path) as f: key = RSA.import_key(f.read()) print('e = %d' % key.e) print('n = %d' % key.n)
python RSA Module :RSA — PyCryptodome 3.17.0 documentation
openssl命令行实现
openssl rsa -inform PEM -in Key0_pub.pem -pubin -text -out Key1_pub.txt
发表评论