Keyed-Hash Message Authentication Code

Keyed-Hash Message Authentication Code

Ein Keyed-Hash Message Authentication Code (HMAC) ist eine Art Message Authentication Code (MAC), dessen Konstruktion auf einer kryptografischen Hash-Funktion basiert. HMACs werden beispielsweise in den Protokollen TLS oder IPsec verwendet.

Der HMAC wird aus der Nachricht N und einem geheimen Schlüssel K mittels der Hash-Funktion H wie folgt berechnet. K wird auf die Blocklänge B der Hash-Funktion (512 Bit für die meisten gängigen Hash-Funktionen) aufgefüllt. Falls die Länge von K größer als die Blocklänge der Hash-Funktion ist, wird K durch H(K) ersetzt.

\mathrm{HMAC}_K(N) = \mathrm{H}\left(\left(K \oplus opad \right) \;||\; \mathrm{H}\left(\left(K \oplus ipad \right) \;||\; N\right)\right)

Die Werte opad und ipad sind dabei Konstanten, \oplus steht für die bitweise XOR-Operation und \;||\; für die Verknüpfung durch einfaches Zusammensetzen (Konkatenation).

Nach RFC 2104 sind beide Konstanten:

opad = \underbrace{\mathrm{0x5C}\dotso\mathrm{0x5C}}_{B\text{-mal}} \text{ und } ipad = \underbrace{\mathrm{0x36}\dotso\mathrm{0x36}}_{B\text{-mal}}.

Der innere Hashwert alleine ist nicht ausreichend, da ein Angreifer einfach weitere Blöcke an N anhängen und den Hashwert weiterrechnen könnte. Die innere Schlüsselkomponente sichert also nur den Anfang der Nachricht. Die Äußere Funktion sichert auch das „Ende“ der Nachricht.

Eigenschaften

Vorausgesetzt sei:

  • Die Hashfunktion H ist unumkehrbar (Berechnung von N aus H(N) ausgeschlossen)
  • H ist kollisionsresistent (N,N' mit H(N)=H(N') nicht bestimmbar)

Unter diesen Voraussetzungen kann für den HMAC folgendes abgeleitet werden:

  • Die Bestimmung des Schlüsselwerts K aus der Nachricht N und dem HMAC-Wert ist ausgeschlossen.
  • Die Bestimmung der Nachricht N aus K und dem HMAC-Wert ist ausgeschlossen.
  • Es können keine unterschiedlichen Wertepaare (K',N') gefunden werden, die zum gleichen HMAC-Wert führen.

Die Eigenschaften können jedoch auch dann erfüllt sein, falls die Hash-Funktion H die geforderten Eigenschaften nicht voll erfüllt. Für einen festen Schlüsselwert kann die HMAC-Funktion als Hash-Funktion angesehen werden. Die Sicherheit dieser Hash-Funktion ist gewährleistet, sofern die Hash-Funktion H sicher ist.

Auch eine Hashfunktion, die nur eine Einweghashfunktion (OWHF) ist, wäre hinreichend für einen MAC. Zu einem gegebenen MAC-Wert, entsprechend einem Schlüssel und einer Nachricht, kann für eine OWHF keine zweite Nachricht oder ein zweiter Schlüssel mit gleichem MAC-Wert gefunden werden.

Weblinks


Wikimedia Foundation.

Игры ⚽ Поможем решить контрольную работу

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Keyed-Hash Message Authentication Code — Un HMAC, de l anglais keyed hash message authentication code (code d authentification d une empreinte cryptographique de message avec clé), est un type de code d authentification de message (CAM), ou MAC en anglais (Message Authentication Code),… …   Wikipédia en Français

  • Message authentication code — In cryptography, a message authentication code (often MAC) is a short piece of information used to authenticate a message. A MAC algorithm, sometimes called a keyed (cryptographic) hash function, accepts as input a secret key and an arbitrary… …   Wikipedia

  • Cryptographic hash function — A cryptographic hash function (specifically, SHA 1) at work. Note that even small changes in the source input (here in the word over ) drastically change the resulting output, by the so called avalanche effect. A cryptographic hash function is a… …   Wikipedia

  • Digest access authentication — HTTP Persistence · Compression · HTTPS Request methods OPTIONS · GET · HEAD · POST · PUT · DELETE · TRACE · CONNECT Header fields Cookie · ETag · Location · Referer DNT · …   Wikipedia

  • HMAC — Keyed Hash Message Authentication Code Un HMAC, de l anglais keyed hash message authentication code (code d authentification d une empreinte cryptographique de message avec clé), est un type de code d authentification de message (CAM), ou MAC en… …   Wikipédia en Français

  • HMAC — Ein keyed hash message authentication code, (HMAC) ist eine Art Message Authentication Code (MAC), der basierend auf einer kryptografischen Hash Funktion berechnet wird. HMACs werden in vielen modernen Protokollen wie beispielsweise TLS oder… …   Deutsch Wikipedia

  • HMAC — SHA 1 HMAC Generation. In cryptography, HMAC (Hash based Message Authentication Code) is a specific construction for calculating a message authentication code (MAC) involving a cryptographic hash function in combination with a secret key. As with …   Wikipedia

  • Block cipher modes of operation — This article is about cryptography. For method of operating , see modus operandi. In cryptography, modes of operation is the procedure of enabling the repeated and secure use of a block cipher under a single key.[1][2] A block cipher by itself… …   Wikipedia

  • Outline of cryptography — See also: Index of cryptography articles The following outline is provided as an overview of and topical guide to cryptography: Cryptography (or cryptology) – practice and study of hiding information. Modern cryptography intersects the… …   Wikipedia

  • Topics in cryptography — This article is intended to be an analytic glossary , or alternatively, an organized collection of annotated pointers.Classical ciphers*Autokey cipher *Permutation cipher*Polyalphabetic substitution **Vigenère cipher*Polygraphic substitution… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”