Pendulum Key Cipher — Encrypt & Decrypt
Single‑file • Client‑side • ASCII A–Z onlyInvented by Thaddeus Mitchell.
Example patterns: 2112
12321
32123. Only digits 1–9 allowed.
Only letters A–Z/a–z are shifted; other characters are left unchanged.
How it works(click to expand)
The Pendulum Key cipher applies a repeating sequence of Caesar shifts across letters, then flips the direction each full cycle. With key 2112
the shifts go +2, +1, +1, +2
then −2, −1, −1, −2
, then repeat. Non‑letters are copied unchanged. Decrypting reverses the sign.
// Pseudocode
for each char c in text:
if isLetter(c):
shift = sign * seq[j]
if decrypt: shift = -shift
out += shiftChar(c, shift)
j = (j+1) % len(seq)
if j == 0: sign = -sign
else:
out += c