SlideShare ist ein Scribd-Unternehmen logo
1 von 9
The Keyed-Hash Message
Authentication Code

HMAC
FIPS-198-1

http://www.youtube.com/zarigatongy
Follow Me @
http://youtube.com/zarigatongy

http://www.youtube.com/zarigatongy
HMAC Illustration

http://www.youtube.com/zarigatongy
Introduction
Typically, message authentication codes are
used between two parties that share a secret
key in order to authenticate information
transmitted between these parties. This
Standard defines a MAC that uses a
cryptographic hash function in conjunction with
a secret key in order to authenticate information
transmitted between these parties

http://www.youtube.com/zarigatongy
HMAC Uses
• HMAC whenever you want integrity of the data
maintained (and authenticity)
• The key is part of the HMAC, since it is a shared
secret known between 2 parties only and only
they can create the HMAC and no one else.
(Ensures authenticity)
• Length extension attacks are not possible on
HMAC. MAC's on the other hand simply appends
key to the message, which is susceptible to it.
HMAC was introduced to overcome this attack on
MAC's.
http://www.youtube.com/zarigatongy
HMAC Specification
• To compute a MAC over the data ‘text’ using
the HMAC function, the following operation is
performed:
MAC(text)=HMAC(K, text) = H((K0⊕opad)|| H((K0⊕ipad) ||
text))
Terms
• K= Secret Key,
• K0=The key K after any necessary pre-processing to form a B
byte key.
• ⊕ = Exclusive OR
• ipad=Inner Pad, the byte x’36‘ repeated B times.
http://www.youtube.com/zarigatongy
• opad=Outer Pad, the byte x‘5c‘ repeated B times.
HMAC Construction

http://www.youtube.com/zarigatongy
Example : bash to calculate HMAC
#echo -n "value" | openssl dgst -sha1 -hmac
"key"
57443a4c052350a44638835d64fd66822f813319

#echo -n "value" | openssl sha1 -hmac "key"
57443a4c052350a44638835d64fd66822f813319

#echo '<?= hash_hmac("sha1", "value", "key")
?>' | php
57443a4c052350a44638835d64fd66822f813319

http://www.youtube.com/zarigatongy
More Protocol Tutorials
•
•
•
•
•
•
•
•
•
•

AES Tutorial Click Here
X.509 Certificate
SSL Protocol Click here
DHCPv6 Protocol Click Here
CHAP Protocol Click Here
ISCSI Protocol Tutorial Click Here
BGP Tutorial Click Here
RADIUS Protocol Click Here
PPP Protocol Click Here
PPPoE Protocol Click Here
http://youtube.com/zarigatongy

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (14)

Keisitimewaan ekonomi islam
Keisitimewaan ekonomi islamKeisitimewaan ekonomi islam
Keisitimewaan ekonomi islam
 
Lançamento concurso
Lançamento concursoLançamento concurso
Lançamento concurso
 
Aula 01
Aula 01Aula 01
Aula 01
 
Presentation1
Presentation1Presentation1
Presentation1
 
Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...
Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...
Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...
 
USPTO DESIGN PATENT
USPTO DESIGN PATENTUSPTO DESIGN PATENT
USPTO DESIGN PATENT
 
Marketing viral DA TEORIA A PRATICA
Marketing viral  DA TEORIA A PRATICAMarketing viral  DA TEORIA A PRATICA
Marketing viral DA TEORIA A PRATICA
 
uni
uniuni
uni
 
Plantillas hosteleria 2
Plantillas hosteleria 2Plantillas hosteleria 2
Plantillas hosteleria 2
 
DMG v4
DMG v4DMG v4
DMG v4
 
P Gafoor document0001
P Gafoor document0001P Gafoor document0001
P Gafoor document0001
 
БЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООД
БЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООДБЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООД
БЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООД
 
LINKED IN PRESENTATION
LINKED IN PRESENTATIONLINKED IN PRESENTATION
LINKED IN PRESENTATION
 
Revista Info Ceará
Revista Info Ceará Revista Info Ceará
Revista Info Ceará
 

Kürzlich hochgeladen

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Kürzlich hochgeladen (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

Hmac The Keyed-Hash Message Authentication Code (HMAC)

  • 1. The Keyed-Hash Message Authentication Code HMAC FIPS-198-1 http://www.youtube.com/zarigatongy
  • 4. Introduction Typically, message authentication codes are used between two parties that share a secret key in order to authenticate information transmitted between these parties. This Standard defines a MAC that uses a cryptographic hash function in conjunction with a secret key in order to authenticate information transmitted between these parties http://www.youtube.com/zarigatongy
  • 5. HMAC Uses • HMAC whenever you want integrity of the data maintained (and authenticity) • The key is part of the HMAC, since it is a shared secret known between 2 parties only and only they can create the HMAC and no one else. (Ensures authenticity) • Length extension attacks are not possible on HMAC. MAC's on the other hand simply appends key to the message, which is susceptible to it. HMAC was introduced to overcome this attack on MAC's. http://www.youtube.com/zarigatongy
  • 6. HMAC Specification • To compute a MAC over the data ‘text’ using the HMAC function, the following operation is performed: MAC(text)=HMAC(K, text) = H((K0⊕opad)|| H((K0⊕ipad) || text)) Terms • K= Secret Key, • K0=The key K after any necessary pre-processing to form a B byte key. • ⊕ = Exclusive OR • ipad=Inner Pad, the byte x’36‘ repeated B times. http://www.youtube.com/zarigatongy • opad=Outer Pad, the byte x‘5c‘ repeated B times.
  • 8. Example : bash to calculate HMAC #echo -n "value" | openssl dgst -sha1 -hmac "key" 57443a4c052350a44638835d64fd66822f813319 #echo -n "value" | openssl sha1 -hmac "key" 57443a4c052350a44638835d64fd66822f813319 #echo '<?= hash_hmac("sha1", "value", "key") ?>' | php 57443a4c052350a44638835d64fd66822f813319 http://www.youtube.com/zarigatongy
  • 9. More Protocol Tutorials • • • • • • • • • • AES Tutorial Click Here X.509 Certificate SSL Protocol Click here DHCPv6 Protocol Click Here CHAP Protocol Click Here ISCSI Protocol Tutorial Click Here BGP Tutorial Click Here RADIUS Protocol Click Here PPP Protocol Click Here PPPoE Protocol Click Here http://youtube.com/zarigatongy