CSC350 - Lab 3
Cracking Ciphers

Assigned Sep 18th
Due Sep 25th Beginning of Class


Part 1 - Affine Ciphers

Decode the following message encrypted with an affine cipher.

FIXXNSXQZIDBYSEUSRZEUUVAXXNSXQZIDBRICECIRE

You know that

T -> X
O -> I

Write your decoded message, the keys you found, and your work, in a file called lab3.txt

Part 2 - Vigenere Ciphers

Implement the algorithm discussed on page 74 of the textbook for performing cryptanalysis on Vigenere-encoded ciphertext.

You may write this in either Java or Python.

  1. Analyse the text searching for frequent substrings of length 3.
  2. Find the greatest common denominator of the repetition distance for the 4 most frequent substrings.
  3. Split the ciphertext into subparts based on this greatest common denominator.
  4. Use Chi-Squared analysis to determine the most likely shift for each subpart.
  5. Piece back together the translated subparts to form the complete plaintext.

You must decode the following message, and write the message and keyword used to encrypt this message in your lab3.txt file:

RCSMQBLCKBQLCHYIVSQHYMSECGKQQXUVVBJOPHZAPYZZVZKXRVVUKXBHFAWPDSIBJOQZZVICYBUITBMKJWHYSHIIIOMI
JNQBRIEMQBRCKIMOYFDACQYWEAVKQSRWHDPCLJNOQOELDIMDGWUSLUVVFDFSDBQNGSKWUVCSGVQWMFVIPNZMRANOCDKW
UKWKVMPNRVVPGKPHRKJOYBUBJORVFCUKLREIVEPOCAJYAYJBJKRTCMURGGYMKBRCKQUKACEAWWKOKQQXBSMWWDJMKWDO
UWJPFDMRZMVYQZVMRDMGCMGZNSIKJKLQVBQNPSRUCIRVVZGCRVVZWLDCIQPDFOKANOCDFNFOYHYEJKRRIMCWQARGEYKS
NPGXUSYIXOQVLNHVCRFNHDFWJUQBROCKQSJALAVQGJVCUZYIJMVRCFVAVRCFVAROAHKPCDKOBMUMYZRUKDWCWAQVMBXT
KPCTFZYRMKFCNNZSRZVRCKYQRCYBUAEYPBJWHDGAVBJOMDGZGCQCIAYBMBXBJONFFCFWYBJKQXRIDMNIRVVXCXEGFNFO
QDZAGNJCMMVRCZREUNCZRGVRCWEAQVCBTMQPMTWQEOYBUBJOQDLZPCRVRBRKRWVVVWCFZBQPRVVCPGMFKPADYYVAYRCB
YMJSKGVTHWGUYBJSQELQGDSGDIMOUWKPCLYFVJQNIWEEJYUCLTFPYFUMNCZSRZVYEFLVVKLRJEGKRIELGBYKVITIJWWM
DERHYIVDFSUZGKBCWAQWCHYQPQYTKMTNCOKPVRCIELKCACMMTNACLVVBWTIWOGFCJMDYSFEVQDPOMMNVCFIMVEPBJXWJ
XZVAVRCKZTNKLRDIMOQIJZCDFSIJGKPHYWUOGZCAYOFOMMVRYBWTADMCKPGBQHYIVGCYEWYXMHFNVRSGTWPCAWVVEOBC
VAOKISTWYKPRJWHEQOCTCXBHYCUDFSEIVSTSYCGYDFVAQVSHZWPSQGZKMVGSUWGBUWKPVRCDRTGMYGKWHDFCLOJDYBUM
PDCFGZKCCGFNIBCOKXKDFOELOYKSEBYSRVKPKCPSXITNRVVQTMSFIMPDQHLZPKUFPIPNJCJMVRCBRUGYDOTBKYLGFNVI
MIEWYDFSWIKBMDYMNSYBPURRGBKPAYPWJWPCZSRTNWWGZVUBCAVUDOPR

For extra credit, implement an alternative method using the index of coincidence discussed in class.

What to turn in

  1. VigenereCracker.java or
  2. VigenereCracker.py
  3. lab3.txt
To hand in your Lab 3 files, follow the steps listed below from the Wright Lab computers:
  1. Open the Terminal application.
  2. SSH with ssh username@cs.centenary.edu to connect with the cs server.
  3. Type in your password.
  4. Make a new directory with mkdir csc350/lab3
  5. Log out of the cs server with logout
  6. Change to the directory where you have your files on the local computer.
  7. Securely copy your files to your directory with scp filenames username@cs.centenary.edu:"csc350/lab3"