Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MD5 vs CRC32: Which one's better for common use?

Tags:

algorithm

hash

Recently I read somewhere that although both CRC32 and MD5 are sufficiently uniform and stable, CRC32 is more efficient than MD5. MD5 seems to be a very commonly used hashing algorithm but if CRC32 is faster/more memory efficient then why not use that?

like image 750
bytefire Avatar asked Apr 20 '13 15:04

bytefire


People also ask

Why MD5 is no longer recommended for use?

Although originally designed as a cryptographic message authentication code algorithm for use on the internet, MD5 hashing is no longer considered reliable for use as a cryptographic checksum because security experts have demonstrated techniques capable of easily producing MD5 collisions on commercial off-the-shelf ...

Is CRC32 a good hash?

CRC32 works very well as a hash algorithm. The whole point of a CRC is to hash a stream of bytes with as few collisions as possible.

Which offers better security MD5 or SHA?

Although slower, SHA is more secure than MD5 due to a variety of reasons. First, it produces a larger digest, 160-bit compared to 128-bit, so a brute force attack would be much more difficult to carry out. Also, no known collisions have been found for SHA.

What is better than MD5 encryption?

Probably the one most commonly used is SHA-256, which the National Institute of Standards and Technology (NIST) recommends using instead of MD5 or SHA-1. The SHA-256 algorithm returns hash value of 256-bits, or 64 hexadecimal digits.


1 Answers

MD5 is a one-way-hash algorithm. One-way-hash algorithm are often used in cryptography as they have the property (per design) that it's hard to find the input that produced a specific hash value. Specifically it's hard to make two different inputs that gives the same one-way-hash. Those they are often used as a way to show that a amount of data have not been altered intentionally since the hash code was produced. As the MD5 is a one-way-hash algorithm the emphasis is on security over speed. Unfortunately MD5 is now considered insecure.

CRC32 is designed to detect accidental changes to data and are commonly used in networks and storage devices. The purpose of this algorithm is not to protect against intentionally changes , but rather to catch accidents like network errors and disk write errors etc. The emphasis of this algorithm is those more on speed than on security.

like image 109
Ebbe M. Pedersen Avatar answered Sep 19 '22 00:09

Ebbe M. Pedersen