STATION 25 / FIELD MANUAL

← Back to crypto library

Layered ciphers

Composition

A layered cipher applies transformations in sequence. Each layer receives the output of the previous one. To decrypt, reverse both the operations and their order.

How to recognise it

One supported transformation may yield something structured but still unreadable, or the document may provide two keys or two sets of instructions. Failure to read the first output does not by itself prove another layer exists.

Worked example: Caesar followed by Rail Fence

Encrypt GARDEN, first using Caesar shift 1, then two-rail Rail Fence starting at the top:

Plaintext:          GARDEN
Caesar +1:          HBSEFO

Rail 1:             H . S . F .
Rail 2:             . B . E . O
Read rails:         HSF / BEO
Final ciphertext:   HSFBEO
  1. Apply the shift to every original letter: G→H, A→B, R→S, D→E, E→F, N→O.
  2. Place HBSEFO on two alternating rails.
  3. Read the top rail, then the bottom: HSFBEO.

Work backwards: decrypt HSFBEO

  1. Undo the last layer first. Split six letters into top rail HSF and bottom rail BEO.
  2. Interleave rails to recover HBSEFO.
  3. Undo the first layer by shifting each letter back one place, recovering GARDEN.

Conventions and common mistakes

Record every intermediate result so a mistake can be isolated to one layer. These particular operations commute because one shifts letters uniformly and the other only moves positions; that is a special case. With a position-dependent key such as Vigenère, reversing the wrong order will generally fail.

  • Caesar — The first operation used in this example.
  • Rail Fence — The second operation used in this example.
  • ADFGX — A coordinate cipher with a built-in transposition layer.

Useful desk reference

Transposition worksheets — Draw the rail path used in the worked example.

Support this project

Enjoying Advent of Cypher? If you'd like to support the project and help keep it running, you can make a small donation. Completely optional, always appreciated.