asym encryption working

This commit is contained in:
luke
2021-03-10 13:36:30 -05:00
parent 13e4698095
commit c1a86adcf5
11 changed files with 151 additions and 41 deletions

16
ECC/encrypt.py Normal file
View File

@@ -0,0 +1,16 @@
from Crypto.PublicKey import ECC
from Crypto.Cipher import Salsa20 as salsa
key = ECC.import_key(open("publickey.pem", "r").read())
cipher = salsa.new(key)
message = "attack at dawn"
encd = cipher.encrypt(bytes(message, "utf-8"))
print(encd)
'''
dkey = RSA.import_key(open("privatekey.pem").read())
dcipher = pk.new(dkey)
dmessage = dcipher.decrypt(encd)
print(dmessage)
'''