So now here we would create the last function required for this file, and that is we would define the
decrypts with
Saiful little mapping in which we would pass the ciphertext one and the letter mapping one object.
Now, in this matter, we will return a string of ciphertext decrypted with the little map with any
ambiguous decrypted letters replaced with an undisclosed sum.
So first we create a simple key from the letter mappings mapping.
So we say here at the index of is equal in that we are giving X as we value multiplied by the length
of our.
OK, and then we on a loop saying for the Saiful, let one in your.
Later this year.
OK, here we are, checking if the length of your letter mapping one at the index of your site, Falletta
one, and if that is equal to one, then if there's only one letter, then you have to add it to the
key.
So then we create your SADIQI index, and that's equal to silicosis are not use defined matter.
And we use your little mapping one index of Saiful letter one and zero.
OK, now after we have given the value in the key index, we see the key is that we have created the
index of key ideas and that is equal to your Saiful little one.
Then we move on with the L spot for this F and we see the ciphertext.
One parameter is equal to your Saiful.
Next one doc.
We are replacing the Saiful letter one dot.
Law to give data on the.
Similarly, we are seeing the ciphertext one is equal to the ciphertext, one not replace CESI for one,
but a comma again underscores OK and then your receipt he SDR is equal to blank or join the value of
he is OK.
And with the key we have created we would be the ciphertext.
So we are saying now here we would be creating or calling the decrypts method.
So here we are calling the.
Substitution
cipher demo got the group message and passing the star the Saiful next one.
OK, so this very we would be returning back whenever we are calling this the group with Saifullah come
up and this is the method that we are calling it here.
So let's keep the same name.
OK, and this is not just completed here.
The last part that if underscore name underscore is called to give your name on the school single class
and then you call the main.
OK, so now we will see if this particular file.
OK, now let's give your name C hack.
Simple sub.
Save for Dog Beevor and let us bring in our advanceable coach.
OK, so we would save this and win after completing the save of this particular value.
Now, we have already given them the text, which we want to decrypted.
Let us try and execute this and see the output.
OK, paperclip is not there.
Fine is a dead end.
I will follow.
Let us check it.
No.
So we'll have to copy down that.
Let's do that.
OK, we have copied from our intermediate level.
So now again, let us try to run this.
OK, line number ninety seven that is check that it did go to line.
Ninety seven.
OK, what are we checking here at the end of it?
We are checking if underscore on the screen and then is equal to double is equal to that mean.
And we are calling this the main method, OK?
It is looking fine.
Let's see another that is on line number 12.
OK, so let's go to line 12.
OK, over here now that is we are seeing simple sub one, so have we created some up from here?
Yes, and it is having the same method of the same parameter that we are positing that this message.
OK, so let us just try to.
Substitute the name, OK?
And then we see in Maine, where in Maine, they're trying to call this over here, OK, that's not
an issue.
Let's try and execute this again.
OK, let's see, line number 16 line.
OK, fine, let's just try it out.
Of we have made a mistake, if we have we have Simplist up there where we are calling it, and in this
we are creating this.
Our mistake was it was supposed to be slash as well.
OK, so now if we try to execute this, we get some part of the message, not all, but at least to
some extent, we are able to decrypt the message of substitution cipher for whatever it is not able
to.
We are getting the values of underscore also.
Now let us explore the source code in detail that we have written here.
OK, now the first few lines of the simple substitution hacking program is basically importing sort
of different modules.
Now here we have imported more modules as compared to any other program so far.
So we have here the letters ETR, which is a constant global variable, which stores the symbols it
given, which consists of all the uppercase characters also.
OK, now the audio module is basically a regular expression module which allows for sophisticated string
manipulation using any regular expression.
Now let's have a look at how the regular expression vote.
OK, so a regular expression are basically strings that define a specific pattern that matches certain
string.
Now, for example, if we see apostrophe A to Z is one, OK, is a regular expression that Delphi couldn't
find any characters that is not in the uppercase from A to Z of this character, like a space or type
on a new line character.
Now after that, the road company function basically creates a regular expression pattern object, which
is abbreviated also as an object or a pattern object that the module can use.
We would use this object to remove any known little characters from the function when we're using that
symbol.
OK, now let's look at setting up our main function.
So if we move below, we're defining the main function.
OK, then as in the previous hacking programs that we have done the main function Stoll's your ciphertext
in the messages are variable and that is basically passes the variable, your hack simple sub one method
or the function which we would be creating.
So instead of returning the decrypted message or null if unavailable to decrypt, we have had some sub
one which returns and intercept this little mapping within the group.
Remove this interceptive cipher, let them approve, then gets passed to your decrypt.
What happens now that is helpful for decrypting the ciphertext, storing the message in readable format.
So as you can see, we are having a more detail of decrypting this in the coming session.
OK, now discipling a map that shows your lack of mapping is a dictionary value, which has twenty six
uppercase particles you can see here, and that is a single letter string as keys are represented.
Saifullah.
So it also list the uppercase letters of your potential decryption letters for each letter as a dictionary
value.
Now, when every letter has just one potential decryption letter associated with it, we have a fully
solved mapping and can be any ciphertext using the same cipher and the key.
OK, so each side Fallica mapping generated depends on your ciphertext, which is used.
So in some cases we have only partially solved mapping and with some those have more potential descriptions
and other side follicles have multiple potential descriptions.
So short of ciphertext that don't contain every letter of the alphabet are more likely to result in
an incomplete map.