Gronsfeld cipher
A Vigenere variant whose key is a string of digits 0-9, like 31415. Each digit is the shift for one letter, and the key repeats along the message.
Understanding Gronsfeld cipher in QCE Digital Solutions Unit 4
What it does: Adding the digit shifts the letter forward, and % 26 wraps past Z back to A. Subtracting the same digit reverses the encryption, and % 26 keeps the result between 0 and 25. A Gronsfeld key is a string of digits 0 to 9. A key made of letters like PIZZA belongs to the Vigenere cipher. Each digit is the shift for ONE letter. The first digit is 3, so A moves 3 places to D. Gronsfeld is a Vigenere variant with a numeric key. Both repeat the key along the message. MOD by the key length sends the position back to the start of the key, so 31415 repeats as 3,1,4,1,5,3,1,4...
Common mistakes: A Gronsfeld key is made only of digits 0-9, because each digit is a shift. Letters like ABCDE make a Vigenere key. It should be key = "31415". The key must repeat along the message. Using key[i] runs off the end of a short key. It should use i % len(key) to wrap back to the first digit.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 17–88) and word search (Modules 17–125).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
Gronsfeld cipherFill in the Blanks
Spot the Error
Student with a class code? Join your class →