Skip to main content
CipherChronicle

Cipher methods Polyalphabetic

Ragbaby cipher

An unusual polyalphabetic: each letter is shifted by its position WITHIN ITS WORD, not within the message. Word lengths are preserved, which defeats frequency analysis but exposes the cipher to known-word attacks.

Family :
Polyalphabetic
Difficulty :
Advanced
Era :
Classical American cryptography, 20th century

Also known as : Ragbaby · Rag baby · polyalphabetic by word

The Ragbaby cipher is an unusual polyalphabetic that became popular among American puzzling circles in the early 20th century. Its quirk: the key is not repeated along the message, and spaces matter — what individuates each letter is its position inside its own word.

Principle

The cipher uses two ingredients:

  1. A keyed alphabet built from a keyword. As in Playfair, write the keyword’s unique letters first, then the rest of the alphabet. I/J and U/V are merged — so we work over 24 letters.
  2. For each plain letter, note its position in its word (1st, 2nd, 3rd…). That position is the shift applied to the letter inside the keyed alphabet.
Plain    : C I P H E   R C H R O   N I C L E
Position : 1 2 3 4 5   1 2 3 4 5   1 2 3 4 5

With the keyed alphabet PILOTABCDEFGHKMNQRSUWXYZ (key PILOT, no duplicates, I/J and U/V merged), the leading C is shifted by 1 in that alphabet, the next I by 2, and so on.

Example

With key PILOT and message CIPHER CHRON ICLE (words of 6, 5, 4 letters), the ciphertext preserves the word lengths. The same letter C occurring in position 1 of a word is not encrypted the same way as a C in position 2 of another word — the structure defeats raw frequency counting.

Strengths and weaknesses

Strengths

  • Frequency analysis fails — within-word position smears the distribution.
  • No period is detectable by Kasiski — shifts follow word structure, not a fixed length.
  • Trivial to apply by hand once the keyed alphabet is built.

Weaknesses

  • Spaces are preserved — word lengths leak structural signal, which enables a probable-word attack. A short text with common words (THE, AND, OF) cracks fast.
  • The first letter of every word always takes the same shift (+1 in the keyed alphabet). On a long text, those first letters form a monoalphabetic sample.
  • The keyed alphabet is the only secret: 24! permutations exist, but most reduce to picking a short keyword.

Variants

  • Extended Ragbaby — uses the full 26-letter alphabet, no I/J or U/V merging.
  • Decreasing position — shifts by (word length − position + 1) to reverse the signature.
  • Block Ragbaby — splits the text into fixed-length blocks instead of words, suppressing the structure signal.

How to attack it by hand

  1. Spot 1- or 2-letter words: A, I, OF, IS, IT, TO. Their first letter is always shifted by 1 in the keyed alphabet.
  2. Align those first letters to reconstruct a fragment of the keyed alphabet.
  3. Complete the alphabet by trying short keywords (4–7 letters).
  4. Confirm against longer words — the 4th or 5th letter of OFTEN, WHICH settles ambiguity.

Texts with more than 50 words usually fall in minutes.

In CipherChronicle

Ragbaby illustrates a powerful idea: text structure itself is an attack channel. It’s a clean exercise to move from raw frequency analysis (which fails here) to structural analysis (which suffices). Ragbaby puzzles on the platform will keep word boundaries and lean on plaintexts rich in short words — rewarding observation, not letter counting.

Grid

D
K
S
L
J
S
E
K
V
T
O
J
M
O
J
Q
R
S
T
U
V
W
X
Y
Z
KeyK = PILOT (keyed alphabet, shift = position within word)
  1. 1

    Ciphertext

    Fifteen letters, kept in their original word groupings — the preserved word lengths are the Ragbaby signature.

  2. 2

    Pattern recognition

    Distribution looks Vigenère-like, but the same plain letter maps to different cipher letters even within one word.

  3. 3

    Hypothesis: PILOT-keyed alphabet, shift = position within word

    PILOT yields a 24-letter alphabet (I/J and U/V merged). The 1st letter of each word is shifted by 1, the 2nd by 2, and so on.

  4. 4

    Reverse shift, position by position

    For each cipher letter, step back in the keyed alphabet by its position within the word.

  5. 5

    Message revealed

    Word structure plus the keyed alphabet rebuild the cleartext.