What the Gronsfeld cipher is
The Gronsfeld cipher is a variant of the Vigenere cipher, named after the Dutch cryptographer Count Gronsfeld, who described it in the 1700s. In a Vigenere cipher, the key is a word, and each letter of the key sets a shift of 0 to 25. In Gronsfeld, the key is a number, and each digit sets a shift of 0 to 9. That small change makes the cipher easier to use by hand, because numbers are easier to remember and to write down than a long key word.
To encrypt, you write the key digits under the message, repeating the key when it runs out, and shift each letter forward in the alphabet by its digit. A shift of 0 leaves the letter alone, a shift of 1 moves A to B, and a shift of 9 moves A to J. When a shift runs past Z, it wraps back to A, so Z shifted by 9 becomes I. To decrypt, you shift each letter back by the same digit.
How to use the encoder
Type your message in the first box. Letters are used as capitals, and spaces and punctuation stay as they are, so the shape of the message is kept. Type a number key in the second box, using only the digits 0 to 9, like 314 or 2718. A longer key is better, because a short key repeats often and gives a codebreaker more to work with.
Press Encrypt to see the cipher text, or press Decrypt to turn cipher text back into the plain message. The tool shows the first five shifts, like A plus 1 equals B, so you can check the work by hand.
Worked example
Take the message HELLO with the key 123. Write the key under the letters, repeating it: H gets 1, E gets 2, L gets 3, L gets 1, and O gets 2. Shift each letter: H plus 1 is I, E plus 2 is G, L plus 3 is O, L plus 1 is M, and O plus 2 is Q. So HELLO encrypts to IGOMQ. Decrypting IGOMQ with the same key gives HELLO back.
Take the message HELLO WORLD with the key 12. The key digits run across the whole message, spaces included, as 1, 2, 1, 2, 1, then the space, then 1, 2, 1, 2, 1. Shift each letter: H plus 1 is I, E plus 2 is G, L plus 1 is M, L plus 2 is N, O plus 1 is P, W plus 1 is X, O plus 2 is Q, R plus 1 is S, L plus 2 is N, and D plus 1 is E. So the result is IGMNP XQSNE. A shift of 0, from the digit 0, leaves a letter unchanged, which is why keys with many zeros are weak.
Who uses the Gronsfeld cipher
Students of cryptography use Gronsfeld most, because it is the simplest Vigenere variant to learn: ten shifts instead of twenty-six, and a number key instead of a word key. It shows the core idea of a polyalphabetic cipher, that the same letter can turn into different letters, without the extra work of a full Vigenere table.
Puzzle makers use it for treasure hunts and classroom games, where a short message with a number key is a fair puzzle that solvers can crack with patience. History fans use it to study how ciphers were used in the 1700s, when a short number was easier to carry in your head than a long key word. It also helps anyone learning Vigenere, because Gronsfeld is Vigenere with a smaller key space.
Honest limitations
Gronsfeld is a teaching cipher, not a secure one. A modern computer can break it in seconds, and a patient person with pencil and paper can break it too, especially with a short key. The key space is small: a key of 5 digits has only 100,000 possible values, and each digit only shifts by 0 to 9, so the cipher text keeps much of the shape of the plain message.
Spaces and punctuation are kept, which helps a codebreaker find the word lengths, and a short key repeats so often that the pattern shows through. A key of one digit is just a Caesar shift, which anyone can break by trying 10 shifts. Never use Gronsfeld for a real secret; use it to learn, to play, and to make puzzles.
Frequently asked questions
How is Gronsfeld different from Vigenere? In Vigenere the key is a word and each letter shifts by 0 to 25. In Gronsfeld the key is a number and each digit shifts by 0 to 9. Gronsfeld is simpler, but it is also weaker, because the key space is much smaller.
What does a 0 in the key do? Nothing. A shift of 0 leaves the letter unchanged. A key with many zeros is weak, because many letters stay the same, so use keys with digits from 1 to 9 where you can.
Why does the key repeat? Because the message is longer than the key. The key starts again from the first digit when it runs out, and it keeps repeating until the message ends.
Can I decrypt without the key? No, not with this tool. The key sets every shift, so a different key gives a different message.
También disponible en español: Codificador De Cifrado Gronsfeld – Vigenère Con Claves Numéricas
