Now, this process of determining how this how frequently a letter appeals in a plain text in a ciphertext
is called frequency analysis, not understanding frequency analysis is an important step in hacking
the Virginia cipher.
So we will use the legal frequency analysis to break the Virginia cipher in the next session.
So in this particular session, we are going to cover the frequency of the letter frequency, the method
ski and the reverse method or the reverse keyword arguments.
Parsing functions has value.
Instead of calling the functions and converting dictionaries to list using the keys, values and items
matter.
So let's understand analyzing the frequency of letters in a text.
Now, when you flip a coin, about half the time it comes up heads and half the time it comes up as
sticks.
Now that is the frequency of heads and this should be about the same.
We can represent the frequency as a percentage by dividing the total number of lines and even by total
number of items at that particular event and then multiplying the quotient by one hundred so we can
learn much more about a coin from its frequency of hits and things, whether the coin is fair or unfairly
weighted or even if it has 200 points.
We can also learn much about the ciphertext from a frequency of its letters.
Like some letters in English, alphabets are used more often than others.
For example, the letters E all appear most frequently in the English words, whereas a little G excuse
it.
Appeals are less frequently in English.
So we'll use this differences in the letter frequencies in English language to connect the Virginia
encrypted messages.
Now we will see a graph.
Basically, you can have it when you can compile your other sources for the frequency analysis and then
you can sort those little frequencies in order to order of the greatest frequency to the least frequency,
for example.
OK, now C or likewise, the letters that appear most often a.D.A ciphertext and a simple substitution
ciphertext are more likely to have been encrypted from the most commonly found English letters like
80 or so.
Similarly, the letters that at least often in the ciphertext are more likely to have been encrypted
from excuser, for example, in the plain.
So if we come to some matching letter frequencies to find the letter frequencies in a message, we will
use an algorithm that simply Aldo's the letter in a string by the highest frequency to the lowest frequency.
Then the algorithm uses this ordered string to calculate what in this particular section is called Frequency
Match School, which we will use to determine how similar the strings letters frequency is to that of
the standard English.
So to calculate the frequency med school for the ciphertext, we start with zero and then add a point
each time.
One of the most frequently of frequent English letters at the CDC or ION appeals among the six most
frequent letters of the ciphertext, will also add a point to score each time one of the least frequency
letters like the V or appeals.
Among the six least frequency of frequent letters of the ciphertext, the frequency mathkour of a string
can range from zero to twelve.
Knowing the frequency, mascord of a ciphertext can reveal important information about the original
plaintext.
So, for example, if we go for using a frequency analysis on a Virginia Saiful, so to Harkavy Saiful
we need to decrypt the sub D individually.
That means we can't rely on using English word or detection because we won't be able to decrypt enough
of the message using just one subject.
Instead, we will decrypt the letters and repeat with one subject and preform frequency analysis to
determine which decrypted ciphertext produces a little frequency that most closely matches that of a
regular English.
In other words, we will need to find which decryption has the highest frequency.
Matsuko, which is a good indication that we have found the correct subject.
We repeat this process for the second, third, fourth, fifth suppy as well.
So just for now, we are just guessing that the Guilin this five letters because that are twenty six
descriptions for each subject.
So in a beginning for the computer only has to perform twenty six plus twenty six plus one plus one
is six and that is one fifty six decryption for the five letter.
Q So this is much easier than performing scriptures for every possible combinations which would be somewhere
around.
One one eight one three seven six or something like that, so all these are more steps to have the Saiful,
which we will learn in the next session, obviously.
But when we write the hacking program for now, let's write a module that will form a frequency analysis
using the following helpful function.
First is getting the letter count, which will take the string parameter and return a dictionary that
has a count of how often each letter appears in the string.
Second is get the frequency order, which takes a string parameter and returns a string of twenty six
letters order from most frequent or least frequent in the string parameter.
And finally, English frequency math score, which takes a string parameter undertones and integer from
zero to 12 indicating Alekos frequency match score.
So understanding the background of what frequency analysis will do in the next session.
Now we would start by creating the source code for matching little frequencies.
We would create a separate file for it.
And in that, after creating the file, we will also understand how the file has been created, which
will be helpful for us in the next session to know how much or what are other techniques of hacking
your original cipher also.
So we would see how writing a particular frequency analysis program in the next session.
That's from the session for now.
We will see in the next one.
Thank you very much.