Bitzu

312-50 ยท Cryptography

Cryptanalysis and attack countermeasures

Brute force, known-plaintext, chosen-plaintext, birthday, side-channel, man-in-the-middle, padding oracle, downgrade attacks, and defenses.

Key points

  • Attack (defence):
  • Brute force: every key (long keys, key stretching).
  • Known- and chosen-plaintext: plaintext-ciphertext pairs.
  • Birthday: hash collisions in about 2^(n/2) work (longer digests).
  • Side-channel: timing, power or cache leaks.
  • Man-in-the-middle (certificate validation, pinning).
  • Padding oracle: distinguishable decryption errors (authenticated encryption).
  • Downgrade: weaker protocol versions (disable legacy protocols).

Practice questions

Single choice

What does a padding oracle attack exploit?

  1. Distinguishable error responses about padding during decryption
  2. Weak physical locks on the server room
  3. Short passwords chosen by users
  4. Expired root certificates
Show answer

Answer: A. Distinguishable error responses about padding during decryption

A padding oracle attack learns plaintext from whether the server reports a padding error versus another error. Authenticated encryption and uniform errors remove the oracle.

Select all that apply

Which measures make brute-force attacks on password-derived keys harder?

  1. Long, high-entropy passphrases
  2. Key stretching such as PBKDF2 with many iterations
  3. Shortening the key to speed up encryption
  4. Using the same salt for every user and hiding nothing
  5. Disabling any limit on login attempts
Show answer

Answer: A. Long, high-entropy passphrases, B. Key stretching such as PBKDF2 with many iterations

Longer, high-entropy passwords and slow key derivation with many iterations (PBKDF2) raise the cost per guess. Publishing the salt does no harm but is not a defence, and shorter keys make things easier for the attacker.

True or false

True or false: finding a collision in an n-bit hash by a birthday attack takes about 2^n operations.

Show answer

Answer: False

The birthday paradox reduces the effort to roughly 2^(n/2), which is why a 128-bit hash offers only about 64 bits of collision resistance.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More 312-50 topics in this module