Gronsfeld Cipher

Encrypt and decrypt text with the Gronsfeld cipher online using a numeric key, repeated digit shifts, and a selectable alphabet.

Input
0 chars · 0 bytes
Try:
Result
✓ Key is a sequence of digits 0-9 ✓ Multiple alphabets supported ✓ We never store your messages ✓ Processed on our server
Examples
Encrypt with numeric key 314159 Key: 314159
Input HELLO WORLD
Output KFPMT ZPVMI

Numeric key: 314159. Mode: encrypt. Each digit defines the shift for the matching letter.

Decrypt with numeric key 314159 Key: 314159
Input KFPMT ZPVMI
Output HELLO WORLD

Numeric key: 314159. Mode: decrypt. The same repeated key shifts letters back to the original text.

Short key repeated across text Key: 123
Input SECRET MESSAGE
Output TGFTFV NFUUCIG

Numeric key: 123. The key repeats as 1, 2, 3, 1, 2, 3 while the message is encrypted.

Preserve spaces and punctuation Key: 314159
Input ATTACK AT DAWN!
Output DUYBLP DY EDFO!

Numeric key: 314159. Only letters are shifted. Spaces, punctuation marks, and other symbols remain unchanged.

How the Gronsfeld cipher works

The Gronsfeld cipher is a classical polyalphabetic cipher that works like a sequence of Caesar shifts. Instead of using one fixed shift for the whole message, it uses a numeric key where each digit defines a different shift.

For example, with the key 314159, the first letter is shifted by 3 positions, the second by 1, the third by 4, and so on. When the end of the key is reached, the digits repeat from the beginning until the full message is processed.

During decryption, the same numeric key is used in reverse: each encrypted letter is shifted back by the corresponding digit. Spaces, punctuation, digits, and symbols that are not part of the selected alphabet are usually preserved unchanged.

Gronsfeld cipher vs Vigenere cipher

The Gronsfeld cipher is closely related to the Vigenere cipher, but it uses digits instead of letters as the key. In Vigenere, each key letter represents a shift value. In Gronsfeld, the shift values are written directly as numbers from 0 to 9.

This makes Gronsfeld easier to use manually, because the key already tells you how far each letter should move. At the same time, it has similar weaknesses to other classical polyalphabetic ciphers and should not be considered secure by modern standards.

History of the Gronsfeld cipher

The Gronsfeld cipher is traditionally associated with Count Gronsfeld and is often described as a numeric variant of the Vigenere cipher. It belongs to the family of historical polyalphabetic substitution ciphers.

Although it is much easier to break today, the Gronsfeld cipher remains useful for learning how repeated keys, changing shifts, and classical encryption systems work.

FAQ

A Gronsfeld key is a sequence of digits. Each digit defines how many positions the corresponding letter should be shifted in the selected alphabet.

The Vigenere cipher uses letters as the key, while the Gronsfeld cipher uses digits. Each digit works like a Caesar shift for one character of the message.

Yes. If the message is longer than the key, the numeric key repeats from the beginning until all letters are processed.

Spaces, punctuation marks, numbers, and other characters outside the selected alphabet are usually preserved unchanged. Only letters from the selected alphabet are shifted.

No. The Gronsfeld cipher is a historical encryption method and is not secure by modern cryptographic standards. It is best used for education, puzzles, and demonstrations.

A longer key creates more variation in the shifts, but the tool may apply practical limits for usability and validation. The key should contain digits only.
Related tools

Caesar Cipher

Classic letter-shift cipher with custom shift values.

Playfair Cipher

Classic digraph substitution cipher with keyword matrix encryption.

Vigenere Cipher

Keyword-based polyalphabetic encryption and decryption.

Vernam Cipher

XOR-based Vernam encryption with Base64 output.

Bacon Cipher

Classical A/B encoding and text steganography with the Bacon cipher.