asym encryption working
This commit is contained in:
16
ECC/encrypt.py
Normal file
16
ECC/encrypt.py
Normal 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)
|
||||
'''
|
||||
Reference in New Issue
Block a user