Welcome to the first session in our Biton hacking beginner level class.
Now, in this particular course, the first topic that we will be covering is the revolt.
So now we need to first understand.
What do you mean, Modibo Saiful?
It basically is encrypting any message by printing it in a reverse order.
So, for example, if we see suppose.
Hello.
It should be printed as in a total reverse order.
So the l r o w space o l l e h that is how it should be basically printed.
OK, so it would be great to get the original message.
You simply reverse the encrypted message again.
You will get it in a decrypted form.
Right.
So encryption and encryption steps are the same, but now we will see one particular code for a reverse
cipher program and then we will see what all things could be done in reverse cipher program that we
would create.
So first thing what we will do is let's just remove this.
Now, basically, we are into Python, ideally, OK, which is basically an interface that you can type
the programs.
If you want to save it, you can create it in a new file, type the whole program, save it and you
will run the particular program, which will give you the total output.
So over here, we will start with C, a variable message that's equal to in single code.
We can say this is Python.
Hacking.
Session one.
We are doing.
Reward's.
Saiful, this basically we want to reverse it, so we are putting this fixed whatever text you want
to make it in reverse order in a variable named message.
Then we say here see translate it is equal to again open closed bracket.
Then we say I is equal to we use the length method and here we put the variable that we have created
minus we put it one because it should go to the length minus one.
That is the last character of your message because here it starts with the index of zero.
Then we say while I is more than equal to zero, calling in here to start the particular loop.
So we will move here and will c c translated.
That is the variable that we have now.
That variable is equal to translate it, plus the value of message at the index of.
OK, and then we see eye to eye, minus one now after this, we come to the next line and we say bring
the value of.
Translated, OK, now let us just save this, so for saving, it will go to file say save, let us say
we didn't drive Biton hacking big enough and here we will give see the more one dot be white as the
extensions for python fights.
OK, and then you can simply press a fight if you want to run or you can go here and here.
Also you can sit on modu so once you see it on module you can see whatever text we have written.
Everything is coming in, the total rules of it.
OK, now suppose you want to decrypt the text that we have already encrypted.
So over here what we will do is we will copy it on this text.
OK, so right.
Click copy.
OK then we will go back to our program.
And over here now in this message, OK, in this line we will be OK.
Now let's save this again and let us run the module again.
So again, this is how we have encrypt decrypted.
OK, so in the first program we have encrypted that in the same program.
Just copy pasting the encrypted one in the message when we have decrypted.
OK, so in this basically we we are making a short of a thing unlike we are hacking using Python by
encrypting and decrypting it.
OK, OK, so now let's go to the program back here and let's understand what have we done this over
here in the light of the first one that is we have the message variable.
So whatever text you want to encrypt or you want to decrypt as a new string, we have placed it inside
the message variable and the translated variable is where our program is basically on the store, the
horrible string.
Right.
So at the start of the program, the translated variable over here is blank.
So it is having no string, it is just a single code Max and not the.
So you don't mean that this is a single quotation now to find the length of a particular string we have
used your the alien method, which is basically used for assignment statement, storing all value in
the variable.
I add that value is nothing but the length of the variable message.
So the expression that is evaluated and stored in the variable length message minus one.
The first part of this is a function that is lenth function and which accepts a string argument, just
like we have this print which is accepting the message argument.
OK, so when we create this particular variable, we get the integer value of how many characters are
there in a particular string.
That is for us it is in the message variable.
OK, now we can also use this lens function in a very interactive shell, for example.
Now let's just go here to the shell here and we write down just to lend and we say hello.
For example, we get the Delinda's fif.
We say, suppose let's just open close back.
We don't give any fixed in between.
So we get the length zero or we see a variable system is equal to.
OK, then we say Lenn is equal to the variable SBM.
OK, we get the let's do all we say in length variable.
We open double quotes, we say hello one text, we let's give your a comma, then we add there all space,
we concatenate that with the variable.
OK, and we close it, so here we get Delinda's 30.
OK, so from this particular return value, we know that the particular string that we have given in
the bracket is having how many characters in a blank string will have a zero character.
So if we store any value apart from a blank value, you will get exactly how many lenth you are storing
in a particular given string in that function of length that we are using.
So after this particular function that we have used, the next thing we run this loop here.
OK, so we over here, we have given an instruction to Python.
That of provided statement is basically made up of four parts.
You can see the first is the real key word that we have.
Then we have the condition that is I is more than equal to zero.
Then we have a colon symbol after that and the block of code, which will execute if the condition is
true, that is, you will pass the value of.
OK, so here a condition is basically nothing but an expression which is used in your vital statements.
And the block of code in the file statement will execute as long as the condition becomes true.
So to understand why, we will need to first learn about booleans, comparison operators and blocks.
So come in to the Boolean data type.
Basically, Boolean has only two values, either true or false.
Now this boolean values Audible's, we call our case sensitive.
So you always need to capitalize the deal or if by leaving the rest in peace so they are not string
value.
So you don't put quotes around it true or false value.
OK, now for example, if you want to try out something, we can say, for example, spam is equal to
two.
OK, now if you want to print the value of spam, we will get the value to or if you say spam is equal
to Foote's again, you bring the value of spam.
Now you get the value for it.
Right.
So like a value of any other data type voice can be also stored in the variables.