Activity: Caesar Cipher
For this activity, you will create a caesar cipher to send messages by first encrypting and then decrypting. We will also be testing if we can create a brute force decoder that will correctly decrypt a message.
Instructions
You are to create a program with 3 functions in any programming language you see fit. You may work in groups for this assignement, and a file containing the program must be submitted via Kit. The information for the three functions can be found below.
Caesar Cipher
The Caesar cipher is a type of substitution cipher where each letter in the plaintext is shifted a fixed number of places in the alphabet.
This reads mathematically as encrpyt, E(x) = (x + k) mod 26 and as decrypt, D(x) = (x - k) mod 26, where x is the position of the plaintext letter and k is the key (shift).
Encrypt Function
The encrypt function should take a plaintext input and a key. Then, it will output the encrypted message following the rules of a caesar cipher.
Decrpyt Function
The decrypt function should take a plaintext input and a key. Then, it will output the decrypted message following the rules of the casesar cipher.
Brute Force Function
You are to create a function that can solve any caesar cipher input without being given a key. You do not need to verify which input is correct, you can simply output all possible versions of the text.