HMAC 產生器

輕鬆生成 HMAC 摘要

Copied!

關於 HMAC

HMAC (Hash-based Message Authentication Code) is a mechanism for calculating a message authentication code (MAC) involving a cryptographic hash function in combination with a secret cryptographic key. It can be used to verify the integrity and authenticity of a message.

HMAC 可以抵抗長度擴展攻擊,並提供一種方法來確保消息未被篡改,並且發件者是他們聲稱的身份。HMAC 的安全性取決於底層哈希函數的加密強度和密鑰的保密性。

Note:HMAC 中使用的金鑰必須保密。不同的金鑰應該用於不同的目的,並且應該使用加密安全的隨機數生成器生成密鑰。

常見用例

  • API 請求鑒權
  • 安全的消息傳輸
  • 數據完整性驗證
  • 會話身份驗證令牌
  • 檔或數據驗證

技術細節

Algorithm: HMAC 哈希函數
Key Size: Varies by algorithm (typically 128-512 bits)
輸出尺寸: 因哈希函數而異
Security: 使用得當時安全
常見的哈希函數: SHA-256、SHA-512、MD5、SHA-1

Related Tools