pycryptodome
pycryptodome copied to clipboard
How to use ECC from Crypto.PublicKey for encryption?
I need to perform encryption-decryption of a message using ECC from Crypto.PublicKey package. Is there any package I can use to encrypt using ECC like once exists for RSA (PKCS1_OAEP).
This is how I perform encryption using RSA, I need the ECC equivalent method.
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
# Encryption part
message = "plaintext for RSA"
key = RSA.generate(2048)
public = key.publickey()
cipher = PKCS1_OAEP.new(public)
cipher_text = cipher.encrypt(message.encode())
print("Data is encrypted")
# Decryption part
cipher = PKCS1_OAEP.new(key)
message = cipher.decrypt(cipher_text)
print("Decrypted data is : \"{}\"".format(message.decode()))
Thank you.
Encryption with ECC is not supported right now.
Hi, is it supported now or still under maintenance
Encryption with ECC is not supported right now.
Is it planned?
It's been five years. Any update? Why is this not implemented after so long? Is it because there's not a standard on how to encrypt data with ECC keys?
Edit: It seems that GnuPG has adopted Curve25519 encryption for, also around five years? Do we have any plan for this?
Now that a decent standard is available (HPKE, RFC 9180), I plan to add it in the coming weeks.
I plan to add it in the coming weeks.
Any update on this? Just want to know if I should use RSA for encryption instead.