Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Most effective substring of an MD5 checksum

Tags:

substring

md5

If I want a shorter MD5 checksum, should I take the regular one and use the first half or the second half? Or does it even matter?

(obviously it would cease to be an MD5, it would just be a checksum)

like image 239
700 Software Avatar asked Feb 07 '11 20:02

700 Software


People also ask

How do you read a MD5 checksum?

Open a terminal window. Type the following command: md5sum [type file name with extension here] [path of the file] -- NOTE: You can also drag the file to the terminal window instead of typing the full path. Hit the Enter key. You'll see the MD5 sum of the file.

What is MD5 checksum value?

An MD5 checksum is a 32-character hexadecimal number that is computed on a file. If two files have the same MD5 checksum value, then there is a high probability that the two files are the same. After downloading an Altera software installation package, you can compute the MD5 checksum on the installation file.

Are checksums unique?

Checking Data Integrity using MD5 Checksums Checksums provide a simple way to compute the integrity of data files before and after file transfer or in backups. A checksum is like a unique fingerprint of a file that can be used to verify whether two files are identical.

What is MD5 verification?

MD5 (message-digest algorithm) is a cryptographic protocol used for authenticating messages as well as content verification and digital signatures. MD5 is based on a hash function that verifies that a file you sent matches the file received by the person you sent it to.


2 Answers

It doesn't matter, but I'd think very hard about doing this: you'll greatly increase the chance of a collision (two different bits of data with the same checksum).

like image 197
Dan Avatar answered Oct 14 '22 21:10

Dan


Use some sort of a CNC hashing function if you need a short string. Be aware that it isn't a very safe, but it will be still better than taking the half of a MD5.

like image 41
Martin Buberl Avatar answered Oct 14 '22 22:10

Martin Buberl