Welcome to the next session in our python hacking course that is encrypting with the transposition cipher.
Now, we have seen Cesar Saiful and we have also seen that it is not more secure or the most secure
one.
It doesn't take much of a computer to brute force through all the possible keys.
The transposition cipher, on the other hand, is more difficult to brute force because the number of
possible keys depends on the message length.
Now there are many different types of transposition cipher.
If you look at it now, those different types basically includes the real fanciful, your Saiful, the
disruptive transposition cipher.
Now this particular session will be covering a simple transposition cipher, all the columnar transposition
cipher.
OK, so in this particular session we would be covering the topics like creating functions with def
statements, arguments and parameters, variables in global and the local scoop's.
What is main function?
The list data types, similarities in the list and strings list of list coming to argument and assignment
operators using the joint string matau return values and the written statement.
And finally, the name variable.
Now we will first of all look at how the transposition cipher will.
Now, instead of substituting characters with other characters, the transposition cipher rearranges
the messages symbols into an order that makes the original message unreadable.
Now, because each GUI creates a different ordering or permutation of the characters and script analyst
doesn't know how to rearrange these ciphertext back into the original message.
Now, some steps for encrypting with the transposition cipher are Faustus count the number of characters
in a message and the key second is you will draw a roll off a number of boxes equal to the key.
For example, eight boxes for key of eight or something like that.
Next is start filling in the boxes from left to right and wrong.
One character PO box.
Fourth is when you run out of boxes but still have more characters.
Add another roll of the boxes next year when you reach the last character shared in the unused boxes
in the last row and starting from the top left and going down each column, write out characters.
When you get to the bottom of a column, move to the next column in the right, skip any boxes of any,
and this will be your ciphertext, which is encrypted.
Now, just to show you how this basically steps work in practice, we will encrypt the message by manually
and then we will translate the process into a particular program, not encrypting a message manually.
Now, before we start writing, the code will first walk out on a simple paper or your will you will
say, for example, a notepad for doing that.
Now, instead of a notepad, we will use your Excel, which would be easy for us because we already
have the column in a format that.
Now, let us take one particular example, for example.
So now let us take the text, something like Biton hacking Paul's message.
Now, over here, we will take, for example, the key as the aid in this case.
Now, the range of the possible keys for this type of cipher is from two the half of the message.
Now, what is the message size?
If you just look at this, one, two, three, four, five, six, seven, eight, nine, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21 to 23, 24, 25, 26, 27, 28, 29, 30, including
all the characters.
So the range of the possible keys would be over your from to fill half of the messages.
That is still 15.
So we have used over your digits eight.
But the longer the message you have, the more keys are possible.
Now encrypting the entire particular paragraph, you can say using the column in a strong position would
allow you to use thousands of possible keys.
OK, now what we'll do is first thing will create an eight boxes in a particular room.
Now let's take four, five, six, seven, eight, eight, OK?
We'll just make it in a border type so that, you know, it is easy for us to understand and let us
increase the size of the boxes.
Each boxer's.
Let's remove this that's not required, even this one not required.
We can decrease this, so now we have three, four, five, six, seven, eight, OK, fine.
All should be visible enough.
Properly, let's cut and we pasted here so that even this could be removed.
So now.
Let's make this trip and even all these boxes also will make it refixed now after we have done this,
we have the eight boxes which we have created.
Now, the second step is to start writing the message you want to encrypt into the boxes, placing one
character into each box.
So, for example, now you start writing one, one character,
not even a space that you have.
We are indicating over here with the particular symbol.
So let's insert here a particular symbol.
Let's unleash some special characters.
OK, so here we have the symbol.
Now let's place that symbol over here and again, we will continue for one more has been done.
Now, this particular rule has ended, so now we want another rule below.
So let's take this.
And again.
Let's make it the same formatting and again, start writing here.
So we had reached in H, e, c, g, i, n, g and again here, let's cooperate it on the same symbol
C.
Now, again, we require another rule below, let's take down and do the same thing nowadays, fool,
you are s e again.
We require all space and then M e and the last one we will require.
S s e g, e and dot.
So let's take a little less.
And.
Let's call it on the floor.
OK, so after this, let's write down here, so we have written this particular way.
OK, and last thing that we have is a dot.
So we have even written that the only space is we have stimulated that with a particular symbol.
OK, now.
Just to make it more meaningful, we will increase the.
Foreign sites.
OK, so this is all we have basically arranged it now, this store are not used.
So over here, let us give some different background color just to highlight that we are not using this
particular two boxes because 88 rows or columns would automatically be created.
So we have created the last two boxes in the last row as a reminder to ignore them.