namazso / OpenHashTab

đź“ť File hashing and checking shell extension
GNU General Public License v3.0
3.31k stars 128 forks source link

[Feature Request] Improvements to Exported hashes? #32

Closed Darthagnon closed 4 years ago

Darthagnon commented 4 years ago

HashCheck (2016) has a Save... button that serves the same purpose as Export...; it implements the export marginally better, in my opinion (however, its development has ceased, and it isn't quite as pretty as OpenHashTab).

HashCheck displays a Save as... dialog, with a Save as type... dropdown, listing the available hash types with extensions as follows:

CRC32 (*.sfv)
MD5 (*.md5)
SHA-1 (*.sha1)
SHA-256 (*.sha256)
SHA-512 (*.sha512)
SHA3-256 (*.sha3-256)
SHA3-512 (*.sha3-512)

OpenHashTab currently (unless I've done something horribly wrong with my configuration) has a similar Save as... dialog, but with no options in the dropdown, requiring manual extension typing. Would it please be possible to implement a list of currently selected (in OpenHashTab settings) hash-types in a similar way to HashCheck in the Save as type... dropdown?

Perhaps worth noting is that checksum (2015) attempted to create a standard filename.hash format for mixed hashes which I would love to see more widely used e.g.

All selected hash formats (*.hash)

Something else that I thought worth mentioning, that I'd sure appreciate, would be a starting comment to (non-clipboard?) exports with

; OpenHashTab vX.XX on [date] at [time]
; https://github.com/namazso/OpenHashTab/
;
;
[actual hash data here]

... similar to how QuickSFV and checksum start their hash files.


Here's an example SFV with a comment generated by QuickSFV (my goto standard for SFVs, due to its popularity within the torrenting community):

File: igorware-hasher-x64_v1.7.3.rar

Filename: igorware-hasher-x64_v1.7.3.SFV

; Generated by QuickSFV v2.36 on 2020-11-09 at 21:56:22
; http://www.QuickSFV.org
;
;       121823  18:46.40 2020-11-09 igorware-hasher-x64_v1.7.3.rar
igorware-hasher-x64_v1.7.3.rar FFBFB060

Example checksum software hash (NB has mixed hashes, multiple types for the same file, but uses undesirable non-standard # as comment markers, rather than standard ;):

# made with checksum.. point-and-click hashing for windows (64-bit edition).
# from corz.org.. http://corz.org/windows/software/checksum/
#
# Program version x64 1.7.0.1
#
#md5#checksum_x64.zip#2015.07.04@01.26:28
72e1cac7bd2dfd4ce3cf862920350bfa *checksum_x64.zip
#sha1#checksum_x64.zip#2015.07.04@01.26:28
86d8db98f96b5c8e196594667b9d324e066f4215 *checksum_x64.zip
Darthagnon commented 4 years ago

My bad; this issue is almost a duplicate of #30

namazso commented 4 years ago

Funny, .hash format was already accidentally supported in the format you written, the only problem was that that program adds an UTF8 BOM at the begin of the file. After removing that it works. Anyways, I added code to skip BOM.

I'm not sure how you can get that software make two different algorithms for the same file, the site doesn't hint of such feature either. Also, # is the standard comment in sumfiles, that's why OpenHashTab supports it already. ; is only in SFVs

Darthagnon commented 4 years ago

I'm not sure how you can get that software make two different algorithms for the same file, the site doesn't hint of such feature either.

On the checksum homepage, if you search for the section "Introducing.. The Unified Hash Extension™ And Multi-Hashing™..", it mentions the ability to store multiple hash types inside one file:

As well as being able to verify MD5, SHA1 and BLAKE2 hashes, even mixed up in the same file, checksum can also create such a file, if you so desire. At any rate, if you start using BLAKE2 or SHA1 hashes some day, you can keep your old MD5 hashes handy, inside your .hash files..

The single, unified hash extension gives us not only the freedom to effortlessly upgrade algorithms at any time, without having to handle yet-another-file-type, but also the ability to easily store output from multiple hashing algorithms inside a single .hash file. Welcome to multi-hashing, which will doubtless have security benefits, to boot (a multi-hash is simply collision-proof).

Darthagnon commented 4 years ago

Thank you for the fix! I didn't realise that ; was only for SFVs!

namazso commented 4 years ago

Welcome to multi-hashing, which will doubtless have security benefits, to boot (a multi-hash is simply collision-proof).

I missed this, my bad. Assumed the .hash can just contain multiple aglos in general, so that file1 is hashed with md5 and file2 with sha1. OpenHashTab currently only supports this form, I'll see what I can do for that.

Darthagnon commented 4 years ago

If I remember correctly from using checksum, multihashing calculated multiple hashes for each file. More of a future-proofing thing, or if the user wants multi hashes (e.g. I like to save MD5 or SHA 256 for full checks, and CRC32 for visual checks, just to identify if file is the same or not) or maybe could be used for speed enhancements (e.g. check CRC32 quickly first to give initial "OK", then check more complex hashes if the user is willing to wait longer).

probably not too useful, though, for most people... one hash is enough normally

namazso commented 4 years ago

With the latest commit I think I added about everything listed here.

Since the .hash format is practically undocumented I only assumed some things (like hash identifiers), and omitted the date (replaced with checksum generated result of unix epoch) since there's absolutely no docs on what time (local? global?) and what format that is in. So this is how a generated .hash looks now:

# Generated by OpenHashTab 2a2a957f28d5e7db9ae4cf721d2d44bf9ce94361 at 2020-11-28T19:33:05Z
# https://github.com/namazso/OpenHashTab/
#
#crc32#OpenHashTab_setup.exe#1970.01.01@00.00:00
3097f327 *OpenHashTab_setup.exe
#md2#OpenHashTab_setup.exe#1970.01.01@00.00:00
aeb41a75e23244a07038b3c83b3deccc *OpenHashTab_setup.exe
#md4#OpenHashTab_setup.exe#1970.01.01@00.00:00
bf7a60d566f8049b65f78ee70499dbce *OpenHashTab_setup.exe
#md5#OpenHashTab_setup.exe#1970.01.01@00.00:00
305b2ddc577e6edc162ac95c77ca6057 *OpenHashTab_setup.exe
#ripemd160#OpenHashTab_setup.exe#1970.01.01@00.00:00
8d917d0b01b18091e63007444eab38256ada7bc3 *OpenHashTab_setup.exe
#sha1#OpenHashTab_setup.exe#1970.01.01@00.00:00
2c4cb4a3bd283307609ac9a4278d698fddc3ec7c *OpenHashTab_setup.exe
#sha224#OpenHashTab_setup.exe#1970.01.01@00.00:00
0a70ce12b003ef819f64e57b3392d8eab16ee2f9728bdb663d683e28 *OpenHashTab_setup.exe
#sha256#OpenHashTab_setup.exe#1970.01.01@00.00:00
8ac681926df55ad9b81ea38bbaf4665351b92c89187896c7aec561528687fad3 *OpenHashTab_setup.exe
#sha384#OpenHashTab_setup.exe#1970.01.01@00.00:00
150a56d321ac193e5e454612f57057238993c3a739fc5644e1f521750abc9504efa60578bcf64a8387d8d6a3b924c7f7 *OpenHashTab_setup.exe
#sha512#OpenHashTab_setup.exe#1970.01.01@00.00:00
00996e2fef6ab5630e9ad9a9e6a2459db6c7c160d57cb05ea1f09d7719b854b0d1e86491d342ab2728544f9a19949d7079a2e998cc192f780261f8ad15b4fbe5 *OpenHashTab_setup.exe
#blake2sp#OpenHashTab_setup.exe#1970.01.01@00.00:00
c5d3473ca9206d2361b0eb460ccf3b7c24bb709afa094a25d9550c4e56398f66 *OpenHashTab_setup.exe
#sha3256#OpenHashTab_setup.exe#1970.01.01@00.00:00
431124e74bc1cad02667124936a4af23cbece987335def756d255b4b5b3e1200 *OpenHashTab_setup.exe
#sha3384#OpenHashTab_setup.exe#1970.01.01@00.00:00
59ddb9b107c55ab9cbebb775a9127e10495ea7350d827668899cf9450d29f9060f214648a5d8da2aa88d3771b8bd33fe *OpenHashTab_setup.exe
#sha3512#OpenHashTab_setup.exe#1970.01.01@00.00:00
144e8c035804cf69f91e35e2b3265f179cd90a9a27327a530ebd66c0b71ac41b6eb3add4a23d573146b293cf9df238b1eee54236d3f457ca0ad2aa225b6b1e3e *OpenHashTab_setup.exe
#blake3#OpenHashTab_setup.exe#1970.01.01@00.00:00
1599f4a53070f7b96576caf0d174d6f09cb55ac8dd703407d83c288f9ed687b7 *OpenHashTab_setup.exe
Darthagnon commented 4 years ago

Thank you so much!