"First of all, cryptography has a historical legacy. There is one cryptographic system in the East and another in the West. It spread and merged through the Arab world, reached its peak during World War I and World War II, and has continued to develop until now, when it is almost at its end," Xiang Xiaotong said, taking a sip of Eight Treasure Porridge.
"Are we nearing the end of our rope?" Song He was taken aback.
"We'll talk about that last," Xiang Xiaotong said, keeping everyone in suspense.
Song He nodded.
"When I was learning cryptography, I had a feeling that the cryptography created by humans, like biological evolution, has an evolutionary process passed down from generation to generation, with each generation making minor adjustments based on the previous generation's cryptography," Xiang Xiaotong continued.
"To help you understand more clearly, I'll first go over the historical context of the development of cryptography and intelligence science."
"Okay." Song He, with a potsticker in his mouth, stared intently at the teacher.
"There was a period in history when the Arab world was extremely prosperous. Through trade routes, Arab collected vast amounts of books and texts in Egyptian, Chinese, Babylonian, Sanskrit, French, Farsi, Syriac, Hebrew, and Roman, translating them extensively into Arab." Xiang Xiaotong paused. "Have you heard of that?"
"I've heard of it. Arab are a product of this period, invented by the ancient Indians, learned by the Arab, and spread to Europe." Song He thought for a moment, "Translating a language is a bit like breaking a code, and the rise of mathematics also boosted the development of Arab cryptography?"
"Yes! There's another key factor: scriptures," Xiang Xiaotong said.
Song He was taken aback.
"In ancient times, the only way to spread the classics was through manual copying or even oral transmission, so it was easy for forgeries to appear. Some people would secretly fabricate fake classics," Xiang Xiaotong said.
Song He suddenly realized that, not to mention the ancients, modern people also like to fabricate fake celebrity quotes. They post a screenshot of a writer or entrepreneur from a video, add random subtitles, and fool netizens.
"The apocryphal books are very destructive; they can erode some doctrines and cause confusion among believers. That's why some theological schools were established in the Arab at that time to calculate the frequency of various words in the scriptures."
Song He understood. "The mainstream slang in different periods is completely different. By statistically analyzing the frequency of certain words, you can tell whether it's an ancient classic or a modern forgery!"
"That's right. For example, if you go to an antique market and see a Qing Dynasty vase with the words 'No Microwave Oven' printed on the bottom, it's definitely fake." Xiang Xiaotong smiled. "Ming and Qing Novels are full of this character, but modern novels hardly use him anymore."
"Besides analyzing words, some Arab scholars have also studied letters. For example, the letter 'a' appears extremely frequently in Arab, while the letter 'j' appears only one-tenth as frequently as 'a'." Xiang Xiaotong paused, "This is a historic breakthrough in cryptography!"
"An Arab scholar named Kendi wrote a book called '"Manuscript on Deciphering Cryptographic Messages"' and put it in an archive in Istanbul. It contains the earliest record of frequency analysis for breaking codes."
"Kendi's approach was to count all the letters in the ciphertext, label them one, two, three, four according to their number, and then determine which letter each ciphertext corresponded to based on the letter frequency of the corresponding language."
"For example, when deciphering English codes, the most frequent letter in English is 'e', followed by 't' and 'a'. If we intercept a ciphertext and the most frequent letter in the ciphertext is 'c', then 'c' may be a disguise for 'e', and so on."
Song He nodded emphatically. He had heard of this trick before, and it was indeed effective against simple passwords.
"Besides looking at the number of letters directly, another technique has emerged: looking at the relative positions of the letters," Xiang Xiaotong explained.
"Let's take English as an example again. The letter 'v' is special; it almost never appears before or after letters like 'b, d, g, j, k, etc. The letter 'h' is often placed before 'e,' but it's almost never placed after 'e.'"
"Vowels and consonants?" Song He guessed.
"Yes, it's related to pronunciation. Every language has its own unique pronunciation and intonation. Sound determines writing, and writing determines ciphertext!" Xiang Xiaotong nodded.
Song He looked up in deep thought. His English accent was very similar to that of Beijing. If he wanted to decipher Dewitt Language, would he have to adopt Dewitt's accent?
"Besides alphabetic codes, word codes soon emerged, replacing commonly used words with symbols," Xiang Xiaotong said. "Here, we need to mention a famous person: Queen Mary."
"I've vaguely heard of it," Song He said.
"Queen Mary plotted a coup, but Walsingham, Queen Elizabeth's intelligence chief, intercepted and deciphered the secret letter. The evidence was irrefutable, and Queen Mary was sentenced to beheading."
"Walsingham is a very capable man. He controls dozens of intelligence outposts in Europe and has a bunch of henchmen at his disposal. Some of these henchmen are skilled at imitating handwriting. It is said that once they have seen a piece of handwriting, they can immediately imitate it to the point that even the person who wrote it cannot tell the difference."
"Walsingham had a group of forgery experts who specialized in secretly intercepting letters, opening them, copying their contents, and forging an identical copy to send out. This is how Queen Mary's letter was intercepted."
"Queen Mary's secret letters used a large number of self-created symbols to replace common words. The interweaving of lexical and alphabetic codes made them quite deceptive, since it was difficult to determine whether a symbol represented a word, a sentence, or a letter."
"But with more letters, it's possible to decipher them by guessing the high-frequency symbols and trying different methods. So these small improvements in cryptography are not very useful. They are essentially single-letter cryptography, which means that plaintext symbols and ciphertext symbols correspond one-to-one, which is strict and rigid."
"Walsingham became famous after cracking Queen Mary's secret letters. Later, all Europe countries developed their own secret offices. The most famous one was the Vienna Secret Cabinet Office. Its main job was to intercept a lot of letters every day, copy and forge them, and then decipher them. It was equivalent to countless Walsingham working all over Europe."
"So the password needs to be upgraded to prevent it from being cracked by hackers?" Song He said.
"Yes, the black room made the single-letter cipher completely ineffective, and then multiple-letter ciphers emerged!" Xiang Xiaotong said.
"The Vigenère Cipher?" Song He.
"Yes, a complete set of cipher tables, 26 different ciphers, plus a key word. If the key word is 'apple,' it starts from column 'a' of the cipher table and begins decryption from the corresponding ciphertext. If the key word is 'pear,' it starts from column 'p' of the cipher table," Xiang Xiaotong said.
"I understand this." Song He nodded. "Repeating the string, the key word length, performing cyclic division, and creating a frequency distribution histogram that even a middle school student could do, and you've cracked it."
"The following codes become more complex," Xiang Xiaotong emphasized. "The earlier ones were all quite simple. It's only after the Vigenère Cipher that truly intricate and mind-bending codes appear!"