Who are you protecting it from?

The same note may need to stay private, arrive unchanged, or come from the right person. What can someone else do to it?

One note, three situations

Follow the same note through three situations.

Original messageMEET AT NOON

Someone can read the note

Goal
Keep the meeting time private.
What they can do
See the note as it travels.
What you already trust
You and Edith share a secret key that the person reading the note doesn’t have.

Encrypt the note. Edith uses your shared secret key before sending it. A secure cipher hides the contents from someone who sees the ciphertext without the key.

Someone can change a word

Goal
Tell whether the note you received differs from the original.
What they can do
Replace NOON with DAWN in the note you receive.
What you already trust
A fingerprint of the original note, saved where the person changing the note can’t replace it.

Compare fingerprints. Make a fingerprint of the received note with the same hash function. A mismatch with the saved fingerprint tells you the notes differ.

Someone can claim to be Edith

Goal
Check whether the note really came from Edith.
What they can do
Send a note claiming it came from Edith.
What you already trust
You know which public key belongs to Edith. The note comes with a signature to check.

Verify the signature. Use the trusted public key. If the signature verifies, you have evidence that the note was signed with Edith’s matching private key.

Start with the situation

In these rounds, the adversary is the person who might read, change, or send a note under someone else’s name. A threat model describes what you want to protect, what that person can do, and what you already trust.

Start with the same original note, MEET AT NOON. If someone can replace both the note and the fingerprint, the two can still match. If a signature verifies with a public key supplied by a stranger, the check only connects the note to that key. The saved fingerprint and the trusted public key give you something to check against.

  • Encryption with a secure cipher provides confidentiality, keeping the contents private from someone who can see the ciphertext without the key.
  • A fingerprint comparison can reveal a change when you already have a trusted fingerprint of the original.
  • A digital signature lets you check that the note was signed with the private key paired with the public key you trust.

A cryptographer designs or chooses protections for a situation. A codebreaker asks what someone can learn from the messages they can see. In Chapter 2, you’ll take both roles with ciphers you can work by hand.

Check your understanding

Your friend sends you a private invitation to a club meeting. A stranger can read notes on the way and send notes in your friend’s name. What could go wrong? Which protection fits each problem, and what do you need to trust?

Show the answer

Keep the invitation private with encryption. In the shared-key example, you and your friend need to keep that key secret. To check that your friend signed the invitation, verify it with a public key you trust belongs to them.