This is an old revision of the document!
Please download the lab skeleton from here: lab2.zip The archive contains several files, just need the following:
You need to fill in the TODOs from ex3.py.
Charlie manages to capture a last communication which turns out to be the most important, so it is crucial he decrypts it. However, this time Alice used the Vigenere cipher, with a key that Charlie knows has 7 characters.
The ciphertext is in the file attached. Try the method of multiplying probabilities as explained in class and see if you can decrypt the ciphertext. You can find details about this method here.
These are the known frequencies of the plaintext:
{'A': 0.07048643054277828, 'C': 0.01577161913523459, 'B': 0.012074517019319227, 'E': 0.13185372585096597, 'D': 0.043393514259429625, 'G': 0.01952621895124195, 'F': 0.023867295308187673, 'I': 0.06153403863845446, 'H': 0.08655128794848206, 'K': 0.007566697332106716, 'J': 0.0017594296228150873, 'M': 0.029657313707451703, 'L': 0.04609015639374425, 'O': 0.07679967801287949, 'N': 0.060217341306347746, 'Q': 0.0006382244710211592, 'P': 0.014357175712971482, 'S': 0.05892939282428703, 'R': 0.05765294388224471, 'U': 0.02749540018399264, 'T': 0.09984475620975161, 'W': 0.01892824287028519, 'V': 0.011148804047838086, 'Y': 0.023045078196872126, 'X': 0.0005289788408463661, 'Z': 0.00028173873045078196}