MODULE 5 โ Fundamentals of Cryptography
Learning Objectives
After this module, learners should be able to:
- Explain why cryptography is essential to modern digital security.
- Describe symmetric, asymmetric, and hybrid cryptographic systems.
- Analyse hashing, MACs, signatures, and key exchange mechanisms.
- Identify real-world cryptographic implementation failures.
- Apply cryptographic primitives appropriately in engineering design.
Module Overview
Cryptography is not merely a tool โ it is the mathematical substrate upon which modern cybersecurity is built. Every secure transaction, every authenticated login, every encrypted database, and every trust relationship relies on cryptographic mechanisms functioning correctly.
But cryptography is not magic. Its strength derives from:
- Sound mathematical theory
- Correct implementation
- Proper key management
- Resistance to real-world operational failure
This module treats cryptography as an engineering discipline: not a matter of formulas alone, but a matter of system behaviour under adversarial stress.
1. Symmetric Cryptography: The Oldest and Fastest Form of Encryption
1.1 Conceptual Foundation
Symmetric encryption uses a single shared secret key for both encryption and decryption.
Its security relies on:
- Key secrecy
- Algorithmic resistance to brute-force search
- Strong confusion and diffusion properties
Modern symmetric encryption standards:
- AES (Advanced Encryption Standard)
- ChaCha20 (stream cipher optimised for software)
1.2 Properties and Strengths
- Extremely fast
- Efficient for large data volumes
- Ideal for disk encryption, VPN tunnels, and internal communication
1.3 Weaknesses
- Key distribution problem
- Shared keys require secure exchange
- Compromise of one endpoint compromises the entire encryption system
Symmetric cryptography is mathematically powerful but operationally fragile if key management fails.
2. Asymmetric Cryptography: The Revolution of Public Key Systems
Asymmetric encryption uses two keys:
- A public key for encryption or verification
- A private key for decryption or signing
This creates new security capabilities impossible with symmetric systems.
2.1 Key Algorithms
- RSA (modular exponentiation)
- Elliptic Curve Cryptography (ECC) (more efficient, smaller keys)
2.2 What Asymmetric Systems Enable
- Digital signatures
- Secure key exchange without shared secrets
- Certificate and identity systems (TLS, HTTPS)
2.3 Limitations
- Slow for encrypting large data
- Vulnerable to implementation errors (padding, side-channels)
- Dependent on high-quality randomness
Asymmetric crypto is the backbone of secure internet communication, but it must be paired with symmetric crypto for performance.
3. Hybrid Cryptosystems: The Real-World Solution
In practice, no one uses pure asymmetric encryption for full data exchanges.
Instead, systems use:
- Asymmetric algorithms to exchange a session key
- Symmetric algorithms to encrypt actual data
This approach is used in:
- TLS / HTTPS
- Secure messaging apps
- Cloud storage encryption
Hybrid cryptography combines the strengths of both worlds.
4. Cryptographic Hash Functions: Integrity, Identity, and Irreversibility
A cryptographic hash function transforms input data into a fixed-length output called a digest.
Properties
- One-way (irreversible)
- Collision-resistant
- Deterministic
- Avalanche effect (small input changes produce large output changes)
Common hashes:
- SHA-256
- SHA-3
- BLAKE2
Applications
- Password storage
- Blockchain
- File integrity verification
- Digital signatures
Hash functions guarantee integrity, not confidentiality.
5. MACs and Digital Signatures: Authenticity and Non-Repudiation
5.1 Message Authentication Codes (MACs)
MACs ensure:
- Integrity
- Authentication
But rely on shared keys.
Algorithms:
- HMAC-SHA256
- Poly1305
5.2 Digital Signatures
Digital signatures ensure:
- Integrity
- Authentication
- Non-repudiation (unique proof of origin)
Algorithms:
- RSA signatures
- ECDSA
- Ed25519
Signatures are essential for secure software distribution, financial transactions, and identity verification.
6. Real-World Cryptographic Failures
Cryptography usually fails not due to mathematics, but due to engineering mistakes:
6.1 Weak or Reused Nonces
- The Sony PS3 hack occurred because signatures used a fixed nonce.
6.2 Poor Random Number Generation
- Predictable random values break key security.
6.3 Homegrown Cryptography
- Many breaches arise from developers โinventingโ their own ciphers.
6.4 Plaintext Key Storage
- Keys stored unencrypted on disk undermine all cryptographic mechanisms.
6.5 Downgrade Attacks
- Attackers force a system to use weaker cryptographic algorithms.
The lesson:
Cryptography is powerful when used correctly and catastrophic when implemented poorly.
7. Reflection Questions
- Why is symmetric encryption still used if asymmetric crypto is more modern?
- How does randomness affect cryptographic security?
- Why are digital signatures essential for trust?
Summary
Cryptography is a foundational enabling technology for secure computing. Understanding its structure, strengths, and failure modes is essential for engineering secure systems.
