Ubuntu – How to change MD5 of a file

md5sum

We can get MD5 of a file by using md5sum so my questions are:

  1. Could the MD5 be changed?
  2. How to change the MD5?

Best Answer

md5sum calculates and verifies 128-bit MD5 hashes. The MD5 hash functions as a compact digital fingerprint of a file. It is very unlikely that any two non-identical files in the real world will have the same MD5 hash, unless they have been specifically created to have the same hash.

md5sum is used to verify the integrity of files, as virtually any change to a file will cause its MD5 hash to change. Most commonly, md5sum is used to verify that a file has not changed as a result of a faulty file transfer, a disk error or non-malicious meddling.

For more see Wikipedia

Could it be changed?

No. You can not change md5sum of a file as long as the contents of the files are same. And that is the sole purpose of it. You can change the md5sum value of a file by making any change in its content only.