Verifying files from clipboard using certain hash does not work

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48565
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Verifying files from clipboard using certain hash does not work

Post by *ghisler(Author) »

It only affects hashes when there is ambiguity, e.g. when the clipboard file name contains the hash, and the length is valid for multiple types. For example, a 256-bit hash (64 hexadecimal characters) is used by SHA2-256, SHA3-256 and BLAKE3, so Total Commander cannot know which of the 3 it is. Method 7 calculates all 3, but it is 3 times slower than doing just one. PreferHashType will be 0, not 2, though (I meant SHA2, not method 2).
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4894
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Verifying files from clipboard using certain hash does not work

Post by *white »

What is the difference between
2=BLAKE3 for 256 bit, SHA2 otherwise
3=BLAKE3 for 256 bit, SHA3 otherwise
and
5=both SHA2 and BLAKE3
6=both SHA3 and BLAKE3
? Is it only the order of checking?

Why not using something like I suggested:
white wrote: 2024-07-22, 09:37 UTC
white wrote: 2024-07-21, 15:05 UTC And it could be made an optional feature (perhaps a setting like "HashFallbackOrder=SHA256,SHA3_256,BLAKE3").
What do you think about giving the user control like this. My idea is that the user can control what happens for indistinguishable checksums by specifying one or more hash types. Then, if a user primarily uses BLAKE3, he can set it to BLAKE3 only as follows:
HashFallbackOrder=BLAKE3
I mean that the order and which hashes are checked, are specified this way by the user. Wouldn't that be more flexible?

Suppose a new hash with the same length becomes popular and is added to TC, then you need to add a lot of numbers. With my solution you would only have to add one keyword.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48565
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Verifying files from clipboard using certain hash does not work

Post by *ghisler(Author) »

What is the difference between
The difference is that BLAKE3 only supports 256-bit hashes. With option 2, TC will treat 256-bit hashes as BLAKE3, and all other hash lengths (e.g. 512 bit) as SHA2. With option 3, TC will also treat 256-bit hashes as BLAKE3, but all other hash lengths (e.g. 512 bit) as SHA3.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4894
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Verifying files from clipboard using certain hash does not work

Post by *white »

ghisler(Author) wrote: 2024-09-09, 16:01 UTC The difference is that BLAKE3 only supports 256-bit hashes. With option 2, TC will treat 256-bit hashes as BLAKE3, and all other hash lengths (e.g. 512 bit) as SHA2. With option 3, TC will also treat 256-bit hashes as BLAKE3, but all other hash lengths (e.g. 512 bit) as SHA3.
Thanks, I understand now. However, I have the following considerations:

I don't think it is easy to understand for users. The use of numbers and that a single number is used to solve the ambiguities of multiple bit lengths, is not easy to grasp.

And it's not flexible. If, for example, an improved version of BLAKE3 with the same bit length is later added to TC, you need to add a lot of numbers. And you can't specify the order in which TC should check multiple hash methods.

Whereas as something like this is very easy to read:

Code: Select all

HashFallbackOrder_224bit=SHA2,SHA3
HashFallbackOrder_256bit=SHA2,SHA3
HashFallbackOrder_384bit=SHA2,SHA3
HashFallbackOrder_512bit=BLAKE3,SHA2,SHA3
This can be used to specify for each bit length which hash methods to use and in which order. And it is flexible and much easier to understand for the user.
When the user wants to use only BLAKE3 for verification of a 512 bit hash and use only SHA2 in all other cases, he would specify:

Code: Select all

HashFallbackOrder_224bit=SHA2
HashFallbackOrder_256bit=SHA2
HashFallbackOrder_384bit=SHA2
HashFallbackOrder_512bit=BLAKE3
Post Reply