✖

Phone keypad cipher: keypad and translator

The phone keypad cipher, also called the SMS cipher, the mobile cipher or multi-tap, writes each letter as the digit of the key it sits on, repeated as many times as the letter’s position on that key. C is the third letter on the 2 key, so it is written 222:

A phone keypad with three columns and four rows: 1, 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ, star, 0 and hash; key 2 and the letter C are in red A phone keypad with three columns and four rows: 1, 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ, star, 0 and hash; key 2 and the letter C are in red

The word “ahoj” (Czech for “hello”) is 2 44 666 5: A is first on the 2, H second on the 4, O third on the 6 and J first on the 5. This is how text messages used to be written on phones with buttons. They had no touch screen, only buttons with digits, and each one carried several letters: to write C you pressed the 2 three times in quick succession.

The keypad is the same on all phones today, and the layout of the letters is set by the international standard ITU E.161. The letters sit on keys 2 to 9 in alphabetical order, three at a time, except that 7 (PQRS) and 9 (WXYZ) have four. The 1 and the 0 stayed without letters. S is fourth on the 7, so it is 7777, and T is first on the 8, so just 8.

Like the number cipher, this one is really a code rather than a cipher. It has no key, that is, no secret known only to the sender and the receiver. Almost everybody has the keypad in their pocket: the phone’s dial pad still shows it, with small letters under the digits.

Phone keypad cipher converter

Type a message and the converter writes it according to the keys. It separates letters with a space and words with a slash. It drops accents (č is written as c) and leaves out digits and punctuation, so write the numbers in a message as words.

The default text, “Sraz zitra vecer”, is Czech for “meet tomorrow evening”.

And the other way round: paste in groups of identical digits separated by spaces and separate words with a slash. The converter shows a group that does not stand for any letter as #. Examples are 2222 (the 2 has only three letters) and 23, which is not a group of identical digits. In the shorter variant below, though, 23 is the letter C.

The default digits spell “klic je pod lavickou”, Czech for “the key is under the bench”.

Why a space is needed

What does 22 mean? It could be B, the 2 pressed twice, but also AA, two separate 2s. And 222 could be C, BA, AB or AAA. Without a space between the letters the notation is ambiguous whenever two letters from the same key follow each other.

The phone solved this with timing: if you waited a moment, the cursor moved on and the next press of the 2 started a new letter. In the cipher the space replaces that moment: 2 2 is AA, 22 is B. The number cipher runs into the same problem, where 121 can be ABA or LA, and so does Morse code, where .-. is R, or A and E.

How many digits one letter takes

Each of the eight keys 2 to 9 has a first letter (one press is enough), a second (two) and a third (three). Only two keys have a fourth letter, the 7 (S) and the 9 (Z), and that is four presses. Writing each letter of the alphabet once therefore takes 8 · 1 + 8 · 2 + 8 · 3 + 2 · 4 = 56 presses, on average

5626≈2.15

presses per letter. Czech text comes out slightly worse, about 2.25 digits per letter, because the common letters O, I and L are third on their key and S is even fourth (a weighted mean using the table in the article Frequency analysis). An encrypted message is therefore more than twice as long as the text, which is why shorter variants are played at camp.

Shorter variants for games

Two shortened versions:

  • Key and position. Each letter is made of two digits: the key and the position on it. C is 23 (key 2, third letter), S is 74 and “ahoj” is 21 42 63 51. The pairs have a fixed length, so spaces are not needed, just as with the Polybius square.
  • Key only. A single digit replaces the letter. But that is no longer unambiguous: 567 can be “kos” (Czech for “blackbird”) or “los” (Czech for “elk”), because K and L are on the same key. The message is then solved like a riddle, and it pays to add a hint.

Predictive text (T9) worked in a similar way: each key was pressed once and the phone guessed from a dictionary which word you meant.

How to break the phone keypad cipher

You can recognise it at first glance: groups of identical digits, no 1 or 0 and at most three identical digits in a row, four only for 7s and 9s. All that is left is to read the groups from the keypad above or from the dial pad on your phone.