hsha1.pp 500 B

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