1.4
In progress
Asymmetric Encryption
Summary
Asymmetric, or public key, encryption uses a key pair. The public key can be shared freely; the private key never leaves its owner. Anyone can encrypt for the owner with the public key, and the owner can sign with the private key. Because it is slow, it is mainly used to exchange keys and create signatures.
In plain words
Asymmetric encryption uses a matched pair of keys: a public key you can give anyone, and a private key you keep secret. Anything locked with the public key can only be opened with the private key.
Detailed explanation
- Asymmetric encryption: Encryption that uses a mathematically related public and private key pair.
- Public key: Shared openly; used to encrypt data for the owner or to verify the owner's signatures.
- Private key: Kept secret by the owner; used to decrypt data and to create signatures.
How it is used
- 1. Generate: The owner creates a key pair and keeps the private key secret.
- 2. Publish: The public key is shared, usually inside a digital certificate.
- 3. Encrypt: A sender encrypts with the recipient's public key.
- 4. Decrypt: Only the recipient's private key can decrypt it.
Algorithms
- RSA: Named after Rivest, Shamir and Adleman; its security rests on the difficulty of factoring large numbers. Used for key transport and signatures.
- Elliptic curve cryptography (ECC): Based on elliptic curve math; gives equal strength with smaller keys, which suits mobile and IoT devices.
- Diffie-Hellman (DH): A key agreement method that lets two parties derive a shared secret over an insecure channel; it doesn't encrypt data itself.
Efficiency
- Hybrid encryption: Asymmetric encryption protects a randomly generated symmetric session key, and the symmetric key protects the data. TLS and S/MIME work this way.
Important terms
taken from the text above- Asymmetric encryption
- Encryption that uses a mathematically related public and private key pair.
- Public key
- Shared openly; used to encrypt data for the owner or to verify the owner's signatures.
- Private key
- Kept secret by the owner; used to decrypt data and to create signatures.
- RSA
- Named after Rivest, Shamir and Adleman; its security rests on the difficulty of factoring large numbers. Used for key transport and signatures.
- Elliptic curve cryptography (ECC)
- Based on elliptic curve math; gives equal strength with smaller keys, which suits mobile and IoT devices.
- Diffie-Hellman (DH)
- A key agreement method that lets two parties derive a shared secret over an insecure channel; it doesn't encrypt data itself.
- Hybrid encryption
- Asymmetric encryption protects a randomly generated symmetric session key, and the symmetric key protects the data. TLS and S/MIME work this way.
Examples & real-world scenarios
- Alice encrypts with Bob's public key; only Bob's private key can decrypt.
- RSA needs about 2,048-bit keys; ECC gets similar strength with far smaller keys.
- It's used to protect a symmetric key rather than bulk data.
Scenario
A website wants any visitor to send it data privately without meeting first. It publishes a public key (in its certificate), and visitors use it to protect a session key that then encrypts the traffic.
Common mistakes
- Encrypting with your own private key when you want confidentiality. That's how you sign, not how you keep something secret.
- Using asymmetric encryption for large files. It's slow; use a hybrid approach.
Practical skills
- State which key to use for confidentiality and which for signing.
What I should remember
- Public key: Encrypts for the owner and verifies the owner's signatures.
- Private key: Decrypts and signs; must never be shared.
- RSA: Based on factoring large numbers.
- ECC: Strong security with short keys; good for constrained devices.
- Hybrid encryption: Asymmetric for the key exchange, symmetric for the data.