DESCRIPTION
The Nomenclator ciper is a small variation to the standard substitution
cipher. However, when replacing a
letter, instead of using another letter, we use a word. This requires that we memorize all the
words or have a table of letters and associated words.
Of course, for real-world usage, a more advanced version of this cipher
was used where combinations of letters would be associated with a word. In fact, the combinations would sometimes
even vary in length. This could lead
to a big dictionnary-like lookup table for encrypting/decrypting. WORK QUESTION 1 Consider the following conversion table for a Nomenclature cipher:
In a Python file called Nomenclature, write the enc and dec functions
for the above Nomenclature cipher.
They only need to work with upper case letters. enc (word) dec (word) Test your
code. Feel free
to use any of your past code in here. Note: I
think the decode function might be a little challenging. Please see me if you are stuck. QUESTION 2 The
following sentence has been encrypted using the above Nomenclature cipher. Use your program to decrypt it. JANEJAMESONEVANLENNONLENNONAMBERLENNONEVANJAMESONDARRENLENN ONBRYCESANDROEVANBRYCEPATRICKEVANMAZZYSANDROMICHOCONNERMATT IASBRYCEPATRICKCONNERDARRENSANDROEVANMAZZYWYATTJAMESONMATTI ASCONNERCONNERJONAHMAZZYMICHOBLAKECONNERCONNERBRYCEPATRICKC ONNERCARRENJANEAMBERMATTIASMATTIASLENNONCONNERDYLAN (Hopefully,
I didn’t make an error when encrypting this!) |