Questions tagged [md5sum]

md5sum is a computer program that calculates and verifies 128-bit MD5 hashes, as described in RFC 1321.

md5sum is a computer program that calculates and verifies 128-bit MD5 hashes, as described in RFC 1321. The MD5 hash (or checksum) functions as a compact digital fingerprint of a file. As with all such hashing algorithms, there is theoretically an unlimited number of files that will have any given MD5 hash. However, 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. The underlying MD5 algorithm is no longer deemed secure, thus while md5sum is well-suited for e.g. identifying known files in situations that are not security related, it should not be relied on if there is a chance that files have been purposefully and maliciously tampered. In the latter case, use of a newer hashing tool such as sha256sum is highly recommended.

Virtually any non-malicious change to a file will cause its MD5 hash to change; therefore md5sum is used to verify the integrity of files. 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. The md5sum program is installed by default in most Unix, Linux, and Unix-like operating systems or compatibility layers. Other operating systems, including Microsoft Windows and BSD variants — such as Mac OS X - have similar utilities.

30 questions
64
votes
2 answers

The MD5 hash value is different from Bash and PHP

I tried to generate the MD5 sum (using md5sum) of a string, "hello". I tried out different methods as the md5sum tool in Linux, PHP's MD5() function as well as various online text to md5sum translators. echo "hello" | md5sum and echo "hello" > file…
41
votes
12 answers

What is the value of MD5 checksums if the MD5 hash itself could potentially also have been manipulated?

Downloads on websites sometimes have an MD5 checksum, allowing people to confirm the integrity of the file. I have heard this is to allow not only corrupted files to be instantly identified before they cause a problem but also for for any malicious…
27
votes
3 answers

How accurate is `md5sum`?

When using md5sum to verify the integrity of a file, how accurate is the process? Does a verified MD5 mean that EVERY bit is exactly the same, or is there a threshold that must be broken before binary alteration is reflected in the MD5? Any…
Konner Rasmussen
  • 459
  • 2
  • 7
  • 15
18
votes
8 answers

How can I generate an MD5 sum for a folder on Windows?

There are several posts about generating MD5 sums for files and/or folders on various Windows platforms. However, none of these worked for me. I tried: Windows CertUtil: CertUtil -hashfile myFileName MD5 returns "Access is denied" on all folders…
Klangen
  • 847
8
votes
4 answers

Find all duplicate files by MD5 hash

I'm trying to find all duplicate files (based on MD5 hash) and ordered by file size. So far I have this: find . -type f -print0 | xargs -0 -I "{}" sh -c 'md5sum "{}" | cut -f1 -d " " | tr "\n" " "; du -h "{}"' | sort -h -k2 -r | uniq -w32…
6
votes
1 answer

List files bigger than specified size, then create md5sum or sha256sum of them

I'd like to know how to create a list with md5sums from files in the current directory - files that are over a specified size. I can do one or the other, but I don't know how to combine the two.
Bug J.
  • 63
4
votes
1 answer

Why does tar with -z option create archive with different hash everytime

Can you tell me why tar czf archive.tar dir creates archive with different hash everytime (I check with 'md5sum') Without compression parameter -z or with parameter -j instead all works fine. Thanks
lexluthor
3
votes
6 answers

Compute md5sum of every 1MB part of stream from pipe

I want to do checksumming of large files and stream in unix/linux, and I want get many checksums from every large part of file/stream, every 1 MB or every 10MB. For example, I have disk image, compressed disk image, and the copy of the original…
osgx
  • 7,017
3
votes
2 answers

Md5 checksum different after gunzip and gzip

I accidentally deleted a handful of gzipped files from a folder. Thankfully, I had uncompressed them in a different location, and am in the process of restoring them. I had the md5 checksums for the old (now deleted) files, but the checksums for the…
kevbonham
  • 133
2
votes
3 answers

Finding a file by md5sum

Given the md5sum of a file, I want to know if anywhere else in the directory tree is another file with the same md5sum (but maybe under a different name). How can I do that in bash? P.S.: To emphasize, this should work for the entire tree below a…
user50105
2
votes
1 answer

Batch file to output MD5 hash to a text file starting at a specific directory

@echo off set "src_dir=C:\Users\\Documents\projects\Config\ABC" set OUTFILE="C:\Users\Documents\Scriptoutput.txt" echo %OUTFILE% pushd %cd% cd %src_dir% for /r %%f in (*) do ( (
Sam sh
  • 21
2
votes
1 answer

How to calculate hash value of a directory, is it possible?

I need to send someone a 10GB file that has inside several thousands of files. I know that in Ubuntu you can use the next command in the terminal: md5sum and this returns a hash. I am using Windows 11 and I have tried several…
Linux
  • 135
  • 1
  • 5
2
votes
2 answers

Recursively md5 files compared to stored .md5 file

What is the best way to MD5 3200 files in 167 directories using md5sum where all hashes are compared to a .md5 file that is already created in each directory holding the files to be check summed. I would also need to create a log of which files fail…
1
vote
1 answer

Quickly Maintain Database of sha256sums?

I have many different disks (primarily harddisks) storing various files. I want to know that they are all backed up in some form. Given that I have terabytes of files somehow (backups of backups apparently) I don't want to just backup everything…
gmatht
  • 2,437
1
vote
1 answer

Rename files by md5 checksum

What program can I use to rename files with their calculated md5 checksums? GUI or CLI Programs for Linux or Windows or scripts for DOS or the Linux terminal.
Rublacava
  • 283
1
2