1 00:00:00,330 --> 00:00:07,080 So now in this particular program, we are trying for a particular and that is there because we're told 2 00:00:07,410 --> 00:00:13,440 the program returns little snippet of the decrypted message for the user to confirm that it has found 3 00:00:13,440 --> 00:00:13,810 the right. 4 00:00:14,610 --> 00:00:17,490 OK, now, in this example, the message looks promising. 5 00:00:17,490 --> 00:00:23,610 And when the user confirmed the description is correct by entering the the program, then return the 6 00:00:23,610 --> 00:00:24,870 entire hack the message. 7 00:00:25,320 --> 00:00:30,660 OK, now you can also see it by the biographical note about OK that we have. 8 00:00:30,840 --> 00:00:33,200 Well, we basically get the four percent. 9 00:00:33,660 --> 00:00:39,060 And if the decryption is false positive, the user can press anything else and the program will still 10 00:00:39,060 --> 00:00:40,730 continue to try for other keys. 11 00:00:41,220 --> 00:00:47,610 OK, now the program again runs and skips the correct decryption, replacing anything other than the 12 00:00:47,880 --> 00:00:54,060 the program assumes that it did not find the correct decryption continues its brute force approach to 13 00:00:54,060 --> 00:00:56,260 the other possibilities available. 14 00:00:56,550 --> 00:01:01,710 So eventually the program runs through all the possibilities and then gives up informing the user that 15 00:01:01,710 --> 00:01:04,380 it was unable to have the ciphertext. 16 00:01:04,810 --> 00:01:10,020 OK, now let us take a closer look at the source code that we have used for creating this program. 17 00:01:10,620 --> 00:01:17,400 OK, so the first thing we have done is importing the modules in the first line of the code would tell 18 00:01:17,400 --> 00:01:19,200 the user, what about this program? 19 00:01:19,230 --> 00:01:20,950 We basically do OK. 20 00:01:21,030 --> 00:01:26,820 We are importing several modules that we have written or seen in the previous session that is of a paperclip, 21 00:01:27,180 --> 00:01:29,550 checking them all 16. 22 00:01:29,970 --> 00:01:36,510 Now, the transposition cycle Hackl program containing approximately some lines of code is fairly short 23 00:01:36,510 --> 00:01:37,790 because of it. 24 00:01:37,800 --> 00:01:41,850 Much of it basically exists in other programs that we are using as the module. 25 00:01:42,510 --> 00:01:48,210 So using a multiline string with triple codes like if Ifill's use instead of the single quotation marks, 26 00:01:48,570 --> 00:01:56,490 if you use this triple line or triple double code that is known as our multiple multiline string using 27 00:01:56,490 --> 00:01:57,600 the Republicans. 28 00:01:57,630 --> 00:01:57,960 OK. 29 00:01:58,410 --> 00:02:03,240 Now notice that if you are having a very long string, then triple code strings. 30 00:02:03,360 --> 00:02:09,600 We also call them as multiline strings because the span multiple lines and can contain some line breaks 31 00:02:09,600 --> 00:02:11,310 within the Somali line. 32 00:02:11,310 --> 00:02:15,780 Strings are basically useful for putting a large string into a program for support. 33 00:02:15,990 --> 00:02:21,870 And because single and double codes don't need to be escaped within them, we can see an example of 34 00:02:21,870 --> 00:02:26,350 this multiline string by entering some following text in the interactive shell. 35 00:02:26,640 --> 00:02:34,470 So if we go back here and we try to endorsee SDR is equal to, we give you a double quotation marks. 36 00:02:34,860 --> 00:02:38,130 Sadiel, John Placentals. 37 00:02:38,170 --> 00:02:45,180 We say, why did you dress up my hamster 38 00:02:47,490 --> 00:02:50,430 in doll clothing? 39 00:02:51,690 --> 00:03:10,260 Then say, I look at Mr. ABC and think that I know this was John's doing and then give thanking you 40 00:03:11,010 --> 00:03:15,740 see Elliman and then we end this quotation mark. 41 00:03:16,170 --> 00:03:22,260 Now we give here again, say, in bracket STF, so we get the same text in the same format. 42 00:03:22,280 --> 00:03:29,340 But OK, notice that this particular string value like of a ciphertext string expands multiple lines. 43 00:03:29,340 --> 00:03:35,730 Everything after the opening triple code will be interpreted as part of the string until the program 44 00:03:35,730 --> 00:03:37,680 reaches the course, ending it. 45 00:03:37,860 --> 00:03:44,520 OK, so you can make a multiline string using either for like three double chords, characters or three 46 00:03:44,520 --> 00:03:45,110 singlehood. 47 00:03:45,120 --> 00:03:51,900 So even doing the three and ending it with three single chords will also be possible or do it with double 48 00:03:51,900 --> 00:03:52,660 quotation marks. 49 00:03:53,190 --> 00:03:57,740 OK, anyways, as you wish to do now, let us go back to our program here. 50 00:03:58,110 --> 00:04:02,240 Now come to displaying the results of the hacking, the particular message. 51 00:04:02,490 --> 00:04:10,230 So the ciphertext hacking code exists inside of a particular method that is hack transposition, astar 52 00:04:10,230 --> 00:04:16,410 function vacay, which we are calling it over here and storing the value which is written by this function 53 00:04:16,650 --> 00:04:23,600 in the variable hacked message is for this function will take one string argument, the encrypted ciphertext 54 00:04:23,610 --> 00:04:25,620 message that we are trying to hack. 55 00:04:25,620 --> 00:04:31,560 And if the function can hack this hypertext, it returns a string of the decrypted Asgeir, otherwise 56 00:04:31,560 --> 00:04:33,890 it returns the value that is none. 57 00:04:34,140 --> 00:04:39,960 So if you look at over here, we are saying hacked message Asgeir is equal to calling the method, passing 58 00:04:39,960 --> 00:04:46,680 the parameter, checking if it is equal to non-veteran fail to hack encryption is if it is not equal 59 00:04:46,680 --> 00:04:52,190 to null, then you're saying copying the hack message to avoid printing the hack message and then using 60 00:04:52,710 --> 00:04:55,180 good copy to copy them is OK. 61 00:04:55,200 --> 00:04:58,890 So over here I'm calling the function to return the hacked message. 62 00:04:58,890 --> 00:04:59,940 If the attempt is a. 63 00:05:00,000 --> 00:05:06,690 Facebook or the non-value is an attempt, is unsuccessful, then it stores the returned value in the 64 00:05:06,690 --> 00:05:14,940 message hack is gesture and the next line tells the program what to do if the function is unable to 65 00:05:14,940 --> 00:05:15,770 have deciphered. 66 00:05:15,840 --> 00:05:23,700 So if none was stolen, the variable hacked and the program lets the user know by printing that it was 67 00:05:23,700 --> 00:05:25,200 unable to break the encryption. 68 00:05:25,650 --> 00:05:31,800 And the next lines after that shows what the program does of the function is able to hack the ciphertext. 69 00:05:32,190 --> 00:05:40,530 That is the if part in the as we print the decrypted message to the clipboard and for this code to work, 70 00:05:40,530 --> 00:05:48,870 we also need to define the hack transposition function, which we going to do after the next line of 71 00:05:49,080 --> 00:05:49,960 copying it to the.