1 – Encryption, Decryption and Keys

πŸ“– Unit Overview

This module is going to focus on the science of Cryptography. It begins with a small research project and concludes with the creation of some simple cryptography algorithms using Python. You will learn about and use the Caesar and Vigenere ciphers and see how encryption is used to protect you every time you use a computer.

Cryptography is the practice and study of hiding information. It is sometimes called code, but this is not really a correct name. It is the science used to try to keep information secret and safe.

Modern cryptography is a mix of mathematics, computer science, and electrical engineering. Cryptography is used in bank cards, computer passwords, and shopping on the internet.

🎯 Learning Objectives

Develop the Communication and Networks Learning Strands:

  • Define the terms plaintext and cipher text and explain their importance, and distinguish between the two
  • Understand and explain what encryption and decryption are
  • Understand and explain what a key is
  • Learn to use and describe several common ciphers
πŸ’¬ Key Vocabulary

  • plaintext
  • key
  • cipher text
  • ciphers
  • encryption
  • decryption
πŸ“ Starter Activity – Sending secret messages

  • Alice and Bob are sitting in a classroom and want to send notes to each other, but Eve is sitting in-between them.
  • Alice can write a message onto a bit of paper, but she needs to pass it to Eve first.
  • Eve can then pass the message onto Bob, so Bob can read the message.
  • Can you see how this system is insecure? Eve is easily able to read the message before passing it onto Bob.
  • 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 – Encryption

  • The problem is that Alice and Bob 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 Alice and Bob 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 Eve 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 – The Caesar Cipher

  • Encryption methods have been used for millennia by various people.
  • Watch the video and then answer the quiz in the Badge It section.
  • You wil need to use the internet to research the answers

πŸ… Badge It – Silver and Gold

  • When you are ready, click here to take the quiz.
  • You can try the quiz again if you do not achieve the Gold badge.
  • Silver: Achieve 4 out of 8
  • Gold: Achieve 6 out of 8
Image result for badge

πŸ“– Learn It – The VigenΓ¨re Cipher

  • 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.
  • Watch the video on the Vigenere Cipher

πŸ… Badge It – Platinum

  • In your own words, provide a brief description of how the VigenΓ¨re Cipher works.
  • Now try decrypting this message using the VigenΓ¨re 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.

In this lesson, you…

Defined the terms plaintext and cipher text and explained their importance, and distinguished between the two.

Understood and explained what encryption, decryption and a key are.

Learn to use and describe several common ciphers.

Next lesson, you will…

Understand and explain how the Caesar cipher works. Define and explain the terms strings and variables.

Understand and explain how loops work.

Create a Caesar cipher using Python.