• No results found

Message Authentication Codes

N/A
N/A
Protected

Academic year: 2022

Share "Message Authentication Codes"

Copied!
11
0
0

Loading.... (view fulltext now)

Full text

(1)

Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Message Authentication Codes

CSS322: Security and Cryptography

Sirindhorn International Institute of Technology Thammasat University

Prepared by Steven Gordon on 28 October 2013

css322y13s2l08, Steve/Courses/2013/s2/css322/lectures/mac.tex, r2965

1

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Contents

Message Authentication Requirements and Functions

Authentication using Symmetric Key Encryption

Authentication with Message Authentication Codes

Security of MACs

MAC Algorithms

(2)

Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Attacks on Communications across Network

1. Disclosure: encryption 2. Traffic analysis: encryption

3. Masquerade: message authentication

4. Content modification: message authentication 5. Sequence modification: message authentication 6. Timing modification: message authentication 7. Source repudiation: digital signatures

8. Destination repudiation: digital signatures

3

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Authentication

I Receiver wants to verify:

1. Contents of the message have not been modified (data authentication)

2. Source of message is who they claim to be (source authentication)

I Different approaches available:

I Symmetric Key Encryption

I Message Authentication Codes (MACs)

I Hash Functions

I Public Key Encryption (i.e. Digital Signatures)

(3)

Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Contents

Message Authentication Requirements and Functions

Authentication using Symmetric Key Encryption

Authentication with Message Authentication Codes

Security of MACs

MAC Algorithms

5

CSS322 Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Symmetric Encryption for Authentication

Credit: Figure 12.1(a) in Stallings, Cryptography and Network Security, 5th Ed., Pearson 2011

I Confidentiality: only B (and A) can recover plaintext

I Source Authentication: A is only other user with key;

must have come from A

I Data Authentication: successfully decrypted; data has not been modified

I Assumption: decryptor can recognise correct plaintext

(4)

Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Recognising Correct Plaintext

Example 1

B receives ciphertext (supposedly from A, using shared secret key K ):

DPNFCTEJLYONCJAEZRCLASJTDQFY

B decrypts with key K to obtain plaintext:

SECURITYANDCRYPTOGRAPHYISFUN

I Was the plaintext encrypted with key K (and hence sent by A)?

I Is the ciphertext received the same as the ciphertext sent by A?

7

CSS322 Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Recognising Correct Plaintext

Example 2

B receives ciphertext (supposedly from A, using shared secret key K ):

QEFPFPQEBTOLKDJBPPXDBPLOOVX

B decrypts with key K to obtain plaintext:

FTUEUEFTQIDAZSYQEEMSQEADDKM

I Was the plaintext encrypted with key K (and hence sent by A)?

I Is the ciphertext received the same as the ciphertext sent by A?

(5)

Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Recognising Correct Plaintext

Example 3

B receives ciphertext (supposedly from A, using shared secret key K ):

0110100110101101010110111000010

B decrypts with key K to obtain plaintext:

0101110100001101001010100101110

I Was the plaintext encrypted with key K (and hence sent by A)?

I Is the ciphertext received the same as the ciphertext sent by A?

9

CSS322 Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Recognising Correct Plaintext

Example 1

I Assume the message is English

I Plaintext had expected structure; assume the plaintext is correct

I Sent by A and has not been modified

Example 2

I Assume the message is English

I Plaintext had no structure in expected language;

assume plaintext is incorrect

I Either not sent by A or modified

Example 3

I Binary data, e.g. image, compressed file

I Cannot know whether correct or incorrect

(6)

Introduction

Functions Auth. with Encryption

Auth. with MAC Security

Algorithms

Recognising Correct Plaintext

I Valid plaintexts should be small subset of all possible messages

I E.g. 26n possible messages of length n; only small subset are valid English phrases

I Plaintext messages have structure

I BUT automatically detecting structure can be difficult

I Add structure to make it easier, e.g.

I Error detecting code or Frame Check Sequence

I Packet header

11

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC

Security Algorithms

Contents

Message Authentication Requirements and Functions

Authentication using Symmetric Key Encryption

Authentication with Message Authentication Codes

Security of MACs

MAC Algorithms

(7)

Introduction

Functions Auth. with Encryption Auth. with MAC

Security Algorithms

Authentication with Message Authentication Codes

I Append small, fixed-size block of data to message:

cryptographic checksum or MAC T = MAC(K , M) M = input message

MAC = MAC function

K = shared secret key of k bits

T = message authentication code (or tag) of n bits

I MAC function also called keyed hash function

I MAC function similar to encryption, but does not need to be reversible

I Easier to design stronger MAC functions than encryption functions

13

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC

Security Algorithms

Example Uses of MAC

Credit: Figure 12.4 in Stallings, Cryptography and Network Security, 5th Ed., Pearson 2011

(8)

Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Contents

Message Authentication Requirements and Functions

Authentication using Symmetric Key Encryption

Authentication with Message Authentication Codes

Security of MACs

MAC Algorithms

15

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Requirement of MACs

Objective of Attacker

I Assume MAC function is known, key K is not

I For valid MAC code for given message x

Requirement of MAC Function

Computation Resistance : given one or more text-MAC pairs [xi, MAC (K , xi)], computationally

infeasible to compute any text-MAC pair [x , MAC (K , x )] for new input x 6= xi

(9)

Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Security of MACs

Brute Force Attack on Key

I Attacker knows [x1, T1] where T1 = MAC (K , x1)

I Key size of k bits: brute force on key, 2k

I But . . . many tags match T1

I For keys that produce tag T1, try again with [x2, T2]

I Effort to find K is approximately 2k

Brute Force Attack on MAC value

I For xm, find Tm without knowing K

I Similar effort required as one-way/weak collision resistant property for hash functions

I For n bit MAC value length, effort is 2n Effort to break MAC: min(2k, 2n)

17

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Security of MACs

Cryptanalysis

I Many different MAC algorithms; attacks specific to algorithms

I MAC algorithms generally considered secure

(10)

Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

Contents

Message Authentication Requirements and Functions

Authentication using Symmetric Key Encryption

Authentication with Message Authentication Codes

Security of MACs

MAC Algorithms

19

CSS322 Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

MACs Based on Block Ciphers

I Data Authentication Algorithm (DAA): based on DES;

considered insecure

I Cipher-Based Message Authentication Code (CMAC):

mode of operation used with Triple-DES and AES

I OMAC, PMAC, UMAC, VMAC, . . .

(11)

Introduction

Functions Auth. with Encryption Auth. with MAC Security

Algorithms

HMAC

I MAC function derived from cryptographic hash functions

I MD5/SHA are fast in software (compared to block ciphers)

I Libraries for hash functions widely available

HMAC(K , M) = H((K ⊕ opad)||H((K ⊕ ipad )||M)) where ipad= 00110110 repeated, opad= 01011100 repeated

I Security of HMAC depends on security of hash function used

21

References

Related documents

KRR holds the philosophy and practice a corporate culture to ensure their guests to always enjoy the best in term of food variety and quality, restaurant ambience, menu price

The twofold goal of the course is to expose the student to the many faces and causes of family and intimate violence and to explore the health, legal, and social issues and

3.7 Message-By-Message Authentication 157 Electronic Signatures 157 Public Key Encryption for Authentication 157 Message-by-Message Authentication with Digital Signatures 158

Our intuitive security requirement is that: an ad- versary who sees many valid MACs (m, MAC(k, m)) cannot produce a forgery — a valid MAC of a different message.. 13.1

Here we are proposing a new authentication system by the name Source Anonymous Message authentication, popularly known as SAMA is a scalable authentication system

Here we are proposing a new authentication system by the name Source Anonymous Message authentication, popularly known as SAMA is a scalable authentication system

using asymmetric crypto- graphy for key exchange, symmetric encryption for privacy, and message. authentication codes for

To investigate the rate of emergence of subgenome dominance, we examined gene expression, gene methylation, and transposable element (TE) methylation in a natural,