How does the md5 hash algorithm compress data to a fixed length?

I know that MD5 creates a 128 bit digest. My question is how does it derive this fixed-length length from a 128bits + message?

EDIT:

Now I have more understanding of hash functions. After reading this article, I realized that the hash functions are one-way, which means that you cannot convert the hash back to plain text. I was under the misunderstanding that you could due to the fact that all online services converted them back to strings, but I realized that these are just rainbow tables (collections of strings mapped to pre-computed hashes).

+4
source share
4 answers

When you create an MD5 hash , you are not compressing the input. Compression means that you can unpack it back to its original state. MD5, on the other hand, is a one-way process. That is why it is used to store passwords; you should ideally know the original input line in order to be able to create the same MD5 result again.

This page provides a good graphical explanation of MD5 and similar hash functions and their uses: An Illustrated Guide to Cryptographic Hashes

+7
source

Consider something like a start with a 128-bit value and input 128 bits at a time, and XORing each of these input blocks with an existing value.

MD5 is much more complicated, but the general idea is the same: the input is processed 128 bits at a time. Each input block can change the value of the result, but does not affect the length.

+3
source

He noted (or, better, a little) to do the compression. There is an algorithm that produces a new state for each initial state and byte. This state is more or less unique to this combination of inputs.

+1
source

In short, it will be divided into many parts and will work.

If you are interested in a conflict, consider that your message is read-only.

Bit space is much larger than char read space.

+1
source

Source: https://habr.com/ru/post/1369264/


All Articles