For demonstration-purposes, what are a couple examples of strings that collide when hashed? MD5 is a relatively standard hashing-option, so this will be sufficient.
相关问题
- facebook error invalid key hash for some devices
- Change first key of multi-dimensional Hash in perl
- C# Rijndael decryption returns extra question mark
- Bool.hashValue valid to convert to Int?
- java 11 HttpClient leads to endless SSL loop even
相关文章
- Working with hmacsha256 in windows store app
- Bcrypt vs Hash in laravel
- Decrypting EnvelopedCms with non-default Algorithm
- What is the fastest way to map group names of nump
- Finding out whether there exist two identical subs
- Oracle STANDARD_HASH not available in PLSQL?
- Looking for a fast hash-function
- Python: Is there any reason *not* to cache an obje
If the purpose is to demonstrate why or how hash functions result in collisions, and not MD5 specifically, the clearest hash function I know of is simple modular division. Suppose you are storing values in an array of size 10. To find the index to store a particular value x, the index = x % 10. It is obvious that there will be a lot of collisions in this tiny hash table, since for example, 'A' (65) and 'K' (75) will both hash to 5. MD5 can produce 2128 distinct values, so collisions are much less probable but still possible.
This page provides these examples of 128 byte values hashing to the same value:
and
Note that although your question asked for "strings" which collide, MD5 is defined over binary data, so the normal text meaning of "string" doesn't really apply. Languages and libraries which allow you to take the MD5 hash of text data usually mean "encode the string in a specified encoding, then hash the result."
Søren Steffen Thomsen released a md5 collision finder utility written in C. Might be fun to play with.
The second-most interesting collision I know of is this:
which collides with this (remove the parts in parentheses):
Those are two X.509 certificates of which only the first one was actually signed by the Certificate Authority. The first part is just a header, but the last part (which you will note is the same in the two certificates) is an RSA signature of the MD5 hash of the colliding messages. This means that the second (fake) certificate will validate as having been signed by the Certificate Authority's private RSA key.
This attack involved more than 200 Playstation 3 to prepare the attack and some clever timing on the part of the attackers. For more details see: MD5 considered harmful today.
The most interesting collision I know of is the one used in the Flame espionage malware. Using a different, but similar, technique, an advanced persistent threat (most probably a western intelligence agency) created a fake code signing certificate that claimed to have been signed by Microsoft. See for instance this article. Unfortunately, I don't have access to the actual certificates and the actual MD5-collision.