Question : Help on using PyGenere.py's functions

Dear all,

Currently I am trying to use this class, PyGenere.py found here and my main aim is to produce an GUI program which is very similar to the website given earlier with few improvements such as selecting text files on keywords, encrypted text and freq. distribution for each language.

For now, I need some help on using the methods found in PyGenere.py class.

I been trying to figure out on using it.. Here are the codes that I written..
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
from pygenere import *

plaintext = 'Attack from dawn.'
key = 'king10'
ciphertext = Vigenere(plaintext).encipher(key)
print "Actual text as followed. " + plaintext
print "Encrypted test using key word: king10 as followed. " + ciphertext
print "Decrypted text as followed. " + Vigenere(ciphertext).decipher(key)

print "Using VigCrack to display keyword: " + VigCrack(ciphertext).crack_codeword()
print "Showing the actual message: " + VigCrack(ciphertext).crack_message()


Here is the output..
>>>
Actual text as followed. Attack from dawn.
Encrypted test using key word: king10 as followed. Kbgggn pzbs hdgv.
Decrypted text as followed: Attack from dawn.
Using VigCrack to display keyword: ZBSNO
Showing the actual message: Laotso ohoe icoi.
>>>

And you can see the last two results is not what I expected.
It is supposed to be..
Using VigCrack to display keyword: king10
Showing the actual message: Attack from dawn.

Thanks

Answer : Help on using PyGenere.py's functions

I don't know the algorithm.

Did you try with a much longer text?
perhaps the text is just too short to be cracked.
Random Solutions  
 
programming4us programming4us