The Acrostic Cipher is a form of substitution cipher that encodes plaintext by mapping it into words or blocks such that certain letters (usually the first letters of each block) form the original message when read sequentially. It combines simple substitution with structured presentation, often used for secret messages hidden in poems, lists, or block-formatted text.

In this implementation, the plaintext is split into blocks of fixed size for readability, and a key is used to determine the substitution pattern for letters.

Acrostic Cipher: Encoding

To encode with the Acrostic Cipher:

Plaintext: catENCODE
Key:       key
Block size: 3

Step 1: Split plaintext into blocks (for readability)
cat ENC ODE

Step 2: Apply substitution using the key
Each letter is substituted based on the key mapping:
c → m
a → e
t → r
E → O
N → R
C → A
O → Y
D → H
E → C

Step 3: Arrange into blocks of 3
Block 1: mer
Block 2: ORA
Block 3: YHC

Ciphertext:
mer ORA YHC

The key determines the substitution mapping for each letter, and the block size ensures the encoded message remains readable while keeping the hidden plaintext intact.

Acrostic Cipher: Decoding

Decoding reverses the substitution process:

Ciphertext: mer ORA YHC
Key:        key
Block size: 3

Step 1: Flatten the blocks
mer ORA YHC → merORAYHC

Step 2: Apply inverse key mapping
m → c
e → a
r → t
O → E
R → N
A → C
Y → O
H → D
C → E

Step 3: Reconstruct plaintext
Plaintext:
catENCODE

Acrostic Cipher: Notes

  • Type: Substitution/Steganographic cipher
  • Key: Determines letter mapping
  • Block size: Optional; used for formatting readability
  • Strengths: Hides plaintext within structured text; visually inconspicuous
  • Weaknesses: Susceptible to frequency analysis if block patterns are repetitive

The Acrostic Cipher demonstrates how simple substitution can be combined with structural formatting to encode messages while hiding the original content within plain sight.

Acrostic Cipher

T
🗝