1 00:00:00,450 --> 00:00:04,710 So now let us continue to define our translate message matter. 2 00:00:04,890 --> 00:00:07,440 So this we have done in the last session. 3 00:00:07,500 --> 00:00:19,560 So now over here we are seeing the fine, your translated message SDR method, which will take the GST 4 00:00:19,830 --> 00:00:27,240 as a parameter, the message SDR as the parameter along with the Modesta, which is either a string 5 00:00:27,240 --> 00:00:33,820 of incorrupt or the that we have already passed in the encrypt messages and the decrypt messages. 6 00:00:34,140 --> 00:00:44,880 OK, so now over here in this definition, we would create see translated as the R is equal to blank. 7 00:00:45,180 --> 00:00:49,170 Now this is basically storing the encrypted or the decrypted message string. 8 00:00:49,620 --> 00:00:54,110 Then we are having the key X, which is equal to zero. 9 00:00:54,630 --> 00:01:04,460 We have the GST that's equal to the GST are thought convert to Apple and after this we run a for loop, 10 00:01:04,470 --> 00:01:07,230 OK, which will loop through each symbol in the message. 11 00:01:07,500 --> 00:01:17,010 So we are seeing for SVM in your message Estie are open for loop and your will take. 12 00:01:17,340 --> 00:01:20,910 No one is equal to similar letters. 13 00:01:20,930 --> 00:01:30,380 SDR don't find in bracket as I am thought, convert to uppercase. 14 00:01:30,660 --> 00:01:35,970 Now we have this letter Estie so that is what we are finding it over here. 15 00:01:36,090 --> 00:01:45,780 And after this we check in the if if the value of no one is not equal to minus one, then you're minus 16 00:01:45,780 --> 00:01:50,670 one means you're as brought up or was not found in the letter Oresteia. 17 00:01:51,090 --> 00:01:58,700 So then over here we are seeing if the mode SDR is equal to the value that is encrypted. 18 00:01:58,980 --> 00:02:01,170 This is another condition we are checking. 19 00:02:01,440 --> 00:02:09,750 Then we say number one C plus is equal to the letter is still not fine. 20 00:02:09,930 --> 00:02:17,760 In Blackett we give the GST up along with the key idea that is. 21 00:02:17,760 --> 00:02:24,990 And if it is encrypting it now, another check would be in the elusive part for the less dear. 22 00:02:25,260 --> 00:02:31,040 If it is equal, do not encrypt but decrypt, then we need to subtract it. 23 00:02:31,050 --> 00:02:41,100 So then we say no one is minus is equal to your we are seeing let Oresteia not find in bracket the GST 24 00:02:41,100 --> 00:02:50,550 are the key x that this subtract if it is decrypted now once this is an active part is also part is 25 00:02:50,550 --> 00:02:53,070 done we go for number one. 26 00:02:53,460 --> 00:02:58,150 Modulo is equal to the length of the letter. 27 00:02:58,200 --> 00:03:05,760 Still that is handle any wraparound if any, and then we would add the encrypted or the decrypted symbol 28 00:03:05,760 --> 00:03:09,660 to the end of the translated by seeing C here. 29 00:03:09,660 --> 00:03:19,470 If we say if I m not is in uppercase, then we see the translated SDR. 30 00:03:20,010 --> 00:03:21,980 That is the variable that we have taken. 31 00:03:22,500 --> 00:03:30,300 We are using the append matter and we are seeing letter Estey are at the index of number to be up and 32 00:03:30,720 --> 00:03:44,310 then again, which is if part and we say is am told is lower then via C C translated SDR got up and 33 00:03:44,670 --> 00:03:50,610 here we are using the letter to our index number one dot lol. 34 00:03:52,810 --> 00:04:01,630 If it doesn't look now after this, then we go ahead foreseeing the key idea X plus is equal to one 35 00:04:01,630 --> 00:04:03,050 that is moved to the next level. 36 00:04:03,080 --> 00:04:05,370 The lucky ones, this is that. 37 00:04:05,680 --> 00:04:12,960 And then you check if your E X is equal to the length of your GST up. 38 00:04:13,630 --> 00:04:17,500 If it is, then you make the X back to zero. 39 00:04:17,960 --> 00:04:22,750 Now we come for this if condition that we have written for this. 40 00:04:22,750 --> 00:04:30,160 If we are giving the A spot here, that is we are telling to open the symbol without encrypting or decrypted. 41 00:04:30,550 --> 00:04:38,310 So then we are seeing C translated as we are not up in the value of X, Y and Z. 42 00:04:38,950 --> 00:04:48,760 And then finally we are using a written statement dot join matter and we are seeing translated as still 43 00:04:48,760 --> 00:04:49,920 to be written. 44 00:04:50,410 --> 00:04:56,740 Now once this is done, then if your current program is run instead of imported as a module, we will 45 00:04:56,740 --> 00:04:57,920 call the main function. 46 00:04:57,950 --> 00:05:08,240 So here we are checking if the name on the score is equal to mean, then we are calling the main method. 47 00:05:08,620 --> 00:05:10,990 So let us again just save it. 48 00:05:10,990 --> 00:05:13,330 As already we have given the name for the file. 49 00:05:13,990 --> 00:05:18,160 Now if we try to save one and run the module. 50 00:05:19,160 --> 00:05:26,180 OK, we are getting the air on line fifty five and 16, let us find out that first. 51 00:05:26,690 --> 00:05:32,020 Let's go to line fifty five or is it is line 16. 52 00:05:32,540 --> 00:05:36,260 So let's go to line number 16 first. 53 00:05:36,830 --> 00:05:39,230 And that is over here. 54 00:05:39,650 --> 00:05:48,410 We are passing the value of my Modesta over here that's encrypted or decrypted is what we to actually 55 00:05:48,410 --> 00:05:49,030 printed. 56 00:05:49,370 --> 00:05:54,110 So let us just examine this particular value that we are printing. 57 00:05:54,110 --> 00:05:59,840 This is page this and then let us see this. 58 00:05:59,890 --> 00:06:06,020 And yeah, so we are getting this particular message that has been encrypted in this case because we 59 00:06:06,020 --> 00:06:09,510 have given the message to be encrypted and not decrypted. 60 00:06:09,830 --> 00:06:14,840 So now over here, let us go to understand the program that we have given. 61 00:06:15,200 --> 00:06:21,380 So first, let's go for setting up the modules, the constants and the main functions of the beginning 62 00:06:21,380 --> 00:06:22,190 of the program. 63 00:06:22,190 --> 00:06:29,760 If you look at over here, this starting when we had started was the important statement for the paperclip 64 00:06:29,780 --> 00:06:36,680 module and a variable called later this year was created, which holds a string of every uppercase little. 65 00:06:37,070 --> 00:06:42,500 Then we have the main function for the original cipher, and it is like the other main functions that 66 00:06:42,500 --> 00:06:45,440 we have, which we have already seen in this advanced level. 67 00:06:45,440 --> 00:06:54,740 And also to this also, it starts by defining the variables for your message, as are your key SDR and 68 00:06:54,740 --> 00:06:56,130 your Modesta. 69 00:06:56,510 --> 00:07:01,700 So then once you have understood all this, let us move ahead. 70 00:07:02,090 --> 00:07:06,760 So the user sets these variables before running the given program. 71 00:07:07,010 --> 00:07:13,280 So the encrypted or the decrypted message, depending on what my Monastir is said to, is stored in 72 00:07:13,280 --> 00:07:18,680 the variable name translated, and then it can be also printed and copied today. 73 00:07:19,700 --> 00:07:24,290 So coming to building strengths with the list upand joined process. 74 00:07:24,680 --> 00:07:27,020 Now let us understand something new in this. 75 00:07:27,230 --> 00:07:32,320 Almost all the programs that we have seen have built a string with gold in some form. 76 00:07:32,330 --> 00:07:38,840 Now that goes the program creates a variable that starts as a blank string and then adds characters 77 00:07:38,840 --> 00:07:40,490 using this string concatenation. 78 00:07:40,580 --> 00:07:46,140 Now, this is what is our previous cipher program have done with the translator Asgeir variable. 79 00:07:46,340 --> 00:07:52,160 Now we can open the interactive shell and let us try entering some details over here or something like 80 00:07:52,490 --> 00:07:57,250 we in building as is equal to lank. 81 00:07:57,380 --> 00:08:04,010 Then we say a loop cesi one in C bitin hacking. 82 00:08:05,100 --> 00:08:13,240 And then we are seeing in this, we say building is glass is equal to see one, and then we give here 83 00:08:13,260 --> 00:08:16,200 print the value of building us.