cryptography and network
play

Cryptography and Network Codes Security At cats' green on the - PDF document

4/19/2010 Chapter 12 Message Authentication Cryptography and Network Codes Security At cats' green on the Sunday he took the message from the Chapter 12 inside of the pillar and added Peter Moran's name to the two names already printed


  1. 4/19/2010 Chapter 12 – Message Authentication Cryptography and Network Codes Security • At cats' green on the Sunday he took the message from the Chapter 12 inside of the pillar and added Peter Moran's name to the two names already printed there in the "Brontosaur" code. The message now read: “Leviathan to Dragon: Martin Hillman, Trevor Allan Peter Moran observe and tail ” What was the Trevor Allan, Peter Moran: observe and tail.” What was the good of it John hardly knew. He felt better, he felt that at last Fifth Edition he had made an attack on Peter Moran instead of waiting passively and effecting no retaliation. Besides, what was the by William Stallings use of being in possession of the key to the codes if he never took advantage of it? • — Talking to Strange Men, Ruth Rendell Lecture slides by Lawrie Brown Message Authentication Message Security Requirements • message authentication is concerned with: • disclosure – protecting the integrity of a message • traffic analysis – validating identity of originator • masquerade – non ‐ repudiation of origin (dispute resolution) • content modification • content modification • will consider the security requirements ill id th it i t • then three alternative functions used: • sequence modification – hash function (see Ch 11) • timing modification – message encryption • source repudiation – message authentication code (MAC) • destination repudiation Symmetric Message Encryption Public ‐ Key Message Encryption  encryption can also provides authentication • if public ‐ key encryption is used:  if symmetric encryption is used then: – encryption provides no confidence of sender • since anyone potentially knows public ‐ key  receiver know sender must have created it – however if  since only sender and receiver now key used • sender signs message using their private ‐ key  know content cannot of been altered  know content cannot of been altered • then encrypts with recipients public key h i h i i bli k  if message has suitable structure, redundancy or a • have both secrecy and authentication – again need to recognize corrupted messages checksum to detect any changes – but at cost of two public ‐ key uses on message 1

  2. 4/19/2010 Message Authentication Code (MAC) Message Authentication Code • generated by an algorithm that creates a small  a small fixed a small fixed- -sized block of data sized block of data fixed ‐ sized block  generated from message + secret key generated from message + secret key – depending on both message and some key  MAC = C(K,M) MAC = C(K,M) – like encryption though need not be reversible yp g  appended to message when sent appended to message when sent • 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 MAC Properties • as shown the MAC provides authentication • a MAC is a cryptographic checksum • can also use encryption for secrecy MAC = C K (M) – generally use separate keys for each – condenses a variable ‐ length message M – can compute MAC either before or after encryption – using a secret key K using a secret key K – is generally regarded as better done before ll d d b d b f • why use a MAC? – to a fixed ‐ sized authenticator – sometimes only authentication is needed • is a many ‐ to ‐ one function – sometimes need authentication to persist longer than the – potentially many messages have same MAC encryption (eg. archival use) • note that a MAC is not a digital signature – but finding these needs to be very difficult Requirements for MACs Security of MACs • taking into account the types of attacks • like block ciphers have: • need the MAC to satisfy the following: • brute ‐ force attacks exploiting m/2 1. knowing a message and MAC, is infeasible to – strong collision resistance hash have cost 2 find another message with same MAC find another message with same MAC • 128 ‐ bit hash looks vulnerable, 160 ‐ bits better 128 bit h h l k l bl 160 bit b tt 2. MACs should be uniformly distributed – MACs with known message ‐ MAC pairs 3. MAC should depend equally on all bits of the • can either attack keyspace (cf key search) or MAC message • at least 128 ‐ bit MAC is needed for security 2

  3. 4/19/2010 Keyed Hash Functions as MACs Security of MACs  want a MAC based on a hash function • cryptanalytic attacks exploit structure  because hash functions are generally faster – like block ciphers want brute ‐ force attacks to be the best alternative  crypto hash function code is widely available • more variety of MACs so harder to generalize y g  hash includes a key along with message  hash includes a key along with message about cryptanalysis  original proposal: KeyedHash = Hash(Key|Message)  some weaknesses were found with this  eventually led to development of HMAC HMAC Design Objectives HMAC • specified as Internet standard RFC2104  use, without modifications, hash functions • uses hash function on the message:  allow for easy replaceability of embedded hash HMAC K (M)= Hash[(K + XOR opad) || function Hash[(K + XOR ipad) || M)] ] – where K + is the key padded out to size + i  preserve original performance of hash function h h k dd d i – opad , ipad are specified padding constants without significant degradation • overhead is just 3 more hash calculations than the  use and handle keys in a simple way. message needs alone  have well understood cryptographic analysis of • any hash function can be used – eg. MD5, SHA ‐ 1, RIPEMD ‐ 160, Whirlpool authentication mechanism strength HMAC Security • proved security of HMAC relates to that of the underlying hash algorithm • attacking HMAC requires either: HMAC – brute force attack on key used brute force attack on key used Overview – 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 3

  4. 4/19/2010 Using Symmetric Ciphers for MACs Data Authentication Algorithm • 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 y – 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 CMAC Overview CMAC • previously saw the DAA (CBC ‐ MAC) • widely used in govt & industry • but has message size limitation • can overcome using 2 keys & padding • thus forming the Cipher ‐ based Message Authentication Code (CMAC) • adopted by NIST SP800 ‐ 38B Counter with Cipher Block Authenticated Encryption Chaining ‐ Message Authentication  simultaneously protect confidentiality and Code (CCM) authenticity of communications  often required but usually separate • NIST standard SP 800 ‐ 38C for WiFi  approaches • variation of encrypt ‐ and ‐ MAC approach yp pp  Hash ‐ then ‐ encrypt: E(K, (M || H(M)) • algorithmic ingredients  MAC ‐ then ‐ encrypt: E(K2, (M || MAC(K1, M)) – AES encryption algorithm  Encrypt ‐ then ‐ MAC: (C=E(K2, M), T=MAC(K1, C) – CTR mode of operation  Encrypt ‐ and ‐ MAC: (C=E(K2, M), T=MAC(K1, M) – CMAC authentication algorithm  decryption /verification straightforward • single key used for both encryption & MAC  but security vulnerabilities with all these 4

  5. 4/19/2010 Galois/Counter Mode (GCM) • NIST standard SP 800 ‐ 38D, parallelizable • message is encrypted in variant of CTR CCM • ciphertext multiplied with key & length over in O Operation i (2 128 ) (2 128 ) to generate authenticator tag h i • have GMAC MAC ‐ only mode also • uses two functions: – GHASH ‐ a keyed hash function – GCTR ‐ CTR mode with incremented counter GCM Functions GCM Functions Pseudorandom Number Generation (PRNG) Using Hash Functions and MACs • essential elements of PRNG are GCM Mode – seed value Overview – deterministic algorithm • seed must be known only as needed • can base PRNG on – encryption algorithm (Chs 7 & 10) – hash function (ISO18031 & NIST SP 800 ‐ 90) – MAC (NIST SP 800 ‐ 90) 5

  6. 4/19/2010 PRNG using a Hash Function PRNG using a MAC  hash PRNG from  MAC PRNGs in SP800 ‐ 90 and SP800 ‐ 90, IEEE ISO18031 802.11i, TLS  take seed V   use key k  repeatedly add 1  input based on  hash V last hash in  use n ‐ bits of hash as various ways random value  secure if good hash used Summary • have considered: – message authentication requirements – message authentication using encryption – MACs MACs – HMAC authentication using a hash function – CMAC authentication using a block cipher – Pseudorandom Number Generation (PRNG) using Hash Functions and MACs 6

Recommend


More recommend