CacheHackCacheHack

Bifid Cipher

Encode and decode using the Bifid cipher. A fractionating cipher that combines Polybius square with transposition.

Used to generate the 5x5 Polybius square

Polybius Square

01234
J is treated as I

How Bifid Works

  1. Convert each letter to row/column coordinates
  2. Write all rows, then all columns
  3. Read pairs and convert back to letters

This "fractionates" each letter across two output letters, diffusing the statistics.

What is the Bifid Cipher?

The Bifid cipher is a fractionating cipher that combines the Polybius square with a simple transposition. Invented by Felix Delastelle around 1901, it was considered quite secure for its time because it diffuses the statistical properties of the plaintext.

How It Works

Encryption

  1. Create a 5×5 Polybius square using the keyword
  2. For each plaintext letter, find its row and column coordinates
  3. Write all row numbers in sequence, then all column numbers
  4. Take pairs of numbers and convert back to letters using the grid

Example

With a standard grid, encrypting "HELLO":

  • H = (1,2), E = (0,4), L = (2,1), L = (2,1), O = (2,4)
  • Rows: 1, 0, 2, 2, 2
  • Cols: 2, 4, 1, 1, 4
  • Combined: 1 0 2 2 2 2 4 1 1 4
  • Pairs: (1,0) (2,2) (2,2) (4,1) (1,4) → FMMVE

Bifid in Geocaching

The Bifid cipher appears in puzzles because:

  • Moderate difficulty: Not too hard, not too easy
  • Keyword-based: Finding the keyword is part of the puzzle
  • Historical: Interesting cipher history
  • Resistance to frequency analysis: Letters are diffused

Breaking the Cipher

Without the keyword:

  • Period analysis: Bifid is periodic with period 2
  • Known plaintext: Helps determine the grid
  • Brute force: Try common keywords
  • Hill climbing: Optimize the grid arrangement

Variations

  • Periodic Bifid: Use period longer than message
  • Trifid: Three-dimensional version (27 letters)
  • Four-square: Related digraphic cipher