Now, after this, we create another dictionary, Alpha two, which is also equal to some values, but
now here we are changing it.
We are reversing the order or shuffling the order.
Basically, you can see so say, for example, reticular the key code first and here we give that is
equal to, say, Z, then let's give one as equal to say then say two equal to see B, then three equal
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
eight nine I.
Then you have been as G you have 11,
12 and 13 and 14 as say and.
Then 15th or the next line, C 16 as B, 17 as Q, 18 as R 19 is.
20 as deep and going to the last line, see you 22.
We do any three.
W twenty four X and twenty five Y.
So we have shuffled certain characters, your correspondent, to the index as after shift.
Now, once we have done with this, we will be creating the functions to accept the string, OK, according
to the shift that you are providing.
So we will define how function see
encrypt the text, which will take the message to start and shift or features two parameters.
And in this will be the ciphertext as initially blank.
We will run a loop for later SDR in your message SDR.
And for that we will check your first basis.
That is, if we will check the letter is still not equal to a blank space, then we will look up the
dictionary and we will add the shift to the index and we will take no one that's equal to use your dictionary
Alpha1 in the index as little as SDR.
Plus use the shift code that you have passed modulus twenty six.
Now that Hillary will look up the second dictionary for the shift alphabets and then we will add a bit.
So we will take your ciphertext.
Plus is equal to the second dictionary that is Alpha to add the index number.
Now, if it is not having any spaces, go to the spot on your we will add the space, my giving cipher
text plus is equal to adult space there.
And once we have done that, let's move.
For in the for loop and we Silvertone the value of Saiful, which means our definition of the function
in cryptics is completed.
Now we will have another function here that is see the clip fixed.
And this also takes your message, Istar and shift your parameters.
And here we have the ciphertext, which is equal to initially black.
Then again, here we run.
So let us start in your messages, dear.
And in this four loop, we will check for the spaces.
That is, if your letter is still not equal to space, call it.
And then we will look up the dictionary and subtract the shift to the index.
So we'll take no one is equal to we will use the dictionary alpha one in the index of letter SDR.
That's minus we use the shift code plus twenty six modulus twenty six and then we will look up for the
second dictionary and for the alphabet.
So here we'll use the full text.
Plus is equal to your dictionary alpha to add the index of number.
Now if this is not true we will go for the ls part here and again we will add the next thing.
The ciphertext plus is equal to space.
So once we have added this, we are supposed to also return the value of the cipher text.
And once that is done, we will define here another main function, which basically is helpful for running
our program.
Now here we are going to use the upper function to convert the lowercase characters to uppercase.
So we are going to use here your message SDR and we will pass that on message as C let's give here in
capital C 510 hiking with seasonal Saiful as a text and double quotation marks.
Also, we give the value of shift code as equal to thirty and then we say here the result SDR is equal
to we call here and grep text in bracket.
Same message as the R dot convert to upper and use the value of shift code.
Then finally you print the value of result SDR here.
Now to execute this main matter, what will have to do is check your if c your name is equal to your
mean in single quotation marks, then you want to call the main method.
Now let us save this.
Let's save it again in the python hacking big enough Sidmouth seven VI.
And let us try to run the audio.
So this is how we are getting the encrypted one, but now suppose we want also for decrypting it.
So we copied on this text go back here.
And in the same main method, we see another same message.
Asgeir is equal to the text that we have copied down.
Now we have this shift code as again, 13 we have again, the result are now we are calling the decrypt
text matau passing there again.
The messages are not in uppercase and the value of shift code and then printing the value of result
SDR here.
OK, so now again, let us save this and go back for executing.
OK, fine.
Let's check here
we are having the values decrypt fixed.
So the ciphertext.
We must have made some spelling mistakes.
Let's check it.
OK, so better be copied on one call and see the output now.
An invention has to be also proper.
So getting this now, if you want to know how basically it is getting hacked, if you see the first
character as we come back to our program here, what is the value of the index of the overfield?
You can just find out that is 60.
If you add 16 plus 13, you get the value as twenty nine.
Now, when the value go about that will also require a calculator just to make you understand how you
see the value initially that we have given, therefore the character is.
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
that we have given is 13, it becomes twenty six.
If we subtract twenty six from that, the value comes to three.
So what is the index at the second dictionary for three.
That is C.
So is that coming as the first character.
Yes.
Let's try it for another.
See the value of life.
Go to the first dictionary.
What is the index for y given us twenty five.
If we go back here and see twenty five plus the code thirteen comes to thirty eight.
If we subtract twenty six we get twelve.
What's the value coming on.
Twelve.
That is it in the second dictionary.
Right.
So is that coming here for L.
Yes.
So that is how you're getting a substitute for every key from the force to dictionary.
Alpha1 being substituted by the second dictionary for two and that is the value you're getting for a
decrepit text.
Similarly, if you go from decrypted to encrypted the value of the dictionary, Alfond two is being
substituted in dictionary Alpha1 and then you get the encrypted fixed.
This is basically how you'll see the cipher is executing.
So we have not used your Cichon or the AWADI function.
Instead, we have created the dictionary Alpha one and two by giving some individual values and the
key code for every character and we're using that for encrypting it and again for decrypting the particular
given text.
OK, so in this way we have seen multiple examples on SISA Cipher.
OK, we should make the concept of how to encrypt decrypt using.
This is a cipher concept very much clear.
Right.
So that's it from this particular session of the cipher in Python Hacking.
Thank you very much.