Slashdot Mirror


MD5 To Be Considered Harmful Someday

Effugas writes "I've completed an applied security analysis (pdf) of MD5 given Xiaoyun Wang et al's collision attack (covered here and here). From an applied perspective, the attack itself is pretty limited -- essentially, we can create 'doppelganger' blocks (my term) anywhere inside a file that may be swapped out, one for another, without altering the final MD5 hash. This lets us create any number of binary-inequal files with the same md5sum. But MD5 uses an appendable cascade construction -- in other words, if you happen to find yourself with two files that MD5 to the same hash, an arbitrary payload can be applied to both files and they'll still have the same hash. Wang released the two files needed (but not the collision finder itself). A tool, Stripwire, demonstrates the use of colliding datasets to create two executable packages with wildly different behavior but the same MD5 hash. The faults discovered are problematic but not yet fatal; developers (particularly of P2P software) who claim they'd like advance notice that their systems will fail should take note."

72 of 401 comments (clear)

  1. Two files with the same md5 hash? by Anonymous Coward · · Score: 5, Funny

    I can only hope I live that long.

    1. Re:Two files with the same md5 hash? by Phleg · · Score: 4, Informative
      --
      No comment.
    2. Re:Two files with the same md5 hash? by UTPinky · · Score: 2, Funny

      drice@pinky:/tmp$ echo "Hello World" > file1
      drice@pinky:/tmp$ echo "Hello World" > file2
      drice@pinky:/tmp$ md5sum file1
      e59ff97941044f85df5297e1c302d260 file1
      drice@pinky:/tmp$ md5sum file2
      e59ff97941044f85df5297e1c302d260 file2

      Cheap, I know...

      --
      I'm only paranoid because everyone is against me...
  2. MP5 harmful? No way! by October_30th · · Score: 5, Funny

    Aha! So it was MD5 and not MP5...

    --
    The owls are not what they seem
  3. Re:damn by networkBoy · · Score: 4, Insightful

    Another option is to hash against two very different algorithms, that even if both are partially insecure, the chances of being able to trick both are exponentially higher.
    -nB

    --
    whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  4. Exploit? by Limburgher · · Score: 4, Interesting

    So does this mean that it's possible to find a useful MD5-equivalent file for any file? Just because someone alters a file does not mean they have done anything destructive. Would one be able to take a binary, make a change of some sort, and then run a tool to determine the block of data to add to the binary to both allow the change to take effect and cancel out the MD5 change? How complex would it be to construct this tool?

    --

    You are not the customer.

    1. Re:Exploit? by Ayaress · · Score: 3, Insightful

      It doesn't have to be harmful to break a ptp system. There's a pretty common exploit on Kazaa where people have a file just containing random junk that registers as a match to a popular file. If you download taht file, and get any portion of it from the fake, the file is corrupted and useless. Somebody could use these fake files to "poison" popular torrents, making it very unlikely that anybody on them will get uncorrupted files.

    2. Re:Exploit? by Pxtl · · Score: 2, Insightful

      Wait - no - I'm completely fscking wrong.

      I think the point was this.

      file1: xxxxxxxxxx
      file2: xxxxxyyyyy

      %file1 = %file2

      now, user downloads the file from p2p, and one user gives him file1 and one user gives him file2.

      you get:
      file3: xxxxxyyxxx
      which has the same has file1 and file2. That's the problem - not only can two files have the same hash, the combination of those files (as would occur with a corrupted P2P file) also has the same hash.

      Or I still could be wrong.

    3. Re:Exploit? by anthony_dipierro · · Score: 2, Informative

      As the length of the file is sent in addition to the MD5, in the vast majority of cases it's going to be impossible to find a file which gives you the same length and MD5. I guess as the size of media files increases this gets more and more likely, but if it ever starts affecting more than 0.0000000001% of files you can just increase the length of the hash.

    4. Re:Exploit? by owlstead · · Score: 3, Informative

      Yep, you are still wrong. I've tried some code and the (precalculated) different blocks MUST be at the start of the code. So it's more like

      file1: xxxxccccccc....
      file2: yyyyccccccc....

      %file1 = %file2

      Which is the example given in the article.

      However, Wang said she could get to a collision from any intermediate hash code within the hour (according to the article). That would mean:

      file1: ccccxxxxccccccccc......
      file2: ccccyyyyccccccccc......

      %file1 = %file2

      Where xxxx and yyyy are (pre?)calculated and cccc.... is the payload.

      If _I_ am not mistaken.

    5. Re: Exploit? by Omniscient+Ferret · · Score: 3, Informative

      Somebody could use these fake files to "poison" popular torrents, making it very unlikely that anybody on them will get uncorrupted files.

      This would worry me, except that BT uses SHA1, not MD5, so this is irrelevant. MD5 has seemed suspect for years, & Bram's the sort to pay attention to that sort of thing.

      I checked; Edonkey is based on MD4. Gnutella variants might use MD5.

    6. Re:Exploit? by wdr1 · · Score: 2, Informative
      I thought the same at first, but they have a pretty clear example showing that's not the case. From here:
      file1.dat:

      00000000 d1 31 dd 02 c5 e6 ee c4 69 3d 9a 06 98 af f9 5c
      00000010 2f ca b5 87 12 46 7e ab 40 04 58 3e b8 fb 7f 89
      00000020 55 ad 34 06 09 f4 b3 02 83 e4 88 83 25 71 41 5a
      00000030 08 51 25 e8 f7 cd c9 9f d9 1d bd f2 80 37 3c 5b
      00000040 96 0b 1d d1 dc 41 7b 9c e4 d8 97 f4 5a 65 55 d5
      00000050 35 73 9a c7 f0 eb fd 0c 30 29 f1 66 d1 09 b1 8f
      00000060 75 27 7f 79 30 d5 5c eb 22 e8 ad ba 79 cc 15 5c
      00000070 ed 74 cb dd 5f c5 d3 6d b1 9b 0a d8 35 cc a7 e3

      MD5(file1.dat) = a4c0d35c95a63a805915367dcfe6b751
      file2.dat:

      00000000 d1 31 dd 02 c5 e6 ee c4 69 3d 9a 06 98 af f9 5c
      00000010 2f ca b5 07 12 46 7e ab 40 04 58 3e b8 fb 7f 89
      00000020 55 ad 34 06 09 f4 b3 02 83 e4 88 83 25 f1 41 5a
      00000030 08 51 25 e8 f7 cd c9 9f d9 1d bd 72 80 37 3c 5b
      00000040 96 0b 1d d1 dc 41 7b 9c e4 d8 97 f4 5a 65 55 d5
      00000050 35 73 9a 47 f0 eb fd 0c 30 29 f1 66 d1 09 b1 8f
      00000060 75 27 7f 79 30 d5 5c eb 22 e8 ad ba 79 4c 15 5c
      00000070 ed 74 cb dd 5f c5 d3 6d b1 9b 0a 58 35 cc a7 e3

      MD5(file2.dat) = a4c0d35c95a63a805915367dcfe6b751
      --
      SlashSig Karma: Excellent (mostly affected by moderatio
    7. Re:Exploit? by CryoPenguin · · Score: 2, Informative

      That's only a problem because Kazaa uses one checksum for the whole file. BitTorrent checksums each chunk (typically 256KB - 1MB), so it can detect corrupt data, throw out only little collateral real data, and blacklist whoever sent you the corrupt bits. Then it redownloads the chunk from someone else, and the user never needs to know.

  5. Re:damn by LiquidCoooled · · Score: 2, Informative

    There will ALWAYS be collisions with any kind of hashing algorythm.

    Thats the nature of the game we play.

    The only hashing system without collisions is sending the original file itself.

    --
    liqbase :: faster than paper
  6. In english by ValuJet · · Score: 4, Funny

    Is there a translator from ultra-nerd to english?

    1. Re:In english by Anonymous+Brave+Guy · · Score: 4, Informative

      Short version: A common technology for verifying that a file you've downloaded is legitimate and untampered-with, known as MD5, isn't as secure as people thought.

      Slightly longer version: MD5 is a way of generating a checksum -- a single, comparable value -- from a file. Ideally it is supposed to give you different numbers for different files, so if a web site advertises the checksum a file should have, you can compare that with one generated from the file you actually got to see whether the file you've downloaded has been modified, potentially maliciously.

      The research shows that it is possible for someone to construct a drop-in replacement for the file you thought you had that generates the same MD5 checksum as the original, so anyone attempting to validate the file this way would think they had the real thing. If it turns out that you can construct a damaging replacement for a common file -- perhaps an installer for a popular application like Firefox or OpenOffice that's usually downloaded from a public server -- then this could open a loophole for viruses, worms, etc. that would slip through the security net often used by cautious people when downloading such programs.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    2. Re:In english by MindStalker · · Score: 2, Insightful

      Important part is you have to construct both files. So if you were the distributor of said common file and people trusted you, you could produce two versions of said file, with same hash. But producing a identical hash to a file you can't change has currently not been successful.

  7. Good analysis by overbyj · · Score: 5, Funny

    By examining the MD5 hash using a sophisticated Fourier schema followed by deconvolution with a bit binary-inequal collision analysis, it is quite obvious I have no freaking clue what this stuff is about.

    I am glad somebody does.

    --
    No trees were harmed in the composition of this; however, numerous electrons were inconvenienced.
    1. Re:Good analysis by Wanker · · Score: 3, Funny

      Hibbert: Homer, I'm afraid you'll have to undergo a coronary bypass operation.
      Homer: Say it in English, Doc.
      Hibbert: You're going to need open heart surgery.
      Homer: Spare me your medical mumbo jumbo.
      Hibbert: We're going to cut you open and tinker with your ticker.
      Homer: Could you dumb it down a shade?

      http://www.tvtome.com/tvtome/servlet/GuidePageServ let/showid-146/epid-1355/

  8. Let's face it by mordors9 · · Score: 2, Insightful

    Someone with the knowledge and will and time can come up with a way to circumvent almost any protective scheme they come up with. Likely the only way to really safeguard something like this is to do a very time consuming and cpu intensive comparison of the two files. It will come back to "do you trust the source of the file".

    1. Re:Let's face it by jd · · Score: 2, Interesting
      Let's say you break a file into blocks, encrypt those blocks with Rijndael or Serpent using a chaining method that authenticates the prior block, digitally sign the result using (seperately generated) RSA, DSA and ECC signatures in turn, and generate SHA-1 and Whirlpool checksums of both the encrypted and unencrypted file.


      True, you'd spend longer validating and decrypting the unholy mess generated than you'd spend downloading it, but I think you'd be fairly safe in assuming that the file was what it claimed to be.


      In other words, it isn't impossible to be so close to 100% secure as to make no odds. It is merely a question of whether it's worth it. Is the expense of protecting something greater than the value of what you're protecting? If so, nobody is going to bother, no matter how simple the task of protecting is.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  9. md5 vs sha1 vs ? by alexandre · · Score: 4, Informative

    http://en.wikipedia.org/wiki/Md5

    here is a very good link about the algo... :)

  10. This is almost appropriate... by freeze128 · · Score: 3, Funny

    If your cursor finds a menu item followed by a dash,
    And your double-clicking icon puts your window in the trash,
    And your data is corrupted 'cause the index doesn't hash,
    Then your situation's hopeless and your system's gonna crash!

  11. Correct me if I'm wrong, but... by Sheetrock · · Score: 5, Insightful
    If I'm translating this properly, a malicious person can do two things with this knowledge:

    He can create a file that MD5sum's to the same result as a legitimate file, but does not have full control over the content or size of the result (making this a mostly useless avenue of exploitation except for people who want to spread trash on P2P networks -- I.E. it shouldn't particularly bother anyone except people who already don't care about security).

    Or he can create two files that MD5sum to the same result. But he has to have control over both files, which offers effectively no advantage to someone who is trying to spread malware or tamper with existing archives that have been MD5summed.

    Consequently, while this is of academic interest I don't see what the big deal is; any time you reduce a large file to a fingerprint you will inevitably run into problems like this because it is impossible to represent one-to-one every individual possible combination of a large set of data in smaller sets ("fingerprints"). You can reduce the risk by increasing the set domain with a larger variadic function but it is impossible to escape this constraint without using fingerprints as large as the data itself.

    --

    Try not. Do or do not, there is no try.
    -- Dr. Spock, stardate 2822-3.




    1. Re:Correct me if I'm wrong, but... by chialea · · Score: 4, Insightful

      When you're dealing with cryptography, it should be very, very, very hard to find collisions. If you find enough of them, you can proabably find something bad with the same hash value. For example, if you sign a digital document that says you're going to pay me $1 for my pencil, and I find a suitable hash collision, I could make it look like you signed a promise to pay me $3,000 for some used tissue. I wouldn't rule out that someone could find a harmful collision for a program distributed online, and substitute a trojan. If the prize gives enough reward, people will throw a lot of computational power at it, and will likely hit pay dirt.

      Secondly, this is quite a signifigant break. Once a hash function has had an attack like this discovered, it often becomes completely useless not long down the road. I work in cryptography, and the people I know have written off MD5. Heck, the people I know are also quite worried about SHA-1, and the current best attack against that one isn't nearly as strong.

      The upshot of this is that this hash function should NOT be considered secure any more. For now, if you are not protecting anything of high value, you're probably fine. Tomorrow? Possbily. But soon, you're not going to be protected at all, and so you should start worrying about that now, instead of when you're already in trouble.

      Lea

    2. Re:Correct me if I'm wrong, but... by HeghmoH · · Score: 2, Interesting

      Let's say I have a system that downloads files over the internet. To prevent man-in-the-middle attacks, I digitally sign the files. This prevents me from having to vet all of the code that deals with local files for buffer overflows. I implement the digital signatures by simply encrypting a hash of the file with an RSA private key when I create the file, and decrypting and verifying the hash on the receiving side.

      If I had decided to use MD5 for the hash in the digital signature, my scheme is now vulnerable. It's not too far-fetched to imagine that somebody could come up with a way to embed an exploit in one of the files while staying within the limitations imposed by this collision technique. Then if he can accomplish a man-in-the-middle attack, he's successfully used my automatic downloader to compromise somebody's machine. Not fun.

      This may not be completely feasible currently, but the technique shows that it may be possible in the future. If you're currently designing a system that you plan to have function for several years, you should not assume that MD5 is cryptographically secure.

      --
      Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
    3. Re:Correct me if I'm wrong, but... by Facekhan · · Score: 2, Insightful

      A lot of routing protocols use MD5 as the password hash for authentication. If someone found a collision for some of the important internet router BGP peers then large chunks of the internet could get routed the wrong way or just small parts like the subnet your bank controls could get routed to a some black hat's basement in Romania where he could setup a mock intranet and webserver to steal customer info through a spoofing attack.

    4. Re:Correct me if I'm wrong, but... by ReelOddeeo · · Score: 2, Interesting

      I was thinking the same thing.

      See the long list of cryptographic hash functions on Wikipedia. (Bottom of page.)

      If you used three or four different hash functions, to produce a long combined message digest (concatenated from the several message digests), it would seem to be much more difficult to produce files that collide. An attack resulting in a collision on one algorithm, is not likely to work for another algorithm. Finding two files that simultaneously fool two or more algorithms seems a much more difficult task than just fooling a single algorithm like MD5.

      This is of utmost importance. We can't have the RIAA infiltrating garbage files ("what the fiddlesticks do you think you're doing?") into our p2p networks.

      --

      Those who would give up liberty in exchange for security and DRM should switch to Microsoft Palladium!
    5. Re:Correct me if I'm wrong, but... by kiltedtaco · · Score: 3, Informative

      The Wang et al attack does not apply to passwords. Their attack applied to situations where the md5 input plaintext was known. Collisions are nowhere near common enough when using less than 16 character inputs to md5 to provide a feasible means of cracking passwords. Nobody has ever found a collision with under 128 bits of input, and the attacks in the article take considerably more than that.

    6. Re:Correct me if I'm wrong, but... by jd · · Score: 2, Informative

      Very true, or it could be used to poison the BGP routing tables. The problem with such an attack is that, once one router believes in the poisoned routes, the poison will spread very rapidly.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    7. Re:Correct me if I'm wrong, but... by thing12 · · Score: 2, Informative
      Not really... the article is talking about relatively huge files which when you swap out blocks in order to result in the same MD5. Passwords on the other hand are much shorter than the MD5 in the first place and no two strings shorter than the MD5 length (128 bits) will give you the same MD5. The MD5 space is many orders of magnitude larger than the typical password space - even a 16 character password that uses mixed case, digits and punctuation (basically all of base64), that contains about 96 bits of information -- that's 4 billion times smaller than the space of MD5.

      What I'm getting at is that you'll probably always have to either know the password + the salt (if there is one), use brute force, or use a database of MD5's for all possible passwords in order to decrypt an MD5'd password. But since there are already MD5 databases, we're kind of past this part anyway.

      As for access tokens, MD5's are chosen simply because they're large and seemingly random which makes them "unguessable". Since they're just temporary anyway, guessability is all you're trying to prevent - you'll get a new one next time and the attacker will have to start over.

  12. Not just MD5 by PureFiction · · Score: 2, Interesting

    Other weaknesses were reported in various other secure digests, including MD4, RIPEMD, HAVAL-128, SHA-0.

    SHA-256 is a good replacement. SHA-1 should be fine but if you are going through the trouble of an upgrade, why not make it sufficiently future proof?

    1. Re:Not just MD5 by chialea · · Score: 2, Informative

      SHA-1 has an attack that's somewhat troubling. I'd look to next year's crypto and eurocrypt conferences to see starts shaking out as the new standard.

      Still... I would switch out MD5 if you have a target that's worth pretty much anything at all. After a break like this, I'd expect MD5 to become basically useless pretty fast. Of course, I don't work in hash collisions, I work mostly in protocols...

      Lea

  13. If I Had A Million Terabytes... by Tackhead · · Score: 5, Funny
    If I had a million terabytes of storage, y'know what I'd do?

    Two files with the same MD5 hash at once. Aaw yeah.

    1. Re:If I Had A Million Terabytes... by wren337 · · Score: 2, Funny

      Well, the type of files that would double up on a dude like me do.

  14. Re:damn by WolfWithoutAClause · · Score: 5, Interesting
    There will ALWAYS be collisions with any kind of hashing algorythm.

    Yes, but a good hash makes it *extremely* difficult to find them. MD5 is looking pretty mediocre right now.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  15. The "Detailed Summary" by Effugas · · Score: 5, Informative

    [This is the author]

    I've been doing some analysis on MD5 collision announced by Wang et al. Short version: Yes, Virginia, there is no such thing as a safe hash collision -- at least in a function that's specified to be cryptographically secure. The full details may be acquired at the following link:

    http://www.doxpara.com/md5_someday.pdf

    A tool, Stripwire, has been assembled to demonstrate some of the attacks described in the paper. It may be acquired at the following address:

    http://www.doxpara.com/stripwire-1.1.tar.gz

    Incidentally, the expectations management is by no means accidental -- the paper's titled "MD5 To Be Considered Harmful Someday" for a reason. Some people have said there's no applied implications to Joux and Wang's research. They're wrong; arbitrary payloads can be successfully integrated into a hash collision. But the attacks are not wildly practical, and in most cases exposure remains thankfully limited, for now. But the risks are real enough that responsible engineers should take note: This is not merely an academic threat, systems designed with MD5 now need to take far more care than they would if they were employing an unbroken hashing algorithm, and the problems are only going to get worse.

    Some highlights from the paper:

    * The attack itself is pretty limited -- essentially, we can create "doppelganger" blocks (my term) anywhere inside a file that may be swapped out, one for another, without altering the final MD5 hash. This lets us create any number of binary-inequal files with the same md5sum.

    * MD5 uses an appendable cascade construction -- in other words, if you happen to find yourself with two files that MD5 to the same hash, an arbitrary payload can be applied to both files and they'll still have the same hash. This leads to...

    * Attacks are possible using only the proof of concept test vectors released by Wang -- the actual attack is not necessary.

    * Stripwire emits two binary packages. They both contain an arbitrary payload, but the payload is encrypted with AES. Only one of the packages ("Fire") is decryptable and thus dangerous; the other ("Ice") shields its data behind AES. Both files share the same MD5 hash.

    * Digital Signature systems are vulnerable, as they almost always sign a hashed representation of data rather than the data itself.

    * This is an excellent vector for malicious developers to get unsafe code past a group of auditors, perhaps to acquire a required third party signature. Alternatively, build tools themselves could be compromised to embed safe versions of dangerous payloads in each build. At some later point, the embedded payload could be safely "activated", without the MD5 changing. This has implications for Tripwire, DRM, and several package management architectures.

    * HMAC's invulnerability has been slightly overstated. It's definitely possible, given the key, to create two datasets with the same HMAC. Attacker possession of the key violates MAC presumptions, so the impact of this is particularly questionable.

    * Very interesting possibilities open up once the full attack is made available -- among other things, we can create self-decrypting executables (fire.exe and ice.exe) that exhibit differential behavior based on their internal colliding payloads. They'll still have the same MD5 hash.

    * Several doppelgangers may (relatively quickly, as per Joux) be computed within a single multicollision-friendly block. As such, the particular selection of doppelganger sets within a file can itself be made to represent data. It's relatively straightforward to embed a 128 bit signature inside an arbitrary file, in such a way that no matter the value of the signature, a constant MD5 hash is maintained. This is curiously steganographic.

    * Many popular P2P networks (and innumerable distributed content databases) use MD5 hashes as both a reliable search handle and a mechanism to ensure file integrity. This makes them blind to any sign

    1. Re:The "Detailed Summary" by BranMan · · Score: 2, Insightful

      It seems to me that at least the malicious nature of this vulnerability can be limited by using the size of the file as an additional check besides the MD5 hash. In other words, if you know how large the file is supposed to be in bytes, then there is less likelihood that something malicious can be passed off as the original - even if it has the same MD5.
      Is that right? I'm no expert by any means, but could this reduce the potential for a real attack to pretty much nill?

    2. Re:The "Detailed Summary" by Effugas · · Score: 2, Insightful

      File size remains constant between Fire and Ice. Good thinking, though.

      The solution is to not use MD5.

    3. Re:The "Detailed Summary" by Dracolytch · · Score: 2, Insightful

      I know a fair amount about this stuff, but obviously not as much as you...

      What do you think are the most viable alternatives? It seems to me that SHA-1 would suffer similar vulnerabilities. Does SHA-1 suffer from the appendable cascade issue?

      Do you think there is any way to avoid this kind of problem with hashes? I'm not really aware of any alternate techniques that wouldn't suffer from this same kind of attack eventually. Sure, you could develop related algorithms that increase the hash size, but then it looks like it'd just be an arms race between hashers and colliders.

      ~D

      --
      This sig has been enciphered with a one-time pad. It could say almost anything.
    4. Re:The "Detailed Summary" by Effugas · · Score: 2, Informative

      SHA-1 also uses a Merkle-Damgard construction, so yes, if we find a SHA-1 collision, it'll be appendable.

      SHA-1 has a much stronger design. It's starting to show cracks, though, so I don't recommend anything. Something based on AES will come, though -- maybe AES-OMAC, maybe Whirlpool. At the core of almost every hashing algorithm is just a block cipher anyway...

      --Dan

    5. Re:The "Detailed Summary" by BranMan · · Score: 2, Insightful

      The file size does indeed remain constant, but the attacker is constrained as to what he can substitute out of the original file while maintaining both the file size and the MD5 hash. Without the file size remaining constant too, the attacker can theoretically make the original file into a trojan. With the file size remaining constant, most likely the only thing an attacker can do is break the file - he doesn't have enough leeway to put something malicious in there. I think.

  16. ______ with be harmful/obsolete in the future.. by l4m3z0r · · Score: 2, Insightful
    Really no big surprise, all currently implemented algorithms for security and digital signatures will be rendered useless or easily hackable in the future. The fact that a compromise seems to be soon is the part thats interesting.. however the parent fails to address how serious it is.

    For the most part, big deal, all of current security procedures will be harmful ie compromised in the future...

  17. Solution: Use more than one hash algorithm by NZheretic · · Score: 2, Informative
    This kind of attack can be mitigated into non-existance by just using two dissimilar hash algorithms.

    Using MD5 with SHA1, or even the older MD2 or MD4 will reduce the probability of creating a compatable binary with the same checksum to virtually zero.

    If only one checksum is required then just XOR the resulting checksums from each algorithm.

  18. Re:damn by networkBoy · · Score: 2, Informative

    "You shouldn't be able to because it simply isn't true."

    I have to disagree with you here.
    If I have algo A and algo B:
    I hash with algo A and get a value which I store.
    I hash with algo B and get a value which I store.
    While the security does not add up to A^B it does ammount to > A+B, which is still better than A or B only. (I really wish I had my Crypto reference books handy)

    Other posters mentioned it was more work and equiv to one secure algo, both those statements are true; as I pointed out this was an alternative to writing a new SHA-1 algo.
    -nB

    --
    whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  19. It actually easy to see this by Anonymous Coward · · Score: 2, Interesting

    I was a bit suprised recently when I tried to
    sort 15,000 jpg image files to remove duplicates.
    Since the names varied, and it is not uncommon
    to have many images with the same length, it
    seemed like a good idea to use md5 hashes.
    So I coded it up in python to do the md5 hash,
    and then stuffed the file name into a table
    keyed by the md5 hash. Big suprise when multiple
    different files landed in the same hash.
    Some property of jpgs probably reduces the
    randomness of the files and increases the
    probability of hash collisions.

  20. Re:Already Happening by menscher · · Score: 3, Informative
    Bullshit.

    I'll give you $50 if you can back that claim up. I want to see two video files. They must start out the same, but have a difference about half-way through. And they have to have the same md5 sum. Just post where I can download the two files, and your paypal address.

    The way I see it, you've got a 1/2^64 chance of being right. So I'm risking $50/184467440737095516, which isn't a whole lot.

  21. Re:Cash Money? by Meostro · · Score: 2, Informative

    No, but I believe this one is:

    XiaoyunWang, Dengguo Feng, Xuejia Lai, and Hongbo Yu
    "Collisions for hash functions md4, md5,haval-128 and ripemd"

  22. Re:Inherent to any hashing mechanism by FearUncertaintyDoubt · · Score: 2, Insightful

    Before you flame, change 256^4 / 256^1000 to 256^1000 / 256^4.

  23. Re:damn by TCM · · Score: 2, Insightful

    A P4 at 2.6GHz does >300MB/s md5 according to openssl speed md5. As noted, you probably wait for the data to be fetched from disk rather than the checksum to be computed.

    --
    Of course it runs NetBSD. BTC: 1NT7QvbetmANwaMzhpVL6
  24. Dirt by mfh · · Score: 2, Insightful

    I've always called this dirt. Some folks call it padding, but it's essentially the same. However up until now, no one has known how to do it with md5 and come up with the same sum. This is nothing more than a hack to me.

    The bottom line is that if you care enough about security this will only be a problem for a day or so when md5 is finally solved completely and the hashes don't take five days to brute force -- they could be solved in a matter of microseconds. As soon as that happens, the next hash system goes up and it would not likely be so easy to break, unless the whole hashing process is somehow cracked wide open (which would be very bad for a number of reasons).

    What we'll likely see is that with the greater increases in CPU speeds available to end users, the hash breaking systems can be tested easier until a final reverse algorhythm is available for md5. There already is a site that will break your hash and give you *something* with the same hash, and it takes a couple days.

    --
    The dangers of knowledge trigger emotional distress in human beings.
  25. Re:damn by Hanji · · Score: 2, Insightful

    That was his point.
    Any hash that maps a large (infinitely large, in most cases) space onto a finite ones will always have collisions, it's just a question of how easy they are to find. If you don't want to have have collisions, you have to send the whole file.

    --
    A Minesweeper clone that doesn't suck
  26. Is a two-pass just as vulnerable? by davidwr · · Score: 3, Interesting

    I haven't had time to think this out, so I'm throwing it out for you guys:

    Is doing a 2nd pass helpful?

    In other words, if
    ABCfireDEF
    and
    ABCiceeDEF
    hash the same, does
    ABCfireDEFABCfireDEF
    necessarily, or even frequently, hash to
    ABCiceeABCiceeDEF?

    Even if it were to provide protection, in practical terms,
    1) other hashing althorithms are likely faster than "MD5 times two"
    2) there may be some - hopefully a lot fewer - places in a long file where where
    ABCfireDEFABCfireDEF
    can be replaced with
    ABCiceeDEFABCmeltDEF

    I'm beginning to like the "pick two algorithms and call me in the morning" approach.

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  27. Not always... by Goonie · · Score: 2, Insightful
    How do you know that the algorithms aren't going to be weak for the same text pairs?

    It's well known that encrypting twice doesn't always improve your security, so it wouldn't be surprising if hashing twice didn't always improve your security either.

    --

    Any sufficiently advanced technology is indistinguishable from a rigged demo
    --Andy Finkel (J. Klass?)
  28. Re:MD5 is obviously less secure by pclminion · · Score: 2, Informative
    While this is technically true (there are an infinite number of passwords that hash to the same value), it's not of much practical use. There are only 256^8 possible 8-character passwords (less, if you don't allow un-typeable characters). There are 2^128 possible MD5 hashes. 256^8 is much, much, MUCH less than 2^128, thus the probability of discovering another valid passwords of 8 characters or less is negligible.

    Sure, there are an infinite number of possible passwords, but they're all impossibly huge. I can come up with a password which is one trillion characters long and which hashes to the right result, but that's not practical.

  29. Re:You are missing the point. by pclminion · · Score: 4, Insightful
    Jesus, I hope I'm wrong... I would have to acctualy buy MS crap.

    Your statement is ironic in the extreme. The big risk here is NOT P2P apps. Here's the real risk.

    Using one of these collision generators, I can create two x.509 certificate requests which have the same MD5 hash. One request says, "I am John Smith, kshdfkhs8i76y238888888" and the other request says, "I am Microsoft Corp., oiushir87dsfhgkjshdfg"

    Now, I get Verisign to issue me a certificate for the first request. Since the hash is the same, I can rewrite the certificate to say that I am Microsoft Corp, and nobody will ever be able to tell the difference. Now, I am able to sign code as if I were Microsoft, and Dominate The Earth.

  30. You're wrong. by Piquan · · Score: 4, Informative

    He can create a file that MD5sum's to the same result as a legitimate file, but does not have full control over the content or size of the result (making this a mostly useless avenue of exploitation except for people who want to spread trash on P2P networks -- I.E. it shouldn't particularly bother anyone except people who already don't care about security).

    Suppose you're storing passwords as encrypted hashes, so that intercepting the hashes doesn't tell you what the password is. But if you can generate a password to match that MD5...

    You know that GPG keys are identified and signed by their MD5 hashes? Suppose that I can generate a GPG key that would be identified as yours, and distributed it.

    Or he can create two files that MD5sum to the same result. But he has to have control over both files, which offers effectively no advantage to someone who is trying to spread malware or tamper with existing archives that have been MD5summed.

    There's a coin-flipping protocol that goes as follows. Suppose that Alice and Bob want to flip a coin (over the Internet), but they don't trust each other.

    1. Alice generates a file with random data.
    2. Alice sends Bob the MD5 hash of the file.
    3. Bob picks a bit in the file, and whether he thinks it's a 0 or a 1.
    4. Bob wins if and only if he picked right.
    5. To verify, Alice sends Bob the file she generated at the beginning.

    Now, suppose that Alice generated multiple files in step 1. When Bob makes his guess, she tries to pick a file that will make her win. If she generated only two files, completely randomly, this would let Alice win 75% of the time.

    These are just the first ideas I thought of. If I were looking for other problems, I'd think about undeniable signatures, keysigning (which as GPG and X.509 SSL are heavily based on) and other specialized signature systems. In particular, I expect that the first type of crack could cause issues with SSH keys, both user keys (used for authentication) and host keys (to prevent man-in-the-middle attacks).

    Digital signatures are used for much more than just testing for file tampering.

    1. Re:You're wrong. by Gemini · · Score: 2, Informative

      You know that GPG keys are identified and signed by their MD5 hashes?

      They're not. The old PGP 2.6 keys are, but GnuPG generates OpenPGP keys that use SHA-1.

      GnuPG will use an already generated PGP 2.6 key, but will not make more of them.

  31. Re:damn by canavan · · Score: 4, Insightful

    You're using a different definition of a secure hash than everybody else. It's rather obvious that for files larger than the length of the hash (128 bit for md5), there must be quite a lot sharing the same hash, for a given file length about 2^(filelength in bits - hashlength in bits). However for a hash to be considered secure, it's only required that finding two files with the same hash must be as hard as trying (in md5's case 2^127 different files), but in md5's case you can compute those collisions much cheaper under certain circumstances.

    Another condition is obviously that the message should not be reconstructable from the hash.

  32. You missed the point. by raehl · · Score: 2

    The point is not that there is collision. The point is that given a particular file, you can compute other files that collide with that file in an amount of time many orders of magnitude less than it would take if you randomly tried files until you hit one that happened to collide.

  33. Re:damn by jyoull · · Score: 2, Insightful

    Intuitutively, yes, and i'm just pulling this out of the air here cuz i'm supposed to be working on something else, but solve a slightly different problem.

    If you are concerned that the result-space of a hash algorithm is going to lead to collisions (this is not an ordinary concern because the algorithms claim to have dealt with this for us already) then using two very different hash functions in concert will definitely expand the range of possible results and reduce the probability of collisions by Asize * Bsize.

    If however you are concerned about bad guys faking things up, then there is a slightly different problem...

    A == MD5
    B == SHA

    Hashing to both A and B yields a huge range of results.
    However, if A known or suspected to be broken, then you're down to the security provided by B. A is out of the picture.

    If A can be tossed then, then you're totally reliant on B for a safe hash. If that's true, then you didn't need A at all and you'd better be confident that B is gonna do what you need it to do, cuz A don't dance.

    Note to experts: Please do not grade harshly.

  34. Re:Very true by jd · · Score: 2, Informative
    NESSIE is an attempt to do for the European crypto standards what NIST does for the American crypto standards. Whirlpool was approved by NESSIE and is part of the ISO/IEC 10118-3:2003(E) standard. As such, it should be OK for use in Europe for secure systems, including military and Government applications.


    The ISO approval also carries some weight in industry, although after some rather disasterous specifications (such as ISO 9000), they have lost some of their image. However, there are plenty of organizations that would consider an ISO standard an absolute must.


    I don't know of anyone using Whirlpool for highly secure systems. It certainly wouldn't be ok in the US, as it's not a FIPS standard. France or Germany would be better bets.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  35. Re:You are missing the point. by jjon · · Score: 3, Funny
    [... complex plan snipped ...] Now, I am able to sign code as if I were Microsoft,

    You can just ask Verisign for a certificate in the name of Microsoft, and they'll give you one. Much simpler.

    It's happened in the past.

  36. The biggest problem is still human falibility by syousef · · Score: 2, Insightful

    Be honest. How many of you have checked the MD5 sums on a file with a TRUSTED source, as opposed to from the same source you got the file? How many of you do this regularly?

    THAT is the biggest problem with MD5 for most users.

    --
    These posts express my own personal views, not those of my employer
  37. Almost forgot by jd · · Score: 3, Interesting
    Whirlpool is a 256-bit hashing algorithm, derived from the Rijndael encryption algorithm. Rijndael is known to be strong, and has been approved by NIST, but the conversion to a hash function has not been sufficiently tested.


    Where time isn't critical (eg: creating and validating checksums for files), I'd say use both. The overhead isn't great, and you'd get much more security.


    Where time is critical AND you don't have to be concerned with computers not under your control, use Whirlpool. Rijndael is fast, SHA-1 is slow. Whirlpool also offers a longer hash string than SHA-1.


    In any other situation, use SHA-1. Whirlpool might turn out to be the greatest algorithm out there, but that doesn't help if you're trying to talk to a remote computer that doesn't support it.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  38. Re:damn by uncqual · · Score: 2, Interesting

    Agreed that folding A with B after A has been compromised is a nonstarter.

    However, isn't there merit to the general idea of combining two 'dissimilar' (i.e., the theoretical basis for the 'security' of each share as few attributes as feasible) hash functions X and Y where both X and Y are currently though to be 'secure'?

    In those very common cases where the hash is protecting something with decreasing time value (such as software binaries which become obsolete in a few years) or where the original source is secure and it is only alterations of copies that are a concern (perhaps historical legal documents), this buys time if X or Y (but not both) is compromised (or seem more likely to be compromised - as MD5 is now)?

    For example, if X=MD5, the concerns about MD5 would result in an effort to discontinue its use and replace it with a new hash function Z and start using Y+Z. While the community switches to a new combination, everything is still pretty safe (as safe as Y in this case) during this transition period.

    It seems that in the private sector (spooks aside), it's quite unlikely that X and Y would both be effectively compromised simultaneously and with little warning unless the notion of dissimilarity is also compromised. Fortunately, the skills needed to compromise such functions seem to be concentrated in the guys with the white hats so they tend to publish their preliminary results.

    Disclaimer: I'm not a cryptomaniac so my observations are worth substantially less than you paid for them.

    --
    Why is there an "insightful" mod and why isn't it "-1"? If I wanted insight, I wouldn't be reading /.
  39. MD6 by Danathar · · Score: 2, Funny

    That's OK..just invent MD6!

  40. Re:damn by grumbel · · Score: 2, Interesting

    ### If it's a hash, the message CANNOT be reconstructable from it

    Depends on the hash function, if the input length is equal or smaller then output length reconstructing the message might be possible, ie:

    $ echo "hello" | md5sum
    b1946ac92492d2347c6235b4d2611184 -

    Should be easily reversible with a dictonary attack. However in the more common case a hash maps a large input domain, to a much smaller output domain, so yep, hashes are not reversible unless input is somehow smaller then the hash itself.

  41. Re:damn by goatpunch · · Score: 2, Insightful
    However, if A known or suspected to be broken, then you're down to the security provided by B. A is out of the picture.

    If A can be tossed then, then you're totally reliant on B for a safe hash. If that's true, then you didn't need A at all and you'd better be confident that B is gonna do what you need it to do, cuz A don't dance.

    I'm not so sure, the description of the MD5 attack didn't say it was completely compromised, only that it was possible to find padding bits that could allow malicious content to be inserted without changing the checksum of the whole.

    If the orginal data is: "abcdefg", I can insert some malicious bits 'M', along with some padding bits 'X', and ensure that the result of A would be the same: A("abcdefg") == A("abcdMXfg").

    Assuming that I found a similar attack on B, I could find padding bits 'Y' such that B("abcdefg") == B("abcdMYfg").

    Of course to fool both checksums, X must equal Y. Finding a value that keeps both checksums the same might turn out to be a non-trivial problem.

    PGP is easily broken by a brute force attack given enough time, it's just that the amount of time isn't feasible at the moment.

  42. Re:I have a novel solution by Dan+Farina · · Score: 2, Informative

    I'm not sure if you are being sarcastic or something, but as said before, Bittorrent uses SHA-1, not MD5....

    So you are safe downloading linux for now via bittorrent. Besides, the chances of MD5 collisions happening from sheer luck/unluck are very slim. (after all, we've been using it for ages with no reports)

    The most dangerous factor to continued use of MD5 are malicious individuals.

  43. Cryptographic stacking potentially harmful by j.leidner · · Score: 3, Insightful
    Let's say you break a file into blocks, encrypt those blocks with Rijndael or Serpent using a chaining method that authenticates the prior block, digitally sign the result using (seperately generated) RSA, DSA and ECC signatures in turn, and generate SHA-1 and Whirlpool checksums of both the encrypted and unencrypted file. True, you'd spend longer validating and decrypting the unholy mess generated than you'd spend downloading it, but I think you'd be fairly safe in assuming that the file was what it claimed to be.

    Maybe, maybe not. The new technique would certainly be more difficult to analyse mathematically, but just stacking complicated but flawed methods does not necessarily result in a more secure method: typically, the security of the weakest link determines the security of the whole system.

    What you say reminds me of Don Knuth's experience when he wrote his first innocent 'super' pseudo random number generator (reported in his Art of Computer Programming, Volume 2, page 4: "Algorithm K" ;-): he composed all sorts of complicated operations, but had to learn the resulting number sequence was far from more (pseudo-)random, in fact much worse than the the standard 1-line modulo function.

    Another case of (false sense of) security through obscurity?

    --
    Try Nuggets , our SMS search engine which uses question answering technology; now available across the UK.

  44. Stop-gap solution: hash offset files by AsciiNaut · · Score: 2, Interesting
    Here's a potential stop-gap solution: provide two md5sums per file, one of the whole file as normal, and one of the file offset by one byte. Let's look at the two hash-equivalent files cited by parent:
    $ cmp file1.dat file2.dat
    file1.dat file2.dat differ: char 20, line 1

    $ md5sum file1.dat file2.dat
    a4c0d35c95a63a805915367dcfe6b751 file1.dat
    a4c0d35c95a63a805915367dcfe6b751 file2.dat
    Whoops! Now examine hashes of the same files, omitting the first (identical) bytes:
    $ xxd -s 1 -ps file1.dat | xxd -r -p | md5sum
    84e6e0a21e2c4c9ef53f3762fdc90bc8 -
    $ xxd -s 1 -ps file2.dat | xxd -r -p | md5sum
    a63151008e5f8fc116ba947fd8af8c5a -
    Clearly this would not work with all collisions (nothing useful would), but it might hugely limit their frequency. And it would be relatively easy to tag on tables of 1-byte offset md5sums to existing md5sum tables out there.