On the Caesar Cipher Breaking with Least Squares wiki page

Back to General discussions forum

rpenal     2020-04-15 21:30:04
User avatar

I don't know if maybe it's my error(if so, sorry), but I think i found an error in the letters distribution in the encrypted message:

The page give the values:

[2.8, 16.7, 2.8, 0, 2.8, 0, 2.8, 0, 16.7, 2.8, 5.6, 2.8, 5.6,

    0, 0, 11.1, 5.6, 0, 2.8, 0, 2.8, 8.3, 2.8, 0, 0, 0]

and I found the values:

[2.8, 16.7, 2.8, 0.0, 5.6, 0.0, 2.8, 0.0, 16.7, 2.8, 5.6, 2.8, 5.6, 

    0.0, 0.0, 11.1, 5.6, 0.0, 2.8, 0.0, 2.8, 11.1, 2.8, 0.0, 0.0, 0.0]

(The code I used is:

Data = input("Message = ")  
Message = Data.replace(" ", "")  
lenght = len(Message)  
for x in alphabet:  
    Count = Message.count(x)  
    Distribution = (Count/lenght)*100  
    Distrbs.append(round(Distribution,1))   
print(Distrbs)  

)

Please login and solve 5 problems to be able to post at forum