Welcome to The Next Session by Tom Hacking Course, that is about Cesar Saiful.
Now the Cesar Saiful basically uses the keys, which encrypt a particular message differently, depending
on which he is used.
Now, the key for this is also for basically individuals from zero to twenty five.
Now, even if a cryptanalysis knows the Cesar Saiful was used, that alone doesn't give them enough
information to break the cycle.
Now in this particular session, we would be covering the import statement, how to use it, how to
use constants before loop the effects and details of statements, the in and out in operators and also
the find method of the string method.
Now we would be creating a Caesar cipher program for us in the new window and we would be saving it
by a particular means.
This is a cipher, but for this particular program we would need to download the paperclip via modu
and pasted in the same directory.
So we will import that particular module indices for the Python program and then later on we'll see
how to execute it.
So we will first start by creating the program now or just for your understanding, I will show you
that we have already downloaded this paperclip, Lopevi, which is a python file, and this file will
want to import in our currency for the Python program.
So over here will go for a new file.
And in this particular file, we will first start by C.
Import paper clip now is not necessary as it is a Python program itself.
Now, after this, we would create a string variable which will have a particular message store into
it, which can be encrypted or the same can be decrypted.
So we will take the variable name as same as G String, and that's equal to we will give said this is.
Cesar Saiful program, and this is our message now after this.
We will give or take, which will be also used for encryption also and for decryption also.
So let us give you a key code that's equal to we give, for example, 30.
Now, we will give your whether the program will encrypt or decrypt.
So here we are.
Giving more type is equal to in single code.
We are giving the text as encrypted.
Now this you can either separate are putting it in a comment that says send it to wipe, encrypt or
decrypt.
So depending what do you wish to do?
You you the particular given text in the variable mode type.
Now after this, we are creating one simple variable.
We just want to store all these symbols, capital, small keys and numbers, so we will create your
SI symbols type and that will do anything because we will save
Popy to our eyes to u, v, w, x, y, z, all in capital Novogen and small for a b c d e f g h i j
k l m n.
You are still using w, x, y, z and now one, two, three, four, five six seven eight nine zero
will give you an exclamation mark, question mark or dot and, and the semicolon.
OK, so after we have given all the values here now the next thing is we will store the encrypted,
all the decrypted form of the message and another variable.
So for that, we will take your said translater SDR, which is initially to blank.
We are not storing there any values initially.
Now for the symbol in a particular message, we will run the particular loop and we will check.
So now here we will run for C, so here will be using the SVM in our MSG string.
Put the semicolons over for loop starts here.
Now in this we will check the if condition that if the SVM in our symbols type.
Another condition over here now we want to create here the volume index and is a single index is equal
to.
Symbols type dot find in the as if I am OK now we will perform the encryption or decryption option.
So over here, so just below this, we will check.
If so, let's take our more type.
If that is equal, this is double because I want to check for the equality that if we value in that
more type, is equal to encrypt.
If it is encrypted, then we are going to see the translated so translated into X.
Now that's equal to the owner faqir c.
S I m index plus the value of.
Kiko.
Now, after this, we'll go one step back and go for it.
If that if the mood type is not equal to encrypt, but it is equal to the decrypt, OK, then we are
going to see translated into X is equal to our volume index, minus the key.
OK, now we will handle your wrap around if needed.
So over here we will go again one step back and will check if over translated into X if it is more than
equal to the level of using your symbols type.
Then we will see the translated X is equal to.
Translated into X minus the lenhoff symbols type, and again, it is if but if you're translated IDEX,
that is less than zero, then we will see translated into X is equal to.
Translated IDEX plus Willendorf.
Symbol's.
Type, so after this, we will.
Wants one step back and see translated as is equal to translated are plus symbols type.
And in bracket, we will give here the index as translated idiots.
Now, we'll go for the if else, but for the upper if condition.
And over here we will append the symbol without encrypting or decrypting it.
So here we'll see.
Translated as is equal to translated SDR plus the value of your SVM.
And once we have done this, let's go directly here and we will give your print command and then print.
We will print the value of translated SDR.
Now we'll use your paper clip that we use to copy Matau and also be put translated ASDF.
Now let us save this.
We will save it as.
Cesar Saiful thought be right in the.
Program that is an easy drive, hacking and save it.
OK, so now to run, this will directly go to run and see run module.
So this is what we are getting at the encrypted string as when you run the particular program, whatever
text you have written, it is basically encrypted.
So the output of the string that is this is a cipher program and this is our message of this particular
text.
We are basically encrypting using the key.
So this is a cipher program.
Just run automatically copies this encrypted string to the clipboard and you can place it in your email
or the text file also.
So as a result, you can easily send encrypted output from a particular program to another program also.
So now basically to decrypt the message, you can just based the same message that is encrypted over
here, see in this particular part.
Let's remove this bastard here, save it, and now we run the model of what mistake did we do?
We have our mistake and basically we do this or we did not change here from encrypt to the clip, OK?
Only when we say to decrypt, it will be decrypted.
So now, if you say decrypt, it is a cipher program and this is our message.
This is what output we get when we change the value of the message, our variable and the type change
it to decrypt.
Right.
So now basically we come to the importing of module and setting up some variables.
Now we already have some built-In functions and bitin now some function exist in separate programs called
modules.
Modules are basically also your python program that contains additional functions.
Which program can automatically use them so we can import those modules with an appropriate name.
That is an import statement which consist of the import keyword, followed by the module.
Like in this case here we have all that import and the module that is paperclip.
Right.
So now over here we are importing this module so that we can call the paperclip taught copy function
in the particular program.
So as we are using this code copy, if we don't import this, we are not authorized to use this particular
statement here.