academy.security.krd

← Security Foundations

Cryptography without the mathematics

24 min

You do not need the mathematics to use cryptography correctly. You need to know what each primitive promises, and what it does not.

Four promises

Most real failures come from using one where another was needed.

The failures you will actually meet

  1. A password stored with a fast hash such as SHA-256. Fast is the wrong property: use Argon2id or bcrypt, which are slow on purpose.
  2. Encryption without authentication, so an attacker can alter ciphertext undetected. Use an AEAD mode.
  3. A key committed to a repository. The algorithm is irrelevant once the key is public.

> Every primitive is a promise about one property. Confusing which is which causes more breaches than broken maths.

What to take away

When you see cryptography in a design, ask what property it is supposed to provide and check that the chosen primitive actually provides it.

Adapted from: Written for this course

Check yourself

2

Sign in to have your answers marked and your progress saved.

1

Why is SHA-256 the wrong choice for storing passwords?

2

Which of these does encryption alone NOT give you? (choose all)