1 00:00:00,750 --> 00:00:02,400 Welcome to this new section. 2 00:00:03,090 --> 00:00:08,010 We are going to use Zwi encryption to encrypt our bill. 3 00:00:09,120 --> 00:00:18,810 And so encryption is is where you take the data and then you use that to our operation on that data. 4 00:00:19,590 --> 00:00:28,860 So example here, if you have this form banks, and if you were to accelerate in the secret key, assuming 5 00:00:28,860 --> 00:00:31,290 this is a key, you would get this. 6 00:00:31,860 --> 00:00:33,900 So this is the SLR operation. 7 00:00:35,700 --> 00:00:44,850 And then as our operation is where you use the original Beadie zero, and the key is one. 8 00:00:45,750 --> 00:00:46,860 So you would get one. 9 00:00:48,000 --> 00:00:53,960 It means either one or the other needs to be one. 10 00:00:53,970 --> 00:00:56,280 You kind of have more as one. 11 00:00:56,820 --> 00:01:02,820 So, for example, if the original Betis one and the Keys also one, can you get zero? 12 00:01:03,870 --> 00:01:06,060 And then over here you are the biggest one. 13 00:01:06,480 --> 00:01:09,180 But the key is, you know, you get over. 14 00:01:09,810 --> 00:01:13,620 So there you are, which means exclusive operator. 15 00:01:14,880 --> 00:01:25,050 Now, the good thing about Axler is that if you a story and you get ciphertext and you want to decrypt 16 00:01:25,170 --> 00:01:30,330 this, everything's all you need to do is to Azahari again with the same key. 17 00:01:31,200 --> 00:01:39,270 So, for example, the ciphertext here, which is coming from here, you are you the key the second 18 00:01:39,270 --> 00:01:44,840 time in these keys, assuming key, you would get the original data. 19 00:01:46,320 --> 00:01:46,970 This one here. 20 00:01:47,890 --> 00:01:54,300 So as you are, it's easy simply to encrypt your data. 21 00:01:55,800 --> 00:02:03,120 So go in, download this Puji zero four storing thing, Bill, and zip and put it in the mail f with 22 00:02:03,120 --> 00:02:04,050 it on your desktop. 23 00:02:05,280 --> 00:02:07,170 Inside it, you will find four files. 24 00:02:08,190 --> 00:02:18,990 The compound, that script will take your source code, which is X and Y encrypt first hip and then 25 00:02:18,990 --> 00:02:22,740 build the output X file. 26 00:02:23,070 --> 00:02:25,050 So I could tell that EMC. 27 00:02:27,090 --> 00:02:28,560 And then you have a Python script. 28 00:02:29,430 --> 00:02:35,340 Now Python script will and create shell called the shell code. 29 00:02:35,390 --> 00:02:39,360 Is not bad nor can be sinister on. 30 00:02:40,320 --> 00:02:48,570 So if you opened by the script, we can see the code for the python, which is very simple imposture 31 00:02:48,610 --> 00:02:50,310 the system library. 32 00:02:51,060 --> 00:03:00,420 And then he creates a redeclared encryption key here called secret x alaki narrowly defined function 33 00:03:00,690 --> 00:03:07,540 contextual R function two parameters, the Schuckert debris, one to encrypt and encryption. 34 00:03:08,220 --> 00:03:09,120 He's coming from here. 35 00:03:10,560 --> 00:03:15,270 And then inside this function, you will convert the encryption key to a string. 36 00:03:15,780 --> 00:03:18,510 And so these variable called encryption key. 37 00:03:19,620 --> 00:03:23,850 And then you calculate the length of the key and key to a high variable. 38 00:03:24,780 --> 00:03:30,240 And then we declare you end up with string initially initialized to an empty string. 39 00:03:31,260 --> 00:03:40,020 And then we use of falu to iterate through the data that we put in for each for each database, tracking 40 00:03:40,020 --> 00:03:40,590 the element. 41 00:03:42,120 --> 00:03:51,050 And then for each element, we are going to call it Xolani and then Banita upstream. 42 00:03:52,260 --> 00:03:59,200 And then over here, the encryption keys also dateable for each time that you encrypt. 43 00:03:59,530 --> 00:04:03,390 Also use sliding caching key. 44 00:04:04,440 --> 00:04:10,290 So once you hit the end of the encryption key, then you go back to the beginning of the encryption 45 00:04:10,290 --> 00:04:10,740 key. 46 00:04:11,040 --> 00:04:13,740 So you think a sliding, rotating key. 47 00:04:14,280 --> 00:04:21,360 So for every character, you being content with a different you have a different element of the encryption 48 00:04:21,360 --> 00:04:21,720 key. 49 00:04:22,590 --> 00:04:25,290 Finally, when you finish doing that, you are getting help with string. 50 00:04:26,430 --> 00:04:32,550 And then you have another function to print up the ciphertext to help put it into a string which can 51 00:04:32,550 --> 00:04:38,130 be ready for you to use in insert your source code, your C source code. 52 00:04:39,810 --> 00:04:45,890 So the main entry point for these heightened scrutiny over here is one. 53 00:04:47,220 --> 00:04:53,040 So here you need to specify a parameter for the script to use. 54 00:04:53,430 --> 00:04:56,400 A parameter is a name on file that you want to encrypt. 55 00:04:57,540 --> 00:04:59,820 So the naming of fun in this case would be not. 56 00:05:01,040 --> 00:05:09,200 So this this line here, we just open the file for reading, and you will read by our Women's Week by 57 00:05:10,790 --> 00:05:17,570 Sister Huckabee one barometer of the scrutiny, Sir Harvey zero will be the name of the screen. 58 00:05:18,710 --> 00:05:21,140 And then you have a tri accent here in case. 59 00:05:21,540 --> 00:05:21,910 Yeah. 60 00:05:21,940 --> 00:05:26,150 User made a mistake by not supplying input far. 61 00:05:26,510 --> 00:05:31,930 Now you bring an error message to Talisa, the proper usage of the script. 62 00:05:32,210 --> 00:05:40,650 And then you actually Hiwa, if the user managed to supply the correct parameters, you were going to 63 00:05:40,670 --> 00:05:47,630 see you wouldn't see that the name of the file to a variable Coplin text, and then you would proceed 64 00:05:47,840 --> 00:05:52,850 to this line here that you will call the actual function, which you be fine up here. 65 00:05:53,720 --> 00:05:55,070 Yes, we are functional. 66 00:05:55,490 --> 00:06:02,780 Then take the first parameter as they're paying taxes, which they're put the name of the farm and also 67 00:06:02,780 --> 00:06:09,110 take the encryption key, which is defined out here, and pass both parameters to the function. 68 00:06:09,920 --> 00:06:19,190 So the function we then implement string and return stream and then finally we string will be safe to 69 00:06:19,190 --> 00:06:20,990 another variable called ciphertext. 70 00:06:21,560 --> 00:06:27,470 And then here is where you print the output of the ciphertext. 71 00:06:29,030 --> 00:06:33,140 So to use this file, you need to open a command prompt. 72 00:06:33,140 --> 00:06:33,740 Using how? 73 00:06:33,760 --> 00:06:34,220 Issuing a a. 74 00:06:35,450 --> 00:06:41,180 And then we hear you have our note sherkat, which is similar in a previous peasants'. 75 00:06:41,720 --> 00:06:44,840 And over here is your C program. 76 00:06:45,920 --> 00:06:46,480 Let's open it. 77 00:06:49,280 --> 00:06:50,680 So, yes, he program here. 78 00:06:50,690 --> 00:06:52,460 We have a function to decrypt. 79 00:06:53,660 --> 00:06:58,580 And this is the P paid is defined so that you could function a. 80 00:06:59,360 --> 00:07:07,310 One, two, three, four parameters, the encrypted data, the line of the computer, and then the encryption 81 00:07:07,310 --> 00:07:09,500 key and allow the encryption key. 82 00:07:10,510 --> 00:07:18,170 Initially, he find the key and then assign Nicaragua's key index of zero. 83 00:07:19,220 --> 00:07:24,860 And then here is way available through the data, yet yanqui data. 84 00:07:25,580 --> 00:07:31,910 And then you can go from element by element till he reaches the end of the string. 85 00:07:33,290 --> 00:07:39,270 And then you will use the key encryption key character by character. 86 00:07:39,320 --> 00:07:42,170 So starting in first element of the character. 87 00:07:43,280 --> 00:07:48,170 And then here, if you reach the end of the encryption key, we ricchetti back to zero. 88 00:07:49,040 --> 00:07:52,650 And over here, you see where you decrypted by Xolani. 89 00:07:52,880 --> 00:08:02,330 If the key encryption key first element and the first data element, zero of the encrypted data and 90 00:08:02,330 --> 00:08:05,810 then you write the three, you will write. 91 00:08:06,200 --> 00:08:07,300 They cannot use anything. 92 00:08:08,240 --> 00:08:09,890 Then you increase their key next. 93 00:08:10,250 --> 00:08:16,160 So now you look you will now go into the second element of the encrypted data. 94 00:08:16,580 --> 00:08:20,960 And you also have the second key second element of the key. 95 00:08:21,740 --> 00:08:25,670 And then you repeat the whole process until the whole thing is decrypted. 96 00:08:26,360 --> 00:08:32,630 So once it's finished, decrypting your original encrypted data that is sending will be overwritten, 97 00:08:32,750 --> 00:08:33,980 either decrypted data. 98 00:08:35,390 --> 00:08:36,840 You have the main function here. 99 00:08:37,400 --> 00:08:43,010 And this is where you need to base your encrypted string. 100 00:08:43,880 --> 00:08:50,000 So when you and you first start out this thing we blame, his team will be blame. 101 00:08:50,810 --> 00:08:52,550 He will be just be like this. 102 00:08:53,090 --> 00:08:54,670 So you need to supply the peel. 103 00:08:55,220 --> 00:09:04,310 So then by running the encrypted Python script, if they're not bendin as a barometer. 104 00:09:05,180 --> 00:09:11,150 And then you take the output and then we presume here you do that in a while. 105 00:09:12,290 --> 00:09:13,590 And then here is value. 106 00:09:13,640 --> 00:09:17,420 Copy the size of the payment from up here, sivi to a period length. 107 00:09:18,110 --> 00:09:21,030 And here is very defined encryption secret. 108 00:09:21,110 --> 00:09:29,870 So our key issue and as you you use Koczela to allocate memory and prisoner addresses and also the pillar 109 00:09:30,290 --> 00:09:36,050 which is in phone and also get address how the allocated memory us for user to press enter. 110 00:09:36,470 --> 00:09:37,940 And then it is a present. 111 00:09:38,120 --> 00:09:44,480 He goes ahead and called the decryption function or here and passes the pillar a payroll line. 112 00:09:44,930 --> 00:09:46,670 He comes home here. 113 00:09:48,050 --> 00:09:51,920 And then the payroll is coming from here. 114 00:09:53,330 --> 00:09:56,390 And then the encryption key, which is coming from here. 115 00:09:57,170 --> 00:09:59,520 And then the site I encryption give his calculator. 116 00:10:01,360 --> 00:10:07,830 And then here, copies after the decrypted, your payload will then be overwritten, meaning you to 117 00:10:07,840 --> 00:10:13,630 decrypt it, and then you pass encrypted data into the memory function. 118 00:10:14,210 --> 00:10:18,120 We should copy the data into the allocated memory. 119 00:10:18,130 --> 00:10:21,670 He came from QEP, which I like after. 120 00:10:21,670 --> 00:10:28,600 Then you use whatever attack you may get, which I'll make a logical memory executable as before. 121 00:10:29,200 --> 00:10:31,450 And finally, here you present again. 122 00:10:31,780 --> 00:10:38,440 You will again create a check and execute Elkington memory, which now contains the decrypted data. 123 00:10:39,340 --> 00:10:40,330 So that's how it works. 124 00:10:40,450 --> 00:10:48,800 Now we are going to you are going to use encrypted Python script to create our encrypted mail. 125 00:10:49,420 --> 00:10:50,840 So let's open air coming up. 126 00:10:51,030 --> 00:10:51,840 Angry here. 127 00:10:52,240 --> 00:10:54,070 Clicking on excessive quantitative tools. 128 00:10:55,690 --> 00:11:02,290 Then you copy the path of least for that, come here and change directly to it. 129 00:11:04,000 --> 00:11:09,760 Now we are going to call this script if Python two point seven. 130 00:11:10,720 --> 00:11:12,010 Not on my computer. 131 00:11:12,010 --> 00:11:16,090 You should be synergize python two point seven, async CGI. 132 00:11:16,810 --> 00:11:22,270 And then you scored on this is Python two point seven and Python iciest is one. 133 00:11:23,170 --> 00:11:27,340 So we need to copy this path where the python is fun. 134 00:11:28,270 --> 00:11:35,770 So we copy this part, print here, paste, put it best name, and then the name of the python. 135 00:11:36,820 --> 00:11:41,890 You can use Python three point seven, because this is not this script here. 136 00:11:42,820 --> 00:11:45,510 It's not compatible with Python 3.0. 137 00:11:45,510 --> 00:11:49,390 And the next thing you need is to call a script. 138 00:11:50,020 --> 00:11:54,520 So the new screenies and create the XOR. 139 00:11:56,920 --> 00:11:57,330 Incorrect. 140 00:11:58,180 --> 00:12:05,290 So our python know if you pretend to be tiny parameters, you will show the usage. 141 00:12:05,830 --> 00:12:10,810 He says his name is in locationally a python EIC. 142 00:12:11,380 --> 00:12:16,360 In memory of Python, screw the input far Ananya profile. 143 00:12:16,810 --> 00:12:23,050 And here you have a redirect operator so that when you run this, you how could you do this far? 144 00:12:24,580 --> 00:12:26,020 OK, so this is how easy. 145 00:12:26,680 --> 00:12:31,750 So you repeat the command now you supply the input file input. 146 00:12:31,750 --> 00:12:33,220 Far East been. 147 00:12:34,180 --> 00:12:36,390 So we take what they mean. 148 00:12:36,880 --> 00:12:41,800 If you press enter now, we start providing the redirect operator to the aquifer. 149 00:12:42,310 --> 00:12:45,370 You enter now you output your screen. 150 00:12:45,910 --> 00:12:46,990 That is not what we want. 151 00:12:47,080 --> 00:12:48,520 You only output to a file. 152 00:12:49,210 --> 00:12:50,490 So we repeat a command. 153 00:12:50,860 --> 00:12:52,360 We put the right redirect. 154 00:12:52,360 --> 00:12:54,610 Operator have you given up? 155 00:12:54,610 --> 00:12:56,590 Will find the time note back. 156 00:12:57,610 --> 00:13:01,690 Not so far as to ask you. 157 00:13:01,690 --> 00:13:06,580 Remind ourselves that this is actually going encrypted far. 158 00:13:07,600 --> 00:13:08,320 No, we can't. 159 00:13:09,190 --> 00:13:10,990 And now we're new, far greater here. 160 00:13:11,470 --> 00:13:17,760 So our next thing we are going to open this file opening is not bad pass plus. 161 00:13:18,280 --> 00:13:22,630 And this is your very encrypted data properly formatted for you. 162 00:13:22,630 --> 00:13:23,040 And I see. 163 00:13:23,050 --> 00:13:23,560 Formatted. 164 00:13:24,370 --> 00:13:27,010 So we copy everything correctly and copy. 165 00:13:27,790 --> 00:13:31,480 And we are going to open our source code far. 166 00:13:31,990 --> 00:13:33,550 We've looked at best place. 167 00:13:34,810 --> 00:13:41,710 And then over here, we are going to paste our content file here. 168 00:13:42,080 --> 00:13:42,340 Yeah. 169 00:13:44,070 --> 00:13:44,820 I see. 170 00:13:46,000 --> 00:13:47,470 Let's go to the right, Michou. 171 00:13:47,740 --> 00:13:49,210 Everything good. 172 00:13:49,510 --> 00:13:50,010 Everything. 173 00:13:50,860 --> 00:13:52,690 So now remember to save this. 174 00:13:54,310 --> 00:13:56,950 And then we are now ready to compile it. 175 00:13:57,310 --> 00:13:59,080 So we will run the compiler script. 176 00:14:01,460 --> 00:14:06,840 Press enter before I to campaign here, Cifas. 177 00:14:09,270 --> 00:14:13,140 And here you see he is completa Yeti fans who are here. 178 00:14:14,280 --> 00:14:16,050 Now you can run this Assefa. 179 00:14:21,170 --> 00:14:27,210 So he brings the pillar in yellow memory address as it you press enter to decrypt. 180 00:14:28,010 --> 00:14:29,030 Oh, so I built it. 181 00:14:30,450 --> 00:14:35,330 So you present danger, you create, you present danger. 182 00:14:36,260 --> 00:14:38,780 You may shellcode launch an attack. 183 00:14:39,470 --> 00:14:40,370 So that's how it works. 184 00:14:41,150 --> 00:14:46,010 So in the next video, I'm going to run it again and examine the NBG. 185 00:14:47,150 --> 00:14:48,110 Thank you for watching.