Foundations of modern encryption, written from the perspective of a cybersecurity student.
Cryptography is a fundamental pillar of cybersecurity. It ensures Confidentiality, Integrity, and Authenticity of data in environments where attackers may intercept or manipulate information. These concepts shape how modern secure communication works across the internet.
Encryption is everywhere around us:
- Logging into platforms (e.g., TryHackMe login) uses encrypted passwords.
- SSH establishes encrypted tunnels.
- Online banking uses certificates to ensure you're talking to the legitimate server.
- File downloads use hash functions to guarantee file integrity.
The original readable data before encryption.
The unreadable encrypted data after applying encryption.
The algorithm used to transform plaintext into ciphertext.
A secret value that controls encryption and decryption.
Ciphertext = Encryption(Plaintext, Key)
Depending on the system, decryption uses the same key (symmetric) or a different key (asymmetric).
The Caesar Cipher is one of the simplest classical encryption methods. It shifts each letter in the plaintext by a fixed number of positions.
Example:
- Plaintext:
TRYHACKME - Key = 3
- Ciphertext:
WUBKDFNPH
Because the English alphabet has 26 letters, the cipher only has 25 possible keys → easily breakable by brute force.
Given ciphertext:
XRPCTCRGNEI
Trying all shifts revealed:
ICANENCRYPT
when shifting letters back by 15 → Key = 15.
Symmetric encryption uses the same key for both encryption and decryption.
- Very fast
- Suitable for large data (files, disks, VPNs, Wi-Fi)
- Key distribution problem
| Algorithm | Key Size | Status |
|---|---|---|
| DES | 56-bit | Broken |
| 3DES | 3 × DES | Slow, deprecated |
| AES | 128/192/256-bit | Global standard |
Asymmetric encryption uses two different keys:
- Public Key
- Private Key
This model solves the key distribution problem and enables:
- HTTPS
- SSH
- SSL certificates
- Digital signatures
- RSA (2048–4096 bits)
- Diffie-Hellman
- ECC (strong with short keys)
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Properties:
A ⊕ A = 0A ⊕ 0 = A
Used in simple symmetric encryption:
C = P ⊕ K
P = C ⊕ K
Modulo returns the remainder of division.
Modern crypto algorithms (RSA, DH, ECC) rely heavily on mod arithmetic with very large numbers.
Cryptography is a blend of:
- mathematics
- logic
- secure key management
- protocol design
These principles power the modern secure internet and will be the basis for the next topic:
Public Key Cryptography Basics.
