So now here we are having a for loop for Saiful Ward, one indecipherable list, a stop in this getting
a new SAIFULLAH mapping for cipherText World.
We are seeing candidate map last year is equal to get the blind side Fullarton mapping swane.
Then we have the vote pattern this year which is calling them make lopatin one.
Don't get the vote pattern.
Instead of passing this Saiful vote in this as the parameter then it checks.
If your vote pattern is just not in the vote patterns, not all patterns then you are saying continue.
Now this vote was not in our dictionary so we are saying to continue.
Then later we are saying at the letters of each candidate to the mapping for that we are saying for
a candidate, one in your vote patterns, one not all patterns.
Parsing that word pattern is still in that we are seeing Adlard, those two mapping, parsing the candidate
s my best Saiful vote one and the candidate one.
Then we intersect the new mappings with the existing intersected mapping by saying intersected map one
is equal to the Intersect mappings function barcin that the existing intercepted mappings and the candidate
maps.
So here we are getting a new blank cipher letter mapping from the function that is get blank Saiful
the mapping here and it stores this in the candidate maps.
We are able to find the candidate for the current Saifullah to recall to get vote pattern in the makework
pattern.
One module and in some cases decide for maybe name or very uncommon vote that doesn't exist in the dictionary,
in which case in this overall pattern likely won't exist in the vote pattern.
So if the vote pattern of this if a vote doesn't exist in the keys of your old pattern dictionary,
the original plaintext word doesn't exist in the dictionary.
Fine.
So in that case, ASIFA what doesn't get the mapping?
And then it goes on for continual statement, which basically returns to the next five four vote in
the list.
So if the execution we know the vote pattern exist in your old patterns and the value in the old pattern
dictionary, our list of string of the English words would the pattern in the vote pattern, because
the values are in the form of a list we use for loop to trade over them.
Variable candidates said to each of these English words, string on each iteration of the loop.
Then we call the add on the atlatl to mapping one function, which is basically update this mappings
in the candidate map.
I start using the letters in each of the candidates one and then the arrival goes.
Those two mapping one will modify the list directly.
So the candidate map is modified by the time the function call returns.
And after all, those initial candidates are added to decipher Lettow mapping in the candidate, Mubashir
intersects the candidate map with the intersected map and returns the new value of the intersected map.
So at this point, the program execution's returns to the beginning of the loop and to create a new
mapping for the next time forward in this I forward list.
And the mapping for the next five four vote is also intersected with the intersected map, the loop
continuous mapping Saiful words until it reaches the last of all in your Saiful list still.
Now when we have the final intersected cipher letter mappings that contain the mapping for all deciphered
words in ciphertext, we pass it then to the remove all letters from mapping one function to remove
any salt letters at this particular time.
Now the cipher letter mapping return from this removes all letters from mapping.
One is then written for the simple sub function, and now we have the part of the solution.
We can start decrypting the message.
So coming to using the replace string method.
Now over here, if you see just to have a look at initially what we understand might replace string
method over here now.
So you replace string method returns a new string with the replaced.
Correct false argument is a substring to look for.
One second argument is a string to replace those substring.
Now, if we come to our decrypting the message part now to decrypt of a message, we will use the function
that is your decrypt message.
What happens now here?
Also, we are going to use in this particular function the function that is our DECRYPT message SGA,
which is there is no simple substitution.
Saiful demo.
So now for this now or this particular function also decrypts using only Keefe's, not the letter mapping.
So we can't use the function directly to address this.
We will create a decrypt with cipher letter mapping, which is a function created here that takes a
letter mappings, convert the mapping into a key and then passes the key and the message to your decrypt
message function.
And then the function that is decrypt with cipher letter mappings, basically written or decrypted string,
now recall the simple substitution keys of the string of only six characters in the character at the
index.
Zero in the key string is an encrypted character for the character of the index.
One is an encrypted character for B and so on.
So to convert a mapping into a decryption output we can easily read, we will need to create a closed
placeholder key which will basically look like or X, X, X everywhere, which can be used in the placeholder
key because it actually gives users only uppercase letters because not all the letters will have a decryption.
We need to able to distinguish between parts of the key list that have been filled with decryption letters.
And those were the decryption hasn't been solved.
OK, so now let us see how this all comes together in the given source code.
So if we go for this defined decrypt with cipher letter mapping one where it takes parameters of ciphertext
one and let the mappings one in this particular function is going to return a string of ciphertext decrypted
with the letter mappings with any ambiguous decrypted letters replaced with an underscore sign.
So first of all, we will create a simple Sabga for the letter mappings by saying over here the key
is to R is equal to X, multiplied by the length of letters of.
Then we say for deciphering that no one in the letters is to ah check.
If the length of your letter is one of the index of cipher letter, one is equal to one.
If it is, that is if there is only one letter added to the key.
So then next we are saying the key ID x is equal to let us find it.
And is the index of X is equal to this.
I don't want now he'll be able to create a placeholder list by Freeplay or replicating a single item
list that is X in this case twenty six times because we have or multiply it by length of the letters.
So when we used on all of this on a basically list and integers, the multiplication operator performs
the list replication.
So next we come to the fore loop which checks each of the letters in your letters SDR for the cipher
little variable.
And if this little one is solved, it replaces X with the placeholder with that letter.
Now the letter mappings one at the index of five.
Little one is the decryption letter and the key index is the index of the decryption letters and letters
hestia, which is written from the find method here.
It sets this index in the key list of the decryption letter.
However, if this letter doesn't have a solution, the function.
And so it's an underscore sign for that particular letter to indicate which characters basically remain
unsolved.
Then we replace the lowercase letters over here in this cipher letters with an underscore and replaces
the uppercase letters with that underscore.