Course / 10 Crypto and files / Lesson 04 of 19

What a password cracker does

Estimated time: 15 min reading · 15 min activity

A password system checks a candidate password against a stored verification value. An offline recovery process has a permitted copy of such a value and computes the same rule for candidate inputs. It compares results; it does not use a universal "decrypt hash" operation.

John the Ripper and Hashcat are tools for password auditing or recovery, but neither is needed here. The supplied three words and two-digit checksum are synthetic teaching data. A checksum detects or compares simple data changes; this one is intentionally weak and is not a real password-storage construction. Real password verifiers need appropriate salted, costly derivation methods.

Before you begin

Estimated time
15 min reading, 15 min activity. Setup and optional practice may take longer.
Where you work
Read the printed evidence in a desktop or mobile browser and keep notes on paper or in a text editor. No installation, recovery tool, GPU, real password, live lookup or external account is required. Any later optional tool setup is outside the estimates.
Without a lab
All evidence needed for the activity appears on this page. Copy it into notes if downloads are unavailable. Read the labeled model and predict each result; a paper trace practises the reasoning while tool operation waits for a lab. Reading needs no JavaScript. Answer checking needs JavaScript and a secure context; saving progress also needs usable browser storage.

After this lesson you can:

  • Compute the teaching checksum for three original words.
  • Match one word to the stored two-digit value.
  • Describe the loop as candidate comparison, with a stop at three words.

01Example

Original paper checksum model. Keep the final two decimal digits of the sum of the UTF-8 byte values.

Stored teaching value: 09
hi: 104 + 105 = 209 → 09, match
no: 110 + 111 = 221 → 21, miss
ok: 111 + 107 = 218 → 18, miss
The loop changes its candidate; the stored value stays fixed.

02The loop changes the candidate

Offline means the comparisons are local to the copied verification data rather than login requests to a service. Online attempts interact with that service and may trigger lockouts or rate limits. Neither permission to read a worksheet nor permission to test one account authorizes another target.

For each candidate, compute the teaching rule and compare with the fixed stored value. A matching checksum supports only equality under this weak rule; collisions are easy and the match need not uniquely identify an original input. Stop after the three supplied words.

Trace a tiny offline comparison loop without treating a hash as decryptable ciphertext.Model. A teaching model drawn by hand. It shows the idea, not real tool output.

Read the full explanation below.

Candidate hiCandidate noCandidate ok
Fixed teaching result

Stored teaching value: 09

met · 09 stays fixed.
Assigned toy checksum

hi: 104 + 105 = 209 → 09, match no: 110 + 111 = 221 → 21, miss ok: 111 + 107 = 218 → 18, miss

met · 209 ends in 09.
Apply the stated rule
Match

The assigned teaching checksum for hi matches fixed 09; this is not a password hash.

This paper checksum illustrates offline candidate comparison; it is neither password hashing nor ciphertext decryption.

The assigned teaching checksum for hi matches fixed 09; this is not a password hash.

Follow the explanation

  1. The assigned teaching checksum for hi matches fixed 09; this is not a password hash.
  2. Changing the candidate changes its assigned checksum, not the stored value.
  3. The third candidate also misses fixed 09; no cracking tool ran.
Read every state and value

1. The assigned teaching checksum for hi matches fixed 09; this is not a password hash.

Case
hi
Conditions inspected
Fixed teaching result · Assigned toy checksum
Decision shown
Yes

2. Changing the candidate changes its assigned checksum, not the stored value.

Case
no
Conditions inspected
Fixed teaching result · Assigned toy checksum
Decision shown
Yes

3. The third candidate also misses fixed 09; no cracking tool ran.

Case
ok
Conditions inspected
Fixed teaching result · Assigned toy checksum
Decision shown
Yes
This paper checksum illustrates offline candidate comparison; it is neither password hashing nor ciphertext decryption.

03Compare the three activity words

The guided stored value is 12. The only permitted candidate words are cat, dog and pen. Their byte arithmetic is printed in the download; do the calculation before comparing it.

Label: teaching checksum. Not MD5, SHA-256, bcrypt, scrypt, Argon2, or PBKDF2.
Rule: add the UTF-8 byte values, then keep the last two decimal digits.
A password recovery tool would call a named verifier. This card uses the checksum so the arithmetic can be checked on paper.

Worked stored value: 09
hi -> 104+105=209 -> 09
no -> 110+111=221 -> 21
ok -> 111+107=218 -> 18
Predicted match: hi

Activity stored value: 12
The three activity words and their predicted digits are on candidates.txt.

Download the checksum rule and the worked row

Label: three original words for the activity checksum. Not a password list from a breach.

cat -> 99+97+116=312 -> 12
dog -> 100+111+103=314 -> 14
pen -> 112+101+110=323 -> 23

Stored activity value: 12
Predicted match: cat

Download the three activity words

"""Compare a teaching checksum with three words. Authoring did not run this file.

The checksum is not a password hash. Do not point this file at a real verifier,
a wordlist, or a credential dump. A later run, if separately authorized, may
print only the worked and activity rows in a new directory.
"""


def checksum(word):
    total = sum(word.encode("utf-8"))
    return f"{total % 100:02d}"


def main():
    print("worked stored 09")
    for word in ("hi", "no", "ok"):
        print(word, checksum(word))
    print("activity stored 12")
    for word in ("cat", "dog", "pen"):
        print(word, checksum(word))


if __name__ == "__main__":
    main()

Download the unread comparison script

  1. Add cat’s byte values 99+97+116. Keep 12 from 312 and compare it with the stored value.
  2. Repeat for dog: 100+111+103 leaves 14. For pen: 112+101+110 leaves 23.
  3. Write cat as the match within this tiny list, then state the limitation: a two-digit checksum does not identify all possible matching inputs.
  4. Stop at three words. Read reference-comparison.py as source if useful; do not run a recovery tool or import a real password list.

04Optional challenge

For about ten optional minutes, draw a loop with candidate → same checksum rule → compare → match/miss. Mark the attempt budget beside the loop. Your drawing should keep the stored value fixed and explicitly stop after the third comparison.

05Fresh cases for the checks

Use these fictional cases for the checks below. They have different inputs from the worked examples. Read them here or make notes; no installation or external service is needed.

Checksum card A: fresh fixed candidate setOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.

Teaching rule: add the given UTF-8 byte values and retain the final two decimal digits, including a leading zero if needed. This is not a password hash.
Candidate 1: ab → 97 + 98.
Candidate 2: ba → 98 + 97.
Candidate 3: ac → 97 + 99.
Stored teaching value: 95. Compare exactly these three words in order and stop, even if more than one matches. No service is named.

Changed conclusion card BOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.

A separate weak-checksum worksheet has two different inputs matching its stored value. No original-input provenance or real password-verification method is supplied.

06Explain the evidence and its limit

Optional self-check: draw candidate → same rule → fixed stored-value comparison, with a budget and stop.

Review it: distinguish local comparison from service attempts, keep all matches, call the rule a weak teaching checksum and avoid describing it as decryption or password recovery.

07Common mistakes

If the activity match is hi, distinguish stored 09 in the worked example from stored 12 in the activity.

If you call the checksum SHA-256, reread the rule: adding bytes and keeping two digits is a different, deliberately weak operation.

If a match seems unique, consider how many possible words must share only 100 possible two-digit values.

References

  • Python 3.12: hashlib key derivation

    Official background on password-verifier derivation or the named recovery tool; the lesson requires no tool execution.

  • John the Ripper homepage

    Official background on password-verifier derivation or the named recovery tool; the lesson requires no tool execution.

  • hashcat wiki start page

    Official background on password-verifier derivation or the named recovery tool; the lesson requires no tool execution.