How many different keys do Affine ciphers have in each martian language? Show all your computations. Which of the two languages is more secure against a brute force attack?
Part 2 All 20 letters of the Northern martian language occur in the language with the same frequency and all possible combinations of letters are equally probable. What's the best way to break an affine cipher for Northern martian language? How does its security compare to that of an affine cipher for English?
Extra credit: do you believe that letter frequencies differ significantly depending on the type of text? For instance, is it possible to distinguish texts of the time of Shakespeare from modern texts based on letter frequencies alone? You have to describe your methods and your findings.
The following is an encryption of an English text using affine cipher:
ETWCAIEMDAYWRRWRYLQYALJANGLWNABQZMWLLWRYDGXANMWMLANQRLXADERUERBQZXEJ WRYRQLXWRYLQBQQRCAQNLIWCAMXAXEBPAAPABWRLQLXADQQUXANMWMLANIEMNAEBWRYD KLWLXEBRQPWCLKNAMQNCQRJANMELWQRMWRWLERBIXELWMLXAKMAQZEDQQULXQKYXLETW CAIWLXQKLPWCLKNAMQNCQRJANMELWQRUse your program to help you decrypt the text. Find out the key (a and b) that it has been encrypted with. Describe the procedure that you followed: what hypotheses did you try? Keep in mind that this is an affine cipher, so a must be relatively prime with 26.
Optional, no extra credit Who is the author of the above text?
alexandbethdecidedtousevigenerecipherforsecretcommunicationsandcameupwiththiskey(this is 80 characters).
They start their secret communication by Alex sending the encryption of this message to Beth:
whatareyoudoingthisweekend(this is 26 characters). Eve intercepts the encrypted message. What are Eve's chances to decrypt the message at this point? Assume that Eve has no way of guessing the key or any part of it.
Beth replies to Alex with the encryption of the following:
whatistheretodoBeth could use the part of the key that was not used by Alex's message (i.e. start at letter number 27 in the key) or she could start at the beginning of the key (presumably, she can communicate her choice to Alex somehow so that Alex knows what portion of the key to use to decrypt the message). How does each choice affect Eve's ability to decrypt the message?
LBIEWBWKKSECTAJGVIGKIELYTLOVXRTANQIBSLKOUJVFOVWVSXWHREWZXAKGCIQSGUNXJ RPQGMYIGLHILEFUIGOCCOAMPAGIDLUWLKFTNHYXFARPINZPIGKJWHWBRQVZLIEISUKGGF UKXVRPWYLLEDAZVHERCXIOEGETZDXSJZULNVRNISCBKMIUFUSKHVTEDKNUYWHXIFXHHZR FPIOGLTLODRUILLFRFWWRNWXHIHFZKHUDZZPHBEGLBOPGALRBEJRRQVTITFFRVWGGXUXY WVGTRRUMMCILLRRNWKCCOQWFCMTFCLCXTOGYFFODBEGLPWCOSGUSBRDCHLKLTARWJFSEC DLNAGOAVZTRFBUFSIKIOJUFRVTKTXSRZQYVRPMFWELDEKIKJRNLLARLEYVVVWYIOFYVVV WPFUEIWSHYHEELFJVWZTKTHIWVLDXRVXRMCRNXRLHSSYou might want to write a program that will perform some of the computations (in particular, you definitely don't want to compute index of coincidence by hand!). Submit your program together with the results.
Note: the grammar of the text might not be obvious in some places without punctuation marks, but the text is easily recognizable as English.
Optional, no extra credit. How is the keyword related to the text?