1 00:00:00,330 --> 00:00:02,040 So let us come to new. 2 00:00:02,670 --> 00:00:12,090 We would go for a for loop, see, creating a symbol in my cities and in this for loop we will check 3 00:00:12,090 --> 00:00:13,770 if the symbol in. 4 00:00:15,230 --> 00:00:23,540 Symbolistic, then we are decrypting the symbol, so we are seeing your symbol if X is equal, to use 5 00:00:23,540 --> 00:00:32,510 your symbol star Daudi find the metaphor and symbol in that, then you take the plain text. 6 00:00:32,510 --> 00:00:36,560 SDR plus is equal to, say, Symbolistic. 7 00:00:38,020 --> 00:00:48,070 In squid wreckage around wreckage, the symbol is X minus the V one multiplied by the mod of. 8 00:00:48,970 --> 00:00:53,320 Inverse of the Avon. 9 00:00:54,520 --> 00:00:57,340 That model of land of. 10 00:00:58,670 --> 00:00:59,510 Symbolistic. 11 00:01:03,220 --> 00:01:12,300 Close that, then we write down here the fact that if this is not true, then we take the plaintext 12 00:01:12,310 --> 00:01:14,710 stuff as equal to. 13 00:01:15,870 --> 00:01:16,420 Symbol. 14 00:01:17,040 --> 00:01:20,870 And finally, we use a written statement. 15 00:01:21,790 --> 00:01:25,020 And work the value of plaintext still. 16 00:01:25,480 --> 00:01:27,930 Now that is the end of our decrypt messages. 17 00:01:28,630 --> 00:01:33,070 Now here we are defining another matter that is a good. 18 00:01:34,340 --> 00:01:43,260 Random ATSDR, and in this matter, we are running a vital, vital piece through the U.S. Capitol. 19 00:01:43,820 --> 00:01:48,830 And while this is true, we are saying everyone is equal. 20 00:01:49,100 --> 00:01:58,220 We are generating random thought, run into metal, passing the two and the length of symbolistic. 21 00:01:58,700 --> 00:02:01,310 This is one, then four GB one. 22 00:02:01,560 --> 00:02:08,360 Again, we are seeing random dot run and again passing through and the length of. 23 00:02:10,350 --> 00:02:13,650 Symbolistic, then we check if. 24 00:02:15,400 --> 00:02:16,060 Krypto. 25 00:02:21,020 --> 00:02:32,930 One dot our GCD matter here, we are passing a one in that and the length of SYMBOLISTIC, if that's 26 00:02:32,930 --> 00:02:40,790 equal to one, then we are saying we get one multiplied by line of. 27 00:02:42,670 --> 00:02:43,200 Symbolist. 28 00:02:44,440 --> 00:02:54,010 And plus, he Beevor, so after this, we are using this if condition and the Cryptome at one function 29 00:02:54,250 --> 00:02:59,590 in that we are passing the Evenki and the length of the SYMBOLISTIC, if that comes to equal to one, 30 00:02:59,590 --> 00:03:06,520 then determining the value of even multiplied by the length of this year and the value of Beevor. 31 00:03:07,180 --> 00:03:16,230 Now, once we have completed this, we will check to see if underscore Niemöller score is equal to see 32 00:03:16,240 --> 00:03:21,950 in single code on the score mean and then you want to call me. 33 00:03:23,020 --> 00:03:28,690 Now let's see if this program and let's give you meaningful name for this. 34 00:03:29,170 --> 00:03:32,820 I see a fine Saiful, something like that. 35 00:03:32,830 --> 00:03:35,950 So we will see which here a fine. 36 00:03:37,370 --> 00:03:38,180 Saiful. 37 00:03:42,440 --> 00:03:45,270 Let's give a fine sign for them. 38 00:03:46,370 --> 00:03:47,510 Dr. By. 39 00:03:48,830 --> 00:03:57,860 And let us save this and now let us try and run the module, so we're getting this encrypted text and 40 00:03:57,860 --> 00:03:59,090 full encrypted text. 41 00:04:00,650 --> 00:04:03,110 So now, for example, if we. 42 00:04:04,370 --> 00:04:13,340 Copied on this particular text, go to overprogrammed back here and if we put that text over here. 43 00:04:18,430 --> 00:04:25,780 Let's select this and based it here and now we will give your description. 44 00:04:26,950 --> 00:04:31,080 Then let us save it and again, try to run this. 45 00:04:31,090 --> 00:04:35,200 So now it has been decrypted same the same as it does so. 46 00:04:35,200 --> 00:04:39,520 We have seen encryption process also and the decryption process also. 47 00:04:40,090 --> 00:04:40,460 Right. 48 00:04:40,660 --> 00:04:44,470 So now let us understand that the program that we have written. 49 00:04:44,770 --> 00:04:50,020 So let's come back here and go to the first line that there is where we are basically setting up the 50 00:04:50,290 --> 00:04:53,180 modules, the constants and the main function. 51 00:04:53,560 --> 00:05:00,030 So here we are, first of all, giving the four modules, which we have important in this session. 52 00:05:00,340 --> 00:05:03,710 That is basically the SIS module four is important. 53 00:05:03,760 --> 00:05:08,590 Basically, we have used the exact function don't exist, hence we have imported that module. 54 00:05:09,820 --> 00:05:14,770 It is important for the core pickleball function that we are using then the crypto math. 55 00:05:14,770 --> 00:05:21,400 One module that we have created in the U.S. is important because we are using the function also defined 56 00:05:21,400 --> 00:05:24,280 more inverse function from that particular module. 57 00:05:24,610 --> 00:05:30,730 Similarly, the random module that is important for for the random doctorand and function to generate 58 00:05:30,730 --> 00:05:31,660 some random piece. 59 00:05:32,050 --> 00:05:38,560 So the string stored in the symbols is still variable, is a symbol that we can see, which is basically 60 00:05:38,560 --> 00:05:42,320 a list of all the characters that can be encrypted. 61 00:05:42,340 --> 00:05:47,200 So here we have given all the characters and capital in small case, also numbers. 62 00:05:47,420 --> 00:05:53,010 So any characters in the message that don't appear in this remains unencrypted in the ciphertext. 63 00:05:53,320 --> 00:06:00,250 For example, if you run the particular example, you can see that we have this dush that is remaining 64 00:06:00,250 --> 00:06:02,910 unencrypted because that is not what we have given here. 65 00:06:03,250 --> 00:06:09,310 So that don't get encrypted into ciphertext because they don't belong to your symbols that you have 66 00:06:09,580 --> 00:06:17,620 defined, then we are defining the main function, which is almost exactly the same as the one we have 67 00:06:17,620 --> 00:06:19,870 in the transposition cipher program. 68 00:06:20,320 --> 00:06:20,710 Right. 69 00:06:20,860 --> 00:06:29,550 So it basically it's totally message is still then your idea and your Monastir variables respectively. 70 00:06:30,040 --> 00:06:30,290 Right. 71 00:06:30,370 --> 00:06:32,750 Then the value stored in your mind. 72 00:06:32,750 --> 00:06:35,200 Modesta is either set to include. 73 00:06:35,740 --> 00:06:40,450 So we are checking that over here, whether the program encrypts or decrypt the message. 74 00:06:40,690 --> 00:06:46,600 So if my mood is said to encrypt the execute and return value of the encrypt messages and it is stored 75 00:06:46,600 --> 00:06:52,570 in the trust that it is still variable, but if my estimate is set to decrypt, then we call the decrypt 76 00:06:52,570 --> 00:06:57,470 method to Starmaker and the return value is stored again and translated Estienne. 77 00:06:57,910 --> 00:07:02,290 Now this encrypt messages and decrypt messages are functions. 78 00:07:02,290 --> 00:07:05,160 We would understand that somewhere later in the session. 79 00:07:05,410 --> 00:07:12,010 Now, after the execution of this line, we come over here when we are having the translated variable 80 00:07:12,010 --> 00:07:16,180 that has the encrypted or the decrypted version of the message in my messages. 81 00:07:16,960 --> 00:07:23,380 So we are using some ciphertext, using the percentage as placeholders that basically tells the user 82 00:07:23,500 --> 00:07:25,780 whether the output is encrypted or decrypted. 83 00:07:26,080 --> 00:07:31,140 So after this, we are having some print statements which put in some string in the transmitter last 84 00:07:31,150 --> 00:07:35,140 year, which is encrypted or encrypted version of the string in my messages. 85 00:07:35,830 --> 00:07:43,270 And again, after that, we are hoping that by using the clip and later notifies the user that it is 86 00:07:43,270 --> 00:07:44,470 copied on the clip. 87 00:07:44,980 --> 00:07:53,170 Now, after this, we come to calculating and validating the keys, not unlike the cipher, which uses 88 00:07:53,170 --> 00:07:56,560 addition with only one he finds. 89 00:07:56,600 --> 00:08:02,860 Saiful uses multiplication and addition to Empedocles, which we will call it, say, for example, 90 00:08:03,340 --> 00:08:08,490 A1 and every one, because it is easier to remember just one number. 91 00:08:08,500 --> 00:08:11,860 We'll use a mathematical trick to convert to keys into one. 92 00:08:12,370 --> 00:08:17,720 So now let us look at that when we are converting one or one number in to this. 93 00:08:18,070 --> 00:08:25,900 So you'll we come to the method that is get Keyport SDR, which splits a single integer into two individuals 94 00:08:25,900 --> 00:08:28,600 for P1 and Beevor. 95 00:08:29,080 --> 00:08:32,170 So the key split is fast to the key parameter. 96 00:08:32,590 --> 00:08:40,690 The key one is calculated by using an integer division to divide the key by line of symbol Asgeir and 97 00:08:40,690 --> 00:08:47,560 the size of this Envisat, then the integer division that this double slash latency quotient with all 98 00:08:47,560 --> 00:08:48,170 the remainder. 99 00:08:48,520 --> 00:08:53,930 So the operator calculates the remainder, which will be used for E V1. 100 00:08:54,430 --> 00:08:57,940 So for example, suppose we are having C here. 101 00:08:58,140 --> 00:09:00,330 Yes, two eight nine four. 102 00:09:00,790 --> 00:09:08,970 Then the key parameter and the symbolistic a string of six to six characters, the A1 would be saved. 103 00:09:08,980 --> 00:09:17,880 I just write down here EVA will be equal to do it nine four, six to six which will come to say for. 104 00:09:18,070 --> 00:09:28,540 Three and your key one would be two eight nine four modulars sixty six, which will be 56 now to combined 105 00:09:28,810 --> 00:09:34,980 A1 and V1 back into a single, if you will, multiply even by the size of the set and keep one to the 106 00:09:34,990 --> 00:09:35,560 product. 107 00:09:36,010 --> 00:09:44,830 That is, we would see, for example, see in bracket forty three multiplied by sixty six plus. 108 00:09:46,820 --> 00:09:54,260 Fifty six, which will come to, again, two eight nine four, which is the integer key we started with. 109 00:09:54,560 --> 00:09:57,700 So now let us move on to the tuple data. 110 00:09:58,190 --> 00:10:03,200 So let's just put this particular part in the comment. 111 00:10:03,560 --> 00:10:05,570 So which will not be executed as such? 112 00:10:05,570 --> 00:10:12,020 It is just there in your particular program, which will help you understand what we're trying to do 113 00:10:12,150 --> 00:10:14,270 in the above given two parts. 114 00:10:15,080 --> 00:10:22,760 So once we have done this, now we move on to the next code where we are basically returning the list 115 00:10:22,760 --> 00:10:28,340 values except the parentheses are used instead of the square brackets. 116 00:10:28,520 --> 00:10:35,420 Now, this is basically called as your pupil value or tuple values, similar to a list value in that 117 00:10:35,420 --> 00:10:40,010 it can store all the values which can be accessed with indexes or slices. 118 00:10:40,340 --> 00:10:44,660 However, unlike list values, tuple values cannot be modified. 119 00:10:44,660 --> 00:10:50,900 So there is no appen method for your approvals now because this particular program doesn't need to modify 120 00:10:50,900 --> 00:10:53,860 the value written by the gatekeeper method. 121 00:10:54,200 --> 00:10:57,000 Using a pupil is more appropriate than the list. 122 00:10:57,410 --> 00:11:03,620 Now the next thing is we check for the wikis over here encrypting with the afine. 123 00:11:03,620 --> 00:11:10,460 Saiful involves a characters index in the symbols that are being multiplied by one and then added to 124 00:11:10,690 --> 00:11:11,330 Avivah. 125 00:11:11,690 --> 00:11:17,730 But if each one is one, the encrypted text is very weak because multiplying the index by one results 126 00:11:17,750 --> 00:11:18,700 in the same index. 127 00:11:19,070 --> 00:11:24,770 So in fact, as defined by the multiplicative identity properties, the product of any number is one 128 00:11:24,770 --> 00:11:25,570 is that number. 129 00:11:26,030 --> 00:11:31,880 So similarly, if one is zero, the encrypted text is weak because adding zero to the index doesn't 130 00:11:31,880 --> 00:11:32,450 change it. 131 00:11:32,820 --> 00:11:39,800 If a one is one and we want to zero at the same time, the encrypted output would be identical to the 132 00:11:39,800 --> 00:11:40,720 original message. 133 00:11:41,060 --> 00:11:44,200 So in other words, it won't be encrypted at all. 134 00:11:44,660 --> 00:11:52,910 So we check this wikis using this check the SDR function and the statement or the IF statement. 135 00:11:52,910 --> 00:11:59,860 And this particular function checks whether the key A1 is one or B one is zero, which is overkill. 136 00:11:59,870 --> 00:12:05,420 So we check if each one is one or B, one is one and the more studies. 137 00:12:05,810 --> 00:12:12,130 And so if these conditions are met, the program exit with a message indicating that what went wrong. 138 00:12:12,620 --> 00:12:20,060 So below those lines we are using or we are passing a string to store exit function and sister exit 139 00:12:20,270 --> 00:12:26,240 function has an optional parameter that lets you put in the string to the screen before terminating 140 00:12:26,240 --> 00:12:31,070 the program so you can use this function or display an error message on the screen before the program 141 00:12:31,070 --> 00:12:31,600 quits. 142 00:12:32,120 --> 00:12:33,620 Now, check all this. 143 00:12:33,620 --> 00:12:40,430 Checks prevent you from encrypting with Vickie's, but if your more is set to decrypt, then the check 144 00:12:40,430 --> 00:12:42,380 comes, which we have checked below. 145 00:12:42,380 --> 00:12:50,790 You'll notice on this line now here the condition checks whether each one is a negative number or B 146 00:12:50,810 --> 00:12:55,220 one is greater than zero or less than the size of the sample, said minus one. 147 00:12:55,700 --> 00:13:00,610 So now the reasons the key are in this range is described in the coming session. 148 00:13:01,010 --> 00:13:08,720 If any of these conditions as to the keys are invalid and the program also exits additionally even must 149 00:13:08,720 --> 00:13:11,220 be relatively prime to the symbols size. 150 00:13:11,660 --> 00:13:17,810 So this means that the greatest common deviser or the of A1 and the length of symbolist are must be 151 00:13:17,810 --> 00:13:18,900 equal to one. 152 00:13:19,430 --> 00:13:27,080 So this we are basically checking over here in this condition, which is basically checking that if 153 00:13:27,080 --> 00:13:31,870 this statement, the program is the two values are not relatively bright. 154 00:13:32,270 --> 00:13:39,920 So if all the given conditions in your checky SDR functions written for us, nothing is wrong with the 155 00:13:39,920 --> 00:13:42,350 keys and the program doesn't exist. 156 00:13:42,740 --> 00:13:50,260 Program Execution's returns to the line that originally called the Chiqui Asgeir Method in our MI.