1 00:00:00,180 --> 00:00:07,290 The next thing is the frequency per variable is now a list of Cuba's audio from the most frequent to 2 00:00:07,290 --> 00:00:13,170 the least frequent letters, the first volume in each duopolies, an individual presenting the frequency 3 00:00:13,170 --> 00:00:18,550 count, and the second value is a string containing the letters associated with that frequency. 4 00:00:19,230 --> 00:00:26,040 Now, coming to creating a list of sorted letters, the last step of the get frequency order function 5 00:00:26,040 --> 00:00:30,740 is to create a list of all the strings from the sorted list in the frequency pit. 6 00:00:30,900 --> 00:00:36,960 So we want to end up with a single string values whose letters are in the order of the frequency. 7 00:00:37,200 --> 00:00:43,230 So we don't need the integer values in the frequency, but the variable over here, that is the frequency 8 00:00:43,230 --> 00:00:50,460 or the list starts as a blank list and the default on the next line up against the string at the index, 9 00:00:50,460 --> 00:00:55,740 one of each tuple in the frequency pegged to the end of frequency or the list. 10 00:00:56,100 --> 00:01:03,960 Now, over here, if we move on to the next block, that is calculating the frequency match score of 11 00:01:03,960 --> 00:01:04,850 the message. 12 00:01:05,100 --> 00:01:11,220 So after returning this, we come over here for defining the English frequency match score function, 13 00:01:11,430 --> 00:01:19,170 which takes a string of message and then returns an integer between zero and 12 representing the strings 14 00:01:19,440 --> 00:01:20,770 frequency school. 15 00:01:21,090 --> 00:01:27,630 The higher the score, the more closely the little frequency and message SDR matches the frequency of 16 00:01:27,630 --> 00:01:28,800 normal English text. 17 00:01:29,040 --> 00:01:35,760 So the first step in calculating the frequency Mascord is to get the letter frequency ordering of message 18 00:01:36,120 --> 00:01:39,160 by calling here, get frequency auto function. 19 00:01:39,480 --> 00:01:44,950 OK, then restore the ordered string in the variable called frequency Oresteia. 20 00:01:45,960 --> 00:01:55,050 Then we have the matched score SDR variable that starts at a zero and is incremented by the for loop 21 00:01:55,050 --> 00:02:02,910 beginning on the next line, which compares the first six letters of the OR in string and the first 22 00:02:02,910 --> 00:02:05,080 six letters of the frequency order. 23 00:02:05,130 --> 00:02:09,470 Oresteia giving a point for each letter they have in common. 24 00:02:09,870 --> 00:02:12,450 OK, so that is what we are doing over here. 25 00:02:12,750 --> 00:02:18,570 They might go to zero zero for common to start in line before six letters. 26 00:02:18,900 --> 00:02:24,210 If the common letter is in the frequency order this year, the first six letters incrementing. 27 00:02:24,720 --> 00:02:30,560 Now if you just recall, the colon six is the same as zero colon six. 28 00:02:30,990 --> 00:02:38,220 So the full six letters from it and the frequency of the strings represent respectively, if any of 29 00:02:38,430 --> 00:02:40,020 those that edit or I. 30 00:02:40,030 --> 00:02:45,930 N is also in the four six letters of frequency or the string, the condition on this particular line 31 00:02:45,930 --> 00:02:49,350 will come through and increment them at school. 32 00:02:49,710 --> 00:02:55,980 Similarly, the next lines over here, except in this case that check for the last six letters from 33 00:02:55,980 --> 00:03:03,590 the on string, that is the weak excuse it are in the last six letters of the frequency of Aristos. 34 00:03:04,080 --> 00:03:08,360 And if that was so much, then again your incrementing the value of Metzker. 35 00:03:08,670 --> 00:03:12,090 OK then finally you're returning the value of Matsuko variable. 36 00:03:12,330 --> 00:03:18,090 So we ignore the 14 letters in the middle of frequency order when calculating the frequency. 37 00:03:18,090 --> 00:03:24,680 Matsuko frequency of these letters are too similar to each other to give some meaningful information. 38 00:03:25,170 --> 00:03:29,250 So likewise we have returned the value of Matsuko to start over here. 39 00:03:29,400 --> 00:03:36,630 And in this session we have also learned how to use this function to short list values in alphabetical 40 00:03:36,630 --> 00:03:40,140 order, numerical order and how to use the rebels. 41 00:03:40,140 --> 00:03:45,690 And the key of the key argument to start with the list values in different ways. 42 00:03:45,990 --> 00:03:53,280 We have also learned how to convert the dictionary to list using the keys, values and items, dictionary 43 00:03:53,280 --> 00:03:53,850 methods. 44 00:03:54,450 --> 00:04:00,220 We have also learned that you can pass functions as values in the function codes. 45 00:04:00,570 --> 00:04:07,800 OK, now in the next session we will be using this frequency analysis module and we will write in this 46 00:04:07,830 --> 00:04:11,820 session to have the whole Viginia, for example. 47 00:04:12,330 --> 00:04:18,900 So the next session that will be basically for over hacking the beginning and just will give you a reference 48 00:04:18,900 --> 00:04:21,220 of how can you have the original Saiful? 49 00:04:21,400 --> 00:04:25,440 Another or two methods exist to have the Virginia safe. 50 00:04:25,770 --> 00:04:33,180 One method uses the brute force dictionary attack to try every word in a dictionary file as a beginner, 51 00:04:33,870 --> 00:04:41,160 which works only if the key is an English word, such as something like that one or this the second 52 00:04:41,160 --> 00:04:47,850 or the more sophisticated method which was used by the nineteenth century mathematician Charles Babbage. 53 00:04:48,120 --> 00:04:48,660 Volks. 54 00:04:48,660 --> 00:04:57,300 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 55 00:04:57,300 --> 00:04:57,740 like this. 56 00:04:58,080 --> 00:04:59,880 So in the next session we would. 57 00:04:59,970 --> 00:05:06,660 I don't program, which will be phone hacking, the Virginia Saiful using both the methods that we have 58 00:05:06,690 --> 00:05:07,320 discussed. 59 00:05:07,530 --> 00:05:09,620 One is the brute force dictionary attack. 60 00:05:09,840 --> 00:05:17,310 Second is no sophisticated method which was developed in 19th century mathematician that this Charles 61 00:05:17,310 --> 00:05:24,190 Babbage also with with all these topics, we will also be covering the dictionary attacks, the because 62 00:05:24,210 --> 00:05:31,800 that is an examination, the calculating factor, also how to set data types and dissect functions and 63 00:05:32,040 --> 00:05:34,430 how to use the extent to list methods. 64 00:05:34,680 --> 00:05:37,980 Also the item to store product functions. 65 00:05:38,220 --> 00:05:44,590 All this we would be covering in our hacking cipher session, which would be covered in the next session. 66 00:05:44,730 --> 00:05:46,760 That's it from the session here. 67 00:05:46,770 --> 00:05:54,390 We have seen how to create a frequency analysis for some most frequently used letters and frequently 68 00:05:54,390 --> 00:05:55,110 used letters. 69 00:05:55,440 --> 00:05:58,530 And using the same technique, we would move on with the next session. 70 00:05:58,570 --> 00:06:00,420 Now, that's it from the session. 71 00:06:00,450 --> 00:06:01,380 Thank you very much.