Module 3 · Cryptography and PKI · Lesson 26 of 42
Cryptographic attacks: algorithm, implementation and key
Where attackers aim when they go after encryption: weak or downgraded algorithms, flawed implementations like WEP, and the keys themselves. Plus collisions and birthday attacks.
In this lesson · about 16 minutes
- Sort cryptographic attacks into three targets: the algorithm, the implementation and the key
- Explain a downgrade attack
- Explain why WEP failed even though RC4 itself worked
- Describe brute force, collision and birthday attacks
Every good algorithm has people trying to break it; breaking cryptography is cryptanalysis. A handy way to think about it (a teaching framework, not official exam wording) is that attackers aim at one of three places.
1. Attack the algorithm
Modern, public algorithms like AES are studied constantly by experts worldwide and have held up. Breaking them head-on isn't realistic. So attackers try to get you to use something weaker:
- Downgrade attack: an on-path attacker interferes with the handshake so both sides agree on an older, weaker protocol or cipher (for example, falling back from TLS 1.3 to an old SSL version, or from AES to RC4), which the attacker can then break. Defense: disable old protocols and ciphers so there's nothing to fall back to.
- Old or broken algorithms still in use, such as DES, RC4, MD5 or SHA-1, weakened by faster computers and better cryptanalysis.
2. Attack the implementation
A strong algorithm can still be used badly. Real systems combine many pieces (TLS, for example, uses asymmetric encryption, symmetric encryption and hashes together); this combination is a cryptosystem, and the joins are where weak spots appear.
The classic case is WEP (Wired Equivalent Privacy), the first Wi-Fi encryption. It used the RC4 stream cipher, which wasn't the problem. The problem was how WEP used it: short keys and a tiny 24-bit initialization vector (IV) that repeated quickly, so attackers could collect enough traffic to recover the key in minutes. WEP was broken 20+ years ago, yet a few networks still use it. Replace it with WPA2 or WPA3.
3. Attack the key
If attackers get the key, the strongest algorithm doesn't matter. A password usually isn't the key itself: systems turn a short password into a long key (key stretching), store passwords as salted hashes, and so on. Attacks on keys and passwords include:
- Brute force: try every possible key or password. Longer keys make this impractical: each extra bit doubles the work.
- Stolen keys: keys left in code, config files or unprotected servers. That's why TPMs, HSMs and key management systems exist.
Attacks on hashes
- Collision: finding two different inputs with the same hash, which lets an attacker swap a malicious file for a trusted one. MD5 and SHA-1 fell to this.
- Birthday attack: uses the "birthday paradox" (in a room of just 23 people, there's a 50% chance two share a birthday) to find collisions far faster than trying every value. Defense: longer digests, such as SHA-256 or larger.
Performance-based question (PBQ)
Where is the attack aimed?
You're reviewing a penetration test report. For each finding, decide which part of the cryptography the attacker targeted.
Choose the target for each finding.
- An on-path attacker forced the VPN to negotiate an obsolete cipher suite
- A warehouse Wi-Fi network still uses WEP and was cracked in minutes
- An API secret key was found in a public code repository
- A tool tried billions of possible passwords for an encrypted ZIP file
- A legacy system still encrypts backups with DES
- A homemade app reuses the same IV for every message it encrypts
Check your understanding0 of 6 correct
Quiz score: 0 of 6
Noviq Academy is free and for learning. This course is independent and is not affiliated with or endorsed by CompTIA. CompTIA and Security+ are trademarks of CompTIA, Inc. Exam details such as price and policies change; confirm them on CompTIA's website before you book.