About reversible and irreversible systems, start with md5 (including continuation)

Source: Internet
Author: User
Tags md5 hash


In the <signal and system> lesson, let's talk about the definition of reversible systems:If different inputs are specified for a system, different outputs are obtained, which is called reversible.That is, input and output haveOne-to-one correspondence.

Here, I came up with the md5 Algorithm: for different inputs, the output of the algorithm is different. From this point of view, the md5 algorithm should be a reversible system. However, the md5 algorithm is called an irreversible algorithm, that is, given an md5 hash, it cannot obtain its original value from the algorithm (or the algorithm exists but no one wants to come up with it !?), Is md5 reversible or irreversible?

The teacher said, "md5 should be reversible, Because I can always list a table corresponding to input and output. Even if it takes a lot of time, I can always list it, my inverse algorithm is the look-up table. Isn't that enough?" I am confused when I disagree with my teacher.

Welcome to comments...

P.S. I know someone has written two programs with the same md5 value. I don't know the specific principle...


I have understood this question. Thanks to Dai Weisi and Zhang Huafeng for their guidance.


I first thought of "the output of algorithms for different inputs is different ." Yes. This is indeed true in our daily life. My thinking is limited by my daily life.

ActuallyThe MD5 algorithm is an irreversible system, that is, you can find N different inputs to generate the same input.

Take the 16-bit md5 for discussion: (because the 16-bit MD5 in the middle is the corresponding 16-bit MD5. If it is hard to analyze, the situation is the same .)

Each digit can be a-z and 0-9 with 36 letters. The 16 digits indicate 36 ^ 16 hash columns in MD5, which is the maximum capacity of 16-bit MD5.

We usually use MD5 to encrypt data (which is especially common for password verification in web apps). encryption is only a few simple strings.

In this case, the content I want to encrypt is a 17-bit string, the first is a-z, 0-9, and the last 16 bits meet the MD5 16-bit hash feature, in this way, the capacity is not enough in the general sense of MD5, because the algorithm is always true, it will always generate an output. In this case, different inputs will generate the same output. What about 18 digits? 19 digits? What about the 100 bits?

The same is true for the fingerprints that use MD5 for program files. For example, in a simple C program, printf can output the above N-bit different strings.

Now I feel very open.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.