1 00:00:00,210 --> 00:00:05,910 Now, if we have to run the main method, as in the earlier one we have done, we will have to check 2 00:00:06,390 --> 00:00:15,600 name, underscore name and the score is equal to in single court mean, then you will have to call the 3 00:00:16,140 --> 00:00:16,530 men. 4 00:00:17,490 --> 00:00:19,380 So now let us see if this. 5 00:00:21,350 --> 00:00:31,610 Again, in hiking goals and we'll see what does Demo 14 thought we might and let us try and run this 6 00:00:31,610 --> 00:00:32,680 particular example. 7 00:00:33,600 --> 00:00:42,780 Transposition, encrypt, fine, let us just check if we have made any spelling mistake there, so that's 8 00:00:42,780 --> 00:00:43,490 why we're here. 9 00:00:43,740 --> 00:00:50,080 So we have used the transposition e capital letters and encrypt. 10 00:00:51,660 --> 00:00:58,680 Now, here, the files that we have created earlier, that is the most painful encryption and the 13 11 00:00:58,680 --> 00:01:01,810 for decryption that we will have to use here. 12 00:01:02,130 --> 00:01:05,340 So let us just substitute the filenames. 13 00:01:05,610 --> 00:01:11,870 And also the method is encrypted messages and decrypt message acedia. 14 00:01:12,570 --> 00:01:15,220 So just everything looks good. 15 00:01:15,390 --> 00:01:22,230 Now let us execute this device and message SDR. 16 00:01:23,640 --> 00:01:25,470 Let us run this again. 17 00:01:26,280 --> 00:01:26,690 Fine. 18 00:01:27,780 --> 00:01:39,900 Let's open up the demo then and here we have encrypted message, Asgeir file, so let us copy this in 19 00:01:39,900 --> 00:01:42,490 the current demo. 20 00:01:43,680 --> 00:01:49,540 Similarly, we also have in sort of intermittent tinnitus decrypt messages. 21 00:01:50,610 --> 00:01:53,970 Now let us save it and run it again. 22 00:01:54,750 --> 00:01:55,920 Decrypt message. 23 00:01:55,920 --> 00:01:58,220 SDR has no attributes. 24 00:01:58,780 --> 00:02:06,900 Look at the file demo 13 that we have decrypt and is also small. 25 00:02:06,900 --> 00:02:08,740 Fine, no issues. 26 00:02:09,090 --> 00:02:14,570 Let's open up the 14, the current one and let the substitute define there. 27 00:02:14,950 --> 00:02:19,490 OK, now let's try and execute señoritas executing. 28 00:02:19,920 --> 00:02:26,520 We have totally given their daily range of 20, so we'll have the 20 test, which it will take with 29 00:02:26,520 --> 00:02:32,130 the help of different keys and the message that we have given in the encrypt and decrypt file. 30 00:02:32,130 --> 00:02:38,640 And after everything is successful, it would give us the message as transpositions ciphertext has passed 31 00:02:38,880 --> 00:02:39,760 successfully. 32 00:02:40,380 --> 00:02:48,660 So after we have completed the output now over here, the desktop program creates a random message and 33 00:02:48,660 --> 00:02:50,330 chooses a random Kilson. 34 00:02:50,640 --> 00:02:57,240 So it doesn't matter that the message is just some random letters because the program only needs to 35 00:02:57,240 --> 00:03:03,000 check that encrypting and then decrypting the message results in the original message. 36 00:03:04,080 --> 00:03:09,150 So using a loop, the program repeat this particular test 20 times as we have seen. 37 00:03:09,360 --> 00:03:16,130 And if any point, the string return from the decrypt method isn't the same as the original message, 38 00:03:16,140 --> 00:03:23,820 then you would get that the error which would print the error that we have given that it is not matching 39 00:03:23,820 --> 00:03:25,530 or mismatch of the text. 40 00:03:26,070 --> 00:03:33,030 Now, let us explore the source code that we have written in our demo to 14. Beevor program. 41 00:03:33,600 --> 00:03:39,990 So over here, the first thing we have done is if you look at the first line, that's our import statement. 42 00:03:39,990 --> 00:03:47,190 When we have imported the modules, including the one which we have already seen, that is random system 43 00:03:47,430 --> 00:03:55,080 and also the programs which we have already created, that is Demo 10 and then totally by just typing 44 00:03:55,080 --> 00:03:59,340 their names without the dot by extension, because that is not required. 45 00:03:59,850 --> 00:04:06,540 Now after this, we'll move on to creating the pseudo random numbers now to create some random numbers 46 00:04:06,540 --> 00:04:09,390 which will help for generating the messages and the keys. 47 00:04:10,050 --> 00:04:12,660 We are basically using the random modules. 48 00:04:12,840 --> 00:04:19,650 See the function now before we delve into what the CI does not, let us just have a look at how the 49 00:04:19,650 --> 00:04:25,590 random numbers walks in Python by trying out some random doctorand in functions. 50 00:04:26,010 --> 00:04:32,430 Now, this function that we will be using later on in the session takes to integer arguments and returns 51 00:04:32,430 --> 00:04:38,630 a random integer between those two individuals, including the individuals that you have passed on now. 52 00:04:38,670 --> 00:04:46,200 For example, if we go back to our interactive shell here and we see, for example, the import random 53 00:04:46,560 --> 00:04:56,220 and here we see random thought Švanda and we pass one comma 20 will get any value, random value in 54 00:04:56,220 --> 00:04:57,210 between those two. 55 00:04:57,510 --> 00:05:03,240 Similarly, you again see, for example, random doctorand in one comma 20. 56 00:05:03,540 --> 00:05:05,640 This time you would get some different values. 57 00:05:05,880 --> 00:05:13,650 Or for that case you say another range, say one hundred comma, two thousand would get any value but 58 00:05:13,650 --> 00:05:15,370 one hundred to two thousand. 59 00:05:15,840 --> 00:05:22,320 Now of course the numbers you get will probably be different from those that we are seeing over here 60 00:05:22,320 --> 00:05:25,400 because this is what we are executing at that time. 61 00:05:25,410 --> 00:05:26,640 We are getting some random numbers. 62 00:05:26,650 --> 00:05:34,050 So you might not get the output as C, but these numbers generated by random doctorand in functions 63 00:05:34,050 --> 00:05:35,550 are not truly random. 64 00:05:36,210 --> 00:05:42,390 They are produced from a pseudo random number generator algorithm, which takes an initial number and 65 00:05:42,390 --> 00:05:45,980 produces other numbers based on some formulas. 66 00:05:46,200 --> 00:05:52,240 Now the initial number that the pseudo random number generator starts with is called as the seed. 67 00:05:52,560 --> 00:06:00,300 So if you know this, the rest of the numbers the generator produces are quite predictable because when 68 00:06:00,300 --> 00:06:07,670 you see the seed to a particular or specific number, the same numbers will be generated in the same 69 00:06:07,680 --> 00:06:07,980 order. 70 00:06:08,610 --> 00:06:13,710 Now, these random looking but predictable numbers are also called pseudo random numbers. 71 00:06:14,010 --> 00:06:17,310 Biton programs for which you don't set a seed. 72 00:06:17,490 --> 00:06:21,630 Use the computers current block time to set the particular seed. 73 00:06:21,990 --> 00:06:27,270 You can reset buttons at random seed by calling the random dot seed function. 74 00:06:27,710 --> 00:06:33,920 Now, we would see certain variations of the pseudo random numbers, which are completely random by 75 00:06:34,310 --> 00:06:39,320 entering something in the interactive fashion, but we will do that in the next session and look at 76 00:06:39,320 --> 00:06:39,950 the output. 77 00:06:40,200 --> 00:06:41,870 That's it from this current session. 78 00:06:41,900 --> 00:06:42,800 Thank you very much.