Jump to content

skande

Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by skande


  1. On 7/27/2019 at 9:36 AM, Arnaud Bouchez said:

    Take a look at https://github.com/synopse/mORMot/blob/master/SynCrypto.pas

     

    It is Open Source, works from Delphi 6 up to latest Delphi 10.3, and is the fastest library for Delphi AFAIK - for instance, there is an Intel's SSE4 x64 optimized asm for SHA-256 on x86_64 (Windows and FPC Linux).

     

    You can use the THMAC_SHA256 record, or HMAC_SHA256() function for your purpose.

    THANK YOU !!!

    I have try this , and it works ( the necesary units ( by dependecy you must be put in the same directory ) are .... SynCrypto.pas, SynCommons.pas, SynTable.pas , SynLZ.pas ,  Synopse.inc , SynopseCommit.inc   ( all these files are in this link Github ) OR if you prefer ... are attched to this post

     

    Uses system, SynCrypto


     


    function CalculateHMACSHA256(const value, sKey: String): String;
    var
      sha256Digest: TSHA256Digest;
    begin
      try
        HMAC_SHA256(UTF8Encode(skey),UTF8Encode(value),sha256Digest);
        Result:=UpperCase(SHA256DigestToString(sha256Digest));
      except
        Result:='';
      end;
    end;

     

     

    Synopse.inc

    SynopseCommit.inc

    SynCommons.pas

    SynCrypto.pas

    SynLZ.pas

    SynTable.pas

    sha512-x64sse4.obj

    sha512-x86.obj

×