T

Text Machine

Powerful text tools, in your browser

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

Key

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.

Text
Result

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.

5
9
6
1
3
2
8
4
7
0
A
T
O
N
E
S
I
R
6
B
C
D
F
G
H
J
K
L
M
8
P
Q
U
V
W
X
Y
Z
.
/

How to use VIC Cipher

  1. 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. 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. 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. 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. 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?
The VIC cipher is a Soviet pencil-and-paper cipher from the 1950s, often called the most complex hand cipher ever used. It combines a straddling checkerboard with two columnar transpositions, the second one disrupted, all keyed from a date, a memorized phrase, a personal number and a random five-digit keygroup. It is named after the Soviet agent Reino Häyhänen, whose code name was VICTOR.
Why is it called the VIC cipher?
VIC is short for VICTOR, the code name of Reino Häyhänen, the KGB agent who used the cipher while operating in New York. After he defected in 1957 and described the system to American intelligence, analysts named it after him. It is sometimes also called the VICTOR cipher or, from how it was discovered, the hollow nickel cipher.
How does the VIC cipher work?
First a keying chain expands the four key parts into a checkerboard header and two transposition keys. The message is then turned into digits with a straddling checkerboard, where common letters take one digit and others take two. Those digits are scrambled by two columnar transpositions, the second disrupted by reserved triangular areas, and finally the keygroup is inserted into the ciphertext at a spot fixed by the date.
What is the keying chain?
The keying chain is the sequence of digit operations that turns the four key parts into everything the cipher needs. It subtracts the date from the keygroup, numbers the letters of the key phrase, and repeatedly uses chain addition, a lagged running sum without carrying, to grow a fifty-digit block. From that block it reads off the checkerboard header line and the two transposition keys and their widths.
What is a straddling checkerboard?
A straddling checkerboard is a small table that converts letters into digits. Eight common letters sit in a top row and encode to a single digit each, while the remaining letters, a period and a number-shift symbol sit in two lower rows and take two digits. This makes the ciphertext shorter and hides the letter frequencies that a plain substitution would reveal.
What is the disrupted transposition?
The second VIC transposition is disrupted: triangular regions of the grid are reserved in a staircase pattern set by a key. The message fills all the cells outside the triangles first, then returns to fill the triangles, and the columns are read out in keyed order. This breaks up the regular columns of an ordinary transposition and is a large part of what made VIC so hard to break.
What was the hollow nickel case?
In 1953 a Brooklyn newspaper boy found a hollow five-cent coin containing a microphotograph of a column of numbers. The FBI could not read the enciphered message, and it remained unsolved until the Soviet agent Reino Häyhänen defected in 1957 and revealed the VIC cipher. The case helped expose the spy network of Rudolf Abel and became one of the best-known stories of Cold War espionage.
How do I decode a VIC message?
Switch the tool to Decode and enter exactly the same date, key phrase, personal number and keygroup that were used to encrypt, then paste the ciphertext as groups of digits. The original message appears. Without all four key parts the message cannot be recovered, because each one feeds into the keying chain that builds the checkerboard and the transpositions.
What is the keygroup or indicator?
The keygroup is a random five-digit number chosen fresh for every message. It seeds the keying chain, so each message is enciphered with effectively different keys, and it is then hidden in the finished ciphertext at a position set by the sixth digit of the date. The receiver pulls it back out, repeats the keying chain, and so can decipher the message.
How secure was the VIC cipher?
For a hand cipher it was outstanding. The checkerboard removes letter frequencies and the two transpositions, with the second disrupted, destroy the patterns that let analysts break simpler systems. It was never broken from intercepts alone and was compromised only when an agent defected. Against modern computers, though, it offers no real security and should be treated as a historical and teaching cipher.
Is my text uploaded to a server?
No. All enciphering and deciphering happen entirely in your browser, so your text and keys are never uploaded, logged, or stored. Even a share link keeps your data in the part of the URL after the hash, which browsers never send to a server, so it stays private until you choose to share it.

Related tools

Keep going with these handy tools

Straddling Checkerboard

Bazeries Cipher

Caesar Cipher

Vigenère Cipher

Atbash Cipher

Rail Fence Cipher