People have been talking about using ECC (elliptic-curve cryptography) instead of RSA but I can’t really find a way to use ECC for asymmetric encryption (not signing). I’m pretty sure only RSA (instead of ECC) can be used for asymmetric encryption (disregarding the quantum-resistant algorithms which I haven’t looked into), unless I’m missing something important?
When you want to encrypt asymmetrically with ECC, you do an ECDH operation with the public key of the entity you're sending to, and then include enough information in the file or message for the counterparty to complete the DH operation on their side to derive the message encryption key. This is generally the "right" way to encrypt with RSA as well (with RSA-KEM). Even old PKCS1v15 systems do "hybrid" encryption, with RSA used to establish a key and then AES to do the actual encrypting.
Comments
People have been talking about using ECC (elliptic-curve cryptography) instead of RSA but I can’t really find a way to use ECC for asymmetric encryption (not signing). I’m pretty sure only RSA (instead of ECC) can be used for asymmetric encryption (disregarding the quantum-resistant algorithms which I haven’t looked into), unless I’m missing something important?
When you want to encrypt asymmetrically with ECC, you do an ECDH operation with the public key of the entity you're sending to, and then include enough information in the file or message for the counterparty to complete the DH operation on their side to derive the message encryption key. This is generally the "right" way to encrypt with RSA as well (with RSA-KEM). Even old PKCS1v15 systems do "hybrid" encryption, with RSA used to establish a key and then AES to do the actual encrypting.
Here's some discussion about that: https://crypto.stackexchange.com/questions/15596/are-there-a...