I am writing a program that contains python code that will decode an English
message that was encoded using a Caesar cypher with a fixed
rotation length. It makes use of letter frequencies in
the English language to determine the rotation length.The program should also have some comments within your code to explain what confusing-looking code is doing. These comments should be directly above and indented evenly with the code it is explaining.
The output should look like this
linuxserver1.cs.umbc.edu[101] more code.txt
BJ YMJ UJTUQJ TK YMJ ZSNYJI XYFYJX, NS TWIJW YT KTWR F RTWJ UJWKJHY ZSNTS, JXYFGQNXM OZXYNHJ, NSXZWJ ITRJXYNH YWFSVZNQNYD, UWTANIJ KTW YMJ HTRRTS IJKJSXJ, UWTRTYJ YMJ LJSJWFQ BJQKFWJ, FSI XJHZWJ YMJ GQJXXNSLX TK QNGJWYD YT TZWXJQAJX FSI TZW UTXYJWNYD, IT TWIFNS FSI JXYFGQNXM YMNX HTSXYNYZYNTS KTW YMJ ZSNYJI XYFYJX TK FRJWNHF.
linuxserver1.cs.umbc.edu[102] python hw4.py < code.txt
WE THE PEOPLE OF THE UNITED STATES, IN ORDER TO FORM A MORE PERFECT UNION, ESTABLISH JUSTICE, INSURE DOMESTIC TRANQUILITY, PROVIDE FOR THE COMMON DEFENSE, PROMOTE THE GENERAL WELFARE, AND SECURE THE BLESSINGS OF LIBERTY TO OURSELVES AND OUR POSTERITY, DO ORDAIN AND ESTABLISH THIS CONSTITUTION FOR THE UNITED STATES OF AMERICA.
linuxserver1.cs.umbc.edu[103]
Iam just little bit confuse on how to start and i need some help.
Here are the English frequencies for each letter :
a 8.167%
b 1.492%
c 2.782%
d 4.253%
e 12.702%
f 2.228%
g 2.015%
h 6.094%
i 6.966%
j 0.153%
k 0.772%
l 4.025%
m 2.406%
n 6.749%
o 7.507%
p 1.929%
q 0.095%
r 5.987%
s 6.327%
t 9.056%
u 2.758%
v 0.978%
w 2.360%
x 0.150%
y 1.974%
z 0.074%
Hints:
Make use of the fact that 'E' is the most frequently used letter in English.
Notice that the next most-frequent letter, 'T', occurs significantly less often.
The problem is i can do it on java but not python and i just started