Question : Which strategies to use for a program written in python?

Dear all,

Previously, I was trying to create an simple Python program to crack various encoded message fortunately with the help given and a beginner's luck in both areas.  I was able to crack the message in english language only and not other different languages.

After reading about various strategies on cracking Vigenere cipher. I was wondering whether did I used the "wrong" strategy, kappa test to approach this overwhleming challenge.

I hope by creating this question, I am able to get a better idea through your comments so that I can resolve the current issue of trying to load different language's freq. distribution text files.

Any comments on this would be great!!

Thanks.

Answer : Which strategies to use for a program written in python?

Hi Jon,
Please look at post  http://www.experts-exchange.com/Q_26328009.html, where I showed you how to read the frequency table of a language.

If you want to 'preset' all letters, which are not set in your frequency file to probability 0, then just do this before you read in the probabilities of your file.



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
import string
# python has already a variable containing all ascii upper case letters
all_uppercase_letters = string.ascii_uppercase
# python has also the variable string.uppercase, but this might vary 
# depending on your computer's local settings (language settings)

# create the lookup table ( dict ), 
#that shall contain the frequencies for all the letters in your file.
freq_table =  {}  # empty dict is {} / empty list is []
for letter in all_uppercase_letters:
    freq_table[letter] = 0  # set all letter frequencies by default to 0
Random Solutions  
 
programming4us programming4us