HASHDEEP(1)

πŸ“¦
version 4.4+git20170824 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– HASHDEEP(1) πŸ’–

United States Air Force β€” okay so bestie, this is the manual for hashdeep, and it is a lot, but we're gonna get through it together, no cap. πŸ’…


✨ NAME ✨

hashdeep</p> β€” compute, compare, or audit multiple message digests. Yes, multiple. At the same time. She's an overachiever and we love that for her. 🫢


🌸 SYNOPSIS 🌸

hashdeep -V | -h
hashdeep [-c <alg1>[,<alg2>]] [-k <file>] [-i <size>] [-f <file>] [-o
<fbcplsde>] [-amxwMXreEspblvv] [-F<bum>] [-j <num>] [FILES]

πŸ¦‹ DESCRIPTION πŸ¦‹

She computes multiple hashes (message digests, same thing, don't stress) for literally any number of files, and if you want she'll recursively dig through your whole directory structure like she's snooping through your camera roll. πŸ™ˆ

By default the program computes MD5 and SHA-256 hashes, which is exactly equivalent to -c md5,sha256. Periodt.

She can also take a list of known hashes and show you the filenames of input files whose hashes either do or do not match any of those knowns. And she can use a list of known hashes to audit a set of FILES. It's giving forensic queen. πŸ‘‘

Errors get reported to standard error. If no FILES are specified, she reads from standard input.

  • -c <alg1>[,<alg2>...] β€” Computation mode. She computes hashes of FILES using the algorithms you specify. The legal values are md5, sha1, sha256, tiger, and whirlpool. Pick your fighters. ⭐
  • -k β€” Load a file of known hashes. This flag is required when you're using any of the matching or audit modes (that's -m, -x, -M, -X, or -a). You can use this flag more than once to add multiple sets of known hashes.

Okay so heads up, loading sets with different hash algorithms can sometimes generate spurious hash collisions. Example time, because I know you love one: say we have two hash sets, A and B, and they have some overlapping files. Say the file /usr/bin/bad is in both sets. In A we've recorded the MD5 and SHA-256. In B we've recorded the MD5, SHA-1, and SHA-256. Because these two records are different, they will both be loaded. When the program computes all three hashes and compares them to the set of knowns, we'll get an exact match from the record in B and a collision from the record in A. It's giving drama between two records. πŸ’€

  • -a β€” Audit mode. Each input file gets compared against the set of knowns. An audit passes if each input file is matched against exactly one file in the set of knowns. Any collisions, new files, or missing files will make the audit fail. Used alone, this flag produces a message, either "Audit passed" or "Audit Failed". Use the verbose modes, -v, for more details: -v prints the number of files in each category, -v a second time prints any discrepancies, and -v a third time prints the results for every file examined and every known file. She's thorough, she's detail-oriented, she's the main character. ✨
Due to limitations in the program, any filenames with Unicode characters will appear to have moved during an audit. See the section "UNICODE SUPPORT" below. 😭
  • -m β€” Positive matching, and it requires at least one use of the -k flag. The input files get examined one at a time, and only those files that match the list of known hashes are output. The only acceptable format for known hashes is the output of previous hashdeep runs. If standard input is used with the -m flag, she displays "stdin" if the input matches one of the hashes in the list of known hashes. If the hash does not match, the program displays no output. Silence. Iconic. 🀫
This flag may not be used in conjunction with the -x, -X, or -a flags. See the section "UNICODE SUPPORT" below.
  • -x β€” Negative matching. Same as the -m flag above, but she does negative matching instead. That is, only those files NOT in the list of known hashes are displayed. The audacity. πŸ’…
This flag may not be used in conjunction with the -m, -M, or -a flags. See the section "UNICODE SUPPORT" below.
  • -f <file> β€” Takes a list of files to be hashed from the specified file. Each line is assumed to be a filename. This flag can only be used once per invocation β€” if it's used a second time, the second instance will clobber the first. Sorry babe, only one. πŸŽ€

Note that you can still use other flags, such as the -m or -x modes, and submit additional FILES on the command line.

  • -w β€” When used with positive matching modes (-m,-M), displays the filename of the known hash that matched the input file. See the section "UNICODE SUPPORT" below.
  • -M and -X β€” Same as -m and -x above, but displays the hash for each file that does (or does not) match the list of known hashes. More info, more slay. πŸ”₯
  • -r β€” Enables recursive mode. All subdirectories are traversed. Please note that recursive mode cannot be used to examine all files of a given file extension. For example, calling hashdeep -r *.txt will examine all files in directories that end in .txt. Not what you wanted, bestie, but that's the vibe. 😭
  • -e β€” Displays a progress indicator and estimate of time remaining for each file being processed. Time estimates for files larger than 4GB are not available on Windows.
This mode may not be used with the -p mode.
  • -E β€” When in audit mode, performs case insensitive matching of filenames. For example, \foo\bar will match to \Foo\BAR. This can be important on Windows systems, where filenames are case insensitive. She's flexible like that. 🌈
  • -i <size> β€” Size threshold mode. Only hash files smaller than the given threshold. Sizes may be specified using IEC multipliers b, k, m, g, t, p, and e.
  • -o <bcpflsd> β€” Enables expert mode. Allows the user to specify which (and only which) types of files are processed. Directory processing is still controlled with the -r flag. The expert mode options allowed are:
    • f β€” Regular files
    • b β€” Block Devices
    • c β€” Character Devices
    • p β€” Named Pipes
    • l β€” Symbolic Links
    • s β€” Sockets
    • d β€” Solaris Doors
    • e β€” Windows PE executables
  • -s β€” Enables silent mode. All error messages are suppressed. Shhh. Not a word. 🀫
  • -p β€” Piecewise mode. Breaks files into chunks before hashing. Chunks may be specified using IEC multipliers b, k, m, g, t, p, and e. (Never let it be said that the author didn't plan ahead.) She really did think of everything. πŸ‘‘
  • -b β€” Enables bare mode. Strips any leading directory information from displayed filenames.
This flag may not be used in conjunction with the -l flag.
  • -l β€” Enables relative file paths. Instead of printing the absolute path for each file, she displays the relative file path as indicated on the command line.
This flag may not be used in conjunction with the -b flag.
  • -v β€” Enables verbose mode. Use it again to make the program even more verbose. This mostly changes the behavior of the audit mode, -a. She can go deeper. She can always go deeper. πŸ’œ
  • -jnn β€” Controls multi-threading. By default the program will create one producer thread to scan the file system and one hashing thread per CPU core. Multi-threading causes output filenames to be in non-deterministic order, as files that take longer to hash will be delayed while they are hashed. If a deterministic order is required, specify -j0 to disable multi-threading. Chaos vs. order, your call. ⭐
  • -d β€” Output in Digital Forensics XML (DFXML) format.
  • -u β€” Quote Unicode output. For example, the snowman is shown as U+C426. β˜ƒοΈ
  • -F<bum> β€” Specifies the input mode that is used to read files. The default is -Fb (buffered I/O) which reads files with fopen(). Specifying -Fu will use unbuffered I/O and read the file with open(). Specifying -Fm will use memory-mapped I/O which will be faster on some platforms, but which (currently) will not work with files that produce I/O errors. Pick your fave. πŸ“
  • -h β€” Show a help screen and exit.
  • -V β€” Show the version number and exit.

🧚 UNICODE SUPPORT 🧚

As of version 3.0 the program supports Unicode characters in filenames on Microsoft Windows systems for filenames specified on the command line with globbing (e.g. *), for files specified with the -f of files to hash, and for files read from directories using the -r option. Growth. Evolution. We love to see it. πŸ¦‹

By default all program input and output should be in UTF-8. The program automatically converts this to UTF-16 for opening files.

On Unix/Linux/MacOS, you should use a terminal emulator that supports UTF-8 and UTF-8 characters in filenames will be properly displayed.

On Windows, the programs do not display Unicode characters on the console. You must either redirect output to a file and open the file with Wordpad (which can display Unicode), or you must specify the -u option to quote Unicode using standard U+XXXX notation.

Currently the file name of a file containing known hashes may not be specified as a Unicode filename, but you can specify the name using tab completion or an asterisk (e.g. md5deep -m *.txt where there is only one file with a .txt extension). Little loophole, we love her for it. πŸ’…


πŸ’œ RETURN VALUE πŸ’œ

Returns a bit-wise value based on the success of the operation and the status of any matching operations.

  • 0 β€” Success. Note that the program considers itself successful even when it encounters read errors, permission denied errors, or finds directories when not in recursive mode. She's unbothered. Flourishing. ✨
  • 1 β€” Unused hashes. Under any of the matching modes, returns this value if one or more of the known hashes was not matched by any of the input files.
  • 2 β€” Unmatched inputs. Under any of the matching modes, returns this value if one or more of the input values did not match any of the known hashes.
  • 64 β€” User error, such as trying to do both positive and negative matching at the same time. Bestie. You can't do both. 😭
  • 128 β€” Internal error, such as memory corruption or uncaught cycle. All internal errors should be reported to the developer! See the section "Reporting Bugs" below. 🚨

πŸŽ€ AUTHOR πŸŽ€

hashdeep was written by Jesse Kornblum, research@jessekornblum.com, and Simson Garfinkel. Legends, honestly. πŸ‘‘


🌸 KNOWN ISSUES 🌸

Using the -r flag cannot be used to recursively process all files of a given extension in a directory. This is a feature, not a bug. If you need to do this, use the find(1) command. (Not me telling you to go use another program, but here we are. πŸ’€)

The program will fail if you attempt to compare 2^64 or more input files against a set of known files.


🌈 REPORTING BUGS 🌈

We take all bug reports very seriously. Any bug that jeopardizes the forensic integrity of this program could have serious consequences on people's lives. When submitting a bug report, please include a description of the problem, how you found it, and your contact information.

Send bug reports to the author at the address above.

Okay bestie, legal tea time but make it cute. This program is a work of the US Government. And per 17 USC 105, copyright protection is not available for any work of the US Government. So yeah β€” this program is PUBLIC DOMAIN. πŸ’…

But wait, there's a lil plot twist: Portions of this program contain code that is licensed under the terms of the General Public License (GPL). Those portions keep their original copyright and license. See the file COPYING for more details. πŸ“„βœ¨

There is NO warranty for this program; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 😭 Like, none. Zero. Nada. Protect yourself, bestie.

πŸ”₯ SEE ALSO πŸ”₯

More info and installation instructions? They're chillin' in the README file. πŸ“– Current versions of both documents can be found on the project homepage: http://md5deep.sourceforge.net/ 🌐

The specs, in all their iconic glory:


And that's the whole vibe. This page is serving AFOSI v4.4, dated 29 Jan 2014, for HASHDEEP(1) β€” no cap, iconic behavior. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from