hmd5.pp 478 B

123456789101112131415
  1. // See some samples in: http://en.wikipedia.org/wiki/Hash-based_message_authentication_code
  2. program hmd5;
  3. {$mode objfpc}{$H+}
  4. uses
  5. HMAC;
  6. begin
  7. // for HMAC_MD5("", "") = 0x74e6f7298a9c2d168935f58c001bad88
  8. WriteLn('Example 1: ', HMACMD5Print(HMACMD5Digest('', '')));
  9. // for HMAC_MD5("key", "The quick brown fox jumps over the lazy dog") = 0x80070713463e7749b90c2dc24911e275
  10. WriteLn('Example 2: ', HMACMD5('key', 'The quick brown fox jumps over the lazy dog'));
  11. end.