Before cryptography, it stayed in the era of classical cryptography; From this section, cryptography will enter the computer age.
Since the computer age, the concept of letters as the smallest operating unit has disappeared.
Take a chestnut to understand:
As we all know, in a computer, all data are represented by the combination of 0 and 1, and letters are no exception. There is a standard for letter digitization, and now this standard is called ASCII.
In the early days, each letter and symbol corresponded to a 7-bit binary number, such as a = 1 1000 1! =0 10000 1。 Once a letter becomes a number, the symbolic attribute and pronunciation attribute of the letter completely disappear in the computer.
It's just a binary number, and we can change it at will. For example, AB =100001100010, we can pick out odd numbers and even numbers respectively, and then connect them end to end to form another number (100065438).
We can also formulate other specifications, such as parity exchange to form new characters. ...
Although the final output is still two meaningful characters, the biggest difference between it and the previous encryption method is that:
In the past, encryption operated on a single letter. However, the encryption after digitization disrupts the underlying structure of language laws, and the changes occur inside the letters. Therefore, digitalization brings encryption into a new generation.
The example just given is very simple. In fact, shortly after the appearance of computers, encryption methods with complicated operation steps appeared. How are these methods calculated?
Not only is the process not confidential, but everyone can find out the technical details.
In the era of the enigma cipher machine, the Germans will try their best to keep the internal structure and instructions of the military version of the machine secret. But in the computer age, the so-called internal structure and operating instructions do not need to be kept secret at all, and they are completely open.
To what extent is it open?
From 1976 1 1, a set of specifications became the official standard of the encryption system of the National Bureau of Standards, referred to as DES. Anyone who wants to know can get this instruction.
This specification also has a nickname-"Lucifer", which is the most typical fifth-generation cryptography born in the computer age.
It is said that designers have always called this algorithm "Demonstration algorithm", but the operating system in the 1970s limited the length of the file name, so only the first few letters demon, which means "devil", can be intercepted. Later, everyone used another devil's name to call this algorithm-Lucifer, that is, "the devil."
In computer science, there are often some new words and strange words, such as hackers, bugs, spam, blog, including the name Devil, with stories behind them.
Together, these stories have formed a brand-new mainstream culture-IT culture after 1970s.
In the next development of cryptography, there will be three famous IT virtual roles. Nowadays, even in formal academic discussions, these three names are standard terms. They are Alice, Bob and Eve.
Remember these three names, and we will use them repeatedly in the future.
Now, let's take these three as examples. What if Alice and Bob correspond, but Eve wants to eavesdrop?
Some people say that it is encrypted with the goblin king system just mentioned. But after information encryption, how to ensure the security of the key?
Alice must find a way to give Bob the key corresponding to each message. The safest way is for Alice to go directly to see Bob and tell him the contents of the key.
You said you didn't have to meet, and the two sides agreed that, for example, using the alphabetical order of the Declaration of Independence as the key word, you could omit meeting. But once the news leaked to Eve, their correspondence could not be kept secret.
Therefore, using Devil's system encryption can ensure the security of the information subject, but both parties still need to exchange keys, and the security of keys cannot be guaranteed. This is the biggest loophole in the lich king system.
Matters agreed by both parties on the contents of the key:
The more irregular the key is, the more secure the password is, but the more it is necessary for both parties to meet and communicate; The more regular the key, the less secure the password, but it saves the cost of face-to-face communication.
No way, before the new method appeared, like some occasions that only need to communicate once a month, but the confidentiality level is extremely strict, they really exchanged keys by meeting.
In the 1970s, there was a special position in a big bank. That person flew around the world with a safe every day to deliver keys to customers.
Now the question is coming:
Then you need to wait until the birth of a new generation of cryptographic systems to solve it. This system solves a problem, that is, when transmitting encrypted content, there is no need to pass the key separately, which makes up for the loophole of Devil's encryption system.
Cryptography has developed for more than 2000 years before anyone thought of it.
Some people say: how can it be so complicated? I can come up with a scheme that doesn't need to exchange keys immediately. For example:
Alice put the secret in a box, locked it and gave it to Bob.
After Bob received the box, he couldn't open it because he didn't have Alice's key, but Bob put a lock on the box and sent it back to Alice. Now there are two locks on the box.
After receiving the box with two locks, Alice opened one of her locks with her own key, and then sent the box with only one lock to Bob.
After Bob received the box, there was only one lock on it. He had his own key, so he could open the box and see the confidential documents inside.
The two sides never exchanged keys during the whole process. Does that sound perfect? But it didn't actually work.
The reason is that comparing encryption to locking doesn't work.
Because in encryption, when a group of characters is encrypted once with A and then with B, we must first decrypt it with B and then decrypt it with A, which is the first solution after encryption. If this order is reversed, the solution is garbled. However, there is generally no need to talk about order when unlocking and locking.
This example also reminds us:
Although metaphor is an aid to difficult knowledge, it cannot replace mathematical understanding.
What can solve this problem? Or math.
Specifically, it is to use irreversible functions. In cryptography, for simplicity, it is called "one-way function". In fact, strictly speaking, the mathematical proof of the existence of one-way function has not yet been made. But we don't care, let's call it a one-way function.
A function refers to a fixed operation, such as ×2, which is a function operation. Most of the functions we come into contact with are reversible. If you multiply 3 by 2, you can get 6; Then it can also be reversible, and 6÷2 can get 3.
What is irreversible operation?
There is really a special operation in mathematics, which is sometimes irreversible. This operation is called "modular operation".
Modular operation is very similar to the way we look at watches. For example, what time is three hours after 22 pm? The result is not 25 points, but 1 point, so the clock is a system with a modulus equal to 24. We can arbitrarily specify the size of the module, for example, in a system with a module of 7, 2+3=5 (mod7) and 2+6= 1 (mod7).
Multiplication can also be done by modulo operation. For example, in a system based on 13, what is 1 1×9? We know that, in any case, by adding modules, the result is equal to 99. However, there is no 99 with the modulus equal to 13 in the dial, so the increase of numbers can only be equivalent to continuous rotation, and 99 is equivalent to 7 turns and 8 squares. Therefore, in the modular 13 system,1× 9 = 8 (mod13).
How is modular operation a one-way function?
We can look at the example just now:
The formula1/kloc-0 /× 9 = 8 (mod13) can be deduced from left to right, and the result is unique. But from right to left, it is equivalent to asking you "In a system with a modulus equal to 13, what number is × 9 and the remainder is 8". Can this question be reversed? The answer is no.
Of course, without modular operation, there must be no multiplicative inverse. When the modulus is small, it can be more reciprocal; But when the modulus is large enough, there is no inverse operation at all. This is determined by mathematics.
Knowing the modular operation, you can know how it is used to transfer keys. The process is like this, for example:
Of course, you don't have to worry about why it must be β A and α B. This is guaranteed by mathematical operations, so it must be correct.
When these two people finish the calculation, something strange will happen-they will get exactly the same result, which is 9. They get the same result, so this result can be used as their key.
No one passed the key in the whole process, but both parties got the same key. For eavesdropper Eve, what she overheard was only the result of modular operation. Because there is no reverse operation in this operation, Eve eavesdropped and listened in vain.
You may wonder why the last two calculations are exactly equal to 9.
This is the essence of the whole process. However, this is no coincidence. Whitfield Diffie, a senior engineer of Sun Company, and Hallman, a professor of electronics at Stanford University, spent more than two years to find this function. Therefore, this method is called "Diffie-Hallman key exchange scheme".
The specific proof process is very complicated, and we don't need to know it. We just need to know that after this operation, both parties get the same result.
Since 2000, cryptography has always believed that users must meet specially to exchange keys;
After 1976, this creed was completely shattered.
To sum up, in the computer age, encryption technology has made several major advances:
These advances are all driven by mathematics. In fact, it is not only cryptography, but also mathematics has made great contributions behind the most important theoretical breakthrough in every branch of science.
Can this encryption method be practical? If it is not practical, how to improve it?
Summary report of semester teaching 1
First, political thought:
I love the party, love the people, adhere to the party's educational pol