Atbash Cipher - Ancient Encryption Tool
Free Online Tool

Two-square Cipher Encoder

Encrypt and decrypt digraphs with two keyed 5x5 squares.

TL;DR

  • Two-square cipher is a digraph substitution cipher.
  • It uses two keyed 5x5 squares, usually with I and J combined.
  • Each pair of letters is encrypted by rectangle coordinates across the two squares.
  • It is useful for learning classical cryptography, not for modern security.

How the Two-square Cipher Works

The two-square cipher is a classical polygraphic cipher that encrypts two letters at a time. It is closely related to the Playfair cipher because both methods replace single-letter substitution with digraph substitution.

A Polybius square is a 5x5 alphabet grid used to convert letters into row and column positions. This tool builds two keyed squares using the Polybius square convention where I and J share one cell. The first plaintext letter is found in the left square, the second plaintext letter is found in the right square, and the ciphertext pair is taken from the opposite rectangle corners.

For example, if the first letter is at row 2 column 1 in the left square and the second letter is at row 4 column 5 in the right square, the encrypted pair uses row 2 column 5 from the right square and row 4 column 1 from the left square.

History and Context

The two-square cipher is a hand cipher from the family of classical digraph substitution systems. Historical descriptions usually present it as a simpler relative of four-square cipher systems; see the Two-square cipher reference for the standard two-alphabet construction.

Its security comes from obscuring single-letter frequency patterns by encrypting pairs, but it still leaks structure. Repeated digraphs, language statistics, and known-plaintext examples can break it, so it belongs in education, puzzle design, and cryptanalysis practice rather than operational security.

Use Cases

Classroom Demonstrations

Show how digraph substitution improves on monoalphabetic ciphers while remaining manually traceable.

Puzzle and Escape Room Text

Create ciphertext that is more interesting than Caesar or Atbash but still solvable with clues.

Cryptanalysis Practice

Compare single-letter frequency analysis against pair-based cipher attacks.

Historical Cipher Study

Explore the design path from Polybius square systems to Playfair, two-square, and four-square ciphers.

How to Use This Tool

  1. Choose Encrypt or Decrypt.
  2. Enter one keyword for the left square and one keyword for the right square.
  3. Paste your message or ciphertext into the input box.
  4. Review the output, copy it, or download the result as a text file.

Important Limitations

Two-square cipher is not modern encryption. It provides historical and educational value, but it should not be used to protect passwords, personal data, API keys, financial data, or any real confidential message.