Cryptography: Lesson 1

Cyphers

Learn It

  • This module is going to focus on the science of Cryptography.

  • It begin with a small research project and conclude with the creation of some simple cryptography algorithms using Python.

Learn It

  • Liesel and Rufus are sitting in a classroom and want to send notes to each other, but Arthur is sitting in-between them.

  • Liesel can write a message onto a bit of paper, but she needs to pass it to Arthur first.

  • Arthur can then pass the message onto Rufus, so Rufus can read the message.

  • Can you see how this system is insecure? Arthur is easily able to read the message before passing it onto Bob.

Try It (5 minutes)

  • Assemble yourselves into teams of three.

  • Can two of you manage to write messages to each other in such away that the third member of your group is unable to read the message?

Learn It

  • The problem is that Liesel and Rufus are trying to send messages in what is called Plaintext. Plaintext doesn't necessarily have to be text. It is just any information that is being passed between participants that can easily be read by a third party without needing any special measures. Pictures, Video, Audio as well as Text can all be described as Plaintext.

  • If Liesel and Rufus want to communicate privately, they'll need to Encrypt their messages.

  • Encryption converts information into what is known as Ciphertext. Ciphertext can't easily be read by Arthur unless she knows the Key that was used to encrypt the message.

  • Let's look at an example.

    • Alice tells Bob the key she is going to use prior to the lesson.

    • The key is 'I'll write the message backwards'

    • Alice then writes down her Plaintext message on a piece of paper - I'm loving this lesson on Encryption

    • On a second piece of paper, Alice uses her key to encrypt the message. noitpyrcnE no nossel siht gnivol m'I

    • Alice can then pass the message to Eve, who can't read it (well not quickly anyway).

    • Eve passes the message onto Bob.

    • Bob (knowing the key) can then decrypt the Ciphertext and write out the Plaintext.

  • Of course the encryption method shown above isn't very secure. We'd call it weak encryption.

Research It

  • Encryption methods have been used for millennia by various people.

  • Watch the video below and then answer the questions in the Badge It section.

Learn It

  • Hopefully you can see that the Caesar Cipher isn't a particularly secure method of encrypting PlainText.

  • To try and combat Frequency Analysis the original Caesar Cipher was improved upon, by using more than one shift value.

Research It

  • Watch this video on the Vignere Cipher

Badge It - Platinum

  • In your own words (remember to use a text editor and the .txt extension), provide a brief description of how the Vigenere Cipher works.

  • Now try decrypting this message using the Vigenere Cipher and the key of "compsci"

Gbogqrbkcz bsmmu qabewvkqmiaqv uortj.

  • Keep the answer a secret so that your friends have to work it out themselves.