1. Basics of encryption and number theory
Before we formally talk about ECDHE, we need to talk about the RSA algorithm that is closely related to it. ECDHE was born on the premise of optimizing some features of RSA.
1.1 Asymmetric encryption
RSA algorithm is often used in asymmetric encryption. Asymmetric encryption generates a pair of keys. Common usage scenarios are:
- Public key encryption, private key decryption. This purpose is to Ensure data transmission security, because the content encrypted by the public key cannot be decrypted by others. Only the person holding the private key can decrypt the actual content;
- Private key encryption, public key decryption. This purpose is to Ensure data authenticity, because the private key cannot be leaked. If the public key can normally decrypt the content encrypted by the private key, it can be proved that the message was sent by the person holding the identity of the private key.
If you want to understand the RSA algorithm, you first need to start with several elementary number theory concepts.