Free Tool

Gronsfeld Cipher Tool

A Vigenère cipher with a number for a key

Ciphertext

How the Gronsfeld cipher works

Each digit of the key says how far to shift one letter of the message forward along the alphabet. When the digits run out, the key starts again.

  1. Write the digits of the key under the message's letters, repeating them as needed. Spaces and punctuation are kept and don't use up digits.
  2. Shift each letter forward by its digit: with a 3, A becomes D and Y becomes B (the alphabet wraps round).
  3. To decrypt, shift each letter back by the same digit.

A Gronsfeld key is the same as a Vigenère key that only uses the letters A to J (A = 0 … J = 9). The key 31415 is the Vigenère key DBEBF.

Example

With the key 31415, the digits of π, HELLO WORLD becomes KFPMT ZPVMI: H + 3 = K, E + 1 = F, L + 4 = P, and so on.

How to break it

  • Find the key length with Kasiski examination or the index of coincidence.
  • Try 10 shifts per column. For each position in the key, try shifts 0 to 9 and keep the one whose letter counts look most like English.
  • Try known numbers. Dates, years, π and phone-style numbers are worth a guess first.

History

The cipher is named after a 17th-century Count of Gronsfeld. It stayed popular for a long time because a number is easy to carry in your head, even though cutting the alphabets from 26 to 10 makes it weaker than Vigenère.

Related tools

Questions

What is the difference between Gronsfeld and Vigenère?

Gronsfeld is a Vigenère cipher limited to shifts of 0 to 9, written as digits. The key 31415 means "shift by 3, 1, 4, 1, 5, then repeat". It is the same as a Vigenère key using only the letters A to J.

Is Gronsfeld weaker than Vigenère?

Yes. Once the key length is known, each column has only 10 possible shifts to try instead of 26.

Can I use a date or phone number as the key?

That is the traditional appeal of Gronsfeld: a number is easy to remember. But dates and well-known numbers are among the first keys a codebreaker tries, and a short key repeats often.