Skip to main content
94 votes
Accepted

Does an identical cryptographic hash or checksum for two files mean they are identical?

When the hashes are identical, does this mean that the file contents are 1:1 the same? All files are a collection of bytes (values 0-255). If two files MD5 hashes match, both those collections of ...
LawrenceC's user avatar
  • 74.2k
38 votes

Does an identical cryptographic hash or checksum for two files mean they are identical?

In practice, yes, an identical cryptographic hash means the files are the same, as long as the files were not crafted by an attacker or other malicious entity. The odds of random collisions with any ...
user's user avatar
  • 29.9k
36 votes
Accepted

Why do I get different results from Mac's shasum than from other shasum calculators?

The input to the shasum invocation in the question is test\n (with a newline), not test. If you give test with no newline to shasum you’ll get the same output as the online tools cited: $ echo -n &...
sideshowbarker's user avatar
20 votes

Why do I get different results from Mac's shasum than from other shasum calculators?

Try this: hexdump -C <<< test Knowing Unix shells, you're probably getting an unwanted 0x0a at the end of that string.
Spiff's user avatar
  • 105k
17 votes

How to generate MD5 hash value for multiple files in a folder using cmd

I know you asked specifically for cmd, but if you're using Windows 8.1 or higher, consider using Powershell instead: Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "\\path\to\files\*.*" -Recurse) ...
Charles Burge's user avatar
16 votes

Is there a built-in checksum utility on Windows 7?

I am adding this here only because I didn't see any fully working powershell examples, ready for copy-paste: C:\> powershell "Get-FileHash %systemroot%\system32\csrss.exe" Algorithm Hash ---...
Amit Naidu's user avatar
15 votes

Any Built-In Checksum utility for Windows 10 using CRC-32?

There is a way to get the CRC-32 on Windows (since Win 7): Right-click the file(s) you wish to get the CRC-32 for and click Send to → Compressed (zipped) folder. Open the ZIP file using Windows ...
Taylor Hillegeist's user avatar
14 votes
Accepted

how to verify whether a compressed .gz is corrupted or not?

Using the gunzip test option gzip -t file.tar.gz See How to check if a Unix .tar.gz file is a valid file without uncompressing
shsh's user avatar
  • 276
12 votes
Accepted

How to get Btrfs verify checksum for one file?

The answer is: simply try reading the whole file. If it reads differently from what has been checksummed, there will be an Input/output error. So yes, Btrfs indeed verifies checksums on read! To find ...
Greendrake's user avatar
10 votes

Does compiling a program twice produce a bit-for-bit identical binary?

-frandom-seed=123 controls some GCC internal randomness. man gcc says: This option provides a seed that GCC uses in place of random numbers in generating certain symbol names that have to be ...
Ciro Santilli OurBigBook.com's user avatar
10 votes

How to generate MD5 hash value for multiple files in a folder using cmd

You could use the following script: for %%f in (*) do ( certutil -hashfile "%%f" MD5 )
testeaxeax's user avatar
  • 1,506
10 votes

Does an identical cryptographic hash or checksum for two files mean they are identical?

It's a probability game... hashes are able to represent a finite number of values. If we consider a hypothetical (and very weak) 8-bit hashing algorithm, then this can represent 256 distinct values. ...
Attie's user avatar
  • 20.2k
8 votes

Is there a built-in checksum utility on Windows 7?

A batch file based on pbarney's comment to the answer with the most upvotes: This copies the MD5 hash of whatever file is dragged onto the batch file to the clipboard: @ECHO OFF FOR /f "tokens=*" %%i ...
trapper_hag's user avatar
7 votes

Do lower and capital letters matter for sha checksum?

No, they do not. Simply put, the SHA256 hash is a sequence of 256 bits, which is usually displayed as a sequence of 64 hexadecimal digits instead (each digit being denoted by one of the decimal digits ...
Taederias's user avatar
  • 458
6 votes

Can I calculate the checksum of a file as I create it?

Answering my own question: Yes, you can use tee and bash process substitution: tar cfz - files | tee >(sha256sum) | cat > archive.tar.gz
jl6's user avatar
  • 1,195
6 votes
Accepted

What does star in .sha file mean?

From the sha1sum(1) man page: The default mode is to print a line with checksum, a space, a character indicating input mode ('*' for binary, ' ' for text or where binary is ...
Ignacio Vazquez-Abrams's user avatar
6 votes

Does an identical cryptographic hash or checksum for two files mean they are identical?

If two files have the same MD5 hash, and they haven't both been specially crafted, then they're identical. How hard it is to craft files with the same MD5 hash depends on the file format, I don't know ...
Gilles 'SO- stop being evil''s user avatar
6 votes

Why is this SSD returning inconsistent data, why doesn't the backup image file match the checksum?

Right after posting this question, I found my mistake. I used Fedora XFCE as live system, which has automatically enabled the swap partition that just happens to be on the SSD in question. And of ...
basic6's user avatar
  • 2,707
6 votes
Accepted

What kind of encoding is this (sha256 variant)?

It's raw SHA256 encoded with something base64-ish. The length matches base64 of 32 bytes without padding. SHA256 produces a string of 32 bytes. This string is usually represented in the hexadecimal ...
gronostaj's user avatar
  • 57.3k
5 votes
Accepted

Sha256 checksum on terminal displaying strange characters

Did you read the description of the package you installed? This program will read a passphrase from standard input and print a binary (not printable) hash to standard output. You tried to print ...
Darth Android's user avatar
5 votes
Accepted

What does shasum's --portable option do?

What is this "portable mode" of reading files? For what it's worth shasum says: -p, --portable read in portable mode (to be deprecated) As far as I can tell (I am no perl expert) it appears to ...
DavidPostill's user avatar
  • 158k
5 votes

How to generate MD5 hash value for multiple files in a folder using cmd

The standard way to run a command on multiple files in CMD is the for command.  You can get usage information by typing for /?.  A simple solution for your problem is for %F in (*) do @certutil -...
G-Man Says 'Reinstate Monica''s user avatar
5 votes

Does an identical cryptographic hash or checksum for two files mean they are identical?

Hashes such as MD5 or SHA have fixed length, lets say it's 300 alphanumeric characters (in reality they are shorter and don't use the whole set of alphanumeric characters). Lets say that files are ...
styrofoam fly's user avatar
5 votes

Does an identical cryptographic hash or checksum for two files mean they are identical?

I have 2 excel documents and I want to check if they are exactly the same, apart from the file name. From a practical perspective, directly comparing the files to find out if they're different will ...
Andrew Henle's user avatar
4 votes

Sha256 checksum on terminal displaying strange characters

ubuntu 16.04 default max shared memory per user is 64k. I upped it to 1gb for all users, error goes away. by adding a line to the end of the /etc/security/limits.conf file will fix this. no need to ...
Jeffrey Gong's user avatar
4 votes

Is there a built-in checksum utility on Windows 7?

This is just a cmd shell script which uses tedr2's answer but strips off the extraneous output lines and spaces: :: hash.cmd : Get a hash of a file :: p1: file to be hashed :: p2: Hash algorithm in ...
Jool's user avatar
  • 256
4 votes

how to verify whether a compressed .gz is corrupted or not?

Most sites will give you a check sum of some kind to check the file is good. Most of the time it is a md5sum but there are a few out there. If you can open it that is a good sign but it doesn't ...
Mat000111's user avatar
4 votes

Does an identical cryptographic hash or checksum for two files mean they are identical?

NO. Different values guarantee the files are different. The same values are not a guarantee the files are the same. It is relatively easy to find examples using CRC16. On the balance of probability ...
mckenzm's user avatar
  • 926
4 votes

Any Built-In Checksum utility for Windows 10 using CRC-32?

7-Zip provides an additional Windows Explorer context menu entry from which checksums can be calculated: Right-click the file you wish to get the CRC-32 for. A context menu appears. Select the CRC ...
Trudy's user avatar
  • 149

Only top scored, non community-wiki answers of a minimum length are eligible