3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

The Solitaire cipher - Superstruct Instructables series

Step 5Generating keystream values

Generating keystream values
«
  • jokers_A_B.JPG
  • joker_A_move.JPG
  • joker_B_move.JPG
  • triple_cut_1.JPG
  • triple_cut_2.JPG
  • triple_cut_3.JPG
  • count_cut_1.JPG
  • count_cut_2.JPG
  • count_cut_3.JPG
  • last photo ←
»
Generating keystream values is the heart of Solitaire, which means this is where we're going to have to pay extra attention to every little step. It might take some time for you to understand completely, so in case you're confused at some point just go up one step, or back to the start if you really have to. The reason for that ? If you make a mistake, chances are you'll have to start all over again from the beginning. With that in mind, are you ready ?

Before fiddling with your deck, let's clarify a few points first - namely, let's explain what these keystream numbers are and what they're going to be used for. Simply put, a keystream is a series of randomly-generated values. Each one of these values is added with one value from the cleartext, the sum of which gives you a third value that is used to generate - you guessed it - ciphertext ! Here's how Solitaire generates these keystream values in just a few steps. If you mess up at some point, just use the backup deck to restore your original keystream-generating deck, and start all over again.

Step 1 : Take the keystream-generating deck face up, and find Joker A and B. In a deck of cards, the two Jokers are usually differentiated one way or another : for example, the Jokers in my deck sport either a red or a black star, and I decided that Joker A would be the Joker with the red star and Joker B the Joker with a black star.

Step 2 : Take Joker A and bring it one card down, then take Joker B and take it two cards down.

Step 3 : We're now going to perform a triple cut. Basically we're going to swap the cards above the first Joker from the top of the deck with the cards under the second Joker from the top of the deck.

Notice I *did* say the first and second Joker from the top, NOT Joker A and B ! Only the cards above and below the Jokers move, not the Jokers themselves. Also, if it turned out that there would be no cards in one of the 3 sections, pretend this is an "invisible" set of cards and swap it nonetheless.

Step 4 : Now is time for a count cut. First, let's check the card at the bottom of the deck - here we have a 10 of Diamonds : we're going to convert it into a number between 1 and 53 using the chart below.*

Clubs are the value of the card + 0 ;
Diamonds are the value of the card + 13 ;
Hearts are the value of the card + 26 ;
Spades are the value of the card + 39.

So we're going to count from the top of the deck all the way down to the 23rd card designated by the value we just figured out. Take all these cards and insert them above the last card of the deck. Make sure that last card stays there - there's a reason for that ! We're almost done !

*Since a Joker is worth 53, a deck with a Joker as the bottom card is left unchanged by Step 4.

Step 5 : It's time to find the first card with which we'll generate a keystream value ! Look at the first card on top of the deck, and convert its value much like you did in Step 4. In our case, we're going to count down to the 33rd card designated by the 7 of Hearts on top of the deck, and write down the card right after (I got a 7 of Spades) on paper. Don't remove that card from the deck ! If the card you hit is a Joker, start over again from Step 1.

Step 6 : Finally, we're going to generate that first keystream value by converting the card's suit and value to a number between 1and 26. Remember the value table we used earlier ? We're going to do something similar here. Let's suppose A of Clubs to King of Clubs will be 1 to 13, A of Diamonds to King of Diamonds will be 14 to 26, A of Hearts to King of Hearts will be 1 to 13 again, and A of Spades to King of Spades will be 14 to 26 again - convert the card you got accordingly, and voila - you have your first keystream value ! All you have to do now is generate as many of these values as there are characters in your message. Of course, don't reset your deck until after you're done generating values.

Once you have the amount of keystream values you need, let's move on to the final step that'll turn your cleartext into ciphertext for good !
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
16
Followers
15
Author:Deslivres(Thomas Maillioux)
I'm a French librarian trying to learn something every day - and when I learn something really neat, I love to share it with people around me :)