Search for a tool
Solitaire Cipher (Schneier)

Tool to decrypt / encrypt with Solitaire by Schneier. Solitaire is a cryptographic cipher using a deck of cards, invented by Bruce Schneier in the roman Cryptonomicon.

Results

Solitaire Cipher (Schneier) -

Tag(s) : Poly-Alphabetic Cipher

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Solitaire Cipher (Schneier)' tool for free! Thank you!

Solitaire Cipher (Schneier)

Solitaire Decoder (by B.Schneier)

 






Solitaire Encoder (by B.Schneier)

 






Deck generator





Keystream generator




Letters conversion A=1,Z=26

Answers to Questions (FAQ)

What is Bruce Schneier's Solitaire? (Definition)

Bruce Schneier's Solitaire encryption is a poly-alphabetic cipher whose encryption key is generated with a deck of cards.

How to encrypt using Solitaire cipher?

To encode a message with Solitaire, the deck of cards is used to generate a sequence of numbers that will be used as a key to produce an encrypted message.

Example: Encrypt the message CRYPTONOMICON with the unmixed card game 1,2,3,4…,52,A,B

Step 1: Associate with each character of the message a number like A=1,B=2,…Z=26 (code A1Z26)

Example: C has the value 3, R becomes 18, Y becomes 25, etc.

Step 2: Generate a code (keystream) by mixing the card game according to the solitaire algorithm (see below)

Example: The first code obtained is 4 (then 49, then 10, etc.)

Step 3: Add two by two the numbers of steps 1 and 2. If the total obtained is greater than $ 26 $, subtract $ 26 $.

Example: $ 3+4=7 $, then $ 18+49=67 $, as $ 67 > 26 $ calculate $ 67-26=41 $ and again $ 41-26=15 $ etc.

Step 4: Replace each number by the letter corresponding to it (inverse operation of step 1), 1=A,2=B,…26=Z. The letters obtained correspond to the encrypted message.

Example:

Plain textCRYPTONOMICON
Coded letters31825162015141513931514
Card Keystream4491024851446433203919
Calculation Step 371591421462117162327
Cipher textGOINBNFUQPWBG

How to decrypt Solitaire cipher?

Decryption requires knowing the exact order of the deck of cards used for encryption.

Decryption is the same as encryption, except for step 3 where you do not add but subtract from each number the one generated by the deck of cards. If the number is less than $ 1 $, add $ 26 $.

Example: Decrypt VQMLVBLTF with generated codes (dummies) 3,2,1,3,2,1,…:

Cipher textVQMLVBLTF
Coded letters2217131222212206
Card keystream321321321
Inverse Step 319151292019185
Plain textSOLITAIRE

How to code a card deck?

Bruce Schneier describes an unmixed card deck with the following numbers:

(Clover) Ace,2,3,…,10,J,Q,K equal to 1,2,3,…10,11,12,13

(Diameter) Ace,2,3,…,10,J,Q,K being 14,15,16,…23,24,25,26

(Heart) Ace,2,3,…,10,J,Q,K being 27,28,29,…36,37,38,39

(Spades) Ace,2,3,…,10,J,Q,K being 40,41,42,…49,50,51,52

Joker A, Joker B worth respectively A or 53, B or 53 (yes, not 54)

Clover > Diamond > Heart > Club is the order of the game used in the rules of the Bridge game

How to generate codes by shuffling the cards? (Solitaire Algorithm)

The generation of codes is the most complicated part of the Solitaire code, it involves a precise mixture.

Example: 2,6,A,3,4,5,1,7,8,…,B,9 is a set of 54 cards (with separate wildcards A and B) in this modified starting position

Step 1: Move the joker A by 1 card below in the stack (which is to exchange the joker A with the card immediately below). If this is not possible, ie. if the joker A is at the bottom of the stack (so it does not have a card underneath), then move it on top of the stack and apply step 1 (so it will become the second card of the deck)

Example: 2,6,3,A,4,5,1,7,8…,B,9

Step 2: Move the B joker by 2 cards underneath into the stack. Again if it is not possible, if the joker B is at the bottom of the pile, then move to position 3 (it will have 2 cards above) or if the joker B is in penultimate position, then move it to position 2 (1 card above it). This comes down to considering that the card game is a loop on itself.

Example: 2,B,6,3,A,4,5,1,7,8,…,9

Step 3: Make a triple cut at the level of the jokers (the jokers and all the cards between them do not move but the groups of cards before and after exchange, even if a group is empty)

Example: 1,7,8,…9,B,6,3,A,4,5,2

Step 4: Cut after the Nth card where N is the number corresponding to the card at the bottom of the stack, leaving this last card in its place. If the last card is a joker, do not change anything at this stage.

Example: 1,7,8,…9,B,6,3,A,4,5,2

Step 5: Note the number X of the card in the N+1 position where N is the number corresponding to the top card of the stack (which is in position 1). X is the generated code (the deck is not mixed at this stage).

Example: 1,7,8,…9,B,6,3,A,4,5,2 The first code is 7

Repeat steps 1-5 to obtain the following code of the keystream.

How to recognize a Solitaire ciphertext?

A message encoded by Solitaire has a coincidence index close to random.

All references to card games, bridge, the Solitaire game, or Freecell or the Cryptonomicon book and its author Bruce Schneier are clues.

The word pontifex is used as a code name in the novel.

What are the variants of the Solitaire cipher?

The card game could be encoded in numbers in any other way provided that the sender and receiver agree on the method.

The original position of the card game is better if it is perfectly random, but it is possible to generate one from a keyword. Bruce Schneier describes a keyword-based method for mixing the deck by encoding it as in step 1 of the encryption. Then, it recommends practicing a shuffle of the cards identical to the solitaire algorithm but by replacing step 5 by a new step 4 where the cut is in position M with M a keyword letter code. Repeat all steps as well for each letter.

Optionally, the last 2 letters of the keyword (their codes $ c1 $ and $ c2 $) can be used to move the jokers respectively after the card in position $ c1 $ for the joker A and after the card in position $ c2 $ for the joker B.

When was Solitaire invented?

Neal Stephenson describes the Solitaire algorithm in Cryptonomicon here (affiliate link) a science fiction novel published in 1999. The algorithm was created by Bruce Schneier, cryptography consultant for this book.

Source code

dCode retains ownership of the "Solitaire Cipher (Schneier)" source code. Except explicit open source licence (indicated Creative Commons / free), the "Solitaire Cipher (Schneier)" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Solitaire Cipher (Schneier)" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Solitaire Cipher (Schneier)" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.

Cite dCode

The copy-paste of the page "Solitaire Cipher (Schneier)" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Solitaire Cipher (Schneier) on dCode.fr [online website], retrieved on 2024-11-21, https://www.dcode.fr/solitaire-cipher-schneier

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Solitaire Cipher (Schneier)' tool for free! Thank you!


https://www.dcode.fr/solitaire-cipher-schneier
© 2024 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
 
Feedback