Spring 2010: CS419 Computer Security

Similar documents
CSCE 715: Network Systems Security

Cryptography and Network Security

Cryptography and Network Security Chapter 12. Message Authentication. Message Security Requirements. Public Key Message Encryption

e-pgpathshala Subject : Computer Science Paper: Cryptography and Network Security Module: Hash Algorithm Module No: CS/CNS/28 Quadrant 1 e-text

Security Requirements

Unit III. Chapter 1: Message Authentication and Hash Functions. Overview:

Cryptography and Network Security Chapter 13. Digital Signatures & Authentication Protocols

Digests Requirements MAC Hash function Security of Hash and MAC Birthday Attack MD5 SHA RIPEMD Digital Signature Standard Proof of DSS

Introduction to Network Security Missouri S&T University CPE 5420 Data Integrity Algorithms

Digital Signature. Raj Jain

Lecture 1 Applied Cryptography (Part 1)

Cryptography and Network Security Chapter 13. Fourth Edition by William Stallings. Lecture slides by Lawrie Brown

Contents Digital Signatures Digital Signature Properties Direct Digital Signatures

UNIT III 3.1DISCRETE LOGARITHMS

1. Digital Signatures 2. ElGamal Digital Signature Scheme 3. Schnorr Digital Signature Scheme 4. Digital Signature Standard (DSS)

A hash function is strongly collision-free if it is computationally infeasible to find different messages M and M such that H(M) = H(M ).

The most important development from the work on public-key cryptography is the digital signature. Message authentication protects two parties who

CS408 Cryptography & Internet Security

Data Integrity. Modified by: Dr. Ramzi Saifan

Message Authentication Codes and Cryptographic Hash Functions

Computer Security: Principles and Practice

Data Integrity & Authentication. Message Authentication Codes (MACs)

Data Integrity & Authentication. Message Authentication Codes (MACs)

Lecture 5. Cryptographic Hash Functions. Read: Chapter 5 in KPS

Lecture 5. Cryptographic Hash Functions. Read: Chapter 5 in KPS

Overview of Security Principles

Cryptography and Network Security. Sixth Edition by William Stallings

CSE 127: Computer Security Cryptography. Kirill Levchenko

Distributed Systems. 26. Cryptographic Systems: An Introduction. Paul Krzyzanowski. Rutgers University. Fall 2015

Chapter 6. New HASH Function. 6.1 Message Authentication. Message authentication is a mechanism or service used for verifying

Public Key (asymmetric) Cryptography

Computer Security. 08. Cryptography Part II. Paul Krzyzanowski. Rutgers University. Spring 2018

Winter 2011 Josh Benaloh Brian LaMacchia

ECE 646 Lecture 11. Hash functions & MACs. Digital Signature. message. hash. function. Alice. Bob. Alice s public key. Alice s private key

Integrity of messages

Hash Function. Guido Bertoni Luca Breveglieri. Fundations of Cryptography - hash function pp. 1 / 18

Message authentication. Why message authentication. Authentication primitives. and secure hashing. To prevent against:

S. Erfani, ECE Dept., University of Windsor Network Security. All hash functions operate using the following general principles:

Message Authentication and Hash function

Network and System Security

9/30/2016. Cryptography Basics. Outline. Encryption/Decryption. Cryptanalysis. Caesar Cipher. Mono-Alphabetic Ciphers

Digital Signatures. Luke Anderson. 7 th April University Of Sydney.

The question paper contains 40 multiple choice questions with four choices and students will have to pick the correct one (each carrying ½ marks.).

CRYPTOGRAPHY AND NETWROK SECURITY-QUESTION BANK

Computer Security 3/23/18

Cryptography. Summer Term 2010

Cryptographic Hash Functions

Public Key Cryptography

Public Key Algorithms

Cryptography Basics. IT443 Network Security Administration Slides courtesy of Bo Sheng

Crypto Basics. Recent block cipher: AES Public Key Cryptography Public key exchange: Diffie-Hellmann Homework suggestion

Security: Cryptography

CSE 3461/5461: Introduction to Computer Networking and Internet Technologies. Network Security. Presentation L

Computer Security. 10r. Recitation assignment & concept review. Paul Krzyzanowski. Rutgers University. Spring 2018

Encryption. INST 346, Section 0201 April 3, 2018

Cryptographic Hash Functions. Rocky K. C. Chang, February 5, 2015

Lecture 2 Applied Cryptography (Part 2)

CSCI 454/554 Computer and Network Security. Topic 4. Cryptographic Hash Functions

ISA 662 Internet Security Protocols. Outline. Prime Numbers (I) Beauty of Mathematics. Division (II) Division (I)

Outline. Hash Function. Length of Hash Image. AIT 682: Network and Systems Security. Hash Function Properties. Question

Outline. AIT 682: Network and Systems Security. Hash Function Properties. Topic 4. Cryptographic Hash Functions. Instructor: Dr.

APNIC elearning: Cryptography Basics

Computer Security. 08r. Pre-exam 2 Last-minute Review Cryptography. Paul Krzyzanowski. Rutgers University. Spring 2018

P2_L8 - Hashes Page 1

Cryptography V: Digital Signatures

Introduction to Software Security Hash Functions (Chapter 5)

Summary on Crypto Primitives and Protocols

CS 645 : Lecture 6 Hashes, HMAC, and Authentication. Rachel Greenstadt May 16, 2012

KALASALINGAM UNIVERSITY

Computer Networks. Wenzhong Li. Nanjing University

Unit 8 Review. Secure your network! CS144, Stanford University

Cryptography MIS

Public Key Algorithms

Cryptographic Hash Functions

A hash function is strongly collision-free if it is computationally infeasible to find different messages M and M such that H(M) = H(M ).

Security. Communication security. System Security

Symmetric, Asymmetric, and One Way Technologies

Lecture 4: Authentication and Hashing

Cryptography V: Digital Signatures

ENEE 459-C Computer Security. Message authentication

Lecture 6: Symmetric Cryptography. CS 5430 February 21, 2018

CSC 474/574 Information Systems Security

Public Key Cryptography

(a) Symmetric model (b) Cryptography (c) Cryptanalysis (d) Steganography

NIST Cryptographic Toolkit

Lecture 18 Message Integrity. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017 Slides from Miller & Bailey s ECE 422

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Introduction to Cryptography ECE 597XX/697XX

L13. Reviews. Rocky K. C. Chang, April 10, 2015

Chapter 3 Block Ciphers and the Data Encryption Standard

Hashes, MACs & Passwords. Tom Chothia Computer Security Lecture 5

n-bit Output Feedback

EEC-682/782 Computer Networks I

Lecture 4: Hashes and Message Digests,

David Wetherall, with some slides from Radia Perlman s security lectures.

Symmetric Encryption Algorithms

CS Computer Networks 1: Authentication

Cryptographic Hash Functions

Lecture 1: Course Introduction

1.264 Lecture 28. Cryptography: Asymmetric keys

Introduction to Cryptography. Lecture 6

Transcription:

Spring 2010: CS419 Computer Security MAC, HMAC, Hash functions and DSA Vinod Ganapathy Lecture 6

Message Authentication message authentication is concerned with: protecting the integrity of a message validating identity of originator non repudiation of origin (dispute resolution) will consider the security requirements then three alternative functions used: message encryption message authentication code (MAC) hash function

Security Requirements disclosure traffic analysis masquerade content modification sequence modification timing modification source repudiation destination repudiation

Message Encryption message encryption by itself also provides a measure of authentication if symmetric encryption is used then: receiver know sender must have created it since only sender and receiver now key used know content cannot of been altered if message has suitable structure, redundancy or a checksum to detect any changes

Message Encryption if public key encryption is used: encryption provides no confidence of sender since anyone potentially knows public key however if sender signs message using their private key then encrypts with recipients public key have both secrecy and authentication again need to recognize corrupted messages but at cost of two public key uses on message

Message Authentication Code (MAC) generated by an algorithm that creates a small fixed sized block depending on both message and some key like encryption though need not be reversible appended to message as a signature receiver performs same computation on message and checks it matches the MAC provides assurance that message is unaltered and comes from sender

Message Authentication Codes

Message Authentication Codes as shown the MAC provides authentication can also use encryption for secrecy generally use separate keys for each can compute MAC either before or after encryption is generally regarded as better done before why use a MAC? sometimes only authentication is needed sometimes need authentication to persist longer than the encryption (eg. archival use) note that a MAC is not a digital signature

MAC Properties a MAC is a cryptographic checksum MAC = C K (M) condenses a variable length message M using a secret key K to a fixed sized authenticator is a many to one function potentially many messages have same MAC but finding these needs to be very difficult

Requirements for MACs taking into account the types of attacks need the MAC to satisfy the following: 1. knowing a message and MAC, is infeasible to find another message with same MAC 2. MACs should be uniformly distributed 3. MAC should depend equally on all bits of the message

Using Symmetric Ciphers for MACs can use any block cipher 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 but final MAC is now too small for security

Digital Signatures have looked at message authentication but does not address issues of lack of trust digital signatures provide the ability to: verify author, date & time of signature authenticate message contents be verified by third parties to resolve disputes hence include authentication function with additional capabilities

Digital Signature Properties must depend on the message signed must use information unique to sender to prevent both forgery and denial must be relatively easy to produce must be relatively easy to recognize & verify be computationally infeasible to forge with new message for existing digital signature with fraudulent digital signature for given message be practical save digital signature in storage

Direct Digital Signatures involve only sender & receiver assumed receiver has sender s public key digital signature made by sender signing entire message or hash with private key can encrypt using receivers public key important that sign first then encrypt message & signature security depends on sender s private key

Digital Signature Standard (DSS) US Govt approved signature scheme FIPS 186 uses the SHA hash algorithm designed by NIST & NSA in early 90's DSS is the standard, DSA is the algorithm creates a 320 bit signature, but with 512 1024 bit security security depends on difficulty of computing discrete logarithms

Digital Signature Standard (DSS) US Govt approved signature scheme designed by NIST & NSA in early 90's published as FIPS 186 in 1991 revised in 1993, 1996 & then 2000 uses the SHA hash algorithm DSS is the standard, DSA is the algorithm FIPS 186 2 (2000) includes alternative RSA & elliptic curve signature variants

Digital Signature Algorithm (DSA) creates a 320 bit signature with 512 1024 bit security smaller and faster than RSA a digital signature scheme only security depends on difficulty of computing discrete logarithms variant of ElGamal & Schnorr schemes

Digital Signature Algorithm (DSA)

Digression Primitive Roots from Euler s theorem have a ø(n) mod n=1 consider a m =1 (mod n), GCD(a,n)=1 must exist for m = ø(n) but may be smaller once powers reach m, cycle will repeat if smallest is m = ø(n) then a is called a primitive root if p is prime, then successive powers of a "generate" the group mod p these are useful but relatively hard to find

Digression Discrete Logarithms the inverse problem to exponentiation is to find the discrete logarithm of a number modulo p that is to find x such that y = g x (mod p) this is written as x = log g y (mod p) if g is a primitive root then it always exists, otherwise it may not, eg. x = log 3 4 mod 13 has no answer x = log 2 3 mod 13 = 4 by trying successive powers whilst exponentiation is relatively easy, finding discrete logarithms is generally a hard problem

DSA Key Generation have shared global public key values (p,q,g): choose q, a 160 bit choose a large prime p = 2 L where L= 512 to 1024 bits and is a multiple of 64 and q is a prime factor of (p 1) choose g = h (p 1)/q where h<p 1, h (p 1)/q (mod p) > 1 users choose private & compute public key: choose x<q compute y = g x (mod p)

DSA Signature Creation to sign a message M the sender: generates a random signature key k, k<q nb. k must be random, be destroyed after use, and never be reused then computes signature pair: r = (g k (mod p))(mod q) s = k 1.(H(M)+ x.r)(mod q) sends signature (r,s) with message M

DSA Signature Verification having received M & signature (r,s) to verify a signature, recipient computes: w = s 1 (mod q) u1= (H(M).w)(mod q) u2= (r.w)(mod q) v = (g u1.y u2 (mod p)) (mod q) if v=r then signature is verified Why?

Hash Algorithms Hash Functions condense arbitrary size message to fixed size by processing message in blocks through some compression function either custom or block cipher based Examples: MD4, MD5, SHA1

Secure Hash Functions

Message Auth

Hash Function Requirements applied to any size data H produces a fixed length output. H(x) is relatively easy to compute for any given x one way property computationally infeasible to find x such that H(x) = h weak collision resistance computationally infeasible to find y x such that H(y) = H(x) strong collision resistance computationally infeasible to find any pair (x, y) such that H(x) = H(y)

Hash Algorithms see similarities in the evolution of hash functions & block ciphers increasing power of brute force attacks leading to evolution in algorithms from DES to AES in block ciphers from MD4 & MD5 to SHA 1 & RIPEMD 160 in hash algorithms likewise tend to use common iterative structure as do block ciphers

MD5 designed by Ronald Rivest (the R in RSA) latest in a series of MD2, MD4 produces a 128 bit hash value until recently was the most widely used hash algorithm in recent times have both brute force & cryptanalytic concerns specified as Internet standard RFC1321

MD5 Overview 1. pad message so its length is 448 mod 512 2. append a 64 bit length value to message 3. initialize 4 word (128 bit) MD buffer (A,B,C,D) 4. process message in 16 word (512 bit) blocks: using 4 rounds of 16 bit operations on message block & buffer add output to buffer input to form new buffer value 5. output hash value is the final buffer value

MD5 Overview

MD5 Compression Function each round has 16 steps of the form: a = b+((a+g(b,c,d)+x[k]+t[i])<<<s) a,b,c,d refer to the 4 words of the buffer, but used in varying permutations note this updates 1 word only of the buffer after 16 steps each word is updated 4 times where g(b,c,d) is a different nonlinear function in each round (F,G,H,I) T[i] is a constant value derived from sin

MD5 Compression Function

MD4 precursor to MD5 also produces a 128 bit hash of message has 3 rounds of 16 steps vs 4 in MD5 design goals: collision resistant (hard to find collisions) direct security (no dependence on "hard" problems) fast, simple, compact favours little endian systems (eg PCs)

Strength of MD5 MD5 hash is dependent on all message bits Rivest claims security is good as can be known attacks are: Berson 92 attacked any 1 round using differential cryptanalysis (but can t extend) Boer & Bosselaers 93 found a pseudo collision (again unable to extend) Dobbertin 96 created collisions on MD compression function (but initial constants prevent exploit) Wang et al. 04 created collisions on entire MD5 in less than one hour using an IBM p960 cluster

Secure Hash Algorithm (SHA 1) SHA was designed by NIST & NSA in 1993, revised 1995 as SHA 1 US standard for use with DSA signature scheme standard is FIPS 180 1 1995, also Internet RFC3174 nb. the algorithm is SHA, the standard is SHS produces 160 bit hash values now the generally preferred hash algorithm based on design of MD4 with key differences

SHA Overview 1. pad message so its length is 448 mod 512 2. append a 64 bit length value to message 3. initialize 5 word (160 bit) buffer (A,B,C,D,E) to (67452301,efcdab89,98badcfe,10325476,c3d2e1f0) 5. process message in 16 word (512 bit) chunks: expand 16 words into 80 words by mixing & shifting use 4 rounds of 20 bit operations on message block & buffer add output to input to form new buffer value 6. output hash value is the final buffer value

SHA 1 Compression Function each round has 20 steps which replaces the 5 buffer words thus: (A,B,C,D,E) < (E+f(t,B,C,D)+(A<<5)+W t +K t ),A,(B<<30),C,D) a,b,c,d refer to the 4 words of the buffer t is the step number f(t,b,c,d) is nonlinear function for round W t is derived from the message block K t is a constant value derived from sin

SHA 1 Compression Function

SHA 1 verses MD5 brute force attack is harder (160 vs 128 bits for MD5) not vulnerable to any known attacks (compared to MD4/5) a little slower than MD5 (80 vs 64 steps) both designed as simple and compact optimized for big endian CPU's (vs MD5 which is optimised for little endian CPU s)

Keyed Hash Functions as MACs want a MAC based on a hash function because hash functions are generally faster code for crypto hash functions widely available hash includes a key along with message original proposal: KeyedHash = Hash(Key Message) some weaknesses were found with this eventually led to development of HMAC

HMAC Overview

HMAC specified as Internet standard RFC2104 uses hash function on the message: HMAC K = Hash[(K + XOR opad) Hash[(K + XOR ipad) M)]] where K + is the key padded out to size and opad, ipad are specified padding constants overhead is just 3 more hash calculations than the message needs alone any hash function can be used eg. MD5, SHA 1, RIPEMD 160, Whirlpool

HMAC Security proved security of HMAC relates to that of the underlying hash algorithm attacking HMAC requires either: brute force attack on key used birthday attack (but since keyed would need to observe a very large number of messages) choose hash function used based on speed verses security constraints