OpenCyber Academy
Rapid course · Lesson 8 · English
Course code: OCA-008Lesson 08: OCA-008-A008

Equal passwords still store different values

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Lesson map

Lesson 08. Map, example, EX054.

flowchart TD
  A["Two synthetic accounts, one password"] --> B["same stored value? False"]
  B --> C["Right checks True, wrong check False"]
  C --> D["Do not copy the laboratory secrets into notes"]

A shared password in the script is not a shared stored value, and it is not a library secret to write down.

Logical drawing

stored-value line stays False
right-password lines stay True and True
wrong-password line stays False
notes
    no copy of those laboratory passwords

Learning outcomes

After this chapter, you should be able to:

  1. Keep all four salted-storage lines.
  2. Explain False on the "same stored value" line.
  3. Leave the laboratory passwords out of the library notes.

8.1 Four lines, none of them a member's secret.

lab_salted.py stores one synthetic password for two accounts and prints same password, same stored value? False. The next two lines say member 1 right password: True and member 2 right password: True. The last line says member 1 wrong password: False. A salt is a fresh random value per account, so equal passwords need not produce equal stored results, and the check repeats the calculation rather than looking up a saved password. A classmate who wants the first line to say True is erasing the salt. A classmate who pastes the script's passwords into the staff notes is breaking the sticky-note rule: record place and kind, not the secret itself. These four lines are a teaching run. They are not credentials Leo found at Willow Lane. He does not retune n, r, p, or the salt length.

8.2 Worked example

Lesson table; scroll horizontally to read all columns →

What someone cites What the file holds Decision
same stored value? False Different salts Keep False
Both right-password lines True and True Keep both
The wrong-password line False Keep False
"Copy the script passwords into the notes." Secrets stay out of notes Refuse

Synthetic case. The accounts in this run are not library members.

Errors and limits

Refusing to copy the passwords does not change the four printed Booleans.

Apply

Worked answers

EX054. The stored values differ, so that line stays False. Both right-password lines stay True. The wrong-password line stays False. Do not copy the laboratory passwords into the notes. Do not edit the script.