HowTo do a quick deep hashing/fixity of subfolders

Step-by-Step descriptions of how to do things.

HowTo do a quick deep hashing/fixity of subfolders

Postby peter_b » Sat Mar 02, 2019 4:01 am

You may find or search this under "md5deep", but the command - as well as its package - was renamed/superseeded by "hashdeep".
Where "md5sum" creates a textfile per folder, the command "hashdeep" can be used to create fixity information for a whole subfolder structure.

The basic command is simple:
Code: Select all
$ hashdeep -l -r -c md5 .


Parameters:
  • -l: Relative file paths: Makes the file more "portable" (easier to check even when moved to completely different location)
  • -r: recursive. Include subfolders.
  • -c md5: compute MD5 hashcodes.

I chose to do MD5 only, because I it's sufficient for data integrity checks, and I'm not using it for security.
Since hashdeep's default is MD5+SHA256, I dropped SHA256 to save computing power and speed up the process :D

The output looks something like this:

Code: Select all
%%%% HASHDEEP-1.0
%%%% size,md5,filename
## Invoked from: /media/pb/CAM_SD
## $ hashdeep -l -r -c md5 .
##
1328742227,62c8a3a5d58316d0758413bc414406ad,./DCIM/101XDPHH/S1010001.MP4
1327486509,34eec99491abe839db31c130320a2e04,./DCIM/101XDPHH/S1010002.MP4
1327514894,11d0e549e9832bbe8970e81e1bcdc494,./DCIM/101XDPHH/S1010003.MP4
1327837525,7f1c5e06a3c1fa7a179473c780fb6a7d,./DCIM/101XDPHH/S1010004.MP4
1328092473,d2f9bf6d35e4f763adb76edc608f8c92,./DCIM/101XDPHH/S1010005.MP4
260114642,3edd2bd0908e0accb66e2af72f00116e,./DCIM/102XDPHH/S1020004.MP4
1328250451,13e610710e2f9d323f4dd2c25620a540,./DCIM/101XDPHH/S1010006.MP4
613737399,677d7c2c6b21ad11969fdd8a840a938b,./DCIM/102XDPHH/S1020002.MP4
1327236635,e53122187f81e5da11b9643fad3e8b1f,./DCIM/101XDPHH/S1010007.MP4
1322809572,1652fb231da8c7a7daca0816e84cdef9,./DCIM/102XDPHH/S1020001.MP4
1328600259,59d28e4dfbc6972536f594031012e2ca,./DCIM/102XDPHH/S1020003.MP4


Links:
https://linhost.info/2010/05/using-hash ... integrity/

EDIT (May 17th, 2019):
Changed to relative paths (added "-l"), because I think it's the more regular use case that the files will be moved sooner or later.
Makes validation easier and less confusing.
  • 0

Last edited by peter_b on Fri May 17, 2019 6:29 pm, edited 1 time in total.
User avatar
peter_b
Chatterbox
 
Posts: 302
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3

Validating with existing hashdeep textfile

Postby peter_b » Sat Mar 02, 2019 5:07 am

Here's one way to check the current folder, with the data in the fixity textfile "MD5DEEP.md5":
Code: Select all
$ hashdeep -l -e -vvv -r -a -k MD5DEEP.md5 .


Parameters:
  • -l: Relative paths mode. Otherwise you'll only get "file moved" messages ;)
  • -e: Estimate time. Shows a progress indicator. Must-have for video handling.
  • -vvv: Tell us what you're doing. With less verbosity, you'll only see errors - and therefore "dark screen" while its computing. Better with "vvv" :)
  • -a: Audit mode = compare and verify/validate.
  • -k MD5DEEP.md5: The textfile that contains fixity data from hashdeep (MD5, etc). I've arbitrarily named it ""MD5DEEP.md5".
  • 0

User avatar
peter_b
Chatterbox
 
Posts: 302
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3


Return to HowTo's

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: Bing [Bot], Google [Bot] and 6 guests

cron
Reputation System ©'