SQLite Forum

SHA-3 hash
Login

SHA-3 hash

(1) By anonymous on 2020-09-12 15:16:13

Hi, 
a maybe silly question about sha-3 hash. I just download precompiled binary for Windows, sqlite-dll-win32-x86-3330000.zip. The sha-3 hash should be 
d669a92271ad31bbefe4ba827c3d6621179b1964b5dd1f27c6fbaa9c4cf6a082
according to the download site. However, I checked the hash with another tool, quickhash. It states
e17ec86e7b0d5ff8319e29bc6142445c765dfa77e0cb2aeb2637785064b7fe2baae116da831f7b1e8a5366e126ab3a8a4b8cc99ea42343aa2691fb47284dd93c
to be sha-e hash, for the zipped file. This is quite a difference. 
What am I doing wrong? Thanks in advance for any answer!

(2) By Larry Brasfield (LarryBrasfield) on 2020-09-12 15:50:18 in reply to 1 [link]

For the like-named file downloaded from sqlite.org, I get a 256 bit SHA3 hash of d669a92271ad31bbefe4ba827c3d6621179b1964b5dd1f27c6fbaa9c4cf6a082 and a 512 bit SHA3 hash of 429f5cb2eb6eddaac55599b755bf50513ab1b83a065d83ff24b3873a745e0e138443012d7ee401802f80300ce946e4c2e492dfc9a64181d2133383d7ebbae622 .  The former matches what you claim the website says and the latter is the same length as the "quickhash" result you report but with a different value.  Based on this, I think you have a genuine, uncorrupted .zip file and a strange SHA3 hash calculator.

What happens if you ask Quickhash for the SHA-3 (256 bit) hash? (And what is a "sha-e hash"?)

(3) By Kevin Youren (KevinYouren) on 2020-09-13 06:46:28 in reply to 1 [link]

I suggest having a read of :

https://www.di-mgt.com.au/sha_testvectors.html

This has some standard test examples to test the hash algorithm and software.

The line for the  input abc is:
SHA-3-256	3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532

So, if your Windows program, such as quickhash, produces this same result for the 3 character input abc, then it is acceptable. Make sure you input is EXACTLY 3 characters. No spaces, tabs,line feeds or carriage returns.

It may take a few tries to get the right parameters - as you can see from the above sha_testvectors site there are at least 9 combinations.

(4) By Keith Medcalf (kmedcalf) on 2020-09-13 08:01:48 in reply to 1 [link]

Quite some time ago I wrote my own file hasher that computes all the available hash functions from the Python hashlib that are available with printing and verification.  This is what it reports for that file:

```
>md5 sqlite-dll-win32-x86-3330000.zip d669a92271ad31bbefe4ba827c3d6621179b1964b5dd1f27c6fbaa9c4cf6a082
3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)
sqlite-dll-win32-x86-3330000.zip
 File Name:  sqlite-dll-win32-x86-3330000.zip
      Size:  500989
       md4:  891D 943F 26B2 4535 6096 0509 2520 191A
       md5:  910A E9FB DA13 A82F 9410 303B 653F E0C6
      sha1:  3DE0 2829 408F 5320 B01E 4209 C79C F4A9 D45C DE86
    sha224:  456B AF1B 40F9 831C 0A24 0F60 0A4B 6DE7 05B4 28AC 2699 F19C EFCB 4E11
    sha256:  11BA 415B 7E3B 91C4 587D C73B EC82 CAF9 2F62 724D 0E49 7821 51E7 764A CCA4 3CB5
    sha384:  702A A623 F7F7 4A85 3440 1BB5 7884 FEC2 BDDE 4A00 BA18 196E BC0C D98C 7C4F 166B
             1047 63C1 425B CD02 2C62 3794 13B1 5713
    sha512:  A756 4409 603D EC61 8492 0AED 6080 24DB 319E 8548 B872 A022 EECD 9150 1C12 DA2F
             DE5F AB5B 6CE6 772F 1BA5 724C CE91 51CE 7921 4BED 5CB3 B13D 39E5 E9EA 254E 51B0
  sha3_224:  3143 E412 3E6D E096 DCC1 F35E 9F98 8A9D DAF7 1289 AB30 3470 820A 2B4C
  sha3_256:  D669 A922 71AD 31BB EFE4 BA82 7C3D 6621 179B 1964 B5DD 1F27 C6FB AA9C 4CF6 A082
  sha3_384:  56AB FFCE B654 DA46 54EF 77C9 2495 995B A046 F1D5 683E EE14 2276 D8C3 439A 0714
             9F6E B871 9D2B DAC4 3C3B E3D2 60AB 59AD
  sha3_512:  429F 5CB2 EB6E DDAA C555 99B7 55BF 5051 3AB1 B83A 065D 83FF 24B3 873A 745E 0E13
             8443 012D 7EE4 0180 2F80 300C E946 E4C2 E492 DFC9 A641 81D2 1333 83D7 EBBA E622
   blake2b:  47EF 13DE 5165 CCBF CEDC 6820 3DD0 CD78 4A80 5BC9 D361 8EF9 011E 2BE5 969F 679B
             285A A751 B0B1 FDAD 60D6 BA2D 318F 273D F391 E90B 48C2 3755 4F0B EF64 9930 8D85
   blake2s:  36D7 0E8C 26DD 1B0B 4D7D DEC3 F337 B9C3 527F BE57 E2D3 7B1C 9910 C681 A63A 7F20
  md5-sha1:  910A E9FB DA13 A82F 9410 303B 653F E0C6 3DE0 2829 408F 5320 B01E 4209 C79C F4A9
             D45C DE86
      mdc2:  D230 9FE2 71B4 833C 4587 DCAF 7A22 DCB8
 ripemd160:  C553 1CE5 92F8 B575 8EE7 4008 B303 C6D4 6313 4692
sha512_224:  7CE6 0EB1 F362 E2B2 EC96 914D 7F65 7590 05B4 41A5 D49D 93B5 1F32 7F1C
sha512_256:  55DF BE78 0935 2C3B BC96 72A0 E451 26B9 A793 CBAC 75D4 9549 8DCF EAC8 C6FE C6A0
       sm3:  F9AE 44EE 0B36 153D E2D5 C314 84D1 5876 C259 7A18 8B88 E3CE D20E 6C5B 6F67 0433
 whirlpool:  5B27 0921 CF88 8624 4A2E 21D6 2CF5 039F C9FB 035D 9991 55FA 6623 BB94 E2FE 74AE
             E0FE 1233 3EC4 D302 FE84 12F8 9EB5 397B 3E0F 5387 8020 3A8A C8B1 DD29 DCA3 4312
sha3_256 OK
```

I would suspect that the hash calculator you are using is malfunctioning.  Is the zip file intact (does it test OK)?