1 00:00:00,150 --> 00:00:10,170 Now, after this, we create another dictionary, Alpha two, which is also equal to some values, but 2 00:00:10,170 --> 00:00:12,320 now here we are changing it. 3 00:00:12,690 --> 00:00:16,040 We are reversing the order or shuffling the order. 4 00:00:16,050 --> 00:00:23,760 Basically, you can see so say, for example, reticular the key code first and here we give that is 5 00:00:23,760 --> 00:00:43,410 equal to, say, Z, then let's give one as equal to say then say two equal to see B, then three equal 6 00:00:43,410 --> 00:01:09,450 to C for equal to the five equal to E, move on to the next line say six as F seven as G then eight 7 00:01:12,930 --> 00:01:17,430 eight nine I. 8 00:01:18,810 --> 00:01:26,100 Then you have been as G you have 11, 9 00:01:29,280 --> 00:01:42,730 12 and 13 and 14 as say and. 10 00:01:43,770 --> 00:02:08,310 Then 15th or the next line, C 16 as B, 17 as Q, 18 as R 19 is. 11 00:02:10,700 --> 00:02:21,310 20 as deep and going to the last line, see you 22. 12 00:02:22,630 --> 00:02:25,250 We do any three. 13 00:02:26,720 --> 00:02:36,470 W twenty four X and twenty five Y. 14 00:02:37,530 --> 00:02:42,470 So we have shuffled certain characters, your correspondent, to the index as after shift. 15 00:02:43,080 --> 00:02:49,500 Now, once we have done with this, we will be creating the functions to accept the string, OK, according 16 00:02:49,500 --> 00:02:51,940 to the shift that you are providing. 17 00:02:52,200 --> 00:02:54,450 So we will define how function see 18 00:02:57,240 --> 00:03:08,730 encrypt the text, which will take the message to start and shift or features two parameters. 19 00:03:09,000 --> 00:03:13,830 And in this will be the ciphertext as initially blank. 20 00:03:14,400 --> 00:03:22,540 We will run a loop for later SDR in your message SDR. 21 00:03:23,250 --> 00:03:26,030 And for that we will check your first basis. 22 00:03:26,490 --> 00:03:36,570 That is, if we will check the letter is still not equal to a blank space, then we will look up the 23 00:03:36,570 --> 00:03:44,220 dictionary and we will add the shift to the index and we will take no one that's equal to use your dictionary 24 00:03:44,220 --> 00:03:48,870 Alpha1 in the index as little as SDR. 25 00:03:49,710 --> 00:03:56,490 Plus use the shift code that you have passed modulus twenty six. 26 00:03:56,750 --> 00:04:01,860 Now that Hillary will look up the second dictionary for the shift alphabets and then we will add a bit. 27 00:04:02,310 --> 00:04:05,880 So we will take your ciphertext. 28 00:04:06,450 --> 00:04:16,140 Plus is equal to the second dictionary that is Alpha to add the index number. 29 00:04:17,100 --> 00:04:25,490 Now, if it is not having any spaces, go to the spot on your we will add the space, my giving cipher 30 00:04:25,680 --> 00:04:29,610 text plus is equal to adult space there. 31 00:04:30,150 --> 00:04:33,510 And once we have done that, let's move. 32 00:04:34,740 --> 00:04:41,940 For in the for loop and we Silvertone the value of Saiful, which means our definition of the function 33 00:04:42,090 --> 00:04:44,580 in cryptics is completed. 34 00:04:44,970 --> 00:04:51,590 Now we will have another function here that is see the clip fixed. 35 00:04:51,810 --> 00:04:59,110 And this also takes your message, Istar and shift your parameters. 36 00:04:59,400 --> 00:05:05,870 And here we have the ciphertext, which is equal to initially black. 37 00:05:06,450 --> 00:05:08,070 Then again, here we run. 38 00:05:08,370 --> 00:05:12,780 So let us start in your messages, dear. 39 00:05:13,350 --> 00:05:17,240 And in this four loop, we will check for the spaces. 40 00:05:17,610 --> 00:05:25,960 That is, if your letter is still not equal to space, call it. 41 00:05:26,070 --> 00:05:30,550 And then we will look up the dictionary and subtract the shift to the index. 42 00:05:30,880 --> 00:05:39,960 So we'll take no one is equal to we will use the dictionary alpha one in the index of letter SDR. 43 00:05:41,310 --> 00:05:52,650 That's minus we use the shift code plus twenty six modulus twenty six and then we will look up for the 44 00:05:52,770 --> 00:05:55,860 second dictionary and for the alphabet. 45 00:05:56,130 --> 00:06:00,090 So here we'll use the full text. 46 00:06:00,690 --> 00:06:07,770 Plus is equal to your dictionary alpha to add the index of number. 47 00:06:08,880 --> 00:06:16,710 Now if this is not true we will go for the ls part here and again we will add the next thing. 48 00:06:16,710 --> 00:06:21,350 The ciphertext plus is equal to space. 49 00:06:21,930 --> 00:06:31,200 So once we have added this, we are supposed to also return the value of the cipher text. 50 00:06:31,800 --> 00:06:39,480 And once that is done, we will define here another main function, which basically is helpful for running 51 00:06:39,480 --> 00:06:40,260 our program. 52 00:06:40,710 --> 00:06:45,960 Now here we are going to use the upper function to convert the lowercase characters to uppercase. 53 00:06:46,290 --> 00:06:54,700 So we are going to use here your message SDR and we will pass that on message as C let's give here in 54 00:06:54,730 --> 00:07:06,060 capital C 510 hiking with seasonal Saiful as a text and double quotation marks. 55 00:07:06,480 --> 00:07:16,050 Also, we give the value of shift code as equal to thirty and then we say here the result SDR is equal 56 00:07:16,050 --> 00:07:20,790 to we call here and grep text in bracket. 57 00:07:21,930 --> 00:07:30,780 Same message as the R dot convert to upper and use the value of shift code. 58 00:07:31,650 --> 00:07:38,600 Then finally you print the value of result SDR here. 59 00:07:39,150 --> 00:07:50,970 Now to execute this main matter, what will have to do is check your if c your name is equal to your 60 00:07:51,450 --> 00:07:57,510 mean in single quotation marks, then you want to call the main method. 61 00:07:58,050 --> 00:07:59,490 Now let us save this. 62 00:08:00,060 --> 00:08:05,760 Let's save it again in the python hacking big enough Sidmouth seven VI. 63 00:08:06,790 --> 00:08:09,210 And let us try to run the audio. 64 00:08:09,700 --> 00:08:15,480 So this is how we are getting the encrypted one, but now suppose we want also for decrypting it. 65 00:08:15,700 --> 00:08:18,580 So we copied on this text go back here. 66 00:08:19,000 --> 00:08:23,800 And in the same main method, we see another same message. 67 00:08:23,800 --> 00:08:27,720 Asgeir is equal to the text that we have copied down. 68 00:08:27,730 --> 00:08:37,390 Now we have this shift code as again, 13 we have again, the result are now we are calling the decrypt 69 00:08:37,750 --> 00:08:40,330 text matau passing there again. 70 00:08:40,330 --> 00:08:51,580 The messages are not in uppercase and the value of shift code and then printing the value of result 71 00:08:51,700 --> 00:08:52,670 SDR here. 72 00:08:53,410 --> 00:08:59,130 OK, so now again, let us save this and go back for executing. 73 00:08:59,830 --> 00:09:00,720 OK, fine. 74 00:09:00,910 --> 00:09:01,900 Let's check here 75 00:09:04,900 --> 00:09:09,220 we are having the values decrypt fixed. 76 00:09:09,850 --> 00:09:12,970 So the ciphertext. 77 00:09:14,100 --> 00:09:16,290 We must have made some spelling mistakes. 78 00:09:16,890 --> 00:09:17,910 Let's check it. 79 00:09:21,970 --> 00:09:27,470 OK, so better be copied on one call and see the output now. 80 00:09:28,810 --> 00:09:31,210 An invention has to be also proper. 81 00:09:31,840 --> 00:09:38,770 So getting this now, if you want to know how basically it is getting hacked, if you see the first 82 00:09:38,770 --> 00:09:45,980 character as we come back to our program here, what is the value of the index of the overfield? 83 00:09:46,120 --> 00:09:49,320 You can just find out that is 60. 84 00:09:49,750 --> 00:09:55,850 If you add 16 plus 13, you get the value as twenty nine. 85 00:09:56,920 --> 00:10:04,090 Now, when the value go about that will also require a calculator just to make you understand how you 86 00:10:04,390 --> 00:10:09,140 see the value initially that we have given, therefore the character is. 87 00:10:09,880 --> 00:10:18,500 So the value if you see here for B in the first one coming at 16, if we take your C 16 plus the picture 88 00:10:18,520 --> 00:10:21,490 that we have given is 13, it becomes twenty six. 89 00:10:21,490 --> 00:10:24,580 If we subtract twenty six from that, the value comes to three. 90 00:10:25,060 --> 00:10:29,020 So what is the index at the second dictionary for three. 91 00:10:29,290 --> 00:10:30,140 That is C. 92 00:10:30,520 --> 00:10:32,680 So is that coming as the first character. 93 00:10:32,710 --> 00:10:33,250 Yes. 94 00:10:33,730 --> 00:10:35,130 Let's try it for another. 95 00:10:35,140 --> 00:10:36,640 See the value of life. 96 00:10:37,060 --> 00:10:38,680 Go to the first dictionary. 97 00:10:38,710 --> 00:10:41,460 What is the index for y given us twenty five. 98 00:10:41,830 --> 00:10:49,350 If we go back here and see twenty five plus the code thirteen comes to thirty eight. 99 00:10:49,900 --> 00:10:52,560 If we subtract twenty six we get twelve. 100 00:10:52,930 --> 00:10:54,310 What's the value coming on. 101 00:10:54,310 --> 00:10:54,760 Twelve. 102 00:10:54,760 --> 00:10:56,930 That is it in the second dictionary. 103 00:10:57,040 --> 00:10:57,440 Right. 104 00:10:57,760 --> 00:11:00,520 So is that coming here for L. 105 00:11:00,550 --> 00:11:01,110 Yes. 106 00:11:02,380 --> 00:11:08,650 So that is how you're getting a substitute for every key from the force to dictionary. 107 00:11:08,650 --> 00:11:15,130 Alpha1 being substituted by the second dictionary for two and that is the value you're getting for a 108 00:11:15,130 --> 00:11:16,270 decrepit text. 109 00:11:17,140 --> 00:11:24,370 Similarly, if you go from decrypted to encrypted the value of the dictionary, Alfond two is being 110 00:11:24,370 --> 00:11:29,620 substituted in dictionary Alpha1 and then you get the encrypted fixed. 111 00:11:29,950 --> 00:11:32,580 This is basically how you'll see the cipher is executing. 112 00:11:32,590 --> 00:11:36,490 So we have not used your Cichon or the AWADI function. 113 00:11:36,490 --> 00:11:43,240 Instead, we have created the dictionary Alpha one and two by giving some individual values and the 114 00:11:43,240 --> 00:11:50,560 key code for every character and we're using that for encrypting it and again for decrypting the particular 115 00:11:50,560 --> 00:11:51,700 given text. 116 00:11:51,730 --> 00:11:57,800 OK, so in this way we have seen multiple examples on SISA Cipher. 117 00:11:58,100 --> 00:12:02,530 OK, we should make the concept of how to encrypt decrypt using. 118 00:12:02,530 --> 00:12:05,230 This is a cipher concept very much clear. 119 00:12:05,650 --> 00:12:06,000 Right. 120 00:12:06,220 --> 00:12:10,970 So that's it from this particular session of the cipher in Python Hacking. 121 00:12:11,620 --> 00:12:12,490 Thank you very much.