# Tap Code

The Tap Code is a cipher, commonly used by prisoners in jail to communicate with one another. The method of communicating is usually by "tapping" either the metal bars or the walls inside the cell, hence its name. It is a very simple cipher, not meant to avoid interception, since the messages are sent in cleartext.

It was reportedly invented in June 1965 by four POWs imprisoned in Hoa Lo, Vietnam: Captain Carlyle ("Smitty") Harris, Lieutenant Phillip Butler, Lieutenant Robert Peel and Lieutenant Commander Robert Shumaker. Harris remembered an Air Force instructor who had shown him a cipher based on a Polybius square, as shown on the graph below. Each letter was communicated by tapping two numbers: the first designated the row (horizontal) and the second designated the column (vertical). The letter "X" was used to break up sentences and the letter "C" replaced the letter "K".

The Tap Code is featured in Arthur Koestler's classic work Darkness at Noon, which was published in 1941. The prisoners refer to it as the knock code, but the technique is still the same.

The Tap Code is outlined in the table below:

:
1 2 3 4 5
1ABCDE
2FGHIJ
3LMNOP
4QRSTU
5VWXYZ

For example, to specify the letter "A", you would tap roughly the following: . .

Or to communicate the word "WATER" the cipher would be the following (the time between each pair of numbers is smaller than the one between two different letters):

..... .. . . .... .... . ..... .... .. (5,2) (1,1) (4,4) (1,5) (4,2) W A T E R

Because of the difficulty and length of time required for specifying a single letter, most prisoners devised abbreviations and acronyms for common items or phrases, such as "GN" for Good Night, or "GBU" for God Bless You.

There is however the possibility to do with less taps. First one can arrange the letters in a diagonal fashion. The code shown below never needs more than 8 taps per letter opposed to letters with 9 and 10 taps in the "standard" tap code. Second you can exploit letter frequency as in Morse code. Obviously E should be the code with two taps, not A.

:
1 2 3 4 5 6 7
1EANDWV?
2TIRMB.
3OHUPZ
4SCYQ
5LGX
6FJ
7K

Here is the word WATER with the standard tap code and the modified version.

..... .. . . .... .... . ..... .... .. ..... . .. . . .. . . ... ..

## References

In data communications, cleartext is the form of a message or data which is in a form that is immediately comprehensible to a human being without additional processing. A good early reference is to this is ISO/IEC7498-2, Information Processing Systems--Open Systems Interconnection
19th century - 20th century - 21st century
1930s  1940s  1950s  - 1960s -  1970s  1980s  1990s
1962 1963 1964 - 1965 - 1966 1967 1968

Year 1965 (MCMLXV
POW is a three-letter acronym and may refer to:
• Prisoner of War, a combatant who is imprisoned by an enemy power during or immediately after an armed conflict
• Polish Military Organisation, the Polish Military Organisation active before and during World War I

Hoa Loa Prison (Vietnamese: Hỏa Lò, meaning "fiery furnace"), later known to American prisoners of war as the Hanoi Hilton, was a prison used by the French colonists in Vietnam for political prisoners and later by North Vietnam for prisoners of war during the
Motto
Độc lập - Tự do - Hạnh phúc
"Independence - Freedom - Happiness"
Anthem
Tiến Quân Ca
"Army March" (first verse)
Captain is a rank or title with various meanings. The word came to English via French from the Latin capitaneus ("chief") which is itself derived from the Latin word caput ("head").
Lieutenant is a military, naval, paramilitary, fire service or police officer rank.

Lieutenant may also appear as part of a title used in various other organizations with a codified command structure.
Lieutenant Commander (Lieutenant-Commander in the Royal Navy)[1] is a commissioned officer rank in many navies superior to a Lieutenant and subordinate to a Commander.
United States Air Force (USAF) is the aerial warfare branch of the United States armed forces and one of the seven uniformed services. Previously part of the United States Army, the USAF was formed as a separate branch of the military on September 18, 1947.
In cryptography, the Polybius square, also known as the Polybius checkerboard, is a device invented by the Ancient Greek historian and scholar Polybius, described in Hist. X.45.6 ff.
Arthur Koestler CBE (September 5, 1905, Budapest – March 3, 1983, London) was a Hungarian polymath who became a naturalized British subject. He wrote journalism, novels, social philosophy, and books on scientific subjects.
Darkness at Noon

Cover of Darkness at Noon
Author Arthur Koestler
Language German
Genre(s) Novel
Publisher Bantam Books
Publication date 1940
Published in English 1 March 1984
abbreviation (from Latin brevis "short") is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase. For example, the word "abbreviation" can itself be represented by the abbreviation "abbr.
Acronyms and initialisms are abbreviations, such as NATO, laser, and IBM, that are formed using the initial letters of words or word parts in a phrase or name.
Morse code is a method for transmitting telegraphic information, using standardized sequences of short and long elements to represent the letters, numerals, punctuation and special characters of a message.
The phrase knock three times can refer to:
• A 1968 TV serial, Knock Three Times (TV)
• A 1970 song, Knock Three Times
• A 2001 poem by Bob Rosenthal, Knock Three Times (poem)

In cryptography, the ADFGVX cipher was a field cipher used by the German Army during World War I. ADFGVX was in fact an extension of an earlier cipher called ADFGX. Invented by Colonel Fritz Nebel and introduced in March 1918, the cipher was a fractionating transposition
The Affine cipher is a special case of the more general substitution cipher. It is monoalphabetic and symmetric.

In affine ciphers the encryption function for a letter is where,
• and are coprime (otherwise would have no multiplicative inverse modulo ).

The Alberti Cipher was the first ever Polyalphabetic Cipher.

Created in the late 15th century, circa.1470, by Leon Battista Alberti, it was the peak of cryptography at that time.
Atbash is a simple substitution cipher for the Hebrew alphabet. It consists of substituting aleph (the first letter) for tav (the last), beth (the second) for shin (one before last), and so on, reversing the alphabet.
autokey cipher (also known as the autoclave cipher)[1] is a cipher which incorporates the message (the plaintext) into the key. There are two forms of autokey cipher: key autokey and text autokey ciphers.
In classical cryptography, the bifid cipher is a cipher which combines the Polybius square with transposition, and uses fractionation to achieve diffusion. It was invented around 1901 by Felix Delastelle.
A book cipher is a cipher in which the key is the identity of a book or other piece of text. It is generally essential that both correspondents not only have the same book, but the same edition.
Caesar cipher, also known as a Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques.
The Four-square cipher is a manual symmetric encryption technique. It was invented by famous French cryptographer Felix Delastelle.

The technique encrypts pairs of letters (digraphs
Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester S. Hill in 1929, it was the first polygraphic cipher in which it was practical (though barely) to operate on more than three symbols at once.