Now, if we have to run the main method, as in the earlier one we have done, we will have to check
name, underscore name and the score is equal to in single court mean, then you will have to call the
men.
So now let us see if this.
Again, in hiking goals and we'll see what does Demo 14 thought we might and let us try and run this
particular example.
Transposition, encrypt, fine, let us just check if we have made any spelling mistake there, so that's
why we're here.
So we have used the transposition e capital letters and encrypt.
Now, here, the files that we have created earlier, that is the most painful encryption and the 13
for decryption that we will have to use here.
So let us just substitute the filenames.
And also the method is encrypted messages and decrypt message acedia.
So just everything looks good.
Now let us execute this device and message SDR.
Let us run this again.
Fine.
Let's open up the demo then and here we have encrypted message, Asgeir file, so let us copy this in
the current demo.
Similarly, we also have in sort of intermittent tinnitus decrypt messages.
Now let us save it and run it again.
Decrypt message.
SDR has no attributes.
Look at the file demo 13 that we have decrypt and is also small.
Fine, no issues.
Let's open up the 14, the current one and let the substitute define there.
OK, now let's try and execute señoritas executing.
We have totally given their daily range of 20, so we'll have the 20 test, which it will take with
the help of different keys and the message that we have given in the encrypt and decrypt file.
And after everything is successful, it would give us the message as transpositions ciphertext has passed
successfully.
So after we have completed the output now over here, the desktop program creates a random message and
chooses a random Kilson.
So it doesn't matter that the message is just some random letters because the program only needs to
check that encrypting and then decrypting the message results in the original message.
So using a loop, the program repeat this particular test 20 times as we have seen.
And if any point, the string return from the decrypt method isn't the same as the original message,
then you would get that the error which would print the error that we have given that it is not matching
or mismatch of the text.
Now, let us explore the source code that we have written in our demo to 14. Beevor program.
So over here, the first thing we have done is if you look at the first line, that's our import statement.
When we have imported the modules, including the one which we have already seen, that is random system
and also the programs which we have already created, that is Demo 10 and then totally by just typing
their names without the dot by extension, because that is not required.
Now after this, we'll move on to creating the pseudo random numbers now to create some random numbers
which will help for generating the messages and the keys.
We are basically using the random modules.
See the function now before we delve into what the CI does not, let us just have a look at how the
random numbers walks in Python by trying out some random doctorand in functions.
Now, this function that we will be using later on in the session takes to integer arguments and returns
a random integer between those two individuals, including the individuals that you have passed on now.
For example, if we go back to our interactive shell here and we see, for example, the import random
and here we see random thought Švanda and we pass one comma 20 will get any value, random value in
between those two.
Similarly, you again see, for example, random doctorand in one comma 20.
This time you would get some different values.
Or for that case you say another range, say one hundred comma, two thousand would get any value but
one hundred to two thousand.
Now of course the numbers you get will probably be different from those that we are seeing over here
because this is what we are executing at that time.
We are getting some random numbers.
So you might not get the output as C, but these numbers generated by random doctorand in functions
are not truly random.
They are produced from a pseudo random number generator algorithm, which takes an initial number and
produces other numbers based on some formulas.
Now the initial number that the pseudo random number generator starts with is called as the seed.
So if you know this, the rest of the numbers the generator produces are quite predictable because when
you see the seed to a particular or specific number, the same numbers will be generated in the same
order.
Now, these random looking but predictable numbers are also called pseudo random numbers.
Biton programs for which you don't set a seed.
Use the computers current block time to set the particular seed.
You can reset buttons at random seed by calling the random dot seed function.
Now, we would see certain variations of the pseudo random numbers, which are completely random by
entering something in the interactive fashion, but we will do that in the next session and look at
the output.
That's it from this current session.
Thank you very much.