The Solitaire Cipher, also called the Pontifex Cipher, is a manual encryption system created by Bruce Schneier to allow secure message encryption using a deck of playing cards. Each card represents a number, and the deck is manipulated in a series of steps (joker moves, triple cuts, and count cuts) to generate a pseudorandom keystream. Letters of the plaintext are then converted to numbers (A=1, B=2, …, Z=26) and combined with the keystream numbers modulo 26 to produce ciphertext.

The security of the cipher relies entirely on the initial deck order, which acts as the key. If the keystream is known, encryption and decryption become straightforward.

Solitaire Cipher: Encoding

Suppose the plaintext message is "HELLO WORLD". Using a pre-generated keystream of 32 numbers from the deck:

Plaintext:  HELLO WORLD
Convert letters to numbers:  H=8, E=5, L=12, L=12, O=15, W=23, O=15, R=18, L=12, D=4

Keystream numbers (first 10 shown for example): 
3,15,8,4,11,19,27,30,54,24, ...

Add plaintext numbers + keystream modulo 26 (wrap 26→0→A):
H+3  → 8+3=11 → K
E+15 → 5+15=20 → T
L+8  → 12+8=20 → T
L+4  → 12+4=16 → P
O+11 → 15+11=26 → Z
(space preserved)
W+19 → 23+19=42 → 42 mod 26 = 16 → P
O+27 → 15+27=42 → 42 mod 26 = 16 → P
R+30 → 18+30=48 → 48 mod 26 = 22 → V
L+54 → 12+54=66 → 66 mod 26 = 14 → N
D+24 → 4+24=28 → 28 mod 26 = 2 → B

Ciphertext: MXAPJ AGJVD

Each plaintext letter is encoded using its corresponding keystream number, modulo 26. Spaces are preserved between words, but do not consume keystream values.

Solitaire Cipher: Decoding

To decode, the recipient uses the same deck to reproduce the identical keystream. Subtract each keystream number from the ciphertext number modulo 26:

Ciphertext: MXAPJ AGJVD
Convert letters to numbers: M=13, X=24, A=1, P=16, J=10, A=1, G=7, J=10, V=22, D=4

Keystream numbers:
3,15,8,4,11,19,27,30,54,24, ...

Subtract keystream modulo 26:
M-3 → 13-3=10 → J
X-15 → 24-15=9 → I
A-8 → 1-8=-7 → 19 → S
P-4 → 16-4=12 → L
J-11 → 10-11=-1 → 25 → Y
(space preserved)
A-19 → 1-19=-18 → 8 → H
G-27 → 7-27=-20 → 6 → F
J-30 → 10-30=-20 → 6 → F
V-54 → 22-54=-32 → 20 → T
D-24 → 4-24=-20 → 6 → F

Plaintext: HELLO WORLD

Solitaire Cipher: Notes

The Solitaire Cipher provides a secure, manual method of encryption without computers. Its strength depends on generating a truly pseudorandom keystream via deck manipulation. Each number in the keystream is used exactly once per letter, and spaces in plaintext are preserved but do not consume keystream values. Correct execution ensures strong cryptographic security comparable to a one-time pad.

Solitaire Cipher

T