DESCRIPTION
Cryptography
is the study of creating, analyzing and deciphering coded messages. A cipher is a method used to encrypt
and decrypt a message. The simplest
cipher that you may have used in elementary school to share notes with
friends is a substitution cipher. A substitution cipher is when each
letter is replaced by another letter (or symbol) when encrypted. More advanced versions of this could also
include swapping multiple letters at a time, but we will focus on
single-letter substitutions here. A simple
substitution cipher can be created by simply mapping each letter to another.
WORK QUESTION 1
B) Add the function named dec (which is short for decrypt) that reverses
the process of the enc (which is short for encrypt). This should be very similar to the enc
function. Test it out by checkin if print(dec(enc("campeau"))) outputs campeau as expected. C) The
following mapping is the Campoz cipher. Alter the code so that your program works
with the Campoz cipher.
QUESTION 2 The
following sentence has been encrypted using the Campoz
cipher. Use your program to decrypt
it. ICXSDOZKQMOAOVESDXKT |