The next thing is the frequency per variable is now a list of Cuba's audio from the most frequent to
the least frequent letters, the first volume in each duopolies, an individual presenting the frequency
count, and the second value is a string containing the letters associated with that frequency.
Now, coming to creating a list of sorted letters, the last step of the get frequency order function
is to create a list of all the strings from the sorted list in the frequency pit.
So we want to end up with a single string values whose letters are in the order of the frequency.
So we don't need the integer values in the frequency, but the variable over here, that is the frequency
or the list starts as a blank list and the default on the next line up against the string at the index,
one of each tuple in the frequency pegged to the end of frequency or the list.
Now, over here, if we move on to the next block, that is calculating the frequency match score of
the message.
So after returning this, we come over here for defining the English frequency match score function,
which takes a string of message and then returns an integer between zero and 12 representing the strings
frequency school.
The higher the score, the more closely the little frequency and message SDR matches the frequency of
normal English text.
So the first step in calculating the frequency Mascord is to get the letter frequency ordering of message
by calling here, get frequency auto function.
OK, then restore the ordered string in the variable called frequency Oresteia.
Then we have the matched score SDR variable that starts at a zero and is incremented by the for loop
beginning on the next line, which compares the first six letters of the OR in string and the first
six letters of the frequency order.
Oresteia giving a point for each letter they have in common.
OK, so that is what we are doing over here.
They might go to zero zero for common to start in line before six letters.
If the common letter is in the frequency order this year, the first six letters incrementing.
Now if you just recall, the colon six is the same as zero colon six.
So the full six letters from it and the frequency of the strings represent respectively, if any of
those that edit or I.
N is also in the four six letters of frequency or the string, the condition on this particular line
will come through and increment them at school.
Similarly, the next lines over here, except in this case that check for the last six letters from
the on string, that is the weak excuse it are in the last six letters of the frequency of Aristos.
And if that was so much, then again your incrementing the value of Metzker.
OK then finally you're returning the value of Matsuko variable.
So we ignore the 14 letters in the middle of frequency order when calculating the frequency.
Matsuko frequency of these letters are too similar to each other to give some meaningful information.
So likewise we have returned the value of Matsuko to start over here.
And in this session we have also learned how to use this function to short list values in alphabetical
order, numerical order and how to use the rebels.
And the key of the key argument to start with the list values in different ways.
We have also learned how to convert the dictionary to list using the keys, values and items, dictionary
methods.
We have also learned that you can pass functions as values in the function codes.
OK, now in the next session we will be using this frequency analysis module and we will write in this
session to have the whole Viginia, for example.
So the next session that will be basically for over hacking the beginning and just will give you a reference
of how can you have the original Saiful?
Another or two methods exist to have the Virginia safe.
One method uses the brute force dictionary attack to try every word in a dictionary file as a beginner,
which works only if the key is an English word, such as something like that one or this the second
or the more sophisticated method which was used by the nineteenth century mathematician Charles Babbage.
Volks.
Even when the key is a random group of letters, something life like the v u w if or be in a V or something
like this.
So in the next session we would.
I don't program, which will be phone hacking, the Virginia Saiful using both the methods that we have
discussed.
One is the brute force dictionary attack.
Second is no sophisticated method which was developed in 19th century mathematician that this Charles
Babbage also with with all these topics, we will also be covering the dictionary attacks, the because
that is an examination, the calculating factor, also how to set data types and dissect functions and
how to use the extent to list methods.
Also the item to store product functions.
All this we would be covering in our hacking cipher session, which would be covered in the next session.
That's it from the session here.
We have seen how to create a frequency analysis for some most frequently used letters and frequently
used letters.
And using the same technique, we would move on with the next session.
Now, that's it from the session.
Thank you very much.