Einzelnen Beitrag anzeigen

philipp.hofmann

Registriert seit: 21. Mär 2012
Ort: Hannover
936 Beiträge
 
Delphi 10.4 Sydney
 
#3

AW: HKDFKey-Berechnung

  Alt Gestern, 19:30
1) Yes, the commented lines are the documentation from TMSSoftware.
2) Was a typo only, in the original method the ECDH-Shared-Secret is calculated first with TMS Crypto-Pack and this is working fine.

And I've checked with DEC but get also something different:

ecdhSharedSecret:='8F819BC085A9CF72B4156716BFA4876 56CF7A489B4F46AFC6748038F603ED62D';
salt:=''702FA63716BB17613AA1141A25F8C7637A9B6728B7 5EC4C9BD0460C6F45E248A1F179F6BB6AD2CCFC56889F66C6B 6852BFD208DEB8BAF9F7286B402D5E38000F1E81D6E7C51823 06E388418C4F51E6F9315997290016E8989F3A6FF22C0CE9AC A686F47C88605C5C4735A2BD29E5517792C49DE564487C1EC8 F1A7558A6D0072'';
result:=BytesToHexStr(THash_SHA256.KDF2(HexStrToBy tes(ecdhSharedSecret),HexStrToBytes(salt),36));

result= AE FC 45 FB E4 9B 90 15 17 B1 4B C4 E7 83 D2 0E 43 74 D4 52 37 66 C7 CA 86 39 75 17 35 88 80 C8 23 99 CB A1
expected=44 C8 6D CF 44 F4 18 0B C2 B2 20 88 DC FC D5 89 CD B0 2C CC 64 8A 48 9E 3C 03 1B 73 BD 2B 13 FC 17 25 46 CB
  Mit Zitat antworten Zitat