Introduction: Spy Tech - Practical Codes

This instructable is intended to demonstrate practical codes that are many times harder to crack than the codes you normal find in newspapers and puzzle books. This is the real deal - codes that have been used by real-life spies during such high risk times as WWII. These are for a variety of situations, from keeping your club house a secret to keeping your formula for rocket fuel safe.

Listed below is a short glossary of terms, should you need it:

Code
A method of concealment in which entire words or phrases are substituted for other words or phrases. Example: dog = hideout. This means that most of what people call "codes" are not really codes, but ciphers (see below). Everything in this instructable is a cipher, except for the book code as noted in step 4. However, since everyone is used to hearing the word "code," I will use it interchangeably with "cipher" throughout this instructable.

Cipher
A method of concealment in which individual letters are substituted or transposed (switched around). Example: Agent = tnega (Agent backwards). Pig Latin is also a cipher.

Mono-alphabetic
A method of encryption in which the letters in the alphabet are replaced directly. This means that everywhere an S appears in your message, it would be substituted with, for instance, M. This is generally a weak type of encryption.

Poly-alphabetic
This means that a letter could have more than one meaning. So every time an S appears in your message, the first time it might get replaced with an E, the next time with a W, then a D, and so on. Every cipher in this instructable is poly-alphabetic.

Key
A key is what is needed to decode a message. It may be a word known only to you and your partner (such as the Playfair cipher in step 2), the settings of rotors for the Enigma machine in step 3, or a title of a book for the book code in step 5

Brute force attack
This is when someone tries to break a code by just trying every single possible combination, one at a time, until they get something that makes sense. The average person can break a mono-alphabetic cipher this way, but anything more complicated will likely need a computer.

Plaintext
Your message before it is encrypted. (readable)

Ciphertext
The message after it is encrypted (unreadable)

Step 1: General Rules

It is important that you select a code that is fitting to the situation. When sending secret messages, those that might try to break your code will fall into one of three categories:

A. General population.
This will be 99.9% of everyone you know. Usual, the most difficult type of message this group
can break is a mono-alphabetic (see intro) cipher. This is why this instructable does not give
any mono-alphabetic ciphers - almost everyone can break them! They are included under the
name Cryptograms in many newspapers next to the crosswords.

B. Geeks.
I have nothing against geeks - I am one. This group is not to be taken lightly. They will
probably know about any type of cipher you are considering, so it is best to make it a difficult
one. They may also have encryption breaking software and be able to use brute force attacks.

C. Government.
If you get on the wrong side of the government, all I can say is good luck. They have seen
every trick, and cracked harder codes than you ever thought of producing. The best policy is
to keep your messages limited to common tasks like keeping the next meeting location
of SSOBACCG (Secret Society Of Boys Against Cootie Covered Girls) a secret.

Here are some general rules to follow that will make any code or cipher more difficult to break:

1. Keep it short.
The longer a message is, the easier it is to break using the frequency
that a letter appears (E is the most common), patterns, and other techniques.
Using abbreviations will also help detour software-based code breaking that
might be checking possible solutions against a dictionary to see if it makes sense.

2. Break coded messages into groups of 4 letters.
This is a technique that has been used by spies for decades. This keeps someone
from guessing a message based on word length (ex: a single letter is either I, a,
and sometimes o) Also, it helps to keep someone decoding the message form
losing their place by having it in manageable chunks. Example: AFRT CGTJ VGTY SFVT.

3. Never send the key with the code.
It might be temping to send the keyword (if you were using the telegraph code, for
example) with the message. However, you should always arrange the keyword ahead
of time or send it in a separate message. If someone has the keyword, it is just a matter
of trying every type of encryption.

4. Change the key often - consider using a one-time pad.
It is important that, if someone does break your code, the knowledge of how to translate it
has a very short life. Change the key as often as practically possible. Every week is good,
certainly not more than every month. A very good idea would be to use a one-time pad of
keys. For example, if you were using the Playfair cipher (Step 3), your one-time pad would
be a list of keywords, and as you sent messages back and forth you would go down the list
using each word only once. Then, the entire sheet would get replaced every so often in
case it was discovered.

5. Use dummy characters.
After you message is encoded, consider throwing in some random characters to make it
harder to crack. The person recipient of message would know to discard, say, the first
and last three characters of the message before decoding.

6. Avoid punctuation.
Punctuation can provide a code breaker with valuable information - for example, sentences
that end with a question mark often start with a W (what, when, where, why).

Step 2: Playfair Cipher

The playfair cipher was used extensively in the Boer war and WWI. To my knowledge, it is one of the easiest poly alphabetic ciphers there is. It does not need any props or long tables to use like some ciphers - just a knowledge of the keyword and a 5x5 grid.

1. To start, pick a keyword that has no repeating letters. This example will use the word "codes."

2. Next, take the plaintext message (the message you want to encode) and split it into pairs of letters. If there is an odd number of letters, add an X to the end. If there are two of the same letter paired up, split them up by inserting an X. This is shown in the example "Tonight is not possible":
Plaintext: TONIGHT IS NOT POSSIBLE
Split into pairs: TO NI GH TI SN OT PO SX SI BL EX

3. Next, draw a 5x5 grid, and fill in the first boxes with your keyword. Then, fill in the rest of the boxes with the rest of the alphabet, putting I and J in the same box (as shown in the photos).

4. Now you are ready to start encoding. The rule to remember is "Right, and Down." Take the first pair of letters and find them on the grid. They will either be:

Not in the same row or column - this means that the letters will form two corners of a square. The code letters will be the other two corners. In other words, for the pair TO, go right from T until you are in O's column. In this case, this means that the code letter for T is Q. Look at the pictures to get a visual on what is happening (photo 1).

They are in the same row - go right one letter. For the pair NI, go right one letter from N to give you I. Go right from I one letter to give you J (see photo 2).

They are in the same column - Go down one letter. For the pair DL, go down one letter from D to get F. Go down one letter from L to get R. This case does not occur in the example "tonight is not possible," however photo 3 shows how it would work.

5. Finished! The final message for "Tonight is not possible" is "QEIJ HAUM EQQC DZCN FKDY"

Decoding
To decode the message, just reverse the process in step 4 above. This means that to decode you will use split the coded message into pairs, follow the rule "Left, and Up", and remove the extra X's when you are finished.

Step 3: Enigma Code

This is it - the most famous code machine ever invented. It took the brightest mind in England plus the world's first computer months to crack it in WWII. It is the most secure cipher in this instructable - no one without specialized computer software will break it, ever. The history of the Enigma machine is amazing! There is a very excellent movie called "Enigma" that shows its role in WWII.

Attached to this step is .zip that contains an Enigma simulator (see screen shot). It has a full tutorial included on how to use it.

NOTE:
I have used this without any problems and scanned it with my antivirus software. However, it is always a good idea to scan anything you download from the internet with whatever antivirus software you have on you computer. If you wish, you can download it from the source by going to http://www.xat.nl/enigma/ or just run a Google search for "enigma simulator."

Step 4: Book Code

This is a very good code - simple, yet extremely difficult to break.

It involves taking each letter in your plaintext message one at a time, and writing down where you found it in a book that both you and your partner have. For example, the series 126-9-23 would mean go to page 126, and find the 23rd letter on the 9th line.

If I were to use Wind in the Willows (http://www.amazon.com/Wind-Willows-Signet-Classics/dp/0451530144/ref=sr_1_3?ie=UTF8&s=books&qid=1246749658&sr=8-3) to encode the message "Yes," it would look like this: 5-7-5, 5-8-29, 5-4-6. If I wanted to group my message into sets of 4 (see step 1), then my I could assign three numbers for the page, two for the line, and two for the letter# on that line making it 005-07-05, 005-08-29, 005-04-06, which then becomes 0050 7050 0508 2900 5040 6000.

There are two drawbacks to this cipher. First, it takes a long message to hide a short one. Second, you and your partner must have exactly the same book. This means that not only do you both have Wind in the Willows, but you both have the Signet Classics 2006 paperback version. A good way to ensure this is to use ISBN numbers (the numbers above the bar code on the back of the book) when specifying which book you will use.

A neat way to work this is to use the same library as your partner. You go in one week, check out a book, encode your message and send it to him, then return the book. Next week, he goes to the library to check out the same book.

Step 5: Steganography

This is a big fancy word that means "Hiding a secret message within a larger one in such a way that others can not discern the presence or contents of the hidden message." (www.dictionary.com)

This it not technically a cipher, but I am including it in this instructable because sometimes it is not enough to say "I saw Bobby throwing water balloons out the window at Sally" - sometimes you need to send the picture showing it!

Attached is an application that takes a file (such as a photo, word document, etc.) and hides it in a photo by changing certain pixles in the photo. The photo of Wallace & Gromit shown has the picture of the Instructables robot hidden in it, but you can not tell that there is anything different about it.

There is a size limitation - you can only hid a file that is about 40% the size of the photo you are hiding it in.

NOTE:
I have used this without any problems and scanned it with my anti-virus software. However, it is always a good idea to scan anything you download from the internet with whatever antivirus software you have on you computer. If you wish, you can download it from the source by going to http://stegoshare.sourceforge.net/index.html or just run a Google search for "Steganography".

Step 6: Further Resorces

The following are some very good resources it you want to dig deeper into secret messages:

Instructables:

https://www.instructables.com/id/Encode-data-in-2D-on-your-T-shirts-business-cards/ - Nice bar-code based encryption that only those with a scanner can read.

https://www.instructables.com/id/Secret-Sour-Sayings/ - secret writing w/lemon juice

https://www.instructables.com/id/Make-your-own-secret-code/ - Mono-alphabetic codes

Books:

Codes, Ciphers, and other cryptic abd clandestine communication by Fred B. Wrixon

Secret Messages (Usborne Spy Guides) by Travis Falcon and Judy Handley

Websites:

http://www.xat.nl/enigma/ - Enigma simulator

http://stegoshare.sourceforge.net/index.html - Steganography

http://home.comcast.net/~ebm.md/stego/softwarewindows.html - Steganography

Comments

author
bowmaster made it!(author)2010-01-25

"2. Break coded messages into groups of 4 letters.
Example: AFRT CGTJ VGTY SFVT."

I took this to the next level. Instead of making every group four letters, add fake word lengths and punctuation.
Example: A FRTC GTJ VG TYSFVT!!

author
PaulW347 made it!(author)2017-03-15

A FRTC GTJVG TYSFVT!! Donald Trump will be elected in 2016!! WOW I solved it.

author
GeekBeam made it!(author)2010-02-10

makes it even harder but i have an idea that wrkos lkie so you put the frist lteter, and the lsat letetr in teihr aissgned palces tehn put the ohter lteters jmubeld up in a rnadom odrer if you can't read this then it probly means you have dyslexia

author
GeekBeam made it!(author)2010-02-10

hee hee hee

author
venom1539 made it!(author)2010-10-09

orry-say ut-bay i-ay ead-ray it-ay

Lets see ou-yay read that

author
Johnny+cage+836 made it!(author)2016-09-14

its pig Latin it says "sorry but i read it

author
bowmaster made it!(author)2010-10-09

I did, it was easy.

author
venom1539 made it!(author)2010-10-10

thats the one problem with piglatin. (anybody can read it)

author
bowmaster made it!(author)2010-10-11

Some people can't translate it fast enough when it's spoken.

author
venom1539 made it!(author)2011-05-12

me and my friends used to speak in it no problem.

author
bowmaster made it!(author)2011-05-13

Then you aren't some people, you are most people.

author
resophonicguitarist made it!(author)2011-01-18

I read that no problem.

author
M4industries made it!(author)2010-11-24

I wonder how long it took you to type that.

author
GeekBeam made it!(author)2010-11-24

about 3 minutes, i had to think of how i could jumble the letters, and to make sure that i had the right ones in the word

author
shogunskot made it!(author)2014-11-14

How about using "text speak" for the message? Honestly I probably couldn't read the typical 15-year-olds text message anyway!

HRU? Yo hu u b wit 2nit? Ur gr8 bf or ur bro? RUOK?

author
KwartzKitten made it!(author)2014-10-20

I can't help but feel that using a phonetic code would make cracking a cipher far more difficult.

author
account3r2 made it!(author)2010-06-09

When I made a code on ms word, i made sure to wipe out the file for good when i was done!

author
Hades+di+Angelo made it!(author)2010-01-23

Can you make this easier?

author
SniperofGod made it!(author)2009-08-14

is it on gromit's left ear? or is that just a yellowish speck?

author
AZsid made it!(author)2010-01-15

Nah, it doesn't work like that. It doesn't effect one specific part, it's embedded in the entire file.

I've seen the "yellow speck" method on things like Zest puzzles and in Lost TV show hints (Blue eyed girl has brown eyes and you zoom in on her eyes to find a secret message) and it's really cool but this is a little different kind of cool.

In this case it wouldn't be noticeable to the eye. If it was (because the message was to big) the entire image (not just a speck) would degrade a little.

author
SniperofGod made it!(author)2010-01-15

Oh, allright. Thank you very much. This is definitely an interesting code. So, assuming that you are trying to send this message to someone (say the instructable robot), and you want them to figure it out, but obviously no-one else, how does that person decrypt it?

author
rfmonaco made it!(author)2009-09-25

Error in encoding per two sites:
http://www.purplehell.com/cgi-bin/riddles/playfair.pl
http://www.braingle.com/brainteasers/codes/playfair.php
Should be .. qe ik ha pm hu eq qc dz cn fk dy

author
Kaiven made it!(author)2009-09-21

ooohhh... I get it! Very cool! I can't believe this doesn't have more views.

author
148wmcquiston made it!(author)2009-09-21

What about RSA?

author
maeve made it!(author)2009-07-29

There is another really good book by Herbie Brennan called code breaker, I think. It gives loads of examples of different codes, like yours. It also gave ways of cracking almost every code imaginable. I think your instructable is really good, it shows you know A LOt about differnent codes and ciphers, and secret ways to hide messages. I think the most ingenious method ever used was back millenia ago: On a man/woman's shaven head, they would tatoo a message. Once the hair grew back, they would send the messanger to the reciever. The messanger would pass under enemy radar. Once they reached their destination, their head was again shaved to reveal the message. Cool eh? By the way, do you know why morse code is called a code? It's a cipher, isn't it?

author
bdblock94 made it!(author)2009-07-22

I tried decoding your playfair cipher but I think you have some errors in it

author
Isshinryu made it!(author)2009-07-24

Thank you for your comment - I just tried to decipher it, and it seemed to be working. May I ask at what part the deciphered message stopped making sense? Perhaps I need to buff up the section on decoding.

About This Instructable

34,514views

146favorites

License:

More by Isshinryu:Child Resistant Gun NightstandUltimate Paracord Bracelet Survival KitShooting Range Table
Add instructable to: