Is this the right interperation of this diagram: http://www.cryptopp.com/benchmarks.html



    Cycles Per Byte:28.6

  • MD5


    Cycles Per Byte:6.8

And does that also mean that MD5 is easier to crack when using the same password (so same key length and key strength).

  • 12
    AES and MD5 do not do the same thing. One is an encryption algorithm (technically, the core of an encryption algorithm), the other is a digest algorithm. It makes no sense to compare them. – Gilles Jun 13 '12 at 17:55
  • Well, you can brute force both of them to crack the original input. So assume you would have a AES key and you know 26/32 of the characters, Is it true that it will still be slower to crack the 6 characters you don't know, when using AES, because of the lower MiB/Second. – user915666 Jun 13 '12 at 18:00
  • 1
    Edit your question then. Be sure to state your assumptions very precisely: as usual when it comes to security, a small detail can make a world of difference. – Gilles Jun 13 '12 at 18:18

MD5 is a hashing algo, a bit like a CRC checksum algo, the data is not encrypted, it is hased, and thus unrecoverable. It is in fact fast to compute.

Encryption algo, are a 2-way system, data can be encrypted and decrypted with a valid key. They usually involve more loops and shifting then checksum algos, thus slower.

Choosing between MD5 or AES will depends on your needs and requirements. Bare in mind that MD5 is not secure anymore and should not be used. Prefer SHA-256 instead.

Edit: from wikipedia,

NIST's directive that U.S. government agencies must stop uses of SHA-1 after 2010. Currently, the best public attacks break 41 of the 64 rounds of SHA-256 or 46 of the 80 rounds of SHA-512

  • SHA-1 shouldn't be used either, for the same reason. – Oleksi Jun 13 '12 at 18:26
  • that's correct abt SHA-1, post edited, tx. – fduff Jun 13 '12 at 18:54
  • 2
    Should we just have a hashing is not encryption banner on this site? – k to the z Jun 13 '12 at 19:24
  • 1
    Any purpose, really. You should be phasing it out and replacing with stronger hashing algorithms add stated above. – Rory Alsop Jun 14 '12 at 6:47
  • 2
    @ktothez I think there should be a couple quick questions when signing up, one of them being whether MD5 is an encryption algorithm. – Luc Sep 16 '12 at 18:31

MD5 is a hash function, not an encryption function. It yields a fixed-size output (128 bits) regardless of the input size. It is not meant to be reversible. Thus, it can not be compared with AES: what MD5 does, AES cannot do, and what AES does, MD5 cannot do.

One situation where you can meaningfully compare processing speeds of MD5 and AES is in protocols where the same data is both encrypted (e.g. with AES) and covered by a Message Authentication Code such as HMAC, which is based upon a hash function (possibly MD5). One such protocol is SSL/TLS. In that case, we can try to see which of the encryption and the MAC uses most of the CPU budget. Usually, encryption is more expensive than hashing, which the numbers you give show. Note, though, that MD5 is known to have a number of weaknesses. The standard hash function which is believed to be "as strong" as AES is SHA-256, and SHA-256 processing speed is not much better than that of AES, on commonly used CPU.

Another situation is a PRNG. You can build a PRNG out of a block cipher (such as AES) by encrypting successive values of a counter (this is called CTR mode). You can also build a PRNG out of a hash function by HMAC-ing successive values of a counter. In that case, this works, for the hash function, on its output bandwidth, not its input bandwidth, and it requires hashing many very small messages instead of one big message. Usual hash functions, including MD5, turn out to be disappointingly slow when used that way.

This explains why we define block ciphers such as the AES, instead of using a one-size-fits-all hash function everywhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.