Windows Could you suggest a tool to hash (sha256) files and folders?

deusExMachina

Disciple
I'm looking for a way to perform integrity check on a folder hierarchy. Could make a script to call a hash tool repeatedly or if there is an application available to has entire folders, that'd be sweet.

I also don't want to archive entire directories in order to leverage the integrity checks in 7zip/zip.
 
How do you plan to do the actual integrity checks after you generate the hashes? @deusExMachina
Either the tool could recurse over the directories and generate a list (like with sha256sum -c in Linux). If it doesn't have that, then a script could be written to add that functionality on top of a tool.

All of this was to get something equivalent to a btrfs / zfs scrub on files stored in an NTFS partition (since that's the only filesystem that Windows supports aside from Fat32). On further thought, this approach of manually hashing files might not work when a bunch of files in the path constantly changes.
 
Either the tool could recurse over the directories and generate a list (like with sha256sum -c in Linux). If it doesn't have that, then a script could be written to add that functionality on top of a tool.

All of this was to get something equivalent to a btrfs / zfs scrub on files stored in an NTFS partition (since that's the only filesystem that Windows supports aside from Fat32). On further thought, this approach of manually hashing files might not work when a bunch of files in the path constantly changes.

No I meant how do you detect integrity failures? In your original post you wrote you wanted to check integrity...

Just generating hash is part of the process... You either need to compare the hash of each file with a hash generated or provided earlier or later by you or the provider of the file and if the hash does not match it shows file has been modified not necessarily corrupted.

You have to be wary that some file formats and software can modify embedded metadata like timestamp and that can show hash mismatch even though the main content is intact.

Need to ensure these files are marked read only in such cases...
 
No I meant how do you detect integrity failures? In your original post you wrote you wanted to check integrity...

Just generating hash is part of the process...
I understood your question. The sha256sum program on Linux has an option to take in a list of files+hashes to verify them. I was looking for the same thing on the Windows tool (7z for eg) and what I meant earlier was that if that's not possible, I could write a script to add in support for recursive verification.

You have to be wary that some file formats and software can modify embedded metadata like timestamp and that can show hash mismatch even though the main content is intact.

Need to ensure these files are marked read only in such cases...
Yeah, this is one of the stumbling blocks as of now. Changes in metadata (as you mentioned) and files that get updated frequently. It might be easier to just use btrfs/zfs via a VM running on windows. Though I dunno if this would cause other issues. Planning to test it out as I have multiple backups covering my back.
 
If integrity of your files is paramount and they don't change often, you can look at SnapRAID. It has got a Windows build.
Disclaimer : I have not used it. I use normal disk raid and redundant backups.
 
One thing I use the recursive checksum for is : checking the integrity of a backup. So there are dated backups, to which I add the recursive checksum. This backup can then move across disks, to cloud, and back to me. At the end of this, especially before restore, it would be reassuring to find the checksum matches for each file

The reasons for checksum not matching maybe like bad Ram corrupting files while transferring, files incorrectly transferred to cloud or between disks and an interruption silently truncated a file etc.

Edit : fixed a bad typo
 
Last edited:
One thing I use the recursive checksum for is : checking the integrity of a backup.
This is pretty much one of my main motivations for this. I've had silent corruptions hit me in the past (the backups covered it but the discovery was important). Btrfs scrub was what lead me to discover it. After that I'm quite fond of file checksumming.
 
Back
Top