1 00:00:00,330 --> 00:00:07,890 So if we go back to our program now, here, you can see we are using four six year staff in the range 2 00:00:08,190 --> 00:00:14,700 line of the afine cipher, Dumbledore's symbolistic the double multiplied by two, OK. 3 00:00:14,820 --> 00:00:21,930 So in this, if you know that there are almost a length of the finci for the simplest possible integers 4 00:00:22,140 --> 00:00:28,680 for key and the length of a finci for the model, Symbolistic returns as a possible integer for Key 5 00:00:28,740 --> 00:00:29,210 Beevor. 6 00:00:29,640 --> 00:00:35,940 Now to get the entire range of the possible keys, we multiply these values together because we are 7 00:00:35,940 --> 00:00:37,970 multiplying the same value by itself. 8 00:00:37,980 --> 00:00:43,890 We can use the double exponential operator in explanation length in the package of fine for the model 9 00:00:43,890 --> 00:00:45,470 symbol double multiplied two. 10 00:00:45,820 --> 00:00:49,890 Now after that we call the gatekeeper function over here. 11 00:00:50,350 --> 00:00:51,150 If you look at. 12 00:00:53,940 --> 00:00:59,860 And that we have used in our finci for them now to split a single individual into two individuals. 13 00:01:00,060 --> 00:01:05,860 So in this example, we're using a function to get even part of VR testing. 14 00:01:06,150 --> 00:01:12,150 Now, Ricola, the return value of this function call is a couple of the integers, one for A1 and one 15 00:01:12,150 --> 00:01:13,160 for B1. 16 00:01:13,530 --> 00:01:21,960 So here then we are storing the value of the Dupas first integer in A1 by placing it. 17 00:01:22,150 --> 00:01:25,420 That is zero, which is the first of the values. 18 00:01:25,540 --> 00:01:31,890 OK, so for example, if we say a fine site for the model gatekeeper's jarring bracket ATSDR zero, 19 00:01:32,160 --> 00:01:34,280 it evaluates to the tuple of the index. 20 00:01:34,470 --> 00:01:39,720 So 42 to zero, which is divided into 42, the value of the index zero. 21 00:01:40,080 --> 00:01:47,220 So this just gets the key A1 part of the return value and stores that in the variable give and key one 22 00:01:47,220 --> 00:01:54,760 part is ignored because we don't need we want to calculate whether even as valid now for the afine cipher. 23 00:01:54,810 --> 00:01:58,770 And if it does not, the program continues for the next key to trial. 24 00:01:59,100 --> 00:02:03,930 Now to understand how the execution moves back to the start of the loop, you need to learn about the 25 00:02:03,930 --> 00:02:09,330 continuous succumbing to the continuous statement, which is basically using the continual key word 26 00:02:09,330 --> 00:02:10,040 by itself. 27 00:02:10,290 --> 00:02:12,200 And it takes no parameter. 28 00:02:12,540 --> 00:02:18,450 We use a continuous statement inside of a loop, and when a continuous statement executes a program, 29 00:02:18,450 --> 00:02:23,100 execution immediately jumps from the start of the loop for the next iteration. 30 00:02:23,280 --> 00:02:28,500 Now, this also happens when the program execution's reaches the end of the loops block. 31 00:02:28,830 --> 00:02:34,650 What a continuous statement makes the program execution jump back to the start of the loop before it 32 00:02:34,650 --> 00:02:35,880 reaches the end of the loop. 33 00:02:36,300 --> 00:02:39,210 Now look at more about this continuous statement. 34 00:02:39,570 --> 00:02:42,030 Let's go back here in the interactive shell. 35 00:02:42,030 --> 00:02:47,400 And here we would create say, for Ivan in the range, say three. 36 00:02:47,910 --> 00:02:52,620 OK, here we are seeing print command for Ivan. 37 00:02:52,890 --> 00:02:56,610 We are giving here a print see by. 38 00:02:59,730 --> 00:03:02,470 So he'll never get zero by one python to Python. 39 00:03:02,850 --> 00:03:10,740 Now, in this case, the for loop loop through the range object and the value in Iven becomes each integer 40 00:03:10,740 --> 00:03:13,270 from zero, but not including three. 41 00:03:13,620 --> 00:03:18,900 So on each iteration, it will print Python function calls display Python on the screen. 42 00:03:19,440 --> 00:03:25,320 Now contrast that for a loop with the next example, which we will see, except it has a continuous 43 00:03:25,320 --> 00:03:26,640 statement before the print. 44 00:03:27,000 --> 00:03:34,920 So over here we would write down again, say for Iven in range, three remains, same print. 45 00:03:35,050 --> 00:03:37,700 Even here we see continue. 46 00:03:38,220 --> 00:03:40,020 Then we give print. 47 00:03:43,150 --> 00:03:44,770 S. Biton. 48 00:03:45,760 --> 00:03:53,350 OK, and now we end it, so now we get just zero one and two Prender, notice that Bipin never gets 49 00:03:53,350 --> 00:03:59,020 printed because the continual statement causes a problem execution to jump back to the start of the 50 00:03:59,020 --> 00:04:01,210 for loop for the next iteration. 51 00:04:01,420 --> 00:04:04,730 And the execution never reaches the print python line. 52 00:04:05,140 --> 00:04:11,080 The continual statement is often placed inside, and if statements look so that the execution continues 53 00:04:11,080 --> 00:04:13,600 at the beginning of the loop under certain conditions. 54 00:04:14,050 --> 00:04:19,660 Now let us return to our call and see how it uses the continual statement to skip execution, depending 55 00:04:19,660 --> 00:04:20,620 on the key. 56 00:04:21,100 --> 00:04:28,990 So if we go back to our demo in this old school, you have seen that we are using the GCD function in 57 00:04:28,990 --> 00:04:33,990 the Cryptome at one module to determine whether Key even is relatively primed with the symbols set. 58 00:04:34,660 --> 00:04:39,610 Now, recall that two numbers are relatively bright if there is one. 59 00:04:39,880 --> 00:04:45,610 So if GI, A1 and the symbols that size are not relatively prime, the condition on this particular 60 00:04:45,610 --> 00:04:48,900 line is true and the continual statement executes. 61 00:04:48,920 --> 00:04:54,130 Now this causes the program execution to jump back to the start of the loop for the next iteration. 62 00:04:54,520 --> 00:05:01,930 So as a result of this, the program skips the call to the decrypt method Asgeir function if the key 63 00:05:01,930 --> 00:05:06,400 is invalid and continues to try another key until it finds the right one. 64 00:05:06,850 --> 00:05:12,670 Now, when the program finds the right message is decrypted by calling the decrypt message Istria with 65 00:05:12,670 --> 00:05:18,030 the key on the given line over here where we are passing the key and the message. 66 00:05:18,120 --> 00:05:24,730 OK, now, if Silent Mode was set to force the right key messages printed on the screen, but if it 67 00:05:24,730 --> 00:05:27,400 was said to true print, call is skipped. 68 00:05:27,730 --> 00:05:30,940 Next, we use the is English a function over here? 69 00:05:31,270 --> 00:05:38,710 And we check from the other file that the English module to check whether the decrypted message is recognized 70 00:05:38,710 --> 00:05:39,390 as English. 71 00:05:39,940 --> 00:05:46,270 So if a wrong decryption key was used, the decrypted message would look like a random characters and 72 00:05:46,270 --> 00:05:48,790 this is English check would return false. 73 00:05:49,120 --> 00:05:55,350 But if the decrypted message is recognized as readable English, the program displays it to the user. 74 00:05:55,570 --> 00:06:01,580 So we are displaying a snippet of the decrypted message that is recognized as English because is English 75 00:06:01,580 --> 00:06:06,950 check function might mistakenly identify text as English, even though it hasn't found the correct. 76 00:06:07,390 --> 00:06:13,570 So if the user decides that they are indeed the correct description, they can type D or they can press. 77 00:06:13,590 --> 00:06:17,180 And so we are giving those options over here for the user. 78 00:06:17,560 --> 00:06:24,430 Otherwise, the user just press enter to return to the blank screen or string from the input call and 79 00:06:24,430 --> 00:06:30,220 they have find again continues trying merkies not from the indentation of the beginning. 80 00:06:30,220 --> 00:06:35,200 We can see that we have executed the for loop which has completed over here. 81 00:06:35,950 --> 00:06:43,810 When we use this written statement, do this, the for loop is still continuing, so the for loop finishes 82 00:06:43,810 --> 00:06:45,550 and reaches this return line. 83 00:06:45,850 --> 00:06:51,200 Then it has gone through every possible decryption key without finding the correct one. 84 00:06:51,460 --> 00:06:58,870 So at this point, the Hackel a fine function returns the non-value to this signal that it was unsuccessful 85 00:06:58,870 --> 00:07:00,230 attacking the ciphertext. 86 00:07:00,550 --> 00:07:06,280 Now if the program had found the correct execution would have previously returned from the function 87 00:07:06,460 --> 00:07:09,440 I never reached until this written statement over here. 88 00:07:09,790 --> 00:07:12,490 Now, after this written statement, what are we doing? 89 00:07:12,490 --> 00:07:13,750 Is as normal. 90 00:07:13,840 --> 00:07:20,440 We are running the program with the special underscore, underscore name, underscore variable that 91 00:07:20,440 --> 00:07:24,590 will be set to the string mean instead of the program name. 92 00:07:24,670 --> 00:07:26,870 So in this case, we call the main function. 93 00:07:27,130 --> 00:07:31,000 So that is how we conclude the Afine Saiful hacking program. 94 00:07:31,360 --> 00:07:32,260 Thank you very much.