The Single-Use Cipher

27 12 2009

No ship is too big to sink, as the passengers of the Titanic discovered.  No freedom is so well founded as to be impervious to corruption.  Every government and every establishment throughout history is and has been doomed to eventual collapse.  Freedom as we know it in a representative government will last only until someone strong enough manages to consolidate the power for himself.  When that happens, we will find ourselves back under the rule of a dictator.  Like Russia, it may still be paraded as a representative government, but it will, in truth, be governed by a select few, if not a singular individual.  This is the end that cannot be avoided.  Lament it later.  We don’t have time.  For all we know, we may already be there.  Our aim, then, should be to prepare ourselves for that eventuality.  We hope that it will not happen in our lifetime, but we fear that it might.

A key objective for us will be the development of a method for transmitting information secretly.  The strongest of encryption methods involve the use of computers and special software.  In the event of a complete social meltdown or an iron-fisted shutdown of the Internet, we must be prepared for the possibility that computers will not be available to all of us.  Further, we might find strength in an encryption technique that does not require special equipment, especially software, so that we might reach as many people as we require and under as many varied circumstances as we might encounter.

Probably the most widely-used and weakest of encryption techniques is the simple letter-substitution method.  You may have seen one in your local newspaper.  It’s so bad that a person of modest intelligence can solve it without a key.  Take the following example:

SRIRW JHR D HZUETR TRKKRW HJGHKZKJKZLS JSTRHH OLJ NDSK KL FRK BDJFVK

Translates to:

Never use a simple letter substitution unless you want to get caught.

Even if the spaces are removed, letter patterns and relative occurrence of letters is enough to allow the wrong person to decrypt it.  In the example above, the key was as follows:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Q C F A P G B S V U T O D W Y J K E N L M H R Z X I

Despite the weakness of the simple letter substitution method, one of the best codes is a modification of this idea, called the single-use cipher.  It’s the same as a letter substitution, except that the key changes with every letter.  The letter A could represent the letter T one time and represent the letter X the next time.  Doing this requires a lot of keys, being that we need a new one for each letter.  If we wrote a key like the one above for each letter in the message, then the key would be a lot longer than the actual message.  It would hardly be worth the trouble.  To simplify things, the key is always a simple shifting of the alphabet, like the following:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
K L M N O P Q R S T U V W X Y Z A B C D E F G H I J

In this example, the letter A is shifted over sixteen spaces.  So is every other letter.  If we were to use this key for the above message, then the letter N would be written as the letter D.  We try to think backward when writing it so that the receiver doesn’t have to.  Hence, we encrypt it from the bottom set to the top set, and they decrypt it from the top set to the bottom set.  They see the D, and they translate it to an N.  Like I said, though, the key changes with every letter to prevent anyone from detecting a pattern.  It’s always a simple shift of the alphabet, as above.

In order to not have to write an entire alphabet twice for each and every letter of the message, we can simplify the key to a single letter.  All we need to do to write the key is to simply answer the question, “What does A equal?”  If we know what A equals, then we know what all of the other letters equal, because they’re all shifted over the same number of spaces.  In this case, A equals K.  The letter K can then represent the entire key.  The following is the B key:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B C D E F G H I J K L M N O P Q R S T U V W X Y Z A

In this case, A = B.  Therefore, the letter D represents the second letter in our message, the letter E of the word, “Never.”  For every letter of our message, we have one letter that needs to be translated, and we have one letter that tells us which key we use to translate it.  We could generate a random series of letters to represent our random selection of keys:

KBDIEURYASUEJDKQPELXMRUHYXRWHICKMENWLOPQUAYHENRICOVIRUMPU

Each letter tells us what A equals for that key.  Each key is used only once, to decipher only one letter of the message.  Also, we always remove spaces and punctuation.  Using the series of keys, above, the message now translates to the following:

DDSWN ABG A AOIGIU VPPIHF BAUUWRXNLGEB QAPTED IUU YTJG CG EQY UJAUSZ

In a real situation, we would have removed the spaces, but they were used here for the sake of explanation.  In order to easily translate the message, a good practice is to type the alphabet twice in courier font, so that it all fits on one line.  Then, copy that line to the next line.  Print it out and cut the paper between the lines so that they can be shifted relative to each other.  Circle the middle letter A of the top line so you can find it easily.  Using the key, above, you would align the letter A with K for the first letter of the message.  Then align it with B for the next letter of the message.  Then align it with D, and so on.  Cross off each letter of the key as you use it, and never recycle it.  Each time you shift the alphabet, you translate a letter of the message.

Originally, when this method was devised, the single-use keys were printed as booklets of randomly generated letters.  Each booklet would only have two copies.  You would keep one and send the other to the recipient.  Each letter would be used once to translate a letter in a message, and it would never be used again.  The next message, probably the reply, would start where the other left off, until eventually the whole booklet was used up and a new one had to be sent.  It was virtually unbreakable, unless someone intercepted the book along the way and made copies.

Then someone got the bright idea of using common literature as a key.  That way, no special book was required to decipher the message.  The only thing that needed to be delivered was the encrypted message, itself.  If the other party knew which classic you were going to use, then they could find it in their local library, so long as you chose a work that was common, or that you knew they already had.  Better yet, you could tell them with one encrypted message what the key for the next encrypted message would be.  Once you finished using The Grapes Of Wrath to encrypt your messages, you could mention in the last message that you were switching to A Tale Of Two Cities.  After a long correspondence, there would be no way for anyone to know what you were using to encrypt your messages, because you will have only mentioned it in another encrypted message.  Only the first book would be mentioned, and you might even do that through a subtle hint.  Be careful to avoid using abridged versions or books translated from other languages, because they tend not to be the same from one publication to the next.  Let’s take A Tale Of Two Cities as our key:

It was the best of times, it was the worst of times, it was the age of wisdo….

In this case, A equals I, then T, then W, and so on.  If A equals I, then N equals F.  If A equals T, then E equals L.  If A equals W, then V equals Z, and so on.

FLZEZ BLA Z OQTBGL DSPBWY WUJZMEXGCQVZ PUDSOA QVY WIUM PO AAF XEMOEF

Again, we leave the spaces in place for now.  Normally we would remove them.  So, there you have it.  Take the message, “Never use a simple letter substitution unless you want to get caught,” and cross it with the line from Dickens’ book, “It was the best of times, it was the worst of times, it was the age of wisdo…” and what you have left is a code that would be hard to break.  The other person’s reply would start where you left off, at “…m, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair….” Then, even if the enemy knew what book you were using to decode with, they probably would have trouble finding the right part of the book to use.

Now, the only problem is getting the message to the other person.  Unfortunately, the message still looks like a secret message.  It would be up to the sender to be creative and find a way to hide the fact that it’s a coded message.  For example, it could be hidden in a web page.  To find it, you select from the menu bar View/Source, which will give you a long list of HTML.  Look for the message to be contained between “<!–“ and “–>”.  If the enemy knows that you have a web site, then they might find the code there, but they would neither be able to decode it, nor would they know whom you were talking to.  Anyone could access the page, and there’s no knowing which of them was the recipient and which was someone just visiting the site for what it appeared to be.  Moreover, unless they already suspected you, they would not be likely to find you by accident this way.  As an added plus, you could send the same message to several parties at once, and you would not have to jeopardize them by knowing dangerous information about who or where they are, in the event that you are captured and forced to leak their whereabouts.  Otherwise, one might consider the use of watermarks or invisible ink.

One might also consider a reverse-order cipher, whereby the two alphabets run in opposite directions to one another, as such:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A

The advantage to this is that it works in both directions.  You can’t get confused as to whether you’re translating from the top to the bottom line, or the other way around, because it’s the same both ways.  The disadvantage is that it only provides half as much encryption strength.  I prefer the previous method, though, in all honesty, I hope we never need to use this.


Advertisements

Actions

Information




%d bloggers like this: