Sapphire case

Chapter 56 Cipher Machine

56.

A moment of tranquility is especially precious because of its shortness. In fact, Gu Jiang really only woke up after closing his eyes for a while. The frontline battles are endless, and intercepted secret reports are flying like snowflakes.

Gu Sheng took his calculation results to look for Luke, and Luke took a mouthful of soy milk with a slice of bread in his mouth: "Mmm! Chinese flavor!"

"Damnyou!" Gu Sheng blurted out curses, then turned and went back.

"Hey, hey, don't be angry, don't be angry," Luke hurriedly went back to search for something, put down the soy milk and bread slices, took out a notebook from under a few stacks of draft paper, and followed him, "How have I been in the past two months... I was forced to stay up all night by you, and I have never worked so hard to pick up girls. Look, the result of staying up all night yesterday, shit, I was so excited, I didn't eat a bite of supper, and I stayed until seven o'clock in the morning..."

The notebook was opened, and the [-]-page thick leather assigned by the intelligence department was full of writing. Gu Sheng turned two pages and looked up at him: "What is this, you designed it yourself?"

It was a strangely shaped cipher machine.

The keyboard has a total of 26 keys. In order to keep the communication as short and undecipherable as possible, there are no spaces, numbers and punctuation keys, but only letters.Above the keyboard are 26 small light bulbs marked with the same letter as a display. When a key on the keyboard is pressed, the small light bulb corresponding to the encrypted ciphertext letter of this letter lights up. An almost primitive "display".

Above the display are three rotors with a diameter of 6 cm. Their main parts are hidden under the panel. The rotor is the core and key part of the "Enigma" cipher machine.If the function of the rotor is only to replace one letter with another, it is called "simple substitution cipher" in cryptography, that is, the kind that Gu Sheng once demonstrated to Ye Fengnian, and in the ninth century AD, the Arabic cipher Deciphering experts have been able to use statistical frequency methods to decipher simple substitution ciphers.

The key of this cipher machine lies in its "rotor": when a letter key on the keyboard is pressed, the corresponding encrypted letter will be displayed on the display by the light bulb flashing, and the rotor will automatically rotate the position of a letter. .

"For example, when you type A for the first time, the light bulb B lights up, and the rotor rotates one step, and the password corresponding to each letter changes. When you type A again for the second time, the corresponding letter may become C ;similarly, when you type A for the third time, it may be that the light bulb D is on.——This is the key to its difficulty in deciphering." Luke clicked on the annotation he added next to the model diagram, and explained, "Then this It is not a simple replacement password. Because the same letter can be replaced by different letters in different positions in the plaintext, and the same letter in different positions in the ciphertext can represent different letters in the plaintext. The letter frequency analysis method will here No use at all.

"So, I call it the 'double substitution cipher.'"

Luke pointed to the string of characters he wrote next to it: Compound replacement cipher.

"...It's kind of interesting." Gu Sheng thought for a while, and said, "No, but according to your thinking just now, if I type 26 letters in a row, the rotor will make a full turn, and then return to the original direction. The coding is repeated."

"Yes, I know." Luke flipped through the process analysis explaining the manufacturing principle, and showed him the detailed design, "So I added another rotor, and when the first rotor rotated a full circle, it There is a gear on it to move the second rotor, so that its direction is rotated by the position of a letter. Assuming that the first rotor has turned a full circle, when the A button is pressed, the D light bulb on the display is on; when the A button is released, the first The gear on one rotor also drives the second rotor to rotate one step at the same time, so when typing A for the second time, the encrypted letter may be E; when the key A is released again, only the first rotor rotates, so the second When you type A three times, the corresponding letter is probably F."

"676 kinds...repeat after 676 letters." Gu Sheng said, "If the technology allows, the user can continue to add rotors. For example, if you use three, then the probability of repetition will reach 26x26x26=17576. This is no longer possible. imagined."

"Hahaha, this is unimaginable? You underestimate me." Luke rolled up his sleeves, turned his notebook back, turned to the design schematic diagram, turned back to his desk, and flipped through two books. , "I was inspired by the authors of these two monographs-have you read this book? The internal documents of the First World War, the good stuff at the bottom of the library box, if you haven't read it, I will lend you. Uh, okay, I won't interrupt, then explain.

"Here, on the basis of the previous one, I added a reflector to one end of the three rotors to connect the keyboard and the same letter in the display with wires. The reflector is the same as the rotor, and a certain letter is connected to the another letter, but it doesn't rotate. You might at first glance think that such a fixed reflector is useless, after all, it does not increase the number of codes that can be used, but if you relate it to our decoding process ……Do you have any idea?"

Gu Sheng raised his hand to signal him to stop talking, and looked at the extremely simplistic setup principles on those two pages——Luke's entire notebook was not readable at all, and the sparse handwriting was in a mess, only the design drawings Very detailed.

Luke went for a stroll around, inspected today's deciphering work, and then came back with his soy milk, pressed Gu Sheng's shoulder and asked him, "How's it going?"

"I'm assuming that with what you call a 'reflector', when a key is pressed, the signal doesn't go directly from the keyboard to the display, but first through a line of three rotors, then through the The reflector returns to the three rotors, and then reaches the display through another line." Gu Sheng hesitated, and clicked on the design drawing he had redrawn, "For example, according to my understanding, in this drawing, when A When the key is pressed, the D bulb is on. If the A key is pressed but the D key, then the signal travels in the opposite direction when the A key above is pressed, and finally reaches the A bulb. In other words, With this design, the reflector does not add non-repeating directions like the rotor does, but it allows the decoding process to fully reproduce the encoding process."

He thought for a while in silence, then glanced at Luke to make sure that he did not look idiot-eyed, and then said: "When using this cipher machine to communicate, the sender first adjusts the directions of the three rotors, and then keys in sequence. Plaintext, and write down the flashing letters on the display in turn, and finally send the recorded flashing letters in order by normal telegram. This is the principle of encryption."

"Bingo!" Luke excitedly sat down on the table next to him, and said bluntly, "How about it, isn't it very exquisite! Have you been impressed by your brother's rich imagination and design level!"

"Yes... Although I should be older than you..." Gu Sheng admitted, and laughed, "Hey, don't make trouble, I'm still thinking about how to receive it. According to your idea, then the initial direction of the rotor is the key. , is it necessary for the sender and receiver to agree in advance?"

"Yes, the recipient also needs to use the same cipher machine," Luke said seriously, getting down from the table, "After receiving the message, according to the original agreement, it is the 'key' you mentioned, put the rotor's Adjust the direction to the same initial direction as the sender, and then type in the received ciphertext one by one, and the letters that flash automatically on the display are the plaintext. The process of encryption and decryption is exactly the same, which is the function of the reflector. But reflection The device also has a side effect..."

"A letter will never be encrypted into itself, I thought of it." Gu Sheng continued, "Because a letter in the reflector is always connected to a different letter."

"Yes, but under the premise of the huge possibilities it can give, this is nothing at all." Luke put down the glass, "There is one more thing I haven't explained to you, of course you can Look at the principle analysis behind. ——In addition to the direction and arrangement of the rotors, I also set up a checkpoint to ensure safety. That is, there is a connecting plate between the keyboard and the first rotor.

"Through this connecting board it is possible to connect a letter to another letter with a wire, so that the signal of this letter is transformed into the signal of another letter before entering the rotor. There can be up to six such wires , so that the signals of 6 pairs of letters can be interchanged in pairs, and the other letters that are not connected to the connection remain unchanged. ——Of course, the connection status on the connection board is also agreed in advance by the sending and receiving parties.

“三个转子不同的方向组成了17576种可能性;连接板上两两交换6对字母的可能性则是异常庞大,有100,391,791,500种;于是一共有17576x100,391,791,500……你自己去算吧,我相信就算我们学院最变态的阿斯伯格综合征患者都不想算出准确结果。”

"I was really thinking about the method of brute force decryption just now..." Gu Sheng hesitated, and said, "The key to the encryption of this design lies in the initial direction of the rotor. If the enemy receives the complete ciphertext, they can rotate the rotor direction through repeated experiments to solve the problem." The time required to find this key, especially if the decipherer uses many machines at the same time to do the work, is greatly reduced."

Luke said casually: "Come on, how is it possible? Even if the other party really spends their money to do this, you can still deal with it by increasing the number of rotors, because as long as you add one rotor, you can multiply the number of trials by 26 times!"

"Increasing the rotor is equal to increasing the size and cost of the machine, and the cipher machine needs to be portable... You have to consider the reality." Gu Sheng interrupted him, "Have you really never thought about this?"

"Fuck... I lost half my life when I came up with this principle. Who cares about the cost? If you give me [-] pounds, I will show you right now." Luke looked up to the sky and sighed, "Am I so good? Is your idea about to die in the hands of funding..."

"It's very simple, we can make it detachable." Gu Sheng said in a deep voice, hitting his original design with the pen in his hand, "Let's assume that the three rotors of the cipher machine can be disassembled... and Exchange places with each other."

"In this way, the possibility of the initial direction is increased by six times, and the different relative positions of the three rotors are six possibilities, which means that the data I just gave can be multiplied by 6!" Luke jumped up.

"Yes..." Gu Sheng muttered in a low voice, and wrote down his thoughts casually, "Assuming that the numbers of the three rotors are 1, 2, and 3, then they can be placed as 123-132-213-231-312-321." There are six different positions, and of course the two parties sending and receiving the ciphertext must agree on one of these six arrangements in addition to agreeing on the initial direction of the rotor itself."

Tap the screen to use advanced tools Tip: You can use left and right keyboard keys to browse between chapters.

You'll Also Like