Example
Add a tiny secret MAC key so the receiver can reject tampered ciphertext.
highlighted = computed this step
Step 1 — Set up
Set up the exact toy cryptography values.
cipher nibbles, mac key((1, 2, 12), 11)
Step 2 — Tag
Compute the highlighted cryptography value.
(sum(cipher)+mac_key) mod 16(15, 11, 10)
Step 3 — Verify
Compute the highlighted cryptography value.
recomputed tag vs sent tag(10, 10, match)
Final Step — Tamper check
Compute the highlighted cryptography value.
tampered tag check vs sent tag(11, 10, mismatch)
cryptography
This lesson uses a fixed toy tag formula to show the role of a secret authentication key. The sum-based tag is deliberately weak and can miss sum-preserving edits; it is not a real MAC.