# Symmetric and Asymmetric Encryption

> Understand the two families of encryption, what problem each solves, and how real systems combine them. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/crypto-fundamentals
Last updated: 2026-11-28

Understand the two families of encryption, what problem each solves, and how real systems combine them.

Beginner · about 5 hours · difficulty 3/5

Learn first: [The Security Mindset and the CIA Triad](https://www.internhack.in/roadmaps/tracks/cybersecurity/security-mindset)

Cryptography is a toolbox. Security professionals rarely invent algorithms; they need to pick the right tool and spot when it is used wrongly.

### Symmetric encryption

One shared key encrypts and decrypts. It is fast and used for bulk data. The standard is **AES**, ideally in an authenticated mode like **AES-GCM**, or the modern stream cipher **ChaCha20-Poly1305**. The hard part is **key distribution**: how do both sides get the same secret safely?

### Asymmetric (public-key) encryption

Each party has a **public key** (shareable) and a **private key** (secret). Common algorithms: **RSA**, and elliptic-curve schemes like **ECDH** (key exchange) and **Ed25519/ECDSA** (signatures). Public-key crypto is slow, so it is used to exchange a symmetric key or to sign data.

### Digital signatures

Signing with a private key lets anyone verify with the public key that data came from you and was not altered. Signatures protect software updates, JWTs, code commits and certificates.

### Putting it together

TLS, SSH and Signal all use **hybrid** designs: asymmetric crypto to authenticate and agree on keys, symmetric crypto for the data. Encoding (Base64, hex) is **not** encryption; anyone can reverse it.

### Pitfalls

- Confusing encoding, hashing and encryption. Interviewers love this question.
- Assuming "encrypted" means safe without asking where the key is stored.

Move on when you can encrypt and decrypt a file with a symmetric key using `openssl`, generate an SSH key pair, and explain why TLS uses both families.

## Key concepts

- **Encoding vs hashing vs encryption**
- **AES and authenticated modes (GCM)**
- **Public and private keys**
- **RSA and elliptic curves**
- **Key exchange (Diffie-Hellman)**
- **Digital signatures**
- **Hybrid encryption**

## Mini project

Use openssl to generate an RSA key pair, sign a file, verify the signature, then tamper with one byte and show verification fails.

## Check yourself

Why do real protocols use asymmetric crypto only for the handshake and switch to symmetric crypto for data?

## Free resources

- [Crypto 101](https://www.crypto101.io/) (Laurens Van Houtven)
- [CryptoHack](https://cryptohack.org/) (CryptoHack)
- [Cloudflare: What is encryption?](https://www.cloudflare.com/learning/ssl/what-is-encryption/) (Cloudflare)

Previous: [Git and GitHub for Security Work](https://www.internhack.in/roadmaps/tracks/cybersecurity/git) · Next: [Hashing and Password Storage](https://www.internhack.in/roadmaps/tracks/cybersecurity/hashing-passwords)

## More in Applied Cryptography

- [Symmetric and Asymmetric Encryption](https://www.internhack.in/roadmaps/tracks/cybersecurity/crypto-fundamentals)
- [Hashing and Password Storage](https://www.internhack.in/roadmaps/tracks/cybersecurity/hashing-passwords)
- [PKI and Certificates](https://www.internhack.in/roadmaps/tracks/cybersecurity/pki-certificates)
- [Common Cryptography Mistakes](https://www.internhack.in/roadmaps/tracks/cybersecurity/crypto-mistakes)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
