Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Some thoughts on one-way encryption (md5)

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

When uploading files in Baidu's online disk, I found that the speed of uploading was really fast.

Soon enough to surprise me, there is one more curiosity. The user experience when uploading files using Baidu is very good.

Apart from the problem of bandwidth, is there anything else? In the knowledge I have learned, I naturally think of

One-way encryption algorithm (MD5) is introduced.

We know that one of the characteristics of MD5 encryption is the avalanche effect (once a little change occurs in the encrypted content, it will cause a huge change in the encryption result)

We might as well imagine:

There are three files (Test1.txt | Test2.txt | Test3.txt) on the user's local computer, and the user has only modified one of them: Test3.txt

Although the other two users did not make any changes, the user also dragged it into the upload queue.

My thinking:

Suppose (Test1.txt | Test2.txt | Test3.txt) one already exists on these three file servers, but the file Test3.txt is not up-to-date

Of. The best way to get the best user experience is to skip (Test1.txt | Test2.txt) these two files and upload Test3.txt directly.

But the first problem we need to solve is that we know that the Test3.txt has been modified by the user, but the computer is not clear about it.

Let me assume again here:

If we have a way to compare (the signature of the file already stored on the server and the file with the same name to be uploaded on the client) (that is, the result of MD5 encryption)

If the results of the two MD5 encryption are the same, we assume that the file has not been modified, so there is no need to upload.

If the results of the two MD5 encryption are not consistent, we think that the file has been modified and needs to be uploaded.

In this way, it would have been necessary to upload three files, but now you only need to upload one file (the modified one), which is obviously much faster.

Summary:

Baidu network disk upload speed is so fast naturally inseparable from those high-end technology, not what I can understand, this needless to say.

My idea is a little whimsical, but it doesn't hinder my desire for knowledge. (^ V ^)

Here is a small example of MD5:

The first time writing to 1.txt is "12345678"; the second time writing to 1.txt is "12345678" one more space.

[root@Director1 wbq] # touch 1.txt

[root@Director1 wbq] #

[root@Director1 wbq] # echo "12345678" > 1.txt

[root@Director1 wbq] #

[root@Director1 wbq] # cat 1.txt

12345678

[root@Director1 wbq] #

[root@Director1 wbq] # md5sum 1.txt

23cdc18507b52418db7740cbb5543e54 1.txt

[root@Director1 wbq] #

[root@Director1 wbq] # md5sum 1.txt

23cdc18507b52418db7740cbb5543e54 1.txt

[root@Director1 wbq] #

[root@Director1 wbq] # echo "12345678" > 1.txt

[root@Director1 wbq] #

[root@Director1 wbq] # md5sum 1.txt

0a248abc4cfd2c83de82a5748b141cea 1.txt

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report