Crack the Code! Make a Caesar Cipher (2024)

October 6, 2016

4 min read

Crack the Code! Make a Caesar Cipher

A top secret science project

By Science Buddies & Ben Finio

Crack the Code! Make a Caesar Cipher (1)

Key concepts
Patterns
Code
Puzzles
Cryptography

Introduction
If you need to send a secret message to a friend, how could you prevent other people from reading it? One way is to encrypt the message—that is, use a secret code that only you and your friend know. Try this activity to learn how to create your own “Caesar cipher,” a popular type of code that is easy to learn.

Background
Cryptography is the study of writing or solving secret codes that are used for secure communication. Historically, codes have been used by politicians, spies and countries at war to prevent their enemies from knowing what they’re up to. Many of the earliest codes, or “ciphers,” such as the one you will create in this project were easy to create by hand. Now cryptography is essential in computer science for keeping everything from e-mails to bank account information secure.

On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.

The Caesar cipher, named after Roman Emperor Julius Caesar is one of the earliest and most widely known ciphers. It is a simple form of a “substitution cipher” where you replace each letter of the alphabet with another letter by shifting the whole alphabet a certain number of letters (wrapping around to the beginning once you reach the end). For example, this would be your key and code if you shift each letter by three spaces:

Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW

So, when you write your message, the letter A gets replaced with X, B gets replaced with Y and so on. For example, the word “HELLO” reads:

Plain: HELLO
Cipher: EBIIL

In order to decode your message, you need to share the “key” (the number 3) with your friend. After that you can send messages that are written in cipher so other people can't read them!

Materials

  • Pencil and paper

  • At least one other person

Preparation

  • Explain the concept of a Caesar cipher to a friend or have them read the background section of this activity.

  • Write down the alphabet from A to Z.

  • Pick a number from 1 to 25. (If you use 26, you will just wind up with the original alphabet.) This number is your key.

Procedure

  • Shift the entire alphabet by the number you picked and write it down below your original alphabet (as shown above).

  • Pick a message to write to your friend. It might be easiest to start out with a simple message (such as a single word or phrase) before you try longer sentences or paragraphs.

  • Write down your encoded message using your shifted alphabet. If it helps, write down your plain text message first then encode it one letter at a time (such as the “hello” example above). Just make sure the piece of paper you give your friend only has the encoded message!

  • Give your friend the encoded message and tell them the key. Why do you think you wouldn't want to write down the key?

  • See if your friend can decrypt your message. If it helps for the first try, let them work backward using the original and shifted alphabets you wrote down. Using the example from the background, the letter x becomes a; y becomes b; and so on.

  • Try switching and using a different key for the same messages. Do either look easier to crack?

  • Extra: Try finding a third person who does not know what a Caesar cipher is. Can they crack your code if they “intercept” your message?

  • Extra: What if the person who intercepts your message knows about Caesar ciphers? Does that make it easier to crack the code? Because there are only 25 possible keys, Caesar ciphers are very vulnerable to a “brute force” attack, where the decoder simply tries each possible combination of letters. This might take some patience if a human does it, but nowadays computers can unravel the code in a fraction of a second, so Caesar ciphers are not considered a secure method to encrypt electronic communications.

  • Extra: Another way to crack the Caesar cipher is “frequency analysis,” which is based on the fact that in natural English speech and writing, certain letters appear much more frequently than others. For example, the letter E appears more often than any other one whereas Z appears the least often. (If you have ever played the board game Scrabble, you might notice that this determines how many points letters are worth!) So, for example, if you read an entire paragraph and notice that the letter D appears more often than any other, odds are that it used a Caesar cipher with a shift of 1 (making E a D in the code). This technique will be more accurate for longer blocks of text and very inaccurate for short words or phrases because there are plenty of words that do not contain E at all. Can you have a friend write an entire paragraph with a Caesar cipher and then try to crack it using frequency analysis?

  • Extra: If you plan to use the Caesar cipher for regular communication, one risk is that eventually someone will discover your key. You can help prevent this by changing the key, for example using a new one every week. This is a similar concept to periodically changing your computer passwords.

  • Extra: The Caesar cipher is just one type of substitution cipher. Look up some other types of substitution ciphers and try them out. Are they harder or easier to use and crack?

Observations and results
Once you and your friend both understand how to use a Caesar cipher it should be relatively easy to send encrypted communications to each other. This can be a fun way to pass secret messages back and forth between friends. As discussed above, however, although the Caesar cipher provides a great introduction to cryptography, in the computer age it is no longer a secure way to send encrypted communications electronically.

More to exploreBasics of Cryptography: Caesar Cipher, from Instructables
Cryptography, from Learn Cryptography
Password Hacker, from Scientific AmericanScience Activities for All Ages!, from Science Buddies

This activity brought to you in partnership with Science Buddies

Crack the Code! Make a Caesar Cipher (2)
Crack the Code! Make a Caesar Cipher (2024)
Top Articles
How To Close a Business Checking Account In 8 Steps [+Free Checklist]
How To Tell When Your Dog Is in Pain & How To Help
Uti Hvacr
Goodbye Horses: The Many Lives of Q Lazzarus
How To Be A Reseller: Heather Hooks Is Hooked On Pickin’ - Seeking Connection: Life Is Like A Crossword Puzzle
Evil Dead Rise Showtimes Near Massena Movieplex
Wmlink/Sspr
Legacy First National Bank
How Much Is Tj Maxx Starting Pay
Truck Toppers For Sale Craigslist
10-Day Weather Forecast for Florence, AL - The Weather Channel | weather.com
[Birthday Column] Celebrating Sarada's Birthday on 3/31! Looking Back on the Successor to the Uchiha Legacy Who Dreams of Becoming Hokage! | NARUTO OFFICIAL SITE (NARUTO & BORUTO)
Eva Mastromatteo Erie Pa
How To Cancel Goodnotes Subscription
Walgreens San Pedro And Hildebrand
Richland Ecampus
Soulstone Survivors Igg
Home
Asteroid City Showtimes Near Violet Crown Charlottesville
Macu Heloc Rate
Walmart Pharmacy Near Me Open
2004 Honda Odyssey Firing Order
Www.1Tamilmv.con
Rek Funerals
Ezstub Cross Country
Egg Crutch Glove Envelope
Www.craigslist.com Syracuse Ny
Lehpiht Shop
Ma Scratch Tickets Codes
Strange World Showtimes Near Atlas Cinemas Great Lakes Stadium 16
Craigslist In Myrtle Beach
Vanessa West Tripod Jeffrey Dahmer
Metra Schedule Ravinia To Chicago
Craiglist Hollywood
Cranston Sewer Tax
Vons Credit Union Routing Number
The best specialist spirits store | Spirituosengalerie Stuttgart
Miami Vice turns 40: A look back at the iconic series
Lyndie Irons And Pat Tenore
How Big Is 776 000 Acres On A Map
Quick Base Dcps
Random Animal Hybrid Generator Wheel
Large Pawn Shops Near Me
How to Connect Jabra Earbuds to an iPhone | Decortweaks
The Average Amount of Calories in a Poke Bowl | Grubby's Poke
Uno Grade Scale
Dmv Kiosk Bakersfield
Estes4Me Payroll
Tenichtop
Craigslist Yard Sales In Murrells Inlet
Syrie Funeral Home Obituary
Qvc Com Blogs
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 6542

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.