You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Cryptography is the science of securing communication and data through mathematical algorithms. It is the foundation of confidentiality, integrity, and authentication in cybersecurity.
| Term | Definition |
|---|---|
| Plaintext | The original readable data |
| Ciphertext | The encrypted (unreadable) data |
| Encryption | Converting plaintext to ciphertext |
| Decryption | Converting ciphertext back to plaintext |
| Key | A secret value used by the algorithm to encrypt/decrypt |
| Algorithm (cipher) | The mathematical function used for encryption |
flowchart LR
P1["Plaintext"] -->|"Encryption + Key"| C["Ciphertext"]
C -->|"Decryption + Key"| P2["Plaintext"]
Symmetric encryption uses the same key for encryption and decryption:
| Algorithm | Key Size | Notes |
|---|---|---|
| AES | 128, 192, 256 bits | Industry standard — used everywhere |
| 3DES (Triple DES) | 168 bits | Legacy — being phased out |
| ChaCha20 | 256 bits | Modern, fast on mobile devices |
| Blowfish / Twofish | Up to 448 bits | Older alternatives |
AES is the most widely used symmetric cipher:
| Mode | Full Name | Use Case |
|---|---|---|
| CBC | Cipher Block Chaining | General-purpose, requires IV |
| GCM | Galois/Counter Mode | Authenticated encryption (encryption + integrity) |
| CTR | Counter Mode | Stream-like encryption |
Tip: Always use AES-GCM when you need both encryption and integrity verification. Never use ECB mode — it leaks patterns.
Asymmetric encryption uses a key pair — a public key and a private key:
| Algorithm | Use Case | Notes |
|---|---|---|
| RSA | Encryption, digital signatures | Widely used, key sizes 2048–4096 bits |
| ECC (Elliptic Curve) | TLS, mobile, IoT | Smaller keys, same security (256-bit ECC ~ 3072-bit RSA) |
| Diffie-Hellman | Key exchange | Establishes shared secret over insecure channel |
| Ed25519 | Digital signatures | Modern, fast, used in SSH and TLS |
sequenceDiagram
participant A as Alice (Sender)
participant B as Bob (Receiver)
Note over A: Encrypts with Bob's PUBLIC key
A->>B: Ciphertext
Note over B: Decrypts with Bob's PRIVATE key
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.