O'Reilly logo

Python For Kids For Dummies by Brendan Scott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PROJECT 7

Cryptopy

The muscles you used in the 1337 sp34k3r project get flexed in this project, too. You encrypt and decrypt messages using Python and a little something called a Caesar Cipher.

image

Julius Caesar was a Roman general. Ciphers are what real-life spies use to make and break codes. A cipher is a procedure or a device that changes readable text (called plaintext) into unreadable text (called ciphertext). Caesar encrypted, or coded, his messages by shifting letters along the alphabet. If he had a plaintext d, he would replace it with an a. For an e he would write b, and so on.

In this project you

  • Take a plaintext message.
  • Encrypt the message.
  • Present the encrypted message.
  • Decrypt a ciphertext message into plaintext.
  • Present the plaintext.

Your cipher is going to handle uppercase and lowercase letters, plus punctuation marks and numbers. Caesar got off easy. He didn’t have to worry about punctuation or uppercase letters.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required