Now, let us try and execute this Virginia hacker first, and then we would understand the program that
we have written.
So if we run this particular module, we get the results checked by multiple keys.
And which is what you think that this is the other thing that you have the encrypted text would be looking
like after decryption, you can trace their.
And so we'll have to run this again.
We have made some error in entering the details, so this is all we get decrypted message.
Now, if we understand this particular demo, the first thing that we are doing is importing modules
and setting up the main function.
So the source code in our VIGENIN hacking program, we import many different modules, including a new
module that is named ITER Tools here, which we will see just about after we complete this particular
session.
Now, in addition to this, we have set up several constants on this particular program, which we would
be learning about those in a few moment.
And in the main function of the hacking program, which is similar to our previous hacking programs
that we have done.
Now, if you'll see this ciphertext is passed on to the hack Virginia function over here, which either
returns the decrypted string if they had successful or non-value if the hack fails.
So if successful, the program princi hacked message to the screen and copies it to the clipboard.
Now we move on to finding the repeater sequences.
So we have here the next function that is find repeat sequences space's function.
Now, this accomplishes the fourth step of our kazatsky examination by locating all the repeater sequences
of letters in the message string and counting the spaces between the sequences.
And then we convert the given message to uppercase using this method here and remove any known little
characters from message using the sub function, which is a regular expression method.
Then we have this Acuil Space's, which is a dictionary that holds repeated sequence string as its key
and the list with integers representing the number of letters between all the occurrences of that sequence
and its values.
So the for loop after which checks whether each sequence repeats by finding the sequences in the message.
That is the length of the message and calculating the spaces between the repeated sequences.
That is all about our default loop that we have in this particular function, not on the first iteration
of the loop.
The Goldfine sequences that are exactly three characters long and on the next iteration it finds the
sequences exactly four letters long and then five letters long.
So you can change what sequence length the code searches by modifying the range, say three comma six.
However, finding repeated sequences of letters three, four, five seems to work for most of the ciphertext.
The reason is that these are long enough that repeats are unlikely to be found and the sequence length
of the for loop is currently checking a stone in situ alien variable.
Now if we go ahead, we see we have here the for loop inside the another for loop, then set the variable
AI to be the index of every possible sequence of length.
That is a secure line in the message.
And these indexes start at these Ezekial Start plus the length, which is the last index where the sequence
of length can be found.
So for example, if the message was particularly found, I'd say the sequence was 11 and the sequence
length was three.
Then you would have the execute to survive.
And for example, the follow up would begin looking at the message starting from, again, index number
fourteen.
Now, if we just move ahead, we have the next step.
That is we are checking over here.
If sequence, not in the sequence spacing, then sequence spacing at the index of sequence is equal
to blank and saying sequence spacing and the next subsequent start up.
And so over here we basically check whether the sequence variable exists as a key in the sequence missing.
And if not, then sequence spacing sequence is the set as the key with the blacklist and its values
and number of letters between the sequences and the message I call Michael and I plus sequence length
and the original sequence.
That message is simply ie minus the sequence start.
So notice that I am the sequence start at the beginning in the axis before the call is so the integer
that I'm minus sequence starts evaluate two is the number of letters between the two sequences which
we open to the list stored in sequence spacing at the index of sequence.
Now when all these four loops have finished, the sequence spacing dictionary should contain every repeat
the sequence of the length of three, four and five, as well as number of letters between the repeated
sequences.
So the sequence spacing dictionary is written from the particular function find.
Repeat sequence, specific function.
So once we do this written statement, we end this function and now that we have seen how the program
performs the full step of the Kosofsky examination by finding the repeated sequences in the ciphertext
and then counting the number of letters between them.