ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: FrankB on April 01, 2025, 05:53:39 AM

Title: Compute, and display, a HASH from a file.
Post by: FrankB on April 01, 2025, 05:53:39 AM
Hi Phil,

I have had a request to add a HASH function in ExifToolGUI:
https://github.com/FrankBijnen/ExifToolGui/issues/830 (https://github.com/FrankBijnen/ExifToolGui/issues/830)

I think it is a valid request and could be useful. So I would like to add that in GUI. I looks like I can code computing a HASH (SHA-1, SHA-2, or MD5) quite easily in Delphi, no problems there. But I am wondering: Wouldn't it be a good addition for ExifTool to be able to compute a HASH of a file and display that as a 'pseudo'/'composite' tag?

Frank
Title: Re: Compute, and display, a HASH from a file.
Post by: greybeard on April 01, 2025, 06:50:55 AM
How about -ImageDataHash? Can be set to one of 'MD5', 'SHA256' or 'SHA512' Not quite the same thing but close.
Title: Re: Compute, and display, a HASH from a file.
Post by: FrankB on April 01, 2025, 07:15:12 AM
Thanks for your reply Greybeard.

I would have to ask the original requester of the issue, who is using it for 'digital forensics'. But my guess is that the HASH needs to be including the Metadata.

Title: Re: Compute, and display, a HASH from a file.
Post by: Phil Harvey on April 01, 2025, 07:23:28 AM
If he wants a hash of the whole file then it would be better to do this outside of ExifTool because the hash algorithms I've had to implement in Perl are very slow.

- Phil
Title: Re: Compute, and display, a HASH from a file.
Post by: FrankB on April 01, 2025, 08:07:29 AM
Thanks for your answer, Phil.

Will implement it in Delphi.

Frank
Title: Re: Compute, and display, a HASH from a file.
Post by: StarGeek on April 01, 2025, 09:46:08 AM
Here's a previous config file (https://exiftool.org/forum/index.php?msg=29979) for getting an MD5 hash of a file as a tag. It requires having md5 on the system, which I don't think is default on Windows.
Title: Re: Compute, and display, a HASH from a file.
Post by: FrankB on April 01, 2025, 11:56:26 AM
Quote from: StarGeek on April 01, 2025, 09:46:08 AMwhich I don't think is default on Windows.

Correct. Not on mine at least.