1 00:00:00,330 --> 00:00:05,220 Welcome to the first session in our Biton hacking beginner level class. 2 00:00:05,640 --> 00:00:10,660 Now, in this particular course, the first topic that we will be covering is the revolt. 3 00:00:10,660 --> 00:00:13,680 So now we need to first understand. 4 00:00:13,680 --> 00:00:15,580 What do you mean, Modibo Saiful? 5 00:00:15,960 --> 00:00:21,430 It basically is encrypting any message by printing it in a reverse order. 6 00:00:21,840 --> 00:00:24,600 So, for example, if we see suppose. 7 00:00:25,110 --> 00:00:25,650 Hello. 8 00:00:27,780 --> 00:00:31,360 It should be printed as in a total reverse order. 9 00:00:31,830 --> 00:00:39,720 So the l r o w space o l l e h that is how it should be basically printed. 10 00:00:40,170 --> 00:00:43,620 OK, so it would be great to get the original message. 11 00:00:43,620 --> 00:00:46,830 You simply reverse the encrypted message again. 12 00:00:46,830 --> 00:00:48,960 You will get it in a decrypted form. 13 00:00:49,410 --> 00:00:49,800 Right. 14 00:00:49,830 --> 00:00:58,110 So encryption and encryption steps are the same, but now we will see one particular code for a reverse 15 00:00:58,110 --> 00:01:05,370 cipher program and then we will see what all things could be done in reverse cipher program that we 16 00:01:05,370 --> 00:01:06,060 would create. 17 00:01:06,600 --> 00:01:10,620 So first thing what we will do is let's just remove this. 18 00:01:10,830 --> 00:01:16,470 Now, basically, we are into Python, ideally, OK, which is basically an interface that you can type 19 00:01:16,470 --> 00:01:17,220 the programs. 20 00:01:17,490 --> 00:01:23,280 If you want to save it, you can create it in a new file, type the whole program, save it and you 21 00:01:23,280 --> 00:01:26,880 will run the particular program, which will give you the total output. 22 00:01:27,270 --> 00:01:35,430 So over here, we will start with C, a variable message that's equal to in single code. 23 00:01:35,790 --> 00:01:39,510 We can say this is Python. 24 00:01:40,680 --> 00:01:41,340 Hacking. 25 00:01:42,730 --> 00:01:43,900 Session one. 26 00:01:45,000 --> 00:01:47,100 We are doing. 27 00:01:48,450 --> 00:01:49,170 Reward's. 28 00:01:50,330 --> 00:01:56,750 Saiful, this basically we want to reverse it, so we are putting this fixed whatever text you want 29 00:01:56,750 --> 00:02:00,440 to make it in reverse order in a variable named message. 30 00:02:00,920 --> 00:02:07,400 Then we say here see translate it is equal to again open closed bracket. 31 00:02:07,580 --> 00:02:15,140 Then we say I is equal to we use the length method and here we put the variable that we have created 32 00:02:15,650 --> 00:02:19,400 minus we put it one because it should go to the length minus one. 33 00:02:19,400 --> 00:02:25,060 That is the last character of your message because here it starts with the index of zero. 34 00:02:25,370 --> 00:02:33,410 Then we say while I is more than equal to zero, calling in here to start the particular loop. 35 00:02:33,830 --> 00:02:39,650 So we will move here and will c c translated. 36 00:02:39,860 --> 00:02:42,590 That is the variable that we have now. 37 00:02:42,590 --> 00:02:50,900 That variable is equal to translate it, plus the value of message at the index of. 38 00:02:52,060 --> 00:03:01,000 OK, and then we see eye to eye, minus one now after this, we come to the next line and we say bring 39 00:03:01,840 --> 00:03:02,770 the value of. 40 00:03:05,430 --> 00:03:16,320 Translated, OK, now let us just save this, so for saving, it will go to file say save, let us say 41 00:03:16,320 --> 00:03:24,660 we didn't drive Biton hacking big enough and here we will give see the more one dot be white as the 42 00:03:24,660 --> 00:03:26,280 extensions for python fights. 43 00:03:26,730 --> 00:03:33,470 OK, and then you can simply press a fight if you want to run or you can go here and here. 44 00:03:33,510 --> 00:03:39,600 Also you can sit on modu so once you see it on module you can see whatever text we have written. 45 00:03:39,720 --> 00:03:42,360 Everything is coming in, the total rules of it. 46 00:03:42,690 --> 00:03:48,870 OK, now suppose you want to decrypt the text that we have already encrypted. 47 00:03:49,170 --> 00:03:53,220 So over here what we will do is we will copy it on this text. 48 00:03:53,520 --> 00:03:54,660 OK, so right. 49 00:03:54,660 --> 00:03:55,950 Click copy. 50 00:03:56,100 --> 00:03:59,460 OK then we will go back to our program. 51 00:03:59,940 --> 00:04:06,540 And over here now in this message, OK, in this line we will be OK. 52 00:04:06,810 --> 00:04:11,540 Now let's save this again and let us run the module again. 53 00:04:11,790 --> 00:04:14,940 So again, this is how we have encrypt decrypted. 54 00:04:15,360 --> 00:04:20,070 OK, so in the first program we have encrypted that in the same program. 55 00:04:20,070 --> 00:04:24,490 Just copy pasting the encrypted one in the message when we have decrypted. 56 00:04:25,020 --> 00:04:32,220 OK, so in this basically we we are making a short of a thing unlike we are hacking using Python by 57 00:04:32,490 --> 00:04:35,080 encrypting and decrypting it. 58 00:04:35,100 --> 00:04:41,340 OK, OK, so now let's go to the program back here and let's understand what have we done this over 59 00:04:41,340 --> 00:04:45,750 here in the light of the first one that is we have the message variable. 60 00:04:45,960 --> 00:04:51,480 So whatever text you want to encrypt or you want to decrypt as a new string, we have placed it inside 61 00:04:51,480 --> 00:04:57,900 the message variable and the translated variable is where our program is basically on the store, the 62 00:04:58,140 --> 00:04:59,030 horrible string. 63 00:04:59,040 --> 00:04:59,380 Right. 64 00:04:59,730 --> 00:05:04,490 So at the start of the program, the translated variable over here is blank. 65 00:05:04,500 --> 00:05:09,600 So it is having no string, it is just a single code Max and not the. 66 00:05:09,960 --> 00:05:17,310 So you don't mean that this is a single quotation now to find the length of a particular string we have 67 00:05:17,310 --> 00:05:24,150 used your the alien method, which is basically used for assignment statement, storing all value in 68 00:05:24,150 --> 00:05:24,870 the variable. 69 00:05:24,990 --> 00:05:29,820 I add that value is nothing but the length of the variable message. 70 00:05:30,240 --> 00:05:35,490 So the expression that is evaluated and stored in the variable length message minus one. 71 00:05:35,790 --> 00:05:42,240 The first part of this is a function that is lenth function and which accepts a string argument, just 72 00:05:42,240 --> 00:05:46,260 like we have this print which is accepting the message argument. 73 00:05:46,710 --> 00:05:53,190 OK, so when we create this particular variable, we get the integer value of how many characters are 74 00:05:53,190 --> 00:05:54,660 there in a particular string. 75 00:05:54,660 --> 00:05:57,330 That is for us it is in the message variable. 76 00:05:57,600 --> 00:06:03,270 OK, now we can also use this lens function in a very interactive shell, for example. 77 00:06:03,690 --> 00:06:10,420 Now let's just go here to the shell here and we write down just to lend and we say hello. 78 00:06:11,040 --> 00:06:14,690 For example, we get the Delinda's fif. 79 00:06:14,970 --> 00:06:18,120 We say, suppose let's just open close back. 80 00:06:19,050 --> 00:06:21,670 We don't give any fixed in between. 81 00:06:21,900 --> 00:06:27,000 So we get the length zero or we see a variable system is equal to. 82 00:06:27,900 --> 00:06:34,050 OK, then we say Lenn is equal to the variable SBM. 83 00:06:34,390 --> 00:06:38,570 OK, we get the let's do all we say in length variable. 84 00:06:39,090 --> 00:06:46,920 We open double quotes, we say hello one text, we let's give your a comma, then we add there all space, 85 00:06:47,190 --> 00:06:49,620 we concatenate that with the variable. 86 00:06:51,060 --> 00:06:54,600 OK, and we close it, so here we get Delinda's 30. 87 00:06:55,020 --> 00:07:01,140 OK, so from this particular return value, we know that the particular string that we have given in 88 00:07:01,140 --> 00:07:07,750 the bracket is having how many characters in a blank string will have a zero character. 89 00:07:07,980 --> 00:07:14,250 So if we store any value apart from a blank value, you will get exactly how many lenth you are storing 90 00:07:14,250 --> 00:07:19,470 in a particular given string in that function of length that we are using. 91 00:07:19,890 --> 00:07:25,190 So after this particular function that we have used, the next thing we run this loop here. 92 00:07:25,320 --> 00:07:29,400 OK, so we over here, we have given an instruction to Python. 93 00:07:29,400 --> 00:07:34,630 That of provided statement is basically made up of four parts. 94 00:07:34,650 --> 00:07:38,100 You can see the first is the real key word that we have. 95 00:07:38,670 --> 00:07:42,520 Then we have the condition that is I is more than equal to zero. 96 00:07:43,020 --> 00:07:49,500 Then we have a colon symbol after that and the block of code, which will execute if the condition is 97 00:07:49,500 --> 00:07:52,710 true, that is, you will pass the value of. 98 00:07:53,540 --> 00:07:59,130 OK, so here a condition is basically nothing but an expression which is used in your vital statements. 99 00:07:59,430 --> 00:08:04,590 And the block of code in the file statement will execute as long as the condition becomes true. 100 00:08:04,770 --> 00:08:11,310 So to understand why, we will need to first learn about booleans, comparison operators and blocks. 101 00:08:11,550 --> 00:08:13,450 So come in to the Boolean data type. 102 00:08:13,470 --> 00:08:17,260 Basically, Boolean has only two values, either true or false. 103 00:08:17,580 --> 00:08:21,210 Now this boolean values Audible's, we call our case sensitive. 104 00:08:21,580 --> 00:08:27,780 So you always need to capitalize the deal or if by leaving the rest in peace so they are not string 105 00:08:27,780 --> 00:08:28,140 value. 106 00:08:28,150 --> 00:08:31,890 So you don't put quotes around it true or false value. 107 00:08:32,010 --> 00:08:38,380 OK, now for example, if you want to try out something, we can say, for example, spam is equal to 108 00:08:38,970 --> 00:08:39,320 two. 109 00:08:40,230 --> 00:08:46,110 OK, now if you want to print the value of spam, we will get the value to or if you say spam is equal 110 00:08:46,110 --> 00:08:48,890 to Foote's again, you bring the value of spam. 111 00:08:48,900 --> 00:08:50,790 Now you get the value for it. 112 00:08:51,240 --> 00:08:51,480 Right. 113 00:08:51,600 --> 00:08:57,310 So like a value of any other data type voice can be also stored in the variables.