Hello Freedom
This commit is contained in:
27
infidel-code/py_wrappers/GENKEY_RSA.py
Normal file
27
infidel-code/py_wrappers/GENKEY_RSA.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import time
|
||||
from Crypto.Hash import SHA256
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Signature import PKCS1_v1_5
|
||||
|
||||
def rsa3072():
|
||||
start = time.time()
|
||||
key = RSA.generate(2048)
|
||||
end = time.time()-start
|
||||
with open('RSA3072_priv.pem','wb') as a:
|
||||
a.write(key.exportKey('PEM'))
|
||||
with open('RSA3072_pub.pem','wb') as b:
|
||||
b.write(key.publickey().exportKey('PEM'))
|
||||
print("Time spent RSA 3072 ", end)
|
||||
|
||||
def rsa7680():
|
||||
start = time.time()
|
||||
key = RSA.generate(7680)
|
||||
end = time.time()-start
|
||||
with open('RSA7680_priv.pem','wb') as c:
|
||||
c.write(key.exportKey('PEM'))
|
||||
with open('RSA7680_pub.pem','wb') as d:
|
||||
d.write(key.publickey().exportKey('PEM'))
|
||||
print("Time spent rsa7680 : ", end)
|
||||
|
||||
rsa3072()
|
||||
rsa7680()
|
||||
Reference in New Issue
Block a user