Codes are a way of altering a message so the original meaning is hidden. Generally, this requires a code book or word. Ciphers are processes that are applied to a message to hide or encipher information. These process are reversed to translate or decipher the message.[1] Codes and ciphers form an important part of the science of secure communication (cryptanalysis).[2]

Method 1
Method 1 of 5:

Using Simple Ciphers and Codes (Kids)

  1. 1
    Write out words in reverse. This is a simple way of encoding messages so they can't be understood at a glance. A message like "Meet me outside" written in reverse would instead be "Teem em edistuo."

    Note: Though this code can be easily solved, but it can be useful if you think someone is trying to peek at your message.[3]

  2. 2
    Reflect the alphabet in half to encipher messages. Write out the letters A through M in a single line on a piece of paper. Directly beneath this line, write out the letters N through Z also in a single line. Change each letter of messages to the opposite letter of the two lines of letters you have written out.
    • By using a reflected alphabet, the message "Hello" would instead become "Uryyb."[4]
    Advertisement
  3. 3
    Try pigpen cipher. Draw a tic tac toe grid on a piece of paper. Write out the letters A through I in the grid going from the left to right, top to bottom. In this example:
    • The first row is made up of the letters A, B, C.
    • The second is made up of D, E, F.
    • The last row is made up of G, H, I.[5]
  4. 4
    Create a second tic tac toe grid with dots. Draw another tic tac toe grid beside the first one. Fill the grid in with the letters J through R, similarly to the first grid. Then mark dots in each space of the grid of each row as described:
    • In the first row, starting on the left, place a dot in the lower right corner (letter I), on the bottom middle side (letter K), and in lower left corner (letter L).
    • In the second row, starting on the left, place a dot on the middle right side (letter M), on the bottom middle side (letter N), and on the middle left side (letter O).
    • In the second row, starting on the left, place a dot in the upper right corner (letter P), on the top middle side (letter Q), and in the upper left corner (letter R).[6]
  5. 5
    Write out two X shapes beneath each grid. These two X shapes will also be filled with letters to complete your pigpen cipher key. In the second X, place dots in the open spaces surrounding where the X crosses so there is a dot on each side of the center of the X. Then:
    • In the first (undotted) X shape, write S in the top of the X, T on the left side, U on the right, and V on the bottom.
    • In the second X shape, write W in the top of the X, X on the left side, Y on the right, and Z on the bottom.[7]
  6. 6
    Use the grid surrounding the letters to write in pigpen cipher. The grid shapes (including dots) surrounding letters are used as substitutes for the letters themselves. Use your pigpen cipher key to translate messages into and out of pigpen.[8]
  7. 7
    Use a date shift cipher. Choose a date. This might be something with personal significance, like a birthday or the day you graduated college, but it could be something impersonal, like the birthday of George Washington. Write out the date as an unbroken string of numbers. This is the number key.
    • For example, if you were to use George Washington's birthday (2/22/1732), you would write it as 2221732.
    • If you've already agreed to use a date shift cipher with someone, you can accompany enciphered messages with a clue (like “Washington”) for the number key.[9]
  8. 8
    Encipher your message with the date shift number key. Write out your message on a piece of paper. Underneath the message, write out a single digit of the number key for each letter of your message. When you reach the last digit of the number key, repeat the key from the beginning. For example, using George Washington's birthday (2/22/1732):
    • Message: I'm hungry
    • Enciphering:
      I.m.h.u.n.g.r.y
      2.2.2.1.7.3.2.2
      Shift letters according to the number key, as in…
    • Coded message: K.O.J.V.U.J.T.A[10]
  9. 9
    Use a secret language, like Pig Latin. In Pig Latin, words that start with a consonant sound switch that sound to the end of the word and add “ay.” This holds true for words start with a cluster of consonants. Words that start with vowels just get “way” or “ay” added to the end of the word.
    • Consonant initial examples: pig = igpay ; me = emay ; too = ootay ; wet = etway ; hello = ellohay
    • Consonant cluster initial examples: glove = oveglay ; shirt = irtshay ; cheers = eerschay
    • Vowel initial examples: explain = explainway ; egg = eggway ; ends = endsay ; eat = eatay[11]
  10. Advertisement
Method 2
Method 2 of 5:

Unlocking Codes

  1. 1
    Recognize the limitations of codes. Code books can be stolen, lost, or destroyed. Modern cryptanalytic techniques and computer analysis can oftentimes break even strong codes. Even so, codes can condense long messages into a single signal word, making them great time savers.[12]
    • Codes serve as good pattern identification practice. This skill can be put to use when encoding, decoding, enciphering, or deciphering messages.
    • Codes are naturally used between close friends. Inside jokes could be thought of as a kind of "code." Try developing your code language with your best friends.
  2. 2
    Determine the goal of your code. Knowing the purpose of your code will prevent unnecessary work. If your goal is to save time, you might only need a few specific code words. If you're trying to encode detailed messages, you may need to develop a code book that is more like a dictionary.
    • Select common phrases that occur in the messages you want to encode. These are prime targets to be condensed in a code word.
    • Codes can be further complicated by using several different codes in rotation or combination. However, the more codes used, the more code books necessary for decoding.[13]
  3. 3
    Develop your code book. Condense common phrases, like "Reading you loud and clear," to something like "Roy." For every conceivable word in your encoded messages and common phrases as well, designate alternative code words.
    • Sometimes, partial code can obscure a message sufficiently. For example, if "walk" means "tango" and "museum" means "restaurant" and the previously used code word "Roy" holds its value,
      • Message: About yesterday. I wanted to say, Roy. I'll tango to the restaurant as planned. Over and out.
      • Meaning: About yesterday. I wanted to say, reading you loud and clear. I'll walk to the museum as planned. Over and out.[14]
  4. 4
    Apply your code book to messages. Use the code words in your code book to encode messages. You may find that you can save yourself time by leaving nouns (like names and pronouns like I, me, she) as plain text. However, this decision depends purely on your situation.
    • Two-part codes apply two different code books to encode or decode a message. These are much stronger than one-part codes.
  5. 5
    Use a key to encode your message, alternately. A key message, group of words, letters, symbols, or a combination of these can be used to encode information.[15] The recipient of your message will also need this key phrase or key of letters/symbols to decode the message.[16]
    • For example, with the key word "SECRET," each letter of your message would convert to the number of letters between it and the corresponding letter of the key word. As in,
      • Message: Hello
      • Encoding:
        /H/ is 11 letters away from the key /S/
        /e/ is the same (zero) as the key /E/
        /l/ is 9 letters away from the key /C/
        And so on...
      • Coded Message: 11; 0 ; 9 ; 6 ; 10
  6. 6
    Decode messages. As you receive coded messages, you'll have to make use of your code book or key word/phrase to make sense of them. This may be difficult at first, but will become more intuitive as you become more familiar with the code.[17]

    Tip: To strengthen your encoding ability, you may want to invite your friends to join an amateur code making group. Pass messages to improve your skills.

  7. Advertisement
Method 3
Method 3 of 5:

Learning Common Codes

  1. 1
    Employ the code used by Mary, Queen of Scots. While trying to send messages during a time of political turmoil, Mary, Queen of Scots, used symbols as a substitute code for English letters and common words.[18] Some features of Mary's code you might find useful for your own crypto-education include:
    • The use of simple shapes for high frequency letters, like Mary's use of a circle for the letter /A/. This saves time while encoding.
    • Common symbols used as part of the new code language, like Mary's use of "8" as code for the letter "Y." These can confuse code breakers who might interpret this as a number and not a code symbol.
    • Unique symbols for common words. In Mary's day, "pray" and "bearer" received unique symbols, but these were more common then than they are today. Still, using symbols for frequent words and phrases saves time and adds complexity.[19]
  2. 2
    Use code phrases similar to military alerts. Code phrases can collapse a lot of meaning into a single phrase. Even many kinds of military alert, like the DEFCON system, are simply well-known codes for a state of defense readiness.[20] Come up with suitable code words/phrases in your everyday life.
    • For example, instead of saying "I've got to run to my locker" among your friends, you might use the code word "Sloppy."
    • To let your friends know that the person you want to date has entered the room, you might say the code phrase, "My cousin Bruce likes hockey, too."
  3. 3
    Encode messages with a book key code. Books are relatively easy to come by. If a book has been decided upon as the key to a code, when you receive a message you can go to a bookstore or library to look up the key to decode it.
    • For example, you might decide on using Frank Herbert's Dune, with code numbers representing the page, line, and number word starting from the left.
      • Encoded Message: 224.10.1 ; 187.15.1 ; 163.1.7 ; 309.4.4
      • Decoded Message: I'm hiding my words.

    Tip: Different editions of books might use different page numbers. To ensure the right book is used as a key, include publication information, like edition, year published, and so on with your book key.[21]

  4. Advertisement
Method 4
Method 4 of 5:

Deciphering Ciphers

  1. 1
    Determine the suitability of using a cipher. A cipher uses an algorithm, which is like a process or transformation that is applied to a message consistently. This means that anyone who knows the cipher can translate it.[22]
    • Complex ciphers can puzzle even trained cryptanalysts. Sometimes the math behind complex ciphers can prove a suitable defense for hiding everyday messages.
    • Many cryptographers add a key, like the date, to strengthen ciphers. This key adjusts the output values by the corresponding number of the day of the month (on the first, all output values would be changed by one).[23]
  2. 2
    Invent an algorithm to apply to messages. One of the simplest ciphers you can apply is the ROT1 Cipher (sometimes called Caesar Cipher). This name simply means you should rotate a single letter forward in the alphabet for each letter of your message.[24]
    • ROT1 Message: Hello
    • ROT1 Enciphered: i ; f ; m ; m ; p
    • Caesar Ciphers can be modified to rotate forward a number of different letters of the alphabet. In concept, ROT1 and ROT13 are essentially the same.
    • Ciphers can be incredibly complex. Some require the use of coordinates, times, and other values as well. Some cipher process may require the use of a computer.
  3. 3
    Encipher messages. Use your algorithm to encrypt your messages. As you learn the enciphering process, your speed should increase. Add to your algorithm to make it more complex. For example,
    • Include a rotating condition to your cipher, like the day of the week. For each day of the week, assign a value. Adjust your cipher by this value when encrypting a message on that day.
    • Include a page number with your enciphered message. Each corresponding letter of that page will serve as a key for the message, as in,
      • 1st Deciphered Message: 7 ; 2 ; 3 ; 6 ; 3
      • Book Key: A_girl (spaces aren't counted)
        /H/ is 7 letters away from /A/
        /e/ is 2 letters away from /g/
        /l/ is 3 spaces away from /i/
        And so on...
      • Key Adjusted Message: Hello[25]
  4. 4
    Decipher messages. When you become experienced reading your cipher it should become second nature, or at least easier. As the application of these processes (algorithms) is consistent, habit will help you notice trends and gain intuition when working with this kind of cryptographic system.

    TIp: Amateur cryptography clubs are popular online. Many of these are free and offer primers in the basics of modern ciphering.[26]

  5. Advertisement
Method 5
Method 5 of 5:

Grasping Standard Ciphers

  1. 1
    Master Morse Code. Regardless of its name, Morse Code is a cipher. Dots and dashes represent long and short electrical signals which, in turn, represent the letters of the alphabet. This enabled old-time electrical communication (telegraphs). Common letters in Morse, represented as long ( _ ) and short (.) signals, include:
    • R ; S ; T ; L : ._. ; _.. ; _ ; ._..
    • A ; E ; O : ._ ; . ; _ _ _[27]
  2. 2
    Make use of transposition ciphers. Many greats in history, like the genius Leonardo da Vinci, have written out messages as they would look reflected in a mirror. Because of this, enciphering in this fashion is often called "mirror writing." These kinds of ciphers can be difficult at first, but generally become second nature quickly.[28]

    Note: Transposition ciphers generally treat messages or the formation of letters visually. The image of the message is transformed to hide its meaning.[29]

  3. 3
    Convert messages to binary. Binary is the language of 1's and 0's used by computers. Combinations of these 1's and 0's can be enciphered and then deciphered with a binary key, or by calculating the values represented by the 1's and 0's for each letter communicated in a message.
    • The name "Matt" would encipher to binary as: 01001101 ; 01000001 ; 01010100 ; 01010100.[30]
  4. Advertisement

Community Q&A

  • Question
    How do you make a cipher wheel?
    wikiHow Staff Editor
    wikiHow Staff Editor
    Staff Answer
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    wikiHow Staff Editor
    wikiHow Staff Editor
    Staff Answer
    One easy way to do it is to print out a premade cipher wheel template. The cipher wheel consists of 2 circles with the letters of the alphabet written along the outer edges. Place the smaller circle on top of the larger one and fasten them together with a split pin. Turn the inner wheel so that one of the letters lines up with the letter of your choice on the outer wheel (such as Z and C), then pin the wheel in place so you can use the wheel as a guide when writing your cipher!
  • Question
    What are some famous secret codes?
    wikiHow Staff Editor
    wikiHow Staff Editor
    Staff Answer
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    wikiHow Staff Editor
    wikiHow Staff Editor
    Staff Answer
    Some of the most famous secret codes in history include the Caesar shift, The Vigenère square, and the Enigma machine.
  • Question
    Can I use a secret code generator?
    wikiHow Staff Editor
    wikiHow Staff Editor
    Staff Answer
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    wikiHow Staff Editor
    wikiHow Staff Editor
    Staff Answer
    Yes, there are a variety of secret code generators. You can use something like a simple cipher wheel, or find a code generator online.
Advertisement

Warnings

  • Having a code or cipher does not guarantee the security of your message. Cryptanalysis may break your code, or human error, like the loss of a code book, might lead to your code getting cracked as well.
    ⧼thumbs_response⧽
Advertisement

About This Article

wikiHow Staff
Co-authored by:
wikiHow Staff Writer
This article was co-authored by wikiHow Staff. Our trained team of editors and researchers validate articles for accuracy and comprehensiveness. wikiHow's Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards. This article has been viewed 1,597,116 times.
277 votes - 78%
Co-authors: 149
Updated: November 7, 2022
Views: 1,597,116
Categories: Cryptography
Article SummaryX

To create a secret code or cipher, start by writing the letters A through M in one row and the letters N through Z in another row underneath. Then, replace each letter in your message with the letter above or below it to encode your message. For example, since the rows give you letter pairs of H and U, E and R, L and Y, and B and O, you’d encode “Hello” as “Uryyb.” Alternatively, use a simple code like writing words in reverse, such as encoding "Meet me later" to "Teem em retal." To learn how to create a pigpen cipher or a date shift cipher, keep reading!

Did this summary help you?
Advertisement