LoginSignup
1
0

More than 5 years have passed since last update.

Smalltalk(Pharo)でHMACを利用する

Last updated at Posted at 2018-01-26

必要になったのでメモ。Pharo6.1で確認。
System-Hashingあたりも参考に。

SHA256でHMACを利用する

鍵はtestで、内容はabc

hmac := HMAC on: SHA256.
hmac key: 'test' asByteArray.
mac := hmac digestMessage: 'abc' asByteArray.
mac hex. 
"'d796579aed123e7b743ccaf5b150affa1223e31ecba8b88c9da9ccf7ad5e0594'"

確認

HMAC Generator / Tester Toolで確認。

d796579aed123e7b743ccaf5b150affa1223e31ecba8b88c9da9ccf7ad5e0594

よさそうです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0