1 00:00:00,580 --> 00:00:06,760 Now, here we have already written the program because it is a very big demo, we would be understanding 2 00:00:06,760 --> 00:00:08,410 what the demo is all about. 3 00:00:09,130 --> 00:00:17,170 So over here we have started with the import statement of AI tattoos and E then we are importing our 4 00:00:17,200 --> 00:00:18,790 also created programs. 5 00:00:18,790 --> 00:00:25,440 That is Virginia's AI for the month then of a paperclip frequency analysis and check English. 6 00:00:26,080 --> 00:00:32,590 Now, once we have imported all, we start by creating the little star and giving all the alphabets 7 00:00:32,590 --> 00:00:34,000 in the capital letter. 8 00:00:34,390 --> 00:00:39,280 Then we have here a silent mode created which is initialized to false. 9 00:00:39,850 --> 00:00:42,370 Now it is said to be true. 10 00:00:42,520 --> 00:00:44,430 Then the program doesn't print anything. 11 00:00:44,440 --> 00:00:48,010 Hence we have such to do for this second or third one. 12 00:00:48,010 --> 00:00:55,920 We have NOM most frequency letters which is set to form and this is just attempt this many letters because 13 00:00:56,230 --> 00:00:58,120 that is what we are trying to see here. 14 00:00:58,900 --> 00:01:05,770 Next is we have the max length which is said to 16 that is will not attempt give longer than this. 15 00:01:06,310 --> 00:01:13,050 And the known little pattern here we are using our to compile and capital Aitel Zet. 16 00:01:13,570 --> 00:01:16,960 Then we start by defining our main method here. 17 00:01:17,420 --> 00:01:23,140 OK, so inside the main method, we have first of all, taken the ciphertext in the decrypted format. 18 00:01:23,530 --> 00:01:28,270 Then we have taken the hacked message as we are ready and we are calling the Hack Virginia function, 19 00:01:28,570 --> 00:01:32,240 which we will be creating below and parsing the same ciphertext. 20 00:01:32,800 --> 00:01:36,820 Then we say if you're hacked, message a star is not equal to none. 21 00:01:37,210 --> 00:01:44,050 You print copying message to print the value of hacked message and then use Paperclip to copy the value 22 00:01:44,050 --> 00:01:45,100 of hacked message. 23 00:01:45,100 --> 00:01:50,770 Acedia is if it is equal to none, then you fail to hack the encryption. 24 00:01:51,430 --> 00:01:54,010 Now that's it from your main function. 25 00:01:54,220 --> 00:02:00,630 If you look at other functions that we have created, out of which the first is fine, the repeat sequence, 26 00:02:00,640 --> 00:02:01,580 basic function. 27 00:02:01,960 --> 00:02:08,620 Now this goes through the message and finds any three to five letter sequences which are repeated. 28 00:02:08,830 --> 00:02:14,320 It returns a dictionary with the key of the sequence and the values of the list of spacing. 29 00:02:14,710 --> 00:02:17,310 That is number of letters between repeats. 30 00:02:18,040 --> 00:02:23,640 Now here we will be using a regular expression to remove the known letters from the message. 31 00:02:23,890 --> 00:02:31,150 So first thing that we are doing over here is creating an object of message and passing on letters underscore 32 00:02:31,150 --> 00:02:34,300 pattern, lots of blank and message talkable. 33 00:02:34,690 --> 00:02:41,590 Then we have sequence spacing created which basically compile a list of your sequence length of letters 34 00:02:41,590 --> 00:02:43,930 sequences found in the message. 35 00:02:44,140 --> 00:02:51,380 So these basically are your keys are sequences and values of the list in spacing then mirana for loop 36 00:02:51,380 --> 00:02:58,780 for sequence length in the range of three to six, then you start the sequence, start in the range 37 00:02:58,780 --> 00:03:04,330 of the length of message minus sequence length and you determine what sequence is and stored in the 38 00:03:04,540 --> 00:03:06,590 value of sequence over here. 39 00:03:07,270 --> 00:03:14,530 You OK then you look for this sequence in the rest of the message by using this for loop here. 40 00:03:14,830 --> 00:03:20,650 That is for I in the range of sequence start plus the length comma length of the message minus the sequence 41 00:03:20,650 --> 00:03:27,490 length and then check if message in the index of I call and I play sequence lend is equal to one, which 42 00:03:27,490 --> 00:03:29,410 means found the repeated sequence there. 43 00:03:29,890 --> 00:03:35,950 Then you see if sequence not in this sequence spacing you initialize the Blankley's by giving sequence 44 00:03:35,950 --> 00:03:43,630 spacing at the index of sequence is equal to black after which you are upending the spacing between 45 00:03:43,630 --> 00:03:49,030 the distance, between the repeated sequence and the original sequence by saying the sequence spacing 46 00:03:49,030 --> 00:03:56,020 at the index of sequence got up and I minus the sequence start and finally you return the value of sequence 47 00:03:56,050 --> 00:03:56,440 missing. 48 00:03:57,040 --> 00:04:03,390 The next useful function over is get useful factors passing that parameters. 49 00:04:04,240 --> 00:04:11,850 Now this returns a list of useful factors by num by useful remain factors less than the Max Garland 50 00:04:11,890 --> 00:04:14,650 plus one and not one, for example. 51 00:04:14,830 --> 00:04:16,150 So get useful factors. 52 00:04:16,150 --> 00:04:21,370 If you pass one forty four it will it should return Z two, three, four, six, eight, nine, twelve, 53 00:04:21,370 --> 00:04:22,680 sixteen, something like that. 54 00:04:23,260 --> 00:04:26,320 So inside this function we are force checking. 55 00:04:26,320 --> 00:04:30,490 If the value of NUM is less than two, then we return blank. 56 00:04:30,510 --> 00:04:33,000 So no less than to have no useful factors. 57 00:04:33,010 --> 00:04:36,400 Hence just return the blank values there. 58 00:04:36,670 --> 00:04:41,810 Then you say factors is equal to that in the list of factors is found now. 59 00:04:41,810 --> 00:04:46,900 When finding factors, you only need to check the individuals up to the Max Guillain. 60 00:04:46,900 --> 00:04:53,560 So hensman unaffordable you're saying for I in the range of two to the Max Garland plus one that is 61 00:04:53,560 --> 00:04:54,520 don't test one. 62 00:04:54,520 --> 00:04:59,110 It is not useful to start from the two we check here if. 63 00:05:00,470 --> 00:05:08,240 This has to be below, so then we check here that if no, Modelo is equal to zero, we are seeing factors 64 00:05:08,240 --> 00:05:13,670 that appen and other factors is equal to convert to in the value of num divide by. 65 00:05:14,120 --> 00:05:19,500 And if other factors is lower than the Max Skillern plus one another factor not equal to one, you're 66 00:05:19,520 --> 00:05:21,180 upending the valuable factors. 67 00:05:21,620 --> 00:05:24,080 And finally, you're seeing red on the list. 68 00:05:24,080 --> 00:05:26,150 That is, remove the duplicate factors. 69 00:05:26,600 --> 00:05:33,680 The next function in the particular metal or the file we have is get the item at index one, which is 70 00:05:33,680 --> 00:05:40,940 just returning the items at the index one because items this past year as the parameter, then we have 71 00:05:41,210 --> 00:05:46,310 get the most common factors, which is taking a parameter sequence factors. 72 00:05:46,610 --> 00:05:47,390 Not in this. 73 00:05:47,390 --> 00:05:52,160 The first we will get a count of how many times a factor occurs in the sequence factor. 74 00:05:52,520 --> 00:05:56,750 Hence we have de facto counts, which is initialized to Blacula. 75 00:05:57,260 --> 00:05:59,650 That is value is how often it occurs. 76 00:06:00,020 --> 00:06:02,720 So here we see the sequence factors. 77 00:06:02,730 --> 00:06:08,420 These are sequences, values, a list of the factors, the spacing sequence factors has a value like 78 00:06:08,440 --> 00:06:13,730 the gift you should have two, three, four, six, nine, 12, something like that, or LW should have 79 00:06:13,730 --> 00:06:14,790 some different values. 80 00:06:14,960 --> 00:06:18,740 So here we run the four four sequence and sequence factors. 81 00:06:19,750 --> 00:06:22,720 The list is equal to the sequence factor, to the index of sequence. 82 00:06:23,180 --> 00:06:28,790 Then we run another formula for factor in the factor list and check of the factor is not in the factor. 83 00:06:28,790 --> 00:06:36,560 Count your initialize it to zero and incremented by one and then create factors by count, which is 84 00:06:36,680 --> 00:06:37,960 equal to blank. 85 00:06:38,300 --> 00:06:43,730 Now here we should put the factor on its count and what people and make a list of this tuple so that 86 00:06:43,730 --> 00:06:44,750 we can sort them. 87 00:06:44,990 --> 00:06:48,710 Hence we are creating a war hero pupil for the next. 88 00:06:48,710 --> 00:06:52,310 We create another for loop saying for fact that in fact counts. 89 00:06:52,580 --> 00:06:58,190 We exclude the factors which are larger than the max skill and hence we the effectiveness less than 90 00:06:58,190 --> 00:07:02,180 the max skillet, then we are saying to appendix. 91 00:07:02,180 --> 00:07:08,150 So the factors by count is the list of Dupas and the factor by account has the values like the three 92 00:07:08,480 --> 00:07:13,370 four, ninety seven or Tecoma forty seven, something like that, by using the append. 93 00:07:14,570 --> 00:07:21,680 Then finally we say so the list by the fact, the count by saying factors by counterassault saying is 94 00:07:21,680 --> 00:07:25,610 equal to the get items at index one and rouble's equals two two. 95 00:07:25,880 --> 00:07:29,600 Similarly then you will have to return the value of factors by count. 96 00:07:30,230 --> 00:07:34,130 Now after this we come to our main definition of the function. 97 00:07:34,130 --> 00:07:41,270 That is your definition for the examination function, which takes ciphertext as the parameter. 98 00:07:41,510 --> 00:07:48,920 And here we find out the sequences of three to five letters that occur multiple times in the ciphertext. 99 00:07:49,130 --> 00:07:55,670 So they repeat the sequence spacing has a value like something C X is one nine two two or three three 100 00:07:55,670 --> 00:07:57,830 three nine nine seven to do something like that. 101 00:07:58,130 --> 00:08:04,160 So first thing we do over here is we take the repeated sequence spacing and that is equal to we call 102 00:08:04,370 --> 00:08:10,590 the function, find the sequence spacing function, then you can see that get most common factors, 103 00:08:10,590 --> 00:08:16,490 sort of description of sequence factors which we are defining, executing a four four sequence in the 104 00:08:16,490 --> 00:08:20,120 repeat of sequence spacing and add the values to it. 105 00:08:20,630 --> 00:08:24,350 Then finally to see the get most common factors. 106 00:08:24,690 --> 00:08:26,750 Your description for the factors. 107 00:08:26,750 --> 00:08:33,290 By count, we are taking your factors by count equal to get most common factors in the bracket. 108 00:08:33,290 --> 00:08:35,360 We pass the parameters of sequence factors. 109 00:08:35,930 --> 00:08:43,280 Now we extract the fact accounts from the factors by count and put them all lightly, give length so 110 00:08:43,280 --> 00:08:45,080 that they are easy to use later. 111 00:08:45,080 --> 00:08:52,070 Hence we are creating this blank all likely killens, which is nothing but an created value then. 112 00:08:52,370 --> 00:08:54,740 And in that, what are we trying to append? 113 00:08:54,740 --> 00:09:01,520 We say here for doing tuple and factors by count your opinion, the value in all likelihood, Yealands 114 00:09:01,730 --> 00:09:01,930 OK. 115 00:09:02,000 --> 00:09:08,630 And finally you're returning the same unlikely, likely killens from the method, this ASCII examination 116 00:09:08,630 --> 00:09:09,230 function.