KEMBAR78
5. message authentication and hash function | PPTX
Message Authentication
and
Hash Function
Authentication Requirement
Disclosure Traffic Analysis Masquerade
Content Modification Sequence Modification
Timing Modification Source Repudiation
Destination Repudiation
Attacks in the Network
Message Authentication
Three Alternative Functions used
Message Encryption
Message Authentication Code (MAC)
Hash Function
Message Encryption
Provides Message Authentication
Symmetric Encryption
Receiver know sender must have created it, since only sender and
receiver now key used
Provides both: sender authentication and message authenticity.
Message Encryption
Provides Message Authentication
Public-Key Encryption
Encryption provides no confidence of sender, since anyone
potentially knows public-key.
however if sender signs message using his private-key then encrypts
with recipients public key have both secrecy and authentication
but at cost of two public-key uses on message
Message Authentication Code
A small fixed-sized block of data
Depends on both message and a secret key like encryption though need not be reversible.
Appended to message as a signature
Receiver performs same computation on message and checks with the MAC
Provides assurance that message is unaltered and comes from sender
Message Authentication Code
MAC provides Authentication
Message can be encrypted for secrecy
Generally use separate keys for each
Can compute MAC either before or after encryption, Generally regarded as better done before
why use a MAC?
sometimes only authentication is needed
Note that a MAC is not a Digital Signature
Message Authentication Code
MAC Properties
A MAC is a cryptographic checksum
MAC = CK(M)
C is a function
M is a variable-length message
K is a secret key
Many-to-One function
potentially many messages have same MAC but finding these
needs to be very difficult
Message Authentication Code
Requirements for MAC
MAC needs to satisfy the following:
Knowing a message and MAC, is infeasible to find another
message with same MAC
MAC should depend equally on all bits of the message
Message Authentication Code
Message Authentication
Message Authentication Code
Message Authentication and Confidentiality
Authentication tied to Plaintext
Message Authentication Code
Message Authentication and Confidentiality
Authentication tied to Ciphertext
Message Authentication Code
Using Symmetric Ciphers for MACs
can use any cipher block chaining mode and use final block as a MAC
Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC
using IV=0 and zero-pad of final block
encrypt message using DES in CBC mode
and send just the final block as the MAC
or the leftmost M bits (16≤M≤64) of final block
Message Authentication Code
Using Symmetric Ciphers for MACs
Hash Function
A hash function is any algorithm that maps variable
length data to fixed length data.
Hash Function
Hash Function
• Can be applied to any size message M
• Produces a fixed-length output h
• Easy to compute h=H(M) for any message M
• Given h is infeasible to find x s.t. H(x)=h
• Given x is infeasible to find y s.t. H(y)=H(x)
• infeasible to find any x,y s.t. H(y)=H(x)
Requirements for Hash Functions
Hash Function
MD5 Algorithm
The input message is broken up into chunks of 512-bit blocks (sixteen 32 bit
words).
The message is padded so that its length is divisible by 512
Grouped into four Round (each round process four 32 bit words)
Hash Function
MD5 Algorithm
32 bit
denote the XOR, AND, OR and NOT operations
Mi denotes a 32-bit block of the message input
Ki denotes a 32-bit constant
denotes a left bit rotation by s places
denotes addition modulo 232
SECURE HASH ALGORITHM
SHA 512
Message size : < 2128
Message Digest Size : 512
Block Size : 1024
SECURE HASH ALGORITHM
Step 1: Append padding bits
Step 2: Append Length
Step 3: Initialize HASH buffer
Step 4: Process message in 1024 bit Blocks
Step 5: Output
SECURE HASH ALGORITHM
Step 1: Append padding bits
The message is padded so that length ≡ 896 (mod 1024)
padding is always added
consist of single 1-bit followed by necessary number of 0-bits
SECURE HASH ALGORITHM
Step 2:Append Length
a block of 128 bits is appended
treated as unsigned 128-bit integer
contains the length of original message
SECURE HASH ALGORITHM
Step 3:Initialize hash buffer
hold intermediate values and final result
size: 512 bit
SECURE HASH ALGORITHM
Step 4:Process message in 1024-bit block
Consists 80 rounds
updating a 512-bit buffer using a 64-bit value
Wt derived from the current message block
and a round constant based on cube root of first 80 prime numbers
SECURE HASH ALGORITHM
Step 4:Process message
in 1024-bit block
Step 5:Output
SECURE HASH ALGORITHM
Creation of 80-word Input Sequence for SHA-512 Processing of Single Block
SECURE HASH ALGORITHM
Ch(e,f,g) = If e then f else g
Maj(a, b, c) = TRUE if majority
of a, b, c is TRUE
Wt = 64 bit word
Kt = 64 bit additive constant
HMAC
• Stands for Hash-based Message Authentication Code
• It used to verify data integrity and authenticity of a
message
• It uses current cryptographic hash functions with a secret
key (SHA or MD5)
The name of the function changes depending on what
hash function you use
MD5 would result to HMAC-MD5
SHA# would result to HMAC-SHA#
HMAC
• Stands for Hash-based Message Authentication Code
• It used to verify data integrity and authenticity of a
message
• It uses current cryptographic hash functions with a secret
key (SHA or MD5)
The name of the function changes depending on what
hash function you use
MD5 would result to HMAC-MD5
SHA# would result to HMAC-SHA#

5. message authentication and hash function

  • 1.
  • 2.
    Authentication Requirement Disclosure TrafficAnalysis Masquerade Content Modification Sequence Modification Timing Modification Source Repudiation Destination Repudiation Attacks in the Network
  • 3.
    Message Authentication Three AlternativeFunctions used Message Encryption Message Authentication Code (MAC) Hash Function
  • 4.
    Message Encryption Provides MessageAuthentication Symmetric Encryption Receiver know sender must have created it, since only sender and receiver now key used Provides both: sender authentication and message authenticity.
  • 5.
    Message Encryption Provides MessageAuthentication Public-Key Encryption Encryption provides no confidence of sender, since anyone potentially knows public-key. however if sender signs message using his private-key then encrypts with recipients public key have both secrecy and authentication but at cost of two public-key uses on message
  • 6.
    Message Authentication Code Asmall fixed-sized block of data Depends on both message and a secret key like encryption though need not be reversible. Appended to message as a signature Receiver performs same computation on message and checks with the MAC Provides assurance that message is unaltered and comes from sender
  • 7.
    Message Authentication Code MACprovides Authentication Message can be encrypted for secrecy Generally use separate keys for each Can compute MAC either before or after encryption, Generally regarded as better done before why use a MAC? sometimes only authentication is needed Note that a MAC is not a Digital Signature
  • 8.
    Message Authentication Code MACProperties A MAC is a cryptographic checksum MAC = CK(M) C is a function M is a variable-length message K is a secret key Many-to-One function potentially many messages have same MAC but finding these needs to be very difficult
  • 9.
    Message Authentication Code Requirementsfor MAC MAC needs to satisfy the following: Knowing a message and MAC, is infeasible to find another message with same MAC MAC should depend equally on all bits of the message
  • 10.
  • 11.
    Message Authentication Code MessageAuthentication and Confidentiality Authentication tied to Plaintext
  • 12.
    Message Authentication Code MessageAuthentication and Confidentiality Authentication tied to Ciphertext
  • 13.
    Message Authentication Code UsingSymmetric Ciphers for MACs can use any cipher block chaining mode and use final block as a MAC Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC using IV=0 and zero-pad of final block encrypt message using DES in CBC mode and send just the final block as the MAC or the leftmost M bits (16≤M≤64) of final block
  • 14.
    Message Authentication Code UsingSymmetric Ciphers for MACs
  • 15.
    Hash Function A hashfunction is any algorithm that maps variable length data to fixed length data.
  • 16.
  • 17.
    Hash Function • Canbe applied to any size message M • Produces a fixed-length output h • Easy to compute h=H(M) for any message M • Given h is infeasible to find x s.t. H(x)=h • Given x is infeasible to find y s.t. H(y)=H(x) • infeasible to find any x,y s.t. H(y)=H(x) Requirements for Hash Functions
  • 18.
    Hash Function MD5 Algorithm Theinput message is broken up into chunks of 512-bit blocks (sixteen 32 bit words). The message is padded so that its length is divisible by 512 Grouped into four Round (each round process four 32 bit words)
  • 19.
    Hash Function MD5 Algorithm 32bit denote the XOR, AND, OR and NOT operations Mi denotes a 32-bit block of the message input Ki denotes a 32-bit constant denotes a left bit rotation by s places denotes addition modulo 232
  • 20.
    SECURE HASH ALGORITHM SHA512 Message size : < 2128 Message Digest Size : 512 Block Size : 1024
  • 21.
    SECURE HASH ALGORITHM Step1: Append padding bits Step 2: Append Length Step 3: Initialize HASH buffer Step 4: Process message in 1024 bit Blocks Step 5: Output
  • 22.
    SECURE HASH ALGORITHM Step1: Append padding bits The message is padded so that length ≡ 896 (mod 1024) padding is always added consist of single 1-bit followed by necessary number of 0-bits
  • 23.
    SECURE HASH ALGORITHM Step2:Append Length a block of 128 bits is appended treated as unsigned 128-bit integer contains the length of original message
  • 24.
    SECURE HASH ALGORITHM Step3:Initialize hash buffer hold intermediate values and final result size: 512 bit
  • 25.
    SECURE HASH ALGORITHM Step4:Process message in 1024-bit block Consists 80 rounds updating a 512-bit buffer using a 64-bit value Wt derived from the current message block and a round constant based on cube root of first 80 prime numbers
  • 26.
    SECURE HASH ALGORITHM Step4:Process message in 1024-bit block Step 5:Output
  • 27.
    SECURE HASH ALGORITHM Creationof 80-word Input Sequence for SHA-512 Processing of Single Block
  • 28.
    SECURE HASH ALGORITHM Ch(e,f,g)= If e then f else g Maj(a, b, c) = TRUE if majority of a, b, c is TRUE Wt = 64 bit word Kt = 64 bit additive constant
  • 29.
    HMAC • Stands forHash-based Message Authentication Code • It used to verify data integrity and authenticity of a message • It uses current cryptographic hash functions with a secret key (SHA or MD5) The name of the function changes depending on what hash function you use MD5 would result to HMAC-MD5 SHA# would result to HMAC-SHA#
  • 30.
    HMAC • Stands forHash-based Message Authentication Code • It used to verify data integrity and authenticity of a message • It uses current cryptographic hash functions with a secret key (SHA or MD5) The name of the function changes depending on what hash function you use MD5 would result to HMAC-MD5 SHA# would result to HMAC-SHA#