Message Authentication and Hash Functions Chapter 11.

Slides:



Advertisements
Similar presentations
Chapter 3 Public Key Cryptography and Message authentication.
Advertisements

Sri Lanka Institute of Information Technology
Digital Signatures and Hash Functions. Digital Signatures.
Information Security Principles & Applications Topic 4: Message Authentication 虞慧群
Message Authentication and Hash functions
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown and edited by Archana Chidanandan Cryptographic Tools.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
Information Security and Management 11
Henric Johnson1 Chapter3 Public-Key Cryptography and Message Authentication Henric Johnson Blekinge Institute of Technology, Sweden
Cryptography and Network Security Chapter 11. Chapter 11 – Message Authentication and Hash Functions At cats' green on the Sunday he took the message.
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Authentication & digital signature Jen-Chang Liu Adapted from lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings Lecture slides by Lawrie Brown/Mod. & S. Kondakci.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
Network Security. Contents Security Requirements and Attacks Confidentiality with Conventional Encryption Message Authentication and Hash Functions Public-Key.
Network Security Sorina Persa Group 3250 Group 3250.
1 Message Authentication and Hash Functions Authentication Requirements Authentication Functions Message Authentication Codes Hash Functions Security of.
CRYPTOGRAPHIC DATA INTEGRITY ALGORITHMS
Network Security Essentials Fifth Edition by William Stallings Fifth Edition by William Stallings.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Lecture 2: Message Authentication Anish Arora CSE5473 Introduction to Network Security.
PULIC –KEY CRYPTOGRAPHY AND MESSAGE AUTHENTICATION.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Public-Key Cryptography and Message Authentication Ola Flygt Växjö University, Sweden
MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
Message Authentication  message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating.
Information Security Principles Assistant Professor Dr. Sana’a Wafa Al-Sayegh 1 st Semester ITGD 2202 University of Palestine.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
1 Chapter 11: Message Authentication and Hash Functions Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal,
Message Authentication Requirements Disclosure Release of message contents to any person or process not possessing the appropriate cryptographic key Traffic.
Hash Functions A hash function H accepts a variable-length block of data M as input and produces a fixed-size hash value h = H(M) Principal object is.
Network Security. Security Threats 8Intercept 8Interrupt 8Modification 8Fabrication.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
4 th lecture.  Message to be encrypted: HELLO  Key: XMCKL H E L L O message 7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message + 23 (X) 12 (M) 2 (C) 10 (K) 11.
Fall 2002CS 395: Computer Security1 Chapter 11: Message Authentication and Hash Functions.
Network Security David Lazăr.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
Chapter 11 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Message Authentication and Hash Functions K. U. Khimani Asst. Prof. IT Dept. VVP Engineering College.
MESSAGE AUTHENTICATION and HASH FUNCTIONS - Chapter 11 MESSAGE AUTHENTICATION and HASH FUNCTIONS - Chapter 11 Masquerade – message insertion, fraud, ACK.
1 Message Authentication and Hash Functions G 何采宭.
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Cryptography and Network Security (CS435) Part Nine (Message Authentication)
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
1 Public Key Cryptography. 2 Public Key Cryptography Agenda: Message authentication – authentication codes and hash functions Public key encryption –
Dr. Nermin Hamza.  Attacks:  Traffic Analysis : traffic analysis occurs when an eavesdroppers observes message traffic on network. Not understand the.
Information and Network Security Dr. Hadi AL Saadi Message Authentication and Hash Functions.
@Yuan Xue 285: Network Security CS 285 Network Security Message Authentication Code Data integrity + Source authentication.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
Message Authentication Code
Cryptographic Hash Function
CSCE 715: Network Systems Security
Message Authentication and Hash Functions
Message Authentication and Hash Functions
Chapter 11 – Message Authentication and Hash Functions
Message Authentication and Hash Functions
NETW4005 COMPUTER SECURITY - A
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
CRYPTOGRAPHY & NETWORK SECURITY
Presentation transcript:

Message Authentication and Hash Functions Chapter 11

2 Contents Authentication Requirements Authentication Functions  Message Encryption  Message Authentication Code  Hash Function Message Authentication Codes Hash Functions Security of Hash Functions and MACs

3 Authentication Requirements Attacks  Disclosure  Release of message contents  Traffic analysis  Discovery of the pattern of traffic between parties.  Masquerade  Insertion of messages into the network from a fraudulent source.  Content modification  Changes to the contents of a message.

4 Authentication Requirements  Sequence modification  Any modification to a sequence of messages between parties.  Timing modification  Delay or replay of messages.  Source repudiation  Denial of transmission of message by source.  Destination repudiation  Denial of receipt of message by destination.

5 Authentication Requirements Disclosure and traffic analysis can be prevented by providing message confidentiality. Masquerade, content / sequence / timing modification can be prevented by providing message authentication. Source repudiation can be prevented by providing digital signatures. Destination repudiation can be prevented by a combined use of digital signatures and a protocol designed to counter this attack.

6 Authentication Requirements Message authentication is a procedure to verify that received messages come from the alleged source and have not been altered. Message authentication also verify sequencing and timeliness. Digital signature is an authentication technique that also includes measures to counter source repudiation.

7 Authentication Functions Authentication functions that produce an authenticator.  Message encryption  Symmetric encryption  Public-key encryption  Message authentication code (MAC)  Hash function

8 Message Encryption: Symmetric Encryption Symmetric encryption  A message M transmitted from A to B is encrypted using a secret key K shared by A and B.  If no other party knows the key, then confidentiality is provided.  In addition, B is assured that the message was generated by A.  Because A is the only other party that possesses K.  So, symmetric encryption provides authentication as well as confidentiality.

9 Message Encryption: Symmetric Encryption Authentication of a message at destination B.  B decrypts the incoming message X (Y = D K (X)).  If X is the ciphertext of a legitimate message, Y will be a meaningful plaintext M.  Otherwise, Y will likely be a meaningless bit sequence. If the message M can be any arbitrary bit pattern, the previous authentication cannot work.  If M can be any bit pattern, then regardless of the value X, Y = D K (X) is some bit pattern.  Therefore it must be accepted as authentic plaintext.

10 Message Encryption: Symmetric Encryption Thus, in general, only a small subset of all possible bit patterns be considered legitimate plaintext.  Suppose that only one bit pattern in 10 6 is legitimate plaintext. Then, the probability that any randomly chosen bit pattern will be decrypted to a legitimate plaintext mesasge is only  For example, suppose that we are transmitting English-lauguage messages using a Caesar cipher with K = 1.  nbsftfbupbutboeepftf….  mareseatoatsanddoes…  We are assured the message is legitimate because it is readable.

11 Message Encryption: Symmetric Encryption However, readability check is not easy to be automated. So, there may need to be some automated means of determining at B whether Y is legitimate plaintext. A simple frequency analysis can be automated. However, if the plaintext is binary string, automatic plaintext check is difficult.

12 Message Encryption: Symmetric Encryption One solution to this problem is append an error-detecting code, to each message before encryption.  Known as a frame check sequence (FCS) or checksum.  A prepares a plaintext message M.  Then A provides this as input to a function F that produces an FCS.  The FCS is appended to M and the entire block is then encrypted.  B decrypts the incoming block.  Then B applies the same function F to attempt to reproduce the FCS.  If the calculated FCS is equal to the incoming FCS, then the message is considered authentic.

13 Message Encryption: Symmetric Encryption The order of the FCS and encryption functions is critical.  With internal error control, an opponent would have difficulty generating ciphertext that, when decrypted, would have valid error control bits.  With external error control, an opponent can construct messages with valid error-control code.  Although the opponent cannot know what the decrypted plaintext will be, he or she can still hope to create confusion and disrupt operations.

14 Message Encryption: Symmetric Encryption Another example is the structure of messages transmitted using the TCP/IP protocol architecture.  One could simply encrypt the datagram except the IP header.  If an opponent substituted some arbitrary bit pattern for the encrypted TCP segment, the resulting plaintext would not include a meaningful header.

15 Message Encryption: Symmetric Encryption  The header includes a checksum and the sequence number.  Because TCP segments are numbered sequentially, encryption assures that an opponent does not delay, misorder, or delete any segments.

16 Message Encryption: Public-key Encryption Public-key encryption  A uses the public key KU b of B to encrypt M.  This scheme provides no authentication because any opponent could also use B ’s public key to encrypt a message, claiming to be A.  This scheme provides confidentiality.

17 Message Encryption: Public-key Encryption To provide authentication, A uses its private key to encrypt the message, and B uses A ’s public key to decrypt.  The message must have come from A because A is the only party that possesses KR a.  As before, there must be some internal structure to the plaintext so that the receiver can distinguish between well-formed plaintext and random bits.

18 Message Encryption: Public-key Encryption It also provides what is known as digital signature.  Only A could have constructed the ciphertext because only A possesses KR a.  Not even B (the recipient) could have constructed the ciphertext.  In effect, A has “signed” the message by using its private key to encrypt. This scheme does not provide confidentiality.  Anyone in possession of A ’s public key can decrypt the ciphertext.

19 Message Encryption: Public-key Encryption To provide both confidentiality and authentication, A can encrypt M first using its private key and then using B ’s public key. Disadvantage  This public-key algorithm must be exercised four times rather than two in each communication.

20 Authentication Functions Authentication functions that produce an authenticator.  Message encryption  Symmetric encryption  Public-key encryption  Message authentication code (MAC)  Hash function

21 Message Authentication Code An alternative authentication technique involves the use of a secret key to generate a small fixed-size block of data, known as a cryptographic checksum or MAC that is appended to the message.  This technique assumes that two communicating parties share a common secret key K.  When A has a message to send to B, it calculates the MAC as a function of the message.

22 Message Authentication Code  The message plus MAC are transmitted to B.  B performs the same calculation on the received message, using the same secret key, to generate a new MAC.  The received MAC is compared to the calculated MAC.

23 Message Authentication Code Since only the receiver and sender know the secret key, if the received MAC matches the calculated MAC,  The receiver is assured that the message has not been altered.  The receiver is assured that the message is from the alleged sender.  If the message includes a sequence number, then the receiver can be assured of the proper sequence because an attacker cannot alter the sequence number.

24 Message Authentication Code A MAC function is similar to encryption except that the MAC algorithm need not be reversible.  Decryption is not required. So, the MAC function is usually a many-to-one function.  The domain is the set of messages of some arbitrary length.  The range is the set of MACs of a fixed-length.  For example, messages can be of arbitrary length and we have only 10-bit MAC.

25 Message Authentication Code Confidentiality can be provided by performing message encryption either after or before the MAC algorithm.  Two separate keys are needed, each of which is shared by the sender and the receiver.  Authenticating the plaintext is preferable.

26 Message Authentication Code Because symmetric encryption will provide authentication and it is widely used with readily available products, why not simply use this instead of a separate message authentication code?  In general, MAC checking is faster than decryption. So, if confidentiality is not necessary, MAC is preferred.  MAC checking can be bypassed for efficiency while decryption cannot. The MAC does not provide a digital signature because both sender and receiver share the same key.

27 Hash Function Hash function  Input: A variable-size message M  Output: A fixed-size bit string, referred to as a hash code H(M).  The hash code is also referred to as a message digest or hash value. Unlike a MAC, a hash code does not use a key. A change to any bit or bits in the message results in a change to the hash code.

28 Hash Function Message authentication by hash function  The message plus concatenated hash code is encrypted using symmetric encryption.  Because only A and B share the secret key, the message must have come from A and has not been altered.  Because encryption is applied to the entire message plus hash code, confidentiality is also provided.

29 Hash Function Only the has code is encrypted, using symmetric encryption.  This reduces the processing burden for those applications that do not require confidentiality.  Note that the combination of hashing and encryption results in a MAC. Because E K [H(M)] is a fixed-size output that is secure against an opponent who does not know the secret key.

30 Hash Function Only the has code is encrypted, using public-key encryption and using the sender’s private key.  This provides authentication.  It also provides a digital signature, because only the sender could have produced the encrypted hash code.  This is the essence of the digital signature technique.

31 Hash Function If confidentiality as well as a digital signature is desired, then the message plus the private-key-encrypted hash code can be encrypted using a symmetric secret key.

32 Hash Function It is possible to use a hash function without encryption.  Assume that the two communicating parties share a common secret value S.  A computes the hash value over the concatenation of M and S and appends the resulting hash value to M.  B can verify the hash value because it knows S but an opponent cannot modify a message and cannot generate a false message.

33 Hash Function Confidentiality can be added to the approach of (e) by encrypting the entire message plus the hash code.

34 Contents Authentication Requirements Authentication Functions  Message Encryption  Message Authentication Code  Hash Function Message Authentication Codes Hash Functions Security of Hash Functions and MACs

35 Message Authentication Codes A MAC is generated by a function C of the form  M is a variable-length message.  K is a secret key shared only by sender and receiver.  C K (M) is the fixed-length authenticator. A MAC is a many-to-one function.  Potentially many messages have same MAC.  But finding these needs to be very difficult. MAC = C K (M)

36 Requirements for MACs Need the MAC to satisfy the following:  Knowing a message and MAC, is infeasible to find another message with same MAC  MACs should be uniformly distributed  MAC should depend equally on all bits of the message

37 Message Authentication Code Based on DES One of the most widely used MACs, referred to as the Data Authentication Algorithm, is based on DES. Using the cipher block chaining (CBC) mode of operation of DES with an initialization vector of zero. The data to be authenticated are grouped into contiguous 64- bit blocks : D 1, D 2, …, D N.  If necessary, the final block is padded on the right with zeroes to form a full 64-bit block.

38 Message Authentication Code Based on DES Using the DES encryption algorithm, E, and a secret key, K, a data authentication code (DAC) is calculated as follow.

39 Message Authentication Code Based on DES Data Authentication Algorithm.

40 Hash Function A hash value h is generated by a function H of the form  M is a variable-length message and H(M) is the fixed-length hash value.

41 Hash Function The purpose of a hash function is to produce a “fingerprint” of a file, message, or other block of data. Properties  H can be applied to a block of data of any size.  H produces a fixed-length output.  H(x) is easy to compute for any given x, making both hardware and software implementations practical.  For any given value h, it is infeasible to find x such that H(x) = h.  The one-way property  For any given block x, it is infeasible to find y ≠ x with H(y) = H(x).  Weak collision resistance  It is infeasible to find any pair (x, y) such that H(x) = H(y).  Strong collision resistance

42 Simple Hash Function One of the simplest hash functions is the bit-by-bit XOR of every block.  C i = i th bit of the hash code, 1 ≤ i ≤ n.  m = number of n -bit blocks in the input.  b ij = i th bit in j th block.  XOR operation.

43 Simple Hash Function Simple hash function using bitwise XOR.

44 Simple Hash Function For example, in most normal text files, the high-order bit of each octet is always zero. So if a 128-bit hash value is used, instead of an effectiveness of , the hash function on this type of data has an effectiveness of

45 Simple Hash Function A simple way to improve matters is to perform a one-bit circular shift, or rotation, on the hash value after each block is processed.

46 Simple Hash Function Although a simple XOR or rotated XOR is insufficient if only the hash code is encrypted, you may still feel that such a simple function could be useful when the message as well as the hash code are encrypted. But be careful. We define the scheme as follows  Used the simple XOR applied to 64-bit blocks of the message and then an encryption of the entire message that used the CBC mode.  Given a message consisting of a sequence of 64-bit blocks X 1, X 2, …, X N.  Define the hash code C as the block-by-block XOR of all blocks.  Append the hash code as the final block.

47 Simple Hash Function  Next, encrypt the entire message plus hash code, using CBC mode to produce the encrypted message Y 1, Y 2, …, Y N+1.  By the definition of CBC  But X N+1 is the hash code  Because the terms in the preceding equation can be XORed in any order, it follows that the hash code would not change if the ciphertext blocks were permuted.