Where does z go?
transcript
A tool shifts every letter forward by one. The letter z wraps round to a. So az becomes ba. The words are one group. But a key can miss it. Here is how.
The key is the letter differences from the first letter. In az, z sits twenty-five places after a. In ba, a sits one place before b. Take every difference modulo twenty-six. Both words get zero, twenty-five.
Rebase every letter on the first letter. The first becomes zero. Take the difference of each letter and the first. Then take it modulo twenty-six, so z wraps round.
Without the modulo the code counts two groups for az and ba. Always test a shift that wraps past z.
Letters wrap at z. You have seen that one. Hours wrap at twenty-four, and days wrap at seven. Whenever a cycle exists, take the modulo of the cycle length.
A shift wraps z round to a. Take differences modulo twenty-six. Test one word that wraps. Full breakdown in the lecture.