Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
HMAC
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Definition== This definition is taken from RFC 2104: :<math>\begin{align} \operatorname{HMAC}(K, m) &= \operatorname{H}\Bigl(\bigl(K' \oplus opad\bigr) \parallel \operatorname{H} \bigl(\left(K' \oplus ipad\right) \parallel m\bigr)\Bigr) \\ K' &= \begin{cases} \operatorname{H}\left(K\right) & \text{if}\ K\text{ is larger than block size} \\ K & \text{otherwise} \end{cases} \end{align}</math> where : <math>\operatorname{H}</math> is a cryptographic hash function. : <math>m</math> is the message to be authenticated. : <math>K</math> is the secret key. : <math>K'</math> is a block-sized key derived from the secret key, ''K''; either by padding to the right with 0s up to the block size, or by hashing down to less than or equal to the block size first and then padding to the right with zeros. : <math>\parallel</math> denotes [[concatenation]]. : <math>\oplus</math> denotes bitwise [[exclusive or]] (XOR). : <math>opad</math> is the block-sized outer padding, consisting of repeated bytes valued 0x5c. : <math>ipad</math> is the block-sized inner padding, consisting of repeated bytes valued 0x36.{{Ref RFC|2104|rsection=2}} {| class="wikitable" ! [[Hash function]] <code>H</code> ! <code>b</code>, [[byte]]s ! <code>L</code>, [[byte]]s |- | [[MD5]] || 64 || 16 |- | [[SHA-1]] || 64 || 20 |- | [[SHA-2|SHA-224]] || 64 || 28 |- | [[SHA-2|SHA-256]] || 64 || 32 |- | [[SHA-2|SHA-512/224]] || 128 || 28 |- | [[SHA-2|SHA-512/256]] || 128 || 32 |- | [[SHA-2|SHA-384]] || 128 || 48 |- | [[SHA-2|SHA-512]] || 128 || 64<ref>{{cite web |title=FIPS 180-2 with Change Notice 1 |url=https://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf |website=csrc.nist.gov}}</ref> |- | [[SHA-3|SHA3-224]] || 144 || 28 |- | [[SHA-3|SHA3-256]] || 136 || 32 |- | [[SHA-3|SHA3-384]] || 104 || 48 |- | [[SHA-3|SHA3-512]] || 72 || 64<ref>{{Cite journal |last=Dworkin |first=Morris |date=4 August 2015 |title=SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions |url=https://www.nist.gov/publications/sha-3-standard-permutation-based-hash-and-extendable-output-functions |journal=[[Federal Information Processing Standards]] |via=NIST Publications}}</ref> |- | colspan=3 |<code>out = H(in)</code><br /><code>L = length(out)</code><br /><code>b = H's internal block length</code>{{Ref RFC|2104|rsection=2}} |}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
HMAC
(section)
Add topic