The Kangaroo Cipher is a simple substitution cipher that uses a keyword to generate a variable shift pattern across the plaintext. It is similar in concept to the Caesar Cipher but instead of a single uniform shift, each letter is shifted according to the corresponding letter in the keyword, which repeats across the message.

The cipher operates by converting each letter of the keyword into a numerical shift (A=0, B=1, …, Z=25). Each plaintext letter is then shifted by the numeric value of the corresponding keyword letter. Non-alphabetic characters are typically left unchanged.

Kangaroo Cipher: Encoding

Using the keyword KEY to encode “HELLO”, the process works as follows:

Plaintext:  H  E  L  L  O
Keyword:    K  E  Y  K  E  (keyword repeated)
Numeric:    K=10, E=4, Y=24, K=10, E=4
Shift:      (H+K) mod 26 = (7+10)=17 → R
            (E+E) mod 26 = (4+4)=8  → I
            (L+Y) mod 26 = (11+24)=35 → 35 mod 26 = 9 → J
            (L+K) mod 26 = (11+10)=21 → V
            (O+E) mod 26 = (14+4)=18 → S

Ciphertext: R I J V S

Each letter in the plaintext is “jumped” forward in the alphabet by the numeric value of the matching keyword letter, creating a non-uniform, keyword-based shift pattern.

Kangaroo Cipher: Decoding

Decoding reverses the process by subtracting the keyword shift from each ciphertext letter:

Ciphertext: R  I  J  V  S
Keyword:    K  E  Y  K  E
Shift:      (R-K)=17-10=7 → H
            (I-E)=8-4=4   → E
            (J-Y)=9-24=-15 → +26 = 11 → L
            (V-K)=21-10=11 → L
            (S-E)=18-4=14 → O

Plaintext:  H  E  L  L  O

Kangaroo Cipher: Notes

The Kangaroo Cipher strengthens the basic Caesar approach by introducing keyword-driven variation. The repeating keyword sequence prevents simple uniform shift attacks and introduces more complex patterns, though it remains vulnerable to frequency analysis if the keyword is short. It demonstrates an early approach to polyalphabetic substitution similar in philosophy to the Autokey Cipher.

Kangaroo Cipher