Home‎ > ‎ICT Programming‎ > ‎

Cryptography

What is Cryptography?

  • Sending/receiving information privately 
  • Changing around a message so that no one else can understand it except for you and your recipient 
  • Keep personal info and sensitive data safe
  • First examples of cipher texts date back to 1900 BC 
  • Caesar cipher dates back to roughly 50 BC, when Julius Caesar used this cipher to code messages during his conquest of Gaul (modern day France) 



Caesar Cipher 

The Roman ruler Julius Caesar (100 B.C. – 44 B.C.) used a very simple cipher for secret communication. He substituted each letter of the alphabet with a letter three positions further along. Later, any cipher that used this “displacement” concept for the creation of a cipher alphabet, was referred to as a Caesar cipher. Of all the substitution type ciphers, this Caesar cipher is the simplest to solve, since there are only 25 possible combinations.

Caesar Cipher

Often this type of cipher is implemented on a wheel device. A disk or wheel has the alphabet printed on it and then a movable smaller disk or wheel with the same alphabet printed on it is mounted forming an inner wheel. The inner wheel then can be rotated so that any letter on one wheel can be aligned with any letter on the other wheel.

For example, if the inner wheel is rotated so that the letter M is placed under the letter A on the outer wheel, the Caesar cipher will have a displacement of 12. To encipher the letter P, locate it on the outer wheel and then write down the corresponding letter from the inner wheel, which in this case is B. The same can be accomplished by placing alphabets on two pieces of paper and sliding them back and forth to create a displacement.

One of the main flaws of using the caesar cipher is it's vulnerability to Frequency Analysis, the Vigenère cipher is one proposed solution to reduce this weakness.

Try: The Online Caesar Cipher   AND   Caesar Cypher Exploration   AND   The Black Chamber


Activity: Make your first Caesar Cipher - need pen & paper

Activity: Make your own Caesar Cipher Wheel - need scissors & brass fastener

To encrypt with a cipher wheel, students turn the inner wheel counterclockwise, shifting it the number of letters specified by the key. Then they match plaintext and ciphertext letters as shown on the wheel.  

To decrypt, students read the wheel backwards: after setting the wheel to the appropriate key, they begin with a ciphertext letter on the inner wheel and match it with the corresponding plaintext letter on the outer wheel.

Assignment: Caesar Cipher Assignment 1

                      Caesar Cipher Assignment 2 (negative shifts require counterclockwise (left) turns, positive shifts require                                                                  clockwise (right) turns.

Done so soon? Try reading about other types of Ciphers and Coded Messages

Confused? - watch the "how to read a Caesar Cipher" video



The Vigenère Cipher

The Vigenère cipher, was invented by a Frenchman, Blaise de Vigenère in the 16th century. It is a polyalphabetic cipher because it uses two or more cipher alphabets to encrypt the data. In other words, the letters in the Vigenère cipher are shifted by different amounts, normally done using a word or phrase as the encryption key .

Unlike the monoalphabetic ciphers, polyalphabetic ciphers are not susceptible to frequency analysis, as more than one letter in the plaintext can be represented by a single letter in the encryption.

The Vigenère Square

Blaise de Vigenère developed a square to help encode messages. Reading along each row, you can see that it is a really a series of Caesar ciphers the first has a shift of 1, the second a shift of 2 and so.

The "vigenere cipher" is not an easy code, until you "get" how it works. Practice, practice, practice. The cipher works with a grid, called the "Vigenère Square", is a grid of 26 by 26 characters, where the letters of the alphabet are written, but shifted left one character as you go down.

  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

The Vigenère cipher uses this table in conjunction with a key to encipher a message.

So, if we were to encode a message using the key COUNTON, we write it as many times as necessary above our message. To find the encryption, we take the letter from the intersection of the Key letter row, and the Plaintext letter column.

Key C O U N T O N C O U N T O N
Plaintext V I G E N E R E C I P H E R
Encryption X W A R G S E G Q C C A S E

To decipher the message, the recipient needs to write out the key above the ciphertext and reverse the process.

Activity: Try to create a simple message, choose a key, and encrypt your message using the square above.                   Tell a partner your key (but not your original word) and see if they can decrypt it.

The table above is strictly an alphabet table with letters. To increase the complexity, you can also use a table that combines both letters and numbers

Further Explanations

Assignment 1: The Vigenère Cipher Worksheet

Print your own grid here



Confused? Read more about how to use the Vigenère Cipher

Read more about :
 
Why is Vigenère so strong?


Public / Private Key Cryptography


Public key encryption is an extraordinary recent development that has made internet commerce possible. It allows people to encrypt and decrpyt messages without having to share a password to unlock them. It is hard to believe that such a system could exist, yet this mode of encryption is widely used because it is so easy to set up.



Imagine you have a computer program that will allow you to encrypt a text file or digital document by using either one of two passwords, so that once you freely choose any one of the two passwords for encrypting, then decryption can only be performed by using the other password. That is: you can't both encrypt and decrypt by using the same password; once you use one of the two possible passwords for encryption, then you can only decrypt by using the other password you did not use for encrypting.

This is the trick: you keep one of the two passwords as a secret password only you know and no one else knows; this is called your "private key". And you let the other password be known by everybody; this will be your "public key".

Thanks to this, you can nicely perform two interesting tasks:

a) You can RECEIVE (not send) information in a secure manner: since everybody knows your public key, then they can encrypt any information they want to send to you by using your public key. Since the information has been encrypted by using your public key, then it can only be decrypted by using your private, secret key; and since you are the only one who knows your own private key, then you are the only person who will be able to decrypt the information that was sent to you. (If you want to SEND information to other people in a secure manner, then you'll have to know those people's respective public keys, and use these public keys for encrypting).

b) you can SEND information in such manner that you can absolutely prove that information was sent by YOU: if you want to send a certain information and you encrypt it by using your PRIVATE, SECRET key, then everybody will be able to decrypt and read that information, because the information will be decryptable by your public key and everybody knows your public key. So your information is not protected against reading, but, since it is decryptable by your public key, then it is a complete proof that the information was encrypted by your private, secret key. And since you are the only person who knows your own private, secret key, then it gets perfectly proven that the information was encrypted by you and no one else. This is why encrypting by using your own private key is also known as "digitally signing" the information you send.


Assignment:

Write a blog post explaining a simple version of how Public / Private key encryption works and describe an example of why this is important.

Additional Activities (for your own exploration)



Simple Explanation if you need further help





Cryptography Pioneers


Alan Turing: The Father of Computer Science


 

What's a Chatbot? Try out: Cleverbot or Mitsuku

Turing's Life
Click to enlarge

The Life of Alan Turing: Part 1



The Life of Alan Turing: Part 2




Grace Hopper: The Queen of Code

Grace Hopper: The Queen of Code



Reflection
  • What challenges would Hopper have faced early in her career?
  • What made Hopper's contributions so significant to the field of computer science?
  • How has her legacy lived on since her death in 1992?




Follow up activity

Watch: The Rise of Artificial Intelligence




Other Videos

YouTube Video


YouTube Video



UNIT PROJECT

You will research an existing code and/or cipher and present your findings on your blog. You will be expected to provide coded and decoded examples for the class to see. 

You should be able to answer any questions from the teacher or the class so you need to make sure that you have a thorough understanding of how it works.

You must be ready to present on Tuesday, March 7

You can use any web resource for your information but keep track of your sources.

Use a video to illustrate your code / cipher.

These websites are great places to start your research


What I would like to see:
-  An overview of the cipher, when & who invented it, and what it is used for
-  Examples of the cipher in action and examples of coded and decoded texts
-  An explanation of any weaknesses or strengths of the cipher - why is it worth it or not worth it to use it?
-  Your ability to understand and explain how the cipher works and answer any class questions.


See the Marking Rubric for a clear understanding of how this will be marked.




Final Assignment

Murder Mystery at Pinetree Secondary - details to follow....



Additional Resources





Comments