VIC Cipher
Encode and decode with the VIC cipher, the formidable Soviet hand cipher carried by spy Reino Häyhänen. From a date, a memorized phrase, a personal number and a five-digit keygroup it derives a straddling checkerboard and two columnar transpositions, the second one disrupted. Everything runs in your browser.
The VIC cipher was the most complex hand cipher of the Cold War. From four small secrets, a date, a memorized phrase, a personal number and a five-digit keygroup, a long keying chain builds a straddling checkerboard and two columnar transpositions, the second of which is disrupted. Set the four key parts below, then encode or decode. Only letters, digits and the period are carried; everything else is ignored. Use the same four key parts to decode.
Mode
Date (6+ digits)
A date written as digits, for example 139195. The first five digits start the keying chain; the sixth sets where the keygroup is hidden in the message.
Key phrase (20+ letters)
A memorable line of text, such as a song lyric. The first twenty letters are used; spaces and punctuation are ignored.
Personal number
A small number from 1 to 99 that both correspondents memorize.
Keygroup (5 digits)
A random five-digit group, different for every message. It travels in the clear, hidden inside the ciphertext.
Enter text above to see the VIC result here.
How the keys are derived
Keying chain
Each line is built from the ones above it: A is the keygroup, B the date, and C is A minus B. E.1 and E.2 come from the key phrase. The chain then adds, sequences and combines digits down to S, the checkerboard header, and the two transposition keys.
A
72401
B
13919
C
69592
E.1
8017942653
E.2
6013589427
F.1
6959254417
G
4966196060
H
3288628787
J
3178429506
Block (K–P)
K
5064805552
L
5602850077
M
1620350748
N
7823857125
P
5051328370
S
5961328470
Checkerboard header (S)
5961328470
Transposition 1 width
13
Transposition 2 width
6
Transposition 1 key
0668005552551
Transposition 2 key
758838
Indicator slot
5
Straddling checkerboard
The top row holds eight common letters under the mnemonic AT ONE SIR; the two blank columns' header digits prefix the lower rows. A common letter takes one digit, every other letter takes two.
How to use VIC Cipher
- 1
Choose encode or decode
Select Encode to turn a message into VIC ciphertext, or Decode to recover the message. Decoding needs exactly the same date, key phrase, personal number and keygroup that were used to encode.
- 2
Set the date
Enter a date as digits, for example 139195. The first five digits begin the keying chain, and the sixth digit decides where the keygroup is hidden in the finished message.
- 3
Set the key phrase and personal number
Enter a memorable phrase of at least twenty letters and a small personal number from 1 to 99. These are the standing secrets that both correspondents agree on in advance.
- 4
Set the keygroup
Enter a random five-digit keygroup, or press Random to generate one. The keygroup is the indicator: it changes for every message and is sent hidden inside the ciphertext.
- 5
Type your message and read the result
Type or paste your text. Only letters, digits and the period are enciphered; everything else is ignored. Copy or download the result, or share a link that reopens the tool with your exact keys and text.
Understanding the VIC Cipher
What is the VIC cipher?
The VIC cipher is a pencil-and-paper cipher used by Soviet intelligence in the 1950s and widely regarded as the most complex hand cipher ever fielded. It is named after Reino Häyhänen, a KGB agent whose code name was VICTOR. Despite using nothing more than a pencil, paper, and a few memorized secrets, the system combined substitution and transposition so thoroughly that American cryptanalysts could not break a single intercepted message until Häyhänen himself defected and explained how it worked.
What makes VIC remarkable is that it packs the strength of a machine cipher into a procedure an agent could carry entirely in their head. A short keying routine turns a date, a memorized phrase, a personal number, and a random five-digit group into all the material the cipher needs: a straddling checkerboard for turning letters into digits, and two columnar transpositions, the second of them disrupted, for scrambling the result. This tool reproduces that whole process and shows each step as it happens.
How the VIC cipher works
Enciphering a message with VIC has three stages. First comes the keying chain: a sequence of simple digit operations, additions without carrying, subtractions without borrowing, and rankings, that expands the four key parts into a checkerboard header line and two transposition keys with their widths. Then the message is converted to digits using a straddling checkerboard, a compact table in which the most common letters take a single digit and the rest take two. Finally those digits are scrambled by two columnar transpositions.
The clever part is the second transposition, which is disrupted: triangular areas of the grid are reserved and filled only after the rest of it, breaking up the orderly columns that make ordinary transposition ciphers easier to attack. At the very end the random keygroup is slipped back into the ciphertext at a position fixed by the date, so the receiver can recover the indicator and repeat the keying chain. The result is a string of digit groups that betrays no pattern of the original language.
The keying chain
Everything in VIC flows from the keying chain. The five-digit keygroup becomes line A and the first five digits of the date become line B; subtracting B from A without borrowing gives line C. The key phrase supplies two more lines: its first ten letters and its next ten letters are each numbered in alphabetical order to make lines E.1 and E.2. Line C is then stretched by chain addition, a lagged process where each new digit is the sum of two earlier ones, and combined with the phrase lines to produce more digits.
From these the chain grows a block of fifty digits, again by chain addition. Numbering the last row of that block gives line S, which becomes the header of the straddling checkerboard. Two digits drawn from the block, added to the personal number, set the widths of the two transpositions, and reading the block column by column in a keyed order produces the two transposition keys themselves. The live diagram in this tool lays out every one of these lines so you can follow the derivation from the four secrets all the way to the finished keys.
The straddling checkerboard
A straddling checkerboard is a small table that turns letters and digits into a stream of numbers. Its ten columns are labelled by the header line S. The top row carries eight high-frequency letters, placed under a pre-agreed mnemonic, here the classic AT ONE SIR, whose two spaces mark the columns left blank. Those two blank columns' header digits become the prefixes for the two rows beneath, which hold the rest of the alphabet, a period, and a number-shift symbol.
Because the common letters sit in the top row, they encode to just one digit each, while less common letters take two, the row prefix followed by the column label. This uneven, self-synchronising code keeps the ciphertext short and removes the obvious letter frequencies that a simple substitution would leak. Digits in the message are sent in a figures mode, marked by the number-shift symbol, with each digit written three times so it cannot be confused with a letter code.
The two transpositions
Once the message is a stream of digits, VIC scrambles it twice. The first transposition is an ordinary columnar one: the digits are written into rows of a fixed width, then the columns are read out in an order set by the first transposition key. This alone mixes the digits well, but on its own a columnar transposition leaves regularities that experienced codebreakers can exploit, especially when several messages share a key.
The second transposition closes that gap by being disrupted. Triangular regions of the grid are reserved in a staircase pattern keyed by the second transposition key; the message first fills only the cells outside those triangles, and then comes back to fill the triangles themselves. Reading the columns out in keyed order interleaves the two fillings, so the final digits are thoroughly stirred. It is this disruption, layered on top of the checkerboard and the first transposition, that gave VIC its formidable reputation.
Reino Häyhänen and the hollow nickel case
The VIC cipher came to light through one of the most famous episodes of Cold War espionage. In 1953 a newspaper boy in Brooklyn dropped a nickel that split open, revealing a tiny photograph of a column of numbers. The FBI could not read the message, and the hollow nickel sat as an unsolved curiosity for four years. The break came in 1957 when Reino Häyhänen, a Soviet agent stationed in New York under the code name VICTOR, defected to the United States and described the cipher in detail.
Häyhänen's information also helped expose his superior, the senior illegal officer known as Rudolf Abel, who was later exchanged for the American U-2 pilot Francis Gary Powers. The cipher Häyhänen revealed was so elaborate that analysts named it after him, and the National Security Agency long held it up as an example of just how strong a hand cipher could be. Its secrets had been safe not because the messages were broken, but only because a man walked in and gave them away.
How secure is the VIC cipher?
By the standards of hand ciphers, VIC was exceptional. Layering a straddling checkerboard over two transpositions, one of them disrupted, removes letter frequencies and destroys the column structure that lets analysts attack simpler systems. With a fresh random keygroup for every message and a key built from secrets an agent only had to remember, it resisted the cryptanalysis of its day completely; the system was compromised by a defector, not by codebreaking.
Against modern computers, however, VIC offers no real protection. Its keyspace, though large for a person working by hand, is trivial for a machine to search, and the underlying operations are well understood. Like the Enigma machine or any classical system, it is best enjoyed today as history and as a beautiful demonstration of how substitution, transposition, and careful key management combine. To protect real information you should always use a well-tested modern algorithm such as AES.
Frequently asked questions
What is the VIC cipher?
Why is it called the VIC cipher?
How does the VIC cipher work?
What is the keying chain?
What is a straddling checkerboard?
What is the disrupted transposition?
What was the hollow nickel case?
How do I decode a VIC message?
What is the keygroup or indicator?
How secure was the VIC cipher?
Is my text uploaded to a server?
Related tools
Keep going with these handy tools