1 00:00:00,210 --> 00:00:07,020 So now here we would create the last function required for this file, and that is we would define the 2 00:00:08,100 --> 00:00:10,050 decrypts with 3 00:00:12,780 --> 00:00:23,390 Saiful little mapping in which we would pass the ciphertext one and the letter mapping one object. 4 00:00:23,790 --> 00:00:30,480 Now, in this matter, we will return a string of ciphertext decrypted with the little map with any 5 00:00:30,480 --> 00:00:34,280 ambiguous decrypted letters replaced with an undisclosed sum. 6 00:00:34,680 --> 00:00:39,460 So first we create a simple key from the letter mappings mapping. 7 00:00:39,900 --> 00:00:49,710 So we say here at the index of is equal in that we are giving X as we value multiplied by the length 8 00:00:49,710 --> 00:00:50,520 of our. 9 00:00:53,150 --> 00:01:00,050 OK, and then we on a loop saying for the Saiful, let one in your. 10 00:01:01,310 --> 00:01:02,660 Later this year. 11 00:01:02,780 --> 00:01:14,390 OK, here we are, checking if the length of your letter mapping one at the index of your site, Falletta 12 00:01:14,420 --> 00:01:21,380 one, and if that is equal to one, then if there's only one letter, then you have to add it to the 13 00:01:21,380 --> 00:01:21,610 key. 14 00:01:22,370 --> 00:01:31,970 So then we create your SADIQI index, and that's equal to silicosis are not use defined matter. 15 00:01:32,270 --> 00:01:43,040 And we use your little mapping one index of Saiful letter one and zero. 16 00:01:43,910 --> 00:01:51,690 OK, now after we have given the value in the key index, we see the key is that we have created the 17 00:01:51,710 --> 00:01:58,580 index of key ideas and that is equal to your Saiful little one. 18 00:01:59,300 --> 00:02:05,300 Then we move on with the L spot for this F and we see the ciphertext. 19 00:02:05,300 --> 00:02:09,170 One parameter is equal to your Saiful. 20 00:02:09,530 --> 00:02:11,660 Next one doc. 21 00:02:11,690 --> 00:02:16,250 We are replacing the Saiful letter one dot. 22 00:02:17,830 --> 00:02:21,440 Law to give data on the. 23 00:02:22,720 --> 00:02:34,390 Similarly, we are seeing the ciphertext one is equal to the ciphertext, one not replace CESI for one, 24 00:02:34,840 --> 00:02:48,730 but a comma again underscores OK and then your receipt he SDR is equal to blank or join the value of 25 00:02:49,270 --> 00:02:50,400 he is OK. 26 00:02:50,680 --> 00:02:55,110 And with the key we have created we would be the ciphertext. 27 00:02:55,360 --> 00:03:00,700 So we are saying now here we would be creating or calling the decrypts method. 28 00:03:01,030 --> 00:03:02,740 So here we are calling the. 29 00:03:05,490 --> 00:03:06,570 Substitution 30 00:03:09,030 --> 00:03:21,670 cipher demo got the group message and passing the star the Saiful next one. 31 00:03:21,890 --> 00:03:28,730 OK, so this very we would be returning back whenever we are calling this the group with Saifullah come 32 00:03:28,740 --> 00:03:31,820 up and this is the method that we are calling it here. 33 00:03:32,280 --> 00:03:34,710 So let's keep the same name. 34 00:03:36,170 --> 00:03:39,760 OK, and this is not just completed here. 35 00:03:39,780 --> 00:03:48,300 The last part that if underscore name underscore is called to give your name on the school single class 36 00:03:48,300 --> 00:03:50,270 and then you call the main. 37 00:03:50,950 --> 00:03:54,720 OK, so now we will see if this particular file. 38 00:03:54,930 --> 00:03:58,180 OK, now let's give your name C hack. 39 00:03:59,190 --> 00:04:01,180 Simple sub. 40 00:04:04,060 --> 00:04:09,850 Save for Dog Beevor and let us bring in our advanceable coach. 41 00:04:09,900 --> 00:04:16,100 OK, so we would save this and win after completing the save of this particular value. 42 00:04:16,510 --> 00:04:20,510 Now, we have already given them the text, which we want to decrypted. 43 00:04:20,890 --> 00:04:23,980 Let us try and execute this and see the output. 44 00:04:24,220 --> 00:04:26,640 OK, paperclip is not there. 45 00:04:26,800 --> 00:04:28,020 Fine is a dead end. 46 00:04:28,030 --> 00:04:28,810 I will follow. 47 00:04:28,840 --> 00:04:29,770 Let us check it. 48 00:04:30,100 --> 00:04:30,420 No. 49 00:04:30,490 --> 00:04:31,940 So we'll have to copy down that. 50 00:04:31,970 --> 00:04:32,830 Let's do that. 51 00:04:33,730 --> 00:04:36,910 OK, we have copied from our intermediate level. 52 00:04:37,720 --> 00:04:41,140 So now again, let us try to run this. 53 00:04:41,980 --> 00:04:48,010 OK, line number ninety seven that is check that it did go to line. 54 00:04:49,010 --> 00:04:50,060 Ninety seven. 55 00:04:51,420 --> 00:04:55,430 OK, what are we checking here at the end of it? 56 00:04:55,580 --> 00:05:03,160 We are checking if underscore on the screen and then is equal to double is equal to that mean. 57 00:05:03,830 --> 00:05:06,660 And we are calling this the main method, OK? 58 00:05:07,220 --> 00:05:08,380 It is looking fine. 59 00:05:08,720 --> 00:05:12,040 Let's see another that is on line number 12. 60 00:05:13,050 --> 00:05:15,800 OK, so let's go to line 12. 61 00:05:16,910 --> 00:05:24,320 OK, over here now that is we are seeing simple sub one, so have we created some up from here? 62 00:05:24,860 --> 00:05:30,740 Yes, and it is having the same method of the same parameter that we are positing that this message. 63 00:05:32,970 --> 00:05:36,690 OK, so let us just try to. 64 00:05:38,490 --> 00:05:40,270 Substitute the name, OK? 65 00:05:44,060 --> 00:05:52,100 And then we see in Maine, where in Maine, they're trying to call this over here, OK, that's not 66 00:05:52,100 --> 00:05:52,630 an issue. 67 00:05:54,500 --> 00:05:56,290 Let's try and execute this again. 68 00:05:58,690 --> 00:06:00,880 OK, let's see, line number 16 line. 69 00:06:04,960 --> 00:06:08,340 OK, fine, let's just try it out. 70 00:06:08,960 --> 00:06:15,850 Of we have made a mistake, if we have we have Simplist up there where we are calling it, and in this 71 00:06:15,970 --> 00:06:17,470 we are creating this. 72 00:06:19,180 --> 00:06:22,900 Our mistake was it was supposed to be slash as well. 73 00:06:23,500 --> 00:06:32,620 OK, so now if we try to execute this, we get some part of the message, not all, but at least to 74 00:06:32,620 --> 00:06:40,630 some extent, we are able to decrypt the message of substitution cipher for whatever it is not able 75 00:06:40,630 --> 00:06:40,800 to. 76 00:06:40,990 --> 00:06:43,580 We are getting the values of underscore also. 77 00:06:44,130 --> 00:06:48,160 Now let us explore the source code in detail that we have written here. 78 00:06:48,610 --> 00:06:55,480 OK, now the first few lines of the simple substitution hacking program is basically importing sort 79 00:06:55,480 --> 00:06:56,600 of different modules. 80 00:06:56,950 --> 00:07:01,660 Now here we have imported more modules as compared to any other program so far. 81 00:07:01,780 --> 00:07:08,830 So we have here the letters ETR, which is a constant global variable, which stores the symbols it 82 00:07:08,890 --> 00:07:12,810 given, which consists of all the uppercase characters also. 83 00:07:13,160 --> 00:07:21,250 OK, now the audio module is basically a regular expression module which allows for sophisticated string 84 00:07:21,250 --> 00:07:24,250 manipulation using any regular expression. 85 00:07:24,460 --> 00:07:27,670 Now let's have a look at how the regular expression vote. 86 00:07:27,940 --> 00:07:36,070 OK, so a regular expression are basically strings that define a specific pattern that matches certain 87 00:07:36,070 --> 00:07:36,520 string. 88 00:07:36,970 --> 00:07:45,460 Now, for example, if we see apostrophe A to Z is one, OK, is a regular expression that Delphi couldn't 89 00:07:45,520 --> 00:07:51,760 find any characters that is not in the uppercase from A to Z of this character, like a space or type 90 00:07:51,760 --> 00:07:52,870 on a new line character. 91 00:07:53,410 --> 00:08:00,130 Now after that, the road company function basically creates a regular expression pattern object, which 92 00:08:00,130 --> 00:08:06,010 is abbreviated also as an object or a pattern object that the module can use. 93 00:08:06,550 --> 00:08:12,520 We would use this object to remove any known little characters from the function when we're using that 94 00:08:12,530 --> 00:08:12,940 symbol. 95 00:08:14,020 --> 00:08:18,190 OK, now let's look at setting up our main function. 96 00:08:18,220 --> 00:08:21,330 So if we move below, we're defining the main function. 97 00:08:21,700 --> 00:08:27,970 OK, then as in the previous hacking programs that we have done the main function Stoll's your ciphertext 98 00:08:27,970 --> 00:08:37,120 in the messages are variable and that is basically passes the variable, your hack simple sub one method 99 00:08:37,120 --> 00:08:39,620 or the function which we would be creating. 100 00:08:39,970 --> 00:08:46,910 So instead of returning the decrypted message or null if unavailable to decrypt, we have had some sub 101 00:08:46,930 --> 00:08:51,470 one which returns and intercept this little mapping within the group. 102 00:08:52,140 --> 00:08:58,260 Remove this interceptive cipher, let them approve, then gets passed to your decrypt. 103 00:08:58,390 --> 00:09:06,410 What happens now that is helpful for decrypting the ciphertext, storing the message in readable format. 104 00:09:06,490 --> 00:09:11,710 So as you can see, we are having a more detail of decrypting this in the coming session. 105 00:09:11,750 --> 00:09:17,620 OK, now discipling a map that shows your lack of mapping is a dictionary value, which has twenty six 106 00:09:17,620 --> 00:09:23,960 uppercase particles you can see here, and that is a single letter string as keys are represented. 107 00:09:24,160 --> 00:09:24,550 Saifullah. 108 00:09:24,850 --> 00:09:32,710 So it also list the uppercase letters of your potential decryption letters for each letter as a dictionary 109 00:09:32,710 --> 00:09:33,110 value. 110 00:09:33,400 --> 00:09:39,940 Now, when every letter has just one potential decryption letter associated with it, we have a fully 111 00:09:39,940 --> 00:09:45,670 solved mapping and can be any ciphertext using the same cipher and the key. 112 00:09:46,080 --> 00:09:51,180 OK, so each side Fallica mapping generated depends on your ciphertext, which is used. 113 00:09:51,520 --> 00:09:58,840 So in some cases we have only partially solved mapping and with some those have more potential descriptions 114 00:09:59,080 --> 00:10:02,470 and other side follicles have multiple potential descriptions. 115 00:10:02,740 --> 00:10:08,710 So short of ciphertext that don't contain every letter of the alphabet are more likely to result in 116 00:10:08,710 --> 00:10:09,730 an incomplete map.