Encryption project

This project is designed to span one half term and will require you to design and develop different types of encryption algorithm. You can jump in at whichever stage you feel most confident, but by the end you need to have improved both your programming skills and also your understanding of the topic area.


Core skills

Cipher 1 - Caesar cipher

Using the Unit 2 textbook (page 184 - 197), research how the Caesar cipher works. You may find it helpful to create a set of notes and consider the logic behind how encrypting and decrypting a plaintext message would work.

Once you understand the following programming concepts you can start to create your Caesar cipher:

  • Modulo arithmetic
  • Loops

Your finished Caesar cipher should accept any uppercase or lowercase character and allow you to successfully decrypt a message as well.

Cipher 2 - One time pad

The one time pad is a fantastic cipher that can be very secure. Learn about the one time pad on pages 198 - 204 in the Unit 2 textbook.

Once you understand how the cipher works, you should then build a program which can encrypt and decrypt a message using the one time pad method.

Other ciphers you could program to develop your skills in this area:

  • Homophonic substitution cipher
  • Polygram substitution cipher


Next steps

Cipher 3 - Transposition cipher

Information on transposition ciphers can be found here. Once you understand how they work, program both a route and rail fence cipher.

Cipher 4 - Vernam cipher

Pages 205 and 206 in the Unit 2 textbook detail how the Vernam cipher works. Once you are familiar with the concept, program this cipher ensuring you make use of the XOR operation within your code.

Other ciphers you could attempt to develop your skills in this area:

  • Hill cipher
  • Myszkowski Transposition
  • Double Transposition

Mastery

Cipher 5 - Engima machine

The Enigma machine was used during World War 2 to send signals from German high command to the front line. Information on how the Enigma machine works can be found here and here. Once you understand its operation, recreate the Engima machine including the three rotas and plugboard.

Cipher 6 - Public key encryption

For this challenge you will need to develop an understanding of the RSA algorithm. You should then try to simulate some of the principles underpinning public key encryption. You may not be able to recreate an exact replica, but you could show the principles of how data is encrypted.

Additional features

Throughout the development of all of these ciphers, you should be looking to extend your programming knowledge in other ways as well. For instance:

  1. Can you get data to load from a text file rather than simply entering a message through an input?
  2. Could you display the encryption/decryption of the different ciphers in a visual form e.g. tkinter?
  3. For some of the more visual ciphers, for instance the Enigma machine. Showing how the encryption works through a module such as PyGame would be a really good challenge.