2.9 Computer Problems

The following ciphertext was encrypted by a shift cipher:
ycvejqwvhqtdtwvwu
Decrypt. (The ciphertext is stored in the downloadable computer files (
bit.ly/2JbcS6p
) under the name ycve.) 
The following ciphertext was the output of a shift cipher:
lcllewljazlnnzmvyiylhrmhza
By performing a frequency count, guess the key used in the cipher. Use the computer to test your hypothesis. What is the decrypted plaintext? (The ciphertext is stored in the downloadable computer files (
bit.ly/2JbcS6p
) under the name lcll.) 
The following was encrypted by an affine cipher:
jidfbidzzteztxjsichfoihuszzsfsaichbipahsibdhu hzsichjujgfabbczggjsvzubehhgjsv
. Decrypt it. (This quote (NYTimes, 12/7/2014) is by Mark Wahlberg from when he was observing college classes in order to play a professor in “The Gambler." The ciphertext is stored in the downloadable computer files (bit.ly/2JbcS6p
) under the name jidf.) (Hint: The command “frequency” could be useful. The plaintext has 9 e’s, 3 d’s, and 3 w’s.) 
The following ciphertext was encrypted by an affine cipher:
edsgickxhuklzveqzvkxwkzukcvuh
The first two letters of the plaintext are if. Decrypt. (The ciphertext is stored in the downloadable computer files (
bit.ly/2JbcS6p
) under the name edsg.) 
The following ciphertext was encrypted by an affine cipher using the function $3x+b$ for some $b$:
tcabtiqmfheqqmrmvmtmaq
Decrypt. (The ciphertext is stored in the downloadable computer files (
bit.ly/2JbcS6p
) under the name tcab.) 
Experiment with the affine cipher $y\equiv mx+n\text{}(\text{mod}\text{\hspace{0.17em}}26)$ for values of $m>26$. In particular, determine whether or not these encryptions are the same as ones obtained with $m<26$.

In this problem you are to get your hands dirty doing some programming. Write some code that creates a new alphabet $\{A\text{,}\text{}C\text{,}\text{}G\text{,}\text{}T\}$. For example, this alphabet could correspond to the four nucleotides adenine, cytosine, guanine, and thymine, which are the basic building blocks of DNA and RNA codes. Associate the letters $A\text{,}\text{}C\text{,}\text{}G\text{,}\text{}T$ with the numbers $0\text{,}\text{}1\text{,}\text{}2\text{,}\text{}3$, respectively.
Using the shift cipher with a shift of $1$, encrypt the following sequence of nucleotides, which is taken from the beginning of the thirteenth human chromosome:
GAATTCGCGGCCGCAATTAACCCTCACTAAAGGGATCT
CTAGAACT.
Write a program that performs affine ciphers on the nucleotide alphabet. What restrictions are there on the affine cipher?

The following was encrypted using by the Vigenère method using a key of length at most 6. Decrypt it and decide what is unusual about the plaintext. How did this affect the results?
hdsfgvmkoowafweetcmfthskucaqbilgjofmaqlgspvatvxqbiryscpcfr
mvswrvnqlszdmgaoqsakmlupsqforvtwvdfcjzvgsoaoqsacjkbrsevbel
vbksarlscdcaarmnvrysywxqgvellcyluwwveoafgclazowafojdlhssfi
ksepsoywxafowlbfcsocylngqsyzxgjbmlvgrggokgfgmhlmejabsjvgml
nrvqzcrggcrghgeupcyfgtydycjkhqluhgxgzovqswpdvbwsffsenbxapa
sgazmyuhgsfhmftayjxmwznrsofrsoaopgauaaarmftqsmahvqecev
(The ciphertext is stored under the name hdsf in the downloadable computer files (
bit.ly/2JbcS6p
). The plaintext is from Gadsby by Ernest Vincent Wright.) 
The following was encrypted by the Vigenère method. Find the plaintext.
ocwyikoooniwugpmxwktzdwgtssayjzwyemdlbnqaaavsuwdvbrflauplo
oubfgqhgcscmgzlatoedcsdeidpbhtmuovpiekifpimfnoamvlpqfxejsm
xmpgkccaykwfzpyuavtelwhrhmwkbbvgtguvtefjlodfefkvpxsgrsorvg
tajbsauhzrzalkwuowhgedefnswmrciwcpaaavogpdnfpktdbalsisurln
psjyeatcuceesohhdarkhwotikbroqrdfmzghgucebvgwcdqxgpbgqwlpb
daylooqdmuhbdqgmyweuik
(The ciphertext is stored under the name ocwy in the downloadable computer files (
bit.ly/2JbcS6p
). The plaintext is from The Adventure of the Dancing Men by Sir Arthur Conan Doyle.) 
The following was encrypted by the Vigenère method. Decrypt it. (The ciphertext is stored under the name xkju in the downloadable computer files (
bit.ly/2JbcS6p
).)xkjurowmllpxwznpimbvbqjcnowxpcchhvvfvsllfvxhazityxohulxqoj
axelxzxmyjaqfstsrulhhucdskbxknjqidallpqslluhiaqfpbpcidsvci
hwhwewthbtxrljnrsncihuvffuxvoukjljswmaqfvjwjsdyljogjxdboxa
jultucpzmpliwmlubzxvoodybafdskxgqfadshxnxehsaruojaqfpfkndh
saafvulluwtaqfrupwjrszxgpfutjqiynrxnyntwmhcukjfbirzsmehhsj
shyonddzzntzmplilrwnmwmlvuryonthuhabwnvw