Print Page | Close Window

TSHA3Hash.TupleHash

Printed From: TMS Software
Category: VCL Components
Forum Name: VCL / FMX Cryptography Pack
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=11499
Printed Date: 13 Dec 2019 at 12:43am


Topic: TSHA3Hash.TupleHash
Posted By: Asplund Carl
Subject: TSHA3Hash.TupleHash
Date Posted: 19 Oct 2018 at 6:15am
Hi, 

Please help with a possibly wrong assumption:

Environment
Win10 - Latest Update
CryptoGraphy v3.2.0.0

Using TSHA3Hash with the following

     strings MyTuple1, MyTuple2, MyTuple3, MySalt only once...

    { Create First Hash }
    TSHA3Hash .Create;

      AType := txof;
      OutputFormat := hexa;
      hashSizeBits := 128;
      version := 512;
     
       MyHash1 := TupleHash([MyTuple1, MyTuple2, MyTuple3], MySalt);

      TSHA3Hash .Free;

    { Create second hash using identical values }
     Create;

      AType := txof;
      OutputFormat := hexa;
      hashSizeBits := 128;
      version := 512;
     
       MyHash2:= TupleHash([MyTuple1, MyTuple2, MyTuple3], MySalt);

      TSHA3Hash.Free;

      MyHash1 does not equal MyHash2.

     Is this normal?

     When I use Hash or KMACHash, My Hash1 and MyHash2 are equal...

    Thanks for your help.









Replies:
Posted By: Marion Candau
Date Posted: 22 Oct 2018 at 9:30am
Hello Carl,
Do you have example values for MyTuple1, MyTuple2, MyTuple3 and MySalt?
Best regards,
Marion


Posted By: Asplund Carl
Date Posted: 23 Oct 2018 at 4:53pm


Posted By: Asplund Carl
Date Posted: 23 Oct 2018 at 5:35pm


Tuple1 = '1234'

Tuple2 = 'ABCD'

Tuple3 = '5678'

Salt = 'EpFSQpEw/NLh/ZZUgxVcDj08DOs+JqUZ70D9QKXygkAVyigOOgRDC7TLU/fuuuMZ'

with TSHA3Hash

      AType := txof;
      OutputFormat := base64;
      hashSizeBits := 128;
      version := 512;

TSHA3Hash is created , method TupleHash called,  and freed, twice...

Attempt 1: MyHash1 = 'LW5TxOPlF2yrbyNBaVZ8FQ=='

Attempt 2: MyHash2 = 'zGLvUlNpMD5TW+3ZXlKQvw=='

So the two hash values are different, is this normal? There seems to be some random factor (?)


I attached a zip file with the small form unit in the reply to the e-mail notification. I didn't see how to do it in the forum.

Thanks.



Posted By: Marion Candau
Date Posted: 24 Oct 2018 at 8:54am
Hi Carl,

I do not have this issue with TMS CP v3.2.0.1, as you can see in the picture below.


Which version do you have?

Best regards,
Marion



Posted By: Asplund Carl
Date Posted: 24 Oct 2018 at 2:32pm
Due to a persistent, random Rad Studio (10.2.3) RTL250.bpl A/V problem in the IDE, I uninstalled/cleaned/reinstalled Rad Studio and got the latest versions from 3rd parties and reinstalled them too, including CryptoGraphic. This was within the last 14 days.

I downloaded the latest version, but it shows I have installed 3.1.0.2 (?). I will download again and
uninstall, clean registry and install. I will also check my directories. I may have installed an earlier version by mistake, but I don't see how.

After I am done, I will update on forum. Thx.


Posted By: Asplund Carl
Date Posted: 24 Oct 2018 at 3:26pm
That seems to have solved the problem. Thanks for your help.



Print Page | Close Window