+ All Categories
Home > Documents > Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by...

Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by...

Date post: 23-Dec-2015
Category:
Upload: gordon-marshall
View: 248 times
Download: 7 times
Share this document with a friend
Popular Tags:
37
Cryptography and Cryptography and Network Security Network Security Chapter 12 Chapter 12 Fifth Edition Fifth Edition by William Stallings by William Stallings Lecture slides by Lawrie Lecture slides by Lawrie Brown Brown
Transcript
Page 1: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Cryptography and Cryptography and Network SecurityNetwork Security

Chapter 12Chapter 12

Fifth EditionFifth Edition

by William Stallingsby William Stallings

Lecture slides by Lawrie BrownLecture slides by Lawrie Brown

Page 2: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Chapter 12 –Message Chapter 12 –Message Authentication CodesAuthentication Codes

Each of the messages, like each one he had ever Each of the messages, like each one he had ever read of Stern's commands, began with a number read of Stern's commands, began with a number and ended with a number or row of numbers. No and ended with a number or row of numbers. No efforts on the part of Mungo or any of his experts efforts on the part of Mungo or any of his experts had been able to break Stern's code, nor was had been able to break Stern's code, nor was there any clue as to what the preliminary number there any clue as to what the preliminary number and those ultimate numbers signified.and those ultimate numbers signified.——Talking to Strange Men, Talking to Strange Men, Ruth RendellRuth Rendell

Page 3: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

General Security Requirements General Security Requirements (resistance against the following attacks)(resistance against the following attacks)

disclosuredisclosure traffic analysistraffic analysis masquerademasquerade content modificationcontent modification sequence modificationsequence modification timing modificationtiming modification source repudiationsource repudiation destination repudiationdestination repudiation

Page 4: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Message Authentication Message Authentication FunctionsFunctions

message authentication is concerned with: message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating identity of originator validating identity of originator non-repudiation of origin (dispute resolution)non-repudiation of origin (dispute resolution)

will consider the security requirementswill consider the security requirements then three alternative functions used:then three alternative functions used:

hash functionhash function message encryptionmessage encryption message authentication code (MAC)message authentication code (MAC)

Page 5: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Message EncryptionMessage Encryption

message encryption by itself also provides message encryption by itself also provides a measure of authenticationa measure of authentication

if symmetric encryption is used then:if symmetric encryption is used then: receiver know sender must have created itreceiver know sender must have created it since only sender and receiver know key usedsince only sender and receiver know key used content can not be alteredcontent can not be altered message has message has suitable structure, redundancy suitable structure, redundancy

or a checksum to detect any changesor a checksum to detect any changes

Page 6: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Message EncryptionMessage Encryption

if public-key encryption is used:if public-key encryption is used: encryption provides no confidence of senderencryption provides no confidence of sender since anyone potentially knows public-keysince anyone potentially knows public-key however if however if

• sender sender signssigns message using their private-key message using their private-key• then encrypts with recipients public keythen encrypts with recipients public key• have both secrecy and authenticationhave both secrecy and authentication

again need to recognize corrupted messagesagain need to recognize corrupted messages but at cost of two public-key uses on messagebut at cost of two public-key uses on message

Page 7: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Page 8: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Page 9: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Page 10: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Message Authentication Code Message Authentication Code (MAC)(MAC)

generated by an algorithm that creates a generated by an algorithm that creates a small fixed-sized blocksmall fixed-sized block depending on both message and some keydepending on both message and some key like encryption though need not be reversiblelike encryption though need not be reversible

appended to message as a appended to message as a signaturesignature receiver performs same computation on receiver performs same computation on

message and checks it matches the MACmessage and checks it matches the MAC provides assurance that message is provides assurance that message is

unaltered and comes from senderunaltered and comes from sender

Page 11: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Message Authentication CodeMessage Authentication Code

M – input message C – MAC function K – shared secret keyMAC – message authentication code

MAC = CK(M)

Page 12: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Page 13: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Message Authentication Message Authentication CodesCodes

as shown the MAC provides authenticationas shown the MAC provides authentication can also use encryption for secrecycan also use encryption for secrecy

generally use separate keys for eachgenerally use separate keys for each can compute MAC either before or after encryptioncan compute MAC either before or after encryption is generally regarded as better done beforeis generally regarded as better done before

why use a MAC?why use a MAC? sometimes only authentication is neededsometimes only authentication is needed sometimes need authentication to persist longer than sometimes need authentication to persist longer than

the encryption (eg. archival use)the encryption (eg. archival use) note that a MAC is not a digital signaturenote that a MAC is not a digital signature

Page 14: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

MAC PropertiesMAC Properties

a MAC is a cryptographic checksuma MAC is a cryptographic checksumMAC = CMAC = CKK(M)(M)

condenses a variable-length message Mcondenses a variable-length message M using a secret key Kusing a secret key K to a fixed-sized authenticatorto a fixed-sized authenticator

is a many-to-one functionis a many-to-one function potentially many messages have same MACpotentially many messages have same MAC but finding these needs to be very difficultbut finding these needs to be very difficult

Page 15: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Requirements for MACsRequirements for MACs

taking into account the types of attackstaking into account the types of attacks need the MAC to satisfy the following:need the MAC to satisfy the following:

1.1. knowing a message and MAC, is infeasible knowing a message and MAC, is infeasible to find another message with same MACto find another message with same MAC

2.2. MACs should be uniformly distributedMACs should be uniformly distributed

3.3. MAC should depend equally on all bits of the MAC should depend equally on all bits of the messagemessage

Page 16: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Hash and MAC AlgorithmsHash and MAC Algorithms

Hash FunctionsHash Functions condense arbitrary size message to fixed sizecondense arbitrary size message to fixed size by processing message in blocksby processing message in blocks through some compression functionthrough some compression function either custom or block cipher basedeither custom or block cipher based

Message Authentication Code (MAC)Message Authentication Code (MAC) fixed sized authenticator for some messagefixed sized authenticator for some message to provide authentication for messageto provide authentication for message by using block cipher mode or hash functionby using block cipher mode or hash function

Page 17: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Keyed Hash Functions as MACsKeyed Hash Functions as MACs

want a MAC based on a hash function want a MAC based on a hash function because hash functions are generally fasterbecause hash functions are generally faster code for crypto hash functions widely code for crypto hash functions widely

availableavailable hash includes a key along with messagehash includes a key along with message original proposal:original proposal:

KeyedHash = Hash(Key|Message) KeyedHash = Hash(Key|Message) some weaknesses were found with this some weaknesses were found with this

eventually led to development of HMAC eventually led to development of HMAC

Page 18: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

HMACHMAC

specified as Internet standard RFC2104 specified as Internet standard RFC2104 uses hash function on the message:uses hash function on the message:

HMACHMACKK = Hash[(K = Hash[(K++ XOR opad) || XOR opad) || Hash[(KHash[(K++ XOR ipad)||M)]] XOR ipad)||M)]]

where Kwhere K++ is the key padded out to size is the key padded out to size and opad, ipad are specified padding constants and opad, ipad are specified padding constants overhead is just 3 more hash calculations than overhead is just 3 more hash calculations than

the message needs alonethe message needs alone any hash function can be usedany hash function can be used

eg. MD5, SHA-1, RIPEMD-160, Whirlpooleg. MD5, SHA-1, RIPEMD-160, Whirlpool

Page 19: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

HMAC OverviewHMAC Overview

Page 20: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

HMAC SecurityHMAC Security

proved proved security of HMAC relates to that of security of HMAC relates to that of the underlying hash algorithmthe underlying hash algorithm

attacking HMAC requires either:attacking HMAC requires either: brute force attack on key usedbrute force attack on key used birthday attack (but since keyed would need to birthday attack (but since keyed would need to

observe a very large number of messages)observe a very large number of messages) choose hash function used based on speed choose hash function used based on speed

verses security constraintsverses security constraints Even broken hash functions (like MD5) can Even broken hash functions (like MD5) can

be used in HMAC.be used in HMAC.

Page 21: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Using Symmetric Ciphers for Using Symmetric Ciphers for MACsMACs

can use any block cipher chaining mode can use any block cipher chaining mode and use final block as a MACand use final block as a MAC

Data Authentication Algorithm (DAA)Data Authentication Algorithm (DAA) is is a widely used MAC based on DES-CBCa widely used MAC based on DES-CBC using IV=0 and zero-pad of final blockusing IV=0 and zero-pad of final block encrypt message using DES in CBC modeencrypt message using DES in CBC mode and send just the final block as the MACand send just the final block as the MAC

• or the leftmost M bits (16or the leftmost M bits (16≤M≤64) of final block≤M≤64) of final block

but final MAC is now too small for securitybut final MAC is now too small for security

Page 22: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Data Authentication AlgorithmData Authentication Algorithm

Page 23: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

CMACCMAC

previously saw the DAA (CBC-MAC)previously saw the DAA (CBC-MAC) widely used in govt & industrywidely used in govt & industry but has message size limitationbut has message size limitation can overcome using 2 keys & paddingcan overcome using 2 keys & padding thus forming the Cipher-based Message thus forming the Cipher-based Message

Authentication Code (CMAC)Authentication Code (CMAC) adopted by NIST SP800-38Badopted by NIST SP800-38B

Page 24: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

CMAC OverviewCMAC Overview

Page 25: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Authenticated Encryption: Authenticated Encryption: CCM and GCMCCM and GCM

Counter with Cipher Block Chaining-Message Counter with Cipher Block Chaining-Message Authentication Code, abbreviated CCM, that can provide Authentication Code, abbreviated CCM, that can provide assurance of the confidentiality and authenticity of data.assurance of the confidentiality and authenticity of data.

CCM is based on an approved symmetric key block CCM is based on an approved symmetric key block cipher algorithm whose block size is 128 bits, such as cipher algorithm whose block size is 128 bits, such as the Advanced Encryption Standard (AES)the Advanced Encryption Standard (AES)

CCM cannot be used with the Triple Data Encryption CCM cannot be used with the Triple Data Encryption Algorithm (3DES)Algorithm (3DES)

CCM is intended for use in a packet environment, i.e., CCM is intended for use in a packet environment, i.e., when all of the data is available in storage before CCM is when all of the data is available in storage before CCM is applied; applied;

Page 26: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Authenticated Encryption: Authenticated Encryption: CCM and GCMCCM and GCM

CCM is not designed to support partial processing or CCM is not designed to support partial processing or stream processing.stream processing.

The input to CCM includes three elements: The input to CCM includes three elements: 1) data that will be both authenticated and encrypted, called the 1) data that will be both authenticated and encrypted, called the

payload; payload; 2) associated data, e.g., a header, that will be authenticated but 2) associated data, e.g., a header, that will be authenticated but

not encrypted; and not encrypted; and 3) a unique value, called a nonce, that is assigned to the 3) a unique value, called a nonce, that is assigned to the

payload and the associated datapayload and the associated data

Page 27: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Authenticated Encryption: Authenticated Encryption: CCM and GCMCCM and GCM

CCM consists of two related processes: CCM consists of two related processes: generation-encryption and generation-encryption and decryption-verification, decryption-verification,

which combine two cryptographic primitives: counter which combine two cryptographic primitives: counter mode encryption and cipher block chaining-based mode encryption and cipher block chaining-based authentication.authentication.

Only the forward cipher function of the block cipher Only the forward cipher function of the block cipher algorithm is used within these primitives.algorithm is used within these primitives.

Page 28: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

CCM (generic description,, CCM (generic description,, without details)without details)

Page 29: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Page 30: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

CCM use and criticismCCM use and criticism

In many standards of wireless networks such as In many standards of wireless networks such as IEEE 802.11 [22] (WiFi), IEEE 802.11 [22] (WiFi), IEEE 802.15.40 (Wireless Personal Area IEEE 802.15.40 (Wireless Personal Area

Network/ZigBee)Network/ZigBee)

CCM is not on-line, CCM is not on-line, CCM disrupts word-alignment, CCM disrupts word-alignment, CCM can’t preprocess static associated data,CCM can’t preprocess static associated data, The main issue is that CCM is not on-line since The main issue is that CCM is not on-line since

the sender has to know the length of the message the sender has to know the length of the message before the beginning of the encryption.before the beginning of the encryption.

Page 31: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

GCM (Galois/Counter Mode)GCM (Galois/Counter Mode)

NIST SP 800-38DNIST SP 800-38D The two functions that comprise GCM: The two functions that comprise GCM:

authenticated encryption and authenticated encryption and authenticated decryption. authenticated decryption.

GCM requires one block cipher operation and one GCM requires one block cipher operation and one 128-bit multiplication in GF(2128-bit multiplication in GF(2128128) per each block ) per each block (128 bit) of encrypted and authenticated data. (128 bit) of encrypted and authenticated data.

Intel in the newest CPUs has added the Intel in the newest CPUs has added the PCLMULQDQ instruction, highlighting its use for PCLMULQDQ instruction, highlighting its use for GCMGCM

Page 32: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

GCM (Galois/Counter Mode)GCM (Galois/Counter Mode)

GHASHH(X1 || X2 || … ||Xm) = Ym

Multiplication in a field GF(2128) with a block H.

Page 33: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

GCM (Galois/Counter Mode)GCM (Galois/Counter Mode)

Counter modeCounter mode

Page 34: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Page 35: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

GCM (Galois/Counter Mode)GCM (Galois/Counter Mode)

Counter modeCounter mode

GHASHGHASH

Page 36: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

GCM (Galois/Counter Mode)GCM (Galois/Counter Mode)

GCM mode is used in GCM mode is used in IEEE 802.1AE (MACsec) Ethernet security,IEEE 802.1AE (MACsec) Ethernet security, ANSI (INCITS) Fibre Channel Security ANSI (INCITS) Fibre Channel Security

Protocols (FC-SP), Protocols (FC-SP), IEEE P1619.1 tape storage, IEEE P1619.1 tape storage, IETF IPsec standards, IETF IPsec standards, SSH and TLS/SSL SSH and TLS/SSL AES-GCM is included into the NSA Suite B AES-GCM is included into the NSA Suite B

CryptographyCryptography

Page 37: Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

SummarySummary

have considered:have considered: MACMAC HMAC authentication using hash functionHMAC authentication using hash function CMAC authentication using a block cipherCMAC authentication using a block cipher CCMCCM GCMGCM


Recommended