encryption - Arranging Vigenere Cipher into columns -
I understand as if you find a Vigenere cipher in the columns you can use index of coincidence to locate the key length for. I am struggling to write an algorithm that will take a piece of text and this arrangement in the column
For example - 1 2 3 4 5 6 7 8 9 10
The return will be if this period is 2 - 1,3,5,7,9 2,4,6,8,10
And test the IOC on each of these strings
IF duration is 3 - 1,4,7,10 2,5,8 3,6 9
and each of these strings Test IoC
etc. I have been building an IOC test 'but I am struggling to think of an algorithm to split the text into collumns, how much more sounds like a computer scientist and this way?
If you already know the key length, then it is very insignificant is. If you do not know the key length, then you have to guess it by entropy, here is an example in Python, for example:
If you_dont_know_key_length: key_length = find_key_length_by_entropy (cipher) columns = [cipher [I: key_length] for xrange (key_length)]
Any language should be originally created only (each n in the cifhertext) -th element selected)
Comments
Post a Comment