The Spiral Cipher is a transposition cipher that arranges plaintext into a grid of a specified number of columns and reads the letters in a spiral order. Spaces are preserved in their original positions, and padding characters (·) are added only to fill incomplete grid cells to maintain a rectangular shape.

The cipher works by filling the grid row by row with the plaintext (including spaces), then extracting the ciphertext following a spiral path: top row → rightmost column → bottom row in reverse → leftmost column → repeat inward until all cells are covered.

Spiral Cipher: Encoding

To encode, enter the plaintext and the number of columns. The plaintext is arranged into a grid with padding if necessary. The ciphertext is read along the spiral path. Example:

Plaintext:  HELLO WORLD
Columns:    3

Step 1: Create grid (3 columns, preserve spaces, pad empty cells with '·'):

Row 1: H E L
Row 2: L D L
Row 3: R · O
Row 4: O W  

Step 2: Read in spiral order:
Ciphertext: HELLDLR.OOW

Spiral Cipher: Decoding

To decode, split the ciphertext into the same grid dimensions, fill the grid row by row, and then read the letters following the spiral path in reverse. Padding characters are removed, and spaces are preserved:

Ciphertext: HELLDLR.OOW
Columns:    3

Step 1: Fill grid row by row:

Row 1: H E L
Row 2: L D L
Row 3: R · O
Row 4: O W  

Step 2: Read letters in reverse spiral order:
Plaintext: HELLO WORLD

Spiral Cipher: Notes

- Spaces in the plaintext are preserved and appear in the same positions in the ciphertext. - Padding (·) is added only to fill the grid and does not affect decoding. - The number of columns must match between encoding and decoding. - The spiral reading path follows the exact order used in the tool: top row → right column → bottom row (reverse) → left column → inward loops. - The visual grid in the tool helps verify encoding and decoding for any message.

Spiral Cipher

T