1 00:00:00,330 --> 00:00:06,980 Then we construct a full beginner with indexes, which takes the value of one pupil created by the item 2 00:00:06,990 --> 00:00:13,260 to relax on each iteration of key starts as a blank string and the for loop iterate. 3 00:00:13,260 --> 00:00:20,580 So the individuals from zero up to but not including the most likely killing the Woodhill for each duplicate 4 00:00:20,580 --> 00:00:21,260 constructor. 5 00:00:22,050 --> 00:00:30,600 Now as the eye variable, now as the variable changes for each iteration for the for loop, the loop 6 00:00:30,600 --> 00:00:36,570 and the indexes and the index eye is the index of people we want to use in all frequency score which 7 00:00:36,570 --> 00:00:37,200 is over here. 8 00:00:37,530 --> 00:00:44,390 So this is why the all frequency, cause I add the indexes, i.e. returns or evaluates the correctable 9 00:00:44,450 --> 00:00:50,460 we want, when we want or when we have the correctible we need to access index zero at the tuple to 10 00:00:50,460 --> 00:00:51,000 get this up. 11 00:00:51,780 --> 00:00:58,680 Now, if the silent mode over here is false, then it is the key that was created by the for loop on 12 00:00:58,680 --> 00:01:00,850 this particular line in the print statement. 13 00:01:01,350 --> 00:01:07,080 Now that we have a complete beginner key to decrypt these ciphertext and check whether the decrypted 14 00:01:07,080 --> 00:01:12,750 text is readable English, if it is the program principal the screen for the user to confirm that it 15 00:01:12,750 --> 00:01:16,550 is in English to check for the false positives. 16 00:01:16,770 --> 00:01:21,850 So then we have the printing, the decrypted text with the correct casing. 17 00:01:22,290 --> 00:01:27,000 So over here, because the decrypted text that we are getting here is in the uppercase. 18 00:01:27,300 --> 00:01:32,850 We build a new string by opening and uppercase lowercase form of letters in the decrypted text to the 19 00:01:32,850 --> 00:01:34,190 original case list. 20 00:01:34,710 --> 00:01:42,390 So if we just see this particular program, default loop over here goes through the each of the indexes 21 00:01:42,390 --> 00:01:48,510 in the ciphertext string, which unlikely ciphertext up has an original casing of the ciphertext. 22 00:01:48,750 --> 00:01:55,200 And if the ciphertext at the index using the uppercase, then the uppercase form of the decrypted text 23 00:01:55,200 --> 00:01:56,010 is upended. 24 00:01:56,310 --> 00:01:57,180 Otherwise I. 25 00:01:57,180 --> 00:01:59,710 Lorqess form of the decrypted text is appended. 26 00:02:00,030 --> 00:02:06,600 So the list in the original case is then joined on to become a new value when the decrypted text. 27 00:02:06,930 --> 00:02:12,120 So the next line of the code brings the decryption output to the user could check whether the key has 28 00:02:12,120 --> 00:02:13,060 been found. 29 00:02:13,260 --> 00:02:19,160 So we are giving this print commands to the user next, which is basically printing the correctly based 30 00:02:19,260 --> 00:02:23,550 decrypted text is printed on the screen for user to confirm it is English. 31 00:02:23,790 --> 00:02:27,780 If the user enters the function, returns decrypted text string. 32 00:02:28,020 --> 00:02:34,350 Otherwise, if none of the decryption looks like English hacking has failed and non-value is returned 33 00:02:34,350 --> 00:02:40,710 at the end of this particular method now coming to returning the hacked message. 34 00:02:40,950 --> 00:02:46,260 Now, finally, all of the functions that we have defined will be used by the Hack Virginia function, 35 00:02:46,530 --> 00:02:52,560 which accepts a ciphertext string as an argument and return the hacked message if hacking was successful 36 00:02:52,560 --> 00:02:53,100 or not. 37 00:02:53,100 --> 00:02:59,330 If it wasn't, it starts by getting the likely killens with ASCII examination function. 38 00:02:59,700 --> 00:03:07,290 So if you come at this particular function here, that is hack in your function in this V so defined 39 00:03:07,290 --> 00:03:10,890 that the output depends on whether the program is in the silent mode. 40 00:03:11,220 --> 00:03:14,190 So the likely killens are then printed to the screen. 41 00:03:14,190 --> 00:03:17,320 If the silent mode is off, it checks over here. 42 00:03:17,350 --> 00:03:21,240 Next, we need to find likely some letters for each Gilan. 43 00:03:21,270 --> 00:03:27,720 We will do that with another loop that attempts to have this Saiful with each Elance we found then breaking 44 00:03:27,720 --> 00:03:30,290 out of the loop when the potential is found. 45 00:03:30,510 --> 00:03:35,990 So we want the code to continue looping and checking the Queenland until it finds a potential correct 46 00:03:36,050 --> 00:03:36,430 chelate. 47 00:03:36,780 --> 00:03:38,150 So then it finds the killing. 48 00:03:38,190 --> 00:03:39,120 That seems correct. 49 00:03:39,120 --> 00:03:45,900 We will stop the loop with a statement there and similar to how continual statement is used to that 50 00:03:45,900 --> 00:03:48,870 is inside a loop to go back to the loop and start again. 51 00:03:48,870 --> 00:03:55,140 The break statement in this is that we have used Volks program execution breaks out of a loop. 52 00:03:55,350 --> 00:04:01,440 It immediately moves to the first line of core after the loop ends, so will break out of the loop whenever 53 00:04:01,440 --> 00:04:03,570 the program finds a potential correct. 54 00:04:03,590 --> 00:04:06,810 E I need to ask the user to confirm the keys. 55 00:04:06,810 --> 00:04:07,290 Correct. 56 00:04:07,650 --> 00:04:13,860 So over here, for each possible Chelin, the code calls your attempt back with Keelen function, which 57 00:04:13,860 --> 00:04:14,550 is over here. 58 00:04:15,090 --> 00:04:21,600 And if the attempt with Ealand does not return, the hack is successful and program execution should 59 00:04:21,600 --> 00:04:23,880 break out of the default loop. 60 00:04:23,880 --> 00:04:29,190 Hence we have break it all with you now coming to the brute force, all other fields. 61 00:04:29,430 --> 00:04:35,490 Now, if the hack fills all the possible killens that didkovsky examinations with done Hackman's, they 62 00:04:35,490 --> 00:04:36,360 just said to null. 63 00:04:36,360 --> 00:04:42,990 And if the if statement executes overfield, then all the other commands to Max Eland are right. 64 00:04:43,050 --> 00:04:48,720 And if Kosofsky examination fails to calculate the correct chelate, we can just brute force through 65 00:04:48,720 --> 00:04:53,640 the equivalent of the fourth loop over here, which is the for loop we have done here. 66 00:04:54,030 --> 00:04:59,760 And after that we start with the for loop in the statement for each value of your helan. 67 00:05:00,780 --> 00:05:06,990 That's here for killing in the range, which ranges from one to the max, as long as it's not in the 68 00:05:06,990 --> 00:05:07,690 unlikely. 69 00:05:08,160 --> 00:05:13,730 And the reason is that the killing in all likely killings have already been tried in the earlier court. 70 00:05:14,040 --> 00:05:21,240 So finally, we have completed the loop and then we return the message, a step function after executing 71 00:05:21,240 --> 00:05:23,520 it after this particular function. 72 00:05:23,550 --> 00:05:26,570 The only thing that remains is calling this main function. 73 00:05:26,940 --> 00:05:31,780 So if this program was run by itself rather than being imported by another program. 74 00:05:32,190 --> 00:05:38,880 So the full vaginalis hacking program that we have seen, whether it's successful, depends on the characteristics 75 00:05:38,880 --> 00:05:39,930 of the ciphertext. 76 00:05:40,170 --> 00:05:46,500 The closer the original plaintext little frequency is to regular English little frequency and longer 77 00:05:46,500 --> 00:05:49,750 the plaintext, the more likely the hacking program will work. 78 00:05:49,950 --> 00:05:55,500 Now, modifying the constant of the hacking program that we have defined in the beginning of the program 79 00:05:55,550 --> 00:06:01,710 here, we can modify a few details of the hacking program, doesn't work this book and we will not do 80 00:06:01,710 --> 00:06:02,360 it over here. 81 00:06:02,550 --> 00:06:08,130 But in your case, if it is not working, then the constants we set over here that affect how the hacking 82 00:06:08,130 --> 00:06:14,880 program runs, say, for example, this max length over here is 16 will not attempt this longer than 83 00:06:14,880 --> 00:06:15,180 this. 84 00:06:15,450 --> 00:06:18,450 So you can change this if you want to try it somewhere else. 85 00:06:18,690 --> 00:06:23,560 On the most frequency letters, which we have given here for all the silent mode which we have given 86 00:06:23,700 --> 00:06:24,730 this Foote's. 87 00:06:24,930 --> 00:06:31,950 So if the beginner key is longer than the key in the max of Ealand, there is no way the hacking program 88 00:06:31,950 --> 00:06:33,100 will find the correct key. 89 00:06:33,390 --> 00:06:38,730 So if the hacking program fails to have the ciphertext try increasing this value and running the program 90 00:06:38,730 --> 00:06:39,070 again. 91 00:06:39,540 --> 00:06:45,570 Also, keep in mind that trying to hack an incorrect Chelin that is short takes a short amount of time. 92 00:06:45,810 --> 00:06:51,810 But if the max scale in this set very high, the kazatsky examination function mistakenly thinks that 93 00:06:51,810 --> 00:06:58,410 the KMD could be an enormous ILIJA program, could spend hours or even months attempting to hack a particular 94 00:06:58,410 --> 00:07:05,490 ciphertext to prevent this dynamo's frequency, let those limits the number of possible tries for it. 95 00:07:06,030 --> 00:07:11,640 By increasing this value, the hacking program tries many more keys, which you might need to do if 96 00:07:11,640 --> 00:07:15,330 the frequency analysis or English frequency Matkal was inaccurate. 97 00:07:15,750 --> 00:07:21,870 But this also causes the program to slow down and in the most frequency that those three point six would 98 00:07:21,870 --> 00:07:26,210 cause the program to skip, narrowing down the number of possibilities for each piece. 99 00:07:26,670 --> 00:07:33,390 So for both the max and the most frequency that those are smaller value is faster to execute, but less 100 00:07:33,390 --> 00:07:39,420 likely to succeed in hacking a cipher and a larger value secured but more likely to succeed. 101 00:07:39,990 --> 00:07:46,290 So finally, to increase the speed of your program, you can say this silent more SDR to do so. 102 00:07:46,290 --> 00:07:49,350 The program doesn't waste time printing information to the screen. 103 00:07:49,380 --> 00:07:55,230 Although your computer can perform calculations quickly, displaying characters on screen can be relatively 104 00:07:55,230 --> 00:07:55,630 slow. 105 00:07:56,010 --> 00:08:01,410 The downside of not printing information is that you won't know how the program is doing until it has 106 00:08:01,410 --> 00:08:02,910 completely finished running. 107 00:08:03,480 --> 00:08:10,440 So with this, we have completed the original hiking demo with a complete understanding of how the particular 108 00:08:10,440 --> 00:08:11,580 program executes. 109 00:08:12,300 --> 00:08:15,240 That is the end of our beginner hacking demo session. 110 00:08:15,900 --> 00:08:16,770 Thank you very much.