Four Square Cipher Encoder – Encrypt With Four Squares

What the four-square cipher is

The four-square cipher is a hand cipher that encrypts letters in pairs. It uses four squares of five letters by five letters. The top-left and bottom-right squares hold the plain alphabet in order, from A to Z, with I and J sharing one cell because the alphabet has 26 letters and the square holds only 25. The top-right and bottom-left squares hold the same letters mixed up by two keywords that you choose.

The method was published in 1902 by the French cryptographer Félix Delastelle. It came after the Playfair cipher, and it is stronger than Playfair for one clear reason: each pair of plain letters is replaced by two letters that come from two different squares, so a single plain letter does not always become the same cipher letter. The same letter can turn into different letters in different pairs, which makes simple guessing much harder.

How to use the tool

Start by typing your first keyword in the first box and your second keyword in the second box. A keyword can be any word, such as EXAMPLE or KEYWORD. The tool removes repeated letters from each keyword, then fills the rest of its square with the letters that are left. Your two keywords are the secret: anyone who wants to read your message needs both of them.

Next, type your message in the message box and choose Encrypt or Decrypt. Press the button and the tool shows the result at once. The bar below the result shows how many letters changed, and the two keyword squares appear underneath so you can see how the letters were mixed. Only letters are encrypted. Spaces, numbers and punctuation are dropped, and every J is read as I, which is how the classic method works.

Worked example with real inputs and outputs

Take the message HELLO with the keywords EXAMPLE and KEYWORD. The tool first cleans the message to HELLO, then adds an X because the message has an odd number of letters, giving HELLOX. It splits the text into pairs: HE, LL and OX. Each pair is encrypted with the two keyword squares, and the result is FYGFIX.

Look at the first pair, HE. The H sits in row 2, column 3 of the plain square, and the E sits in row 1, column 5. The first cipher letter comes from the top-right square at row 2, column 5, which is F. The second comes from the bottom-left square at row 1, column 3, which is Y. So HE becomes FY. The same rule turns LL into GF and OX into IX. To check your work, run FYGFIX back through the tool with Decrypt and the same two keywords, and HELLOX comes back.

Who uses this cipher

Puzzle makers use the four-square cipher for treasure hunts, escape rooms and classroom games, because it is easy to explain on one page and hard enough that players must work at it. Teachers use it to show how digraph ciphers work, since it is a clear step past simple letter swaps. Hobby coders and history fans use it to send secret notes to friends, and writers use it to hide messages inside stories.

It also suits anyone who wants a pen-and-paper cipher without a computer. All you need is the four squares and the two keywords. That makes it a good fit for scouts, camps and puzzle clubs, where the fun is in working the cipher out by hand and the message is a game, not a real secret.

Honest limitations

The four-square cipher is not secure by modern standards. A computer can break it with frequency analysis, because pairs of letters still show patterns over a long message. Short messages are safer than long ones, but no hand cipher of this age can protect a real secret from a determined attacker. Never use it for passwords, money, health details or anything private.

The method also drops everything except letters. Numbers, punctuation and spaces disappear, so the reader must guess where the words break. The letter J is lost, because it shares a cell with I, and an odd-length message gains a padding X at the end. If your message is long, split it into short parts and change the keywords often, which makes guessing harder.

Frequently asked questions

Is the four-square cipher secure? No. It is a puzzle cipher from 1902. It hides a message from a casual reader, but a computer breaks it fast. Use it for games and learning, never for real secrets.

How do I decrypt a message? Choose Decrypt, type the same two keywords, and paste the ciphertext. The tool runs the squares in reverse and gives back the plain text, with a padding X at the end if the message had an odd length.

Why does J become I? Each square holds 25 cells, but the alphabet has 26 letters. The classic method merges I and J into one cell, so every J is read as I before encryption.

What if my keyword repeats a letter? The tool keeps only the first copy of each letter, then fills the square with the letters that are left. So EXAMPLE and EXAMPPLE build the same square.

También disponible en español: Codificador De Cifrado De Cuatro Cuadrados – Cifra Con Cuatro Cuadrados

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top