Chapter 220 Encryption Algorithms

readx;

Chapter 220 Encryption Algorithms

The idea of CQCQ software refactoring, Lin Hong actually began to slowly take shape in his mind after chatting with Kevin. Pen, fun, and www.biquge.info

It is easier to solve the problem of encrypting sent messages, as far as Lin Hong knows, there are currently some encryption algorithms with good encryption performance that are free and public, and he can use them directly.

The key is how to set up a "secret stronghold" responsible for the relay of messages.

These sites must be random and not fixed all the time, which can make it more difficult to be tracked and intercepted.

This model of one server managing and forwarding information for all live chat clients is certainly not working, because this structure is so fragile that if the other party compromises the server, the entire chat network will be paralyzed.

After careful consideration, Lin Hong felt that it was more reliable to return to his original idea, that is, to integrate the client and the server together.

That is to say, how many customers on the network are using the whole software, then there are as many message relay servers, and each server can relay messages, forming a huge mesh network without any rules.

Once he had determined the general direction, all sorts of ideas came to his mind, so much so that he immediately took out a few blank sheets of paper from his desk and began to write them down graphically and in short words at great speed.

After a while, the ideas that kept popping up filled five blank sheets of paper, and Lin Hong stopped.

Lin Hong took out one of them, and on this piece of paper, he drew a network topology map that used squares to represent computers, and lines to indicate the direction of data flow.

Lin Hong went back to his previous thoughts, and then improved and repaired this diagram.

Then he pulled out another piece of paper, on which four squares were drawn to represent the computer, connected by several thin lines and a thick line, the thin line represented a small amount of data exchange, and the thick line represented the real data.

After thinking about it for a while, Lin Hong added two thick lines between them again, and crossed out the original thick line.

After a period of brainstorming, Lin Hong has a draft of the architecture of the new version of CQCQ, the overall design framework has been thought out, and the next step is to implement its technical details.

Move away from a centrally controlled server architecture to a peer-to-peer architecture where messages can be relayed through each client.

However, there is a "relay server" that maintains the entire topological network nodes, and these servers do not involve the transfer of data, but only store the client node information, such as IP mapping addresses, online node lists, and the topology between them.

Considering the stability problem, these servers cannot have one, but multiple, and they jointly maintain the same data table, that is, each server has all backups, so that even if a server goes offline, the entire communication network will not be affected.

Moreover, according to Lin Hong's current assumption, even if all relay servers are shut down or offline, it will not cause the entire communication network to be paralyzed, and at most it will affect the immediacy of message sending.

When there is a relay server in the network, the client will keep connected to the relay server in order to know the online status of its friends, and when it wants to send information, it will also query the entire topology to the relay server, and then randomly find an optimal path through algorithm calculation, and send the message to the destination through this optimal path.

Assuming that all relay servers are hung up, we will not be able to confirm whether our friends are online, and when the data is transmitted, it is a broadcast behavior, that is, it broadcasts its own messages to the whole network, and before transmission, it is necessary to confirm whether the next node is online, and then transmit, and finally it will always reach the purpose of its own sending.

However, in this way, the communication loses its timeliness, and a message may be sent out, which can be as fast as a few seconds, and as slow as several minutes or even ten minutes before the other party can receive it, and the length of time is related to the topology of the network.

This structure is also guaranteed in terms of safety.

When a message is sent, it will first be encrypted by its own software, and then transmitted to the "transit node", which is anonymous, and after at least five jumps, the source path cannot be found at all, and finally the message is decrypted from the "exit node", and then passed to the target client.

The only part of the process that can be monitored is at the final "exit node", and if someone happens to be monitoring at the exit node, the message that is being sent can be intercepted.

Lin Hong also discovered this shortcoming, so when he sorted out the drawings later, he improved it again.

He thought of a solution, that is, after the message is sent, it will be encrypted into a packet, and then the packet will be divided, and each part of the packet will be finally passed to the destination through several different paths, so that even if a "exit node" is monitored, they will only intercept a part of the content, and if they do not intercept other packets, they will not be able to decrypt the entire packet.

Theoretically, the possibility of intercepting all packets at the same time is close to zero, so in this way, the communication security is guaranteed to the greatest extent.

The whole new architecture designed by Lin Hong not only realizes the anonymity of information transmission, but also eliminates the centralized server side, which greatly improves the confidentiality and stability of the software.

After repeated refinement and optimization, Lin Hong felt that there was no problem in the end, so he began to write code.

Since he didn't know much about encryption and decryption, he temporarily implemented other basic functions and put encryption and decryption last.

By daybreak, the prototype of the new version of CQCQ was written, and the first thing to do was very simple, only to pass the text version, and it was not encrypted yet.

Today is Monday, Lin Hong doesn't have many classes, and there are no classes at ten o'clock in the morning, so he immediately rushed to the school library.

Coming here today, there are two issues that need to be addressed.

One is to look it up and see if there are any books on the POSIX standard, and the other is to learn about encryption and decryption algorithms.

Since Lin Hong is a frequent visitor to the library, and he is also a member of the SAM team that has been in the limelight recently, many staff in the library are very familiar with him, and after seeing him, they have greeted him.

Lin Hong smiled and responded one by one, in the past few months, he has completely integrated into the big collective of the Latin school. Although there are some flaws here, it is still more comfortable on the whole, everyone is friendly to each other, and others will be eager to help if they encounter any difficulties.

There is one thing that Lin Hong feels the most: the relationship between students and teachers here is completely reciprocal, and they talk to each other, which is completely different from the common situation in China, where one listens and the other is either lecture or reason.

Lin Hong came to the computer science area and began to slowly find the content he needed.

“posix…… Encryption algorithm ......"

Lin Hong muttered these two words in his mouth and looked at them between the bookshelves.

After walking through a few grids, Lin Hong stopped, and a book caught his eye - "MD5 Algorithm Application".

He took the book in his hand, looked through the preface and table of contents, took it in his hand, and continued to look at the other books on the shelf.

After turning around the bookshelf corridor a few times, Lin Hong already had several tomes in his hand: "RSA Encryption Algorithms", "Introduction to Encryption Algorithms", "Public Key Cryptography", "Symmetric and Asymmetric Encryption Algorithms", ......

When choosing these books, Lin Hong would take a general look at the frontier and the table of contents, he originally just wanted to study one of them, but these books were really difficult for him to choose, and he thought they were all very good, so he decided to simply read them all, anyway, he read books very quickly.

It is a pity that Lin Hong is a little regretful that there are no books about the POSIX standard in this library.

In fact, he had expected this for a long time. Algorithms are so scientific that they essentially belong to the field of mathematics, and mathematicians have been studying them for a long time, but the specific application implementation has begun to explode in the field of computers.

The POSIX standard has only begun to emerge in recent years, and the circulation is not very large, and it is normal for the Latin school library to not have a collection, after all, this is a secondary school library, and it is very good to have so many books on algorithms.

As usual, Lin Hong found a small corner in the middle of nowhere and sat down, and then began to read the books in order.

The first to read is "Introduction to Cryptographic Algorithms", which is relatively easy for beginners to understand, and the author specifically reviews the history of algorithms, focusing on the cryptographic systems used by Julius Caesar on the battlefield to transmit military intelligence.

At that time, the encryption method of the password was relatively simple, that is, simply move a few letters forward or backward to get the ciphertext, and the direction operation can be done when decrypting, such as ABC intelligence, and after moving one bit of encryption backwards, it becomes BCD, even if the enemy intercepts this information, if you don't know the encryption principle, it is difficult to crack the ciphertext.

However, with the development of the times, simple encryption technology naturally cannot meet the requirements, and cracking and anti-cracking technology are accompanied by development.

After reading "Introduction to Encryption Algorithms", Lin Hong went on to read several other books.

At this moment, his brain was racing rapidly, absorbing the knowledge contained in the books like a sponge.

While Lin Hong was watching, he was sometimes calculating something on the manuscript paper. There is no obstacle to his understanding of the content of the book, and he even has a feeling of being at home and hating to see each other late.

He sincerely sighed that the wisdom of his predecessors was really not covered, and he had such a profound study of this aspect of the content, if he tried to explore it again, he might not be able to reach this height in his life.

Time passed, and Lin Hong was completely immersed in the world of encryption algorithms, completely unaware of what was happening in the outside world.

……