Public Key Pem To N&e

Public Key Pem To N&e

from Crypto.PublicKey import RSA
from tkinter import *
import tkinter.filedialog
print('Public Key Pem To N&e')
root = tkinter.Tk()
root.withdraw()
filename = tkinter.filedialog.askopenfilename()
with open(filename, 'r') as f:
    key = RSA.importKey(f.read())
    N = key.n
    e = key.e
    print('hex:')
    print('N=' + hex(N))
    print('e=' + hex(e))
    print('dec:')
    print('N=' + str(N))
    print('e=' + str(e))

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注