Volume 2: Residence in the Capital Chapter 111 Coding Method
Late at night, the Shuntian Prefecture Yamen in the north of the inner city of Beijing was brightly lit.
Late at night, the lights were brightly lit at the Ministry of War Yamen in the Qianbu Corridor on the south side of the inner city of Beijing.
However, in the Ministry of War in the south, when the Minister of War Lu Wan learned who were working late into the night in the Shuntian Prefecture in the north, he lost his temper for the first time and dropped the pen in his hand.
After that, a trusted clerk who had followed him for more than ten years and had seen Lu Wan promoted from doctor to minister was kicked out for giving him some irrelevant advice. Others were even more afraid to speak.
"Wang Datou can invite anyone to his Shuntianfu Yamen to help, but my Ministry of War Yamen is clean and no outsiders are allowed to enter!" Although he said these righteous words, Minister Lu was very angry in his heart.
Before, Zhang Shou pointed out the key point in Zhigong Building, and he had thought about bringing his son Lu Sanlang here to decrypt the secret. However, even as a minister, he couldn't just bring his son into such an important place as the Ministry of War! As a result, because of his hesitation and not telling his family to put Lu Sanlang under house arrest, Wang Datou got there first!
That unfilial son actually went to help Wang Datou!
He took a deep breath and said in a cold but stern tone: "Dr. Zhang has already pointed out the key points of the secret letters. All the clerks in the Ministry of War who are best at numbers and calculations have gathered here. If you can solve it before dawn, then everyone can atone for their crimes. If you can't figure it out, I will of course apologize to the emperor. Everyone of you has made mistakes! This time the Ministry of War has lost face!"
The Ministry of War needed to decipher thirteen secret letters at once, but the Shuntian government office had a prefect named Wang Datou who had a very high level of mathematics. Therefore, Zhang Shou and three other students only had to decipher one secret letter.
However, Qi Liang and Lu Sanlang, who had arrived earlier, read this letter over and over again, pondered it over and over again, but were still confused.
After Zhang Shou took over, he first checked the twelve letters that were previously claimed to be solved, and only then did he look at the last letter that had not been solved, and then he began to fall into deep thought.
Perhaps because they were afraid that the secret letters would be inspected or something else, to avoid arousing suspicion, the contents of the twelve letters that were deciphered were all plain family letters. These secret letters relied on the presence or absence of horizontal lines between words to represent one and zero, and then used punctuation marks to separate them, thus introducing binary numbers, and then using the Thousand Character Classic as a code book, so that they could be easily deciphered.
And the last letter, just a piece of paper with dozens of words, was completely incoherent and could not even be called a sentence. The writing style was like a child's doodles. At the end there was a note in beautiful handwriting, saying that the child was practicing writing by copying the words in the Thousand Character Classic. Although it was a bit childish, it was interesting to read, so the letter was sent to her husband who was in the army.
Seeing the three words "Thousand Character Classic", Zhang Shou smiled slightly, thinking that this might be another letter that used the Thousand Character Classic as a code book, but the encoding method was different from the previous twelve letters. Although a lot of random characters were used, if the encoding method of the previous twelve letters, which seemed complicated but was actually simple, was used, this secret letter would not be that complicated in theory.
After all, even if it was relatively simple, there was already a huge mistake in the secret letter exchange, and the recipient actually calculated the date wrong...
This is probably the most ridiculous and saddest incident. No wonder both the sender and the receiver committed suicide.
If the encryption is simple, a shift cipher is most likely.
That is to say, replace the initial word with a word after a certain interval. According to the logic of simple passwords, this interval must have some obvious pattern. It is most convenient to directly replace each word with a word after the same interval, but it is also the easiest to crack. In this case, the shift formula may be set to the simplest y=ax+b, and then more complex...
If it is more complicated, it will be a more complicated quadratic equation, but since the shift distance is definitely an integer, this x is definitely an integer, so it is actually not that difficult. Let's start with the simple one and try to calculate it.
According to the rules of simple passwords, the first word on the secret letter is the word that is spaced a+b apart from the number corresponding to the original word, the second word is the word that is spaced 2a+b apart from the number corresponding to the original word, and the third word is 3a+b...
Because there are only a few dozen words in the letter, but any shift must take into account the factor of circulation. After all, the numbers corresponding to the Thousand Character Classic only go up to one thousand. If you shift two or three hundred words from more than nine hundred characters, you will return to the beginning of the Thousand Character Classic.
Now he only needs to check the first four numbers, and the calculation intensity is still within an acceptable range.
Zhang Shou was thinking and writing on the paper, not realizing that Shuntian Prefecture Governor Wang Datou had quietly stood behind him. He didn't even notice how much time he spent to figure out the simple encrypted equation y=2x+3.
But when he worked out the first four words of the original text, he was really speechless ... because it was still Mr. Kong!
It seems that Mr. Kong is really the most unlucky person this time...
x represents the shift variable = 1, 2, 3, ...
y representing the shift result is 5, 7, 9... That is to say, subtract 5, 7, 9 from the words on the secret letter respectively, and then find the words in the corresponding positions.
According to the decoded coded numbers, Zhang Shou checked his memory against the corresponding number table of the Thousand Character Classic that Wang Fuyin had personally ordered to be copied, and then wrote down a line of dozens of words on paper.
On the day when Grand Secretary Kong passed by the Linhai camp, he ordered the chief general Du Heng to send all the rebels to surround Kong. If the imperial capital was in panic, he would punish the criminals without justice and change the world.
“Arrogant!”
Zhang Shou had just written all the words when he heard an angry shout from behind him. He turned around and saw Wang Jie, the governor of Shuntian Prefecture, standing on end with a rage. He saw Lu Sanlang, who was looking gloomy, suddenly jumped up and rushed over. He reached out to stop Lu Sanlang, picked up the paper with one hand, and said to Wang Jie, "Although the words have been connected into a sentence now, doesn't Wang Dayin think it's strange?"
After his anger subsided, Wang Jie immediately calmed down. He took the paper from Zhang Shou and studied it carefully for a long time before he said in a deep voice, "Could it be that the person who wrote the letter is clearly a traitor, but he calls himself a rebel?"
"That's one reason. I also think that if they were real rebels, they might call themselves righteous men."
Wang Jie couldn't help but raise his eyebrows slightly: "Oh, you mean, there is another one?"
"It's just my feeling." Zhang Shou smiled and said nonchalantly, "All twelve letters were written in the same code, but there was an extra letter written in another code. It was also specially annotated, as if it was afraid that people would not be able to decipher it, saying that this was a child's copy of the Thousand Character Classic. But think about it, which child would copy a word here and a word there when copying the Thousand Character Classic, and not form a complete sentence?"
Lu Sanlang, who had sneaked over, suddenly realized, "That's right, that's right. This is telling others directly that there is something wrong with this letter!"
Qi Liang and Deng Xiaodai looked at each other after putting down their pens. Qi Liang said thoughtfully, "I also think that the words on the letter that look like children's scribbles are a bit deliberate, as if an adult imitated a child's handwriting."
Deng Xiaodai suddenly had an idea and said, "Could it be that the person who wrote this letter did not understand the secrets of the twelve letters, but knew that the reference of the secret letter was the Thousand Character Classic, so he racked his brains to find a different way to encrypt it and wrote such a letter?"
Reminded by everyone's comments, Wang Jie narrowed his eyes slightly, and was shocked: "If I just report the letter that you, Dr. Zhang, have deciphered, the commander of the Linhai Camp, Du Heng, will be regarded as the mastermind of the traitor. But the doubts you mentioned are not enough to clear his suspicion."
"But it's not enough to prove his suspicion." Zhang Shou finally couldn't help yawning, and then he said lazily, "Maybe, the so-called people who committed suicide on both sides were just scapegoats. Maybe someone wanted to pull down the troublesome commander and replace him himself, maybe...anything is possible. But in my opinion, the biggest doubt is the sudden change in the encoding method of the secret letter."
"This letter, which Wang Dayin had not deciphered before, was one of the letters in the middle according to the date. It doesn't make sense that the subsequent letters would not be completely changed and still use the original encryption method. In short, this is my opinion from a mathematical perspective. You, Wang Dayin, need to judge the right and wrong yourself."
"Good, very good. I finally got rid of those two traitors for Duke Zhao's Mansion. Otherwise, the Madam might not agree to let you go."
Wang Jie's stern face showed a hint of smile, and then he said lightly, "Dr. Zhang, you have worked hard tonight, but it is too late at night, so I have to ask you to stay with them in my Shuntianfu Yamen. I have already ordered people to clean the guest room, and hot water for midnight snacks is also being prepared. Please don't misunderstand that I am putting you under house arrest. This is a serious matter . When I report the situation at the court tomorrow, I will not forget your contributions!"