CMSC 426/626 Notes Krishna M. Sivalingam UMBC [email_address]
Based on: Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown
Key Management <ul><li>public-key encryption helps address  key distribution problems </li></ul><ul><li>have two aspects o...
Symmetric Encryption
Modern Block Ciphers <ul><li>will now look at modern block ciphers </li></ul><ul><li>one of the most widely used types of ...
Block vs Stream Ciphers <ul><li>block ciphers process messages in into blocks, each of which is then en/decrypted  </li></...
Data Encryption Standard (DES) <ul><li>most widely used block cipher in world  </li></ul><ul><li>adopted in 1977 by NBS (n...
DES History <ul><li>IBM developed Lucifer cipher </li></ul><ul><ul><li>by team led by Feistel </li></ul></ul><ul><ul><li>u...
DES Design Controversy <ul><li>although DES standard is public </li></ul><ul><li>was considerable controversy over design ...
Strength of DES – Key Size <ul><li>56-bit keys have 2 56  = 7.2 x 10 16  values </li></ul><ul><li>brute force search looks...
Strength of DES – Timing Attacks <ul><li>attacks actual implementation of cipher </li></ul><ul><li>use knowledge of conseq...
Strength of DES – Analytic Attacks <ul><li>now have several analytic attacks on DES </li></ul><ul><li>these  utilise some ...
Differential Cryptanalysis <ul><li>one of the most significant recent (public) advances in cryptanalysis  </li></ul><ul><l...
Modes of Operation <ul><li>block ciphers encrypt fixed size blocks </li></ul><ul><li>eg. DES encrypts 64-bit blocks, with ...
Electronic Codebook Book (ECB) <ul><li>message is broken into independent blocks which are encrypted  </li></ul><ul><li>ea...
Electronic Codebook Book (ECB)
Advantages and Limitations of ECB <ul><li>repetitions in message may show in ciphertext  </li></ul><ul><ul><li>if aligned ...
Cipher Block Chaining (CBC)  <ul><li>message is broken into blocks  </li></ul><ul><li>but these are linked together in the...
Cipher Block Chaining (CBC)
Advantages and Limitations of CBC <ul><li>each ciphertext block depends on  all  message blocks  </li></ul><ul><li>thus a ...
Cipher FeedBack (CFB) <ul><li>message is treated as a stream of bits  </li></ul><ul><li>added to the output of the block c...
Cipher FeedBack (CFB)
Advantages and Limitations of CFB <ul><li>appropriate when data arrives in bits/bytes  </li></ul><ul><li>most common strea...
Output FeedBack (OFB) <ul><li>message is treated as a stream of bits  </li></ul><ul><li>output of cipher is added to messa...
Advantages and Limitations of OFB <ul><li>used when error feedback a problem or where need to  encryptions before message ...
Counter (CTR) <ul><li>a “new” mode, though proposed early on </li></ul><ul><li>similar to OFB but encrypts counter value r...
Counter (CTR)
Advantages and Limitations of CTR <ul><li>efficiency </li></ul><ul><ul><li>can do parallel encryptions </li></ul></ul><ul>...
Triple DES <ul><li>clearly a replacement for DES was needed </li></ul><ul><ul><li>theoretical attacks that can break it </...
Why Triple-DES? <ul><li>why not Double-DES? </li></ul><ul><ul><li>NOT same as some other single-DES use, but have </li></u...
Triple-DES with Two-Keys <ul><li>hence must use 3 encryptions </li></ul><ul><ul><li>would seem to need 3 distinct keys </l...
Triple-DES with Three-Keys <ul><li>although are no practical attacks on two-key Triple-DES have some indications </li></ul...
AES - Origins <ul><li>clear a replacement for DES was needed </li></ul><ul><ul><li>have theoretical attacks that can break...
AES Requirements <ul><li>private key symmetric block cipher  </li></ul><ul><li>128-bit data, 128/192/256-bit keys  </li></...
AES Evaluation Criteria <ul><li>initial criteria: </li></ul><ul><ul><li>security – effort to practically cryptanalyse </li...
AES Shortlist <ul><li>after testing and evaluation, shortlist in Aug-99:  </li></ul><ul><ul><li>MARS (IBM) - complex, fast...
The AES Cipher - Rijndael  <ul><li>designed by Rijmen-Daemen in Belgium  </li></ul><ul><li>has 128/192/256 bit keys, 128 b...
Implementation Aspects <ul><li>can efficiently implement on 32-bit CPU </li></ul><ul><ul><li>redefine steps to use 32-bit ...
RC5 <ul><li>a proprietary cipher owned by RSADSI  </li></ul><ul><li>designed by Ronald Rivest (of RSA fame)  </li></ul><ul...
RC5 Ciphers <ul><li>RC5 is a family of ciphers RC5-w/r/b </li></ul><ul><ul><li>w = word size in bits (16/32/64) nb data=2w...
Stream Ciphers <ul><li>process the message bit by bit (as a stream)  </li></ul><ul><li>typically have a (pseudo) random  s...
Stream Cipher Properties <ul><li>some design considerations are: </li></ul><ul><ul><li>long period with no repetitions  </...
RC4 <ul><li>a proprietary cipher owned by RSA DSI  </li></ul><ul><li>another Ron Rivest design, simple but effective </li>...
RC4 Security <ul><li>claimed secure against known attacks </li></ul><ul><ul><li>have some analyses, none practical  </li><...
Public Key Cryptography
Distribution of Public Keys <ul><li>can be considered as using one of: </li></ul><ul><ul><li>Public announcement </li></ul...
Public Announcement <ul><li>users distribute public keys to recipients or broadcast to community at large </li></ul><ul><u...
Publicly Available Directory <ul><li>can obtain greater security by registering keys with a public directory </li></ul><ul...
Public-Key Authority <ul><li>improve security by tightening control over distribution of keys from directory </li></ul><ul...
Public-Key Authority
Public-Key Certificates <ul><li>certificates allow key exchange without real-time access to  public-key authority </li></u...
Public-Key Certificates
Public-Key  Distribution of Secret Keys <ul><li>use previous methods to obtain public-key </li></ul><ul><li>can use for se...
Diffie-Hellman Key Exchange <ul><li>first public-key type scheme proposed  </li></ul><ul><li>by Diffie & Hellman in 1976 a...
Diffie-Hellman Key Exchange <ul><li>a public-key distribution scheme  </li></ul><ul><ul><li>cannot be used to exchange an ...
Diffie-Hellman Setup <ul><li>all users agree on global parameters: </li></ul><ul><ul><li>large prime integer or polynomial...
Diffie-Hellman Key Exchange <ul><li>shared session key for users A & B is K AB :  </li></ul><ul><ul><li>K AB  =  α x A. x ...
Diffie-Hellman Example  <ul><li>users Alice & Bob who wish to swap keys: </li></ul><ul><li>agree on prime  q=353  and  α =...
Elliptic Curve Cryptography <ul><li>majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic w...
Message Authentication and Hash Functions
Message Authentication <ul><li>message authentication is concerned with:  </li></ul><ul><ul><li>protecting the integrity o...
Security Requirements <ul><li>disclosure </li></ul><ul><li>traffic analysis </li></ul><ul><li>masquerade </li></ul><ul><li...
Message Encryption <ul><li>message encryption by itself also provides a measure of authentication </li></ul><ul><li>if sym...
Message Encryption <ul><li>if public-key encryption is used: </li></ul><ul><ul><li>encryption provides no confidence of se...
Message Authentication Code (MAC) <ul><li>generated by an algorithm that creates a small fixed-sized block </li></ul><ul><...
MAC Properties <ul><li>a MAC is a cryptographic checksum </li></ul><ul><ul><li>MAC = C K (M) </li></ul></ul><ul><ul><li>co...
Requirements for MACs <ul><li>taking into account the types of attacks </li></ul><ul><li>need the MAC to satisfy the follo...
Using Symmetric Ciphers for MACs <ul><li>can use any block cipher chaining mode and use final block as a MAC </li></ul><ul...
Hash Functions <ul><li>condenses arbitrary message to fixed size  </li></ul><ul><li>usually assume that the hash function ...
Hash Functions & Digital Signatures
Hash Function Properties <ul><li>a Hash Function produces a fingerprint of some file/message/data </li></ul><ul><ul><li>h ...
Requirements for Hash Functions <ul><li>can be applied to any sized message  M </li></ul><ul><li>produces fixed-length out...
Hash Algorithms
Hash Algorithms <ul><li>see similarities in the evolution of hash functions & block ciphers </li></ul><ul><ul><li>increasi...
MD5 <ul><li>designed by Ronald Rivest (the R in RSA) </li></ul><ul><li>latest in a series of MD2, MD4  </li></ul><ul><li>p...
Strength of MD5 <ul><li>MD5 hash is dependent on all message bits </li></ul><ul><li>Rivest claims security is good as can ...
Secure Hash Algorithm (SHA-1) <ul><li>SHA was designed by NIST & NSA in 1993, revised 1995 as SHA-1 </li></ul><ul><li>US s...
SHA-1 verses MD5 <ul><li>brute force attack is harder (160 vs 128 bits for MD5)  </li></ul><ul><li>not vulnerable to any k...
Revised Secure Hash Standard <ul><li>NIST have issued a revision FIPS 180-2 </li></ul><ul><li>adds 3 additional hash algor...
RIPEMD-160 <ul><li>RIPEMD-160 was developed in Europe as part of RIPE project in 96 </li></ul><ul><li>by researchers invol...
RIPEMD-160 verses MD5 & SHA-1 <ul><li>brute force attack harder (160 like SHA-1 vs 128 bits for MD5)  </li></ul><ul><li>no...
Keyed Hash Functions as MACs <ul><li>have desire to create a MAC using a hash function rather than a block cipher </li></u...
HMAC <ul><li>specified as Internet standard RFC2104  </li></ul><ul><li>uses hash function on the message: </li></ul><ul><u...
HMAC Overview
HMAC Overview <ul><li>K, secret key shared between the two parties </li></ul><ul><li>K should be larger than L/2, where L ...
HMAC Security <ul><li>know that the  security of HMAC relates to that of the underlying hash algorithm </li></ul><ul><li>a...
Digital Signatures
Digital Signatures <ul><li>have looked at  message authentication  </li></ul><ul><ul><li>but does not address issues of la...
Digital Signature Properties <ul><li>must depend on the message signed </li></ul><ul><li>must use information unique to se...
Digital Signature  Standard  (DSS) <ul><li>US Govt approved signature scheme FIPS 186 </li></ul><ul><li>uses the SHA hash ...
DSA Key Generation <ul><li>have shared global public key values (p,q,g):  </li></ul><ul><ul><li>a large prime  p = 2 L   <...
DSA Signature Creation <ul><li>to  sign  a message  M  the sender: </li></ul><ul><ul><li>generates a random signature key ...
DSA Signature Verification  <ul><li>having received M &  signature  (r,s)   </li></ul><ul><li>to  verify  a signature, rec...
 
Upcoming SlideShare
Loading in...5
×

Download It

522

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
522
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Modern block ciphers are widely used to provide encryption of quantities of information, and/or a cryptographic checksum to ensure the contents have not been altered. We continue to use block ciphers because they are comparatively fast, and because we know a fair amount about how to design them.
  • Block ciphers work a on block / word at a time, which is some number of bits. All of these bits have to be available before the block can be processed. Stream ciphers work on a bit or byte of the message at a time, hence process it as a “stream”.
  • Recent analysis has shown despite this controversy, that DES is well designed. DES is theoretically broken using Differential or Linear Cryptanalysis but in practise is unlikely to be a problem yet. Also rapid advances in computing speed though have rendered the 56 bit key susceptible to exhaustive key search, as predicted by Diffie &amp; Hellman. Have demonstrated breaks: - 1997 on a large network of computers in a few months - 1998 on dedicated h/w (EFF) in a few days - 1999 above combined in 22hrs!
  • DES finally and definitively proved insecure in July 1998, when the Electronic Frontier Foundation (EFF) announced that it had broken a DES encryption using a special-purpose &amp;quot;DES cracker&amp;quot; machine that was built for less than $250,000. The attack took less than three days. The EFF has published a detailed description of the machine, enabling others to build their own cracker [EFF98].
  • AES analysis process has highlighted this attack approach, and is a concern.
  • In [BIHA93] show Differential Cryptanalysis can successfully cryptanalyse DES with an effort on the order of 2 47 , requiring 2 47 chosen plaintexts. Differential cryptanalysis was known to the IBM DES design team as early as 1974, and influenced the design of the S-boxes and the permutation P. Compare with cryptanalysis of an eight-round LUCIFER algorithm requires only 256 chosen plaintexts, whereas an attack on an eight-round version of DES requires 2 14 chosen plaintexts.
  • DES (or any block cipher) forms a basic building block, which en/decrypts a fixed sized block of data. However to use these in practise, we usually need to handle arbitrary amounts of data, which may be available in advance (in which case a block mode is appropriate), and may only be available a bit/byte at a time (in which case a stream mode is used).
  • ECB is the simplest of the modes, where each block is en/decrypted independently of all the other blocks, and is used when only a single block of info needs to be sent (eg. a session key encrypted using a master key) .
  • Stallings Fig 3-11.
  • ECB is not appropriate for any quantity of data, since repetitions can be seen, esp. with graphics, and because the blocks can be shuffled/inserted without affecting the en/decryption of each block.
  • To overcome the problems of repetitions and order independence in ECB, want some way of making the ciphertext dependent on all blocks before it. This is what CBC gives us, by combining the previous ciphertext block with the current message block before encrypting. To start the process, use an Initial Value (IV), which is usually well known (often all 0&apos;s), or otherwise is sent, ECB encrypted, just before starting CBC use. CBC mode is applicable whenever large amounts of data need to be sent securely, provided that its available in advance (eg email, FTP, web etc)
  • Stallings Fig 3-12.
  • CBC is the generally used block mode. The chaining provides an avalanche effect, which means the encrypted message cannot be changed or rearranged without totally destroying the subsequent data. One issue is how to handle the last block, which may well not be complete. In general have to pad this block (typically with 0&apos;s), and then must recognise padding at other end - may be obvious (eg in text the 0 value should usually not occur), or otherwise must explicitly have the last byte as a count of how much padding was used (including the count). Note that if this is done, if the last block IS an even multiple of 8 bytes, will have to add an extra block, all padding so as to have a count in the last byte.
  • If the data is only available a bit/byte at a time (eg. terminal session, sensor value etc), then must use some other approach to encrypting it, so as not to delay the info. Idea here is to use the block cipher essentially as a pseudo-random number generator (see stream cipher lecture later) and to combine these &amp;quot;random&amp;quot; bits with the message. Note as mentioned before, XOR is an easily inverted operator (just XOR with same thing again to undo). Again start with an IV to get things going, then use the ciphertext as the next input. As originally defined, idea was to &amp;quot;consume&amp;quot; as much of the &amp;quot;random&amp;quot; output as needed for each message unit (bit/byte) before &amp;quot;bumping&amp;quot; bits out of the buffer and re-encrypting. This is wasteful though, and slows the encryption down as more encryptions are needed. An alternate way to think of it is to generate a block of &amp;quot;random&amp;quot; bits, consume them as message bits/bytes arrive, and when they&apos;re used up, only then feed a full block of ciphertext back. This is CFB-64 mode, the most efficient. This is the usual choice for quantities of stream oriented data, and for authentication use.
  • Stallings Fig 3-13.
  • CFB is the usual stream mode. As long as can keep up with the input, doing encryptions every 8 bytes. A possible problem is that if its used over a &amp;quot;noisy&amp;quot; link, then any corrupted bit will destroy values in the current and next blocks (since the current block feeds as input to create the random bits for the next). So either must use over a reliable network transport layer (pretty usual) or use OFB.
  • The alternative to CFB is OFB. Here the generation of the &amp;quot;random&amp;quot; bits is independent of the message being encrypted. The advantage is that firstly, they can be computed in advance, good for bursty traffic, and secondly, any bit error only affects a single bit. Thus this is good for noisy links (eg satellite TV transmissions etc).
  • Because the &amp;quot;random&amp;quot; bits are independent of the message, they must never ever be used more than once (otherwise the 2 ciphertexts can be combined, cancelling these bits, and leaving a &amp;quot;book&amp;quot; cipher to solve). Also, as noted, should only ever use a full block feedback ie OFB-64 mode.
  • Stallings Fig 3-15.
  • Triple-DES with two keys is a popular alternative to single-DES, but suffers from being 3 times slower to run. Although there are no practical attacks, have some indications of attack approaches. Hence some are now adopting Triple-DES with three keys for greater security.
  • The AES candidates are the latest generation of block ciphers, and now we see a significant increase in the block size - from the old standard of 64-bits up to 128-bits; and keys from 128 to 256-bits. In part this has been driven by the public demonstrations of exhaustive key searches of DES. Whilst triple-DES is regarded as secure and well understood, it is slow, especially in s/w.
  • Initial criteria were issued with call, and used to evaluate field of 15 candidates to select shortlist of 5. The final criteria were used to select Rijndael from that short-list.
  • The shortlist is as shown. Note mix of commercial (MARS, RC6, Twofish) verses academic (Rijndael, Serpent) proposals, sourced from various countries. All were thought to be good – came down to best balance of attributes to meet criteria.
  • Rijndael is an academic submission, based on the earlier Square cipher, from Belgium academics Dr Joan Daemen and Dr Vincent Rijmen. It is an iterative cipher (operates on entire data block in every round) rather than feistel (operate on halves at a time). cf IDEA cipher
  • Criteria from Rueppel
  • RC4 is widely used, in SSL for secure web transactions amongst other uses. Currently its regarded as quite secure, if used correctly.
  • Stallings Fig 10-3. See text for details of steps in protocol.
  • Stallings Fig 10-4. See text for details of steps in protocol.
  • The idea of public key schemes, and the first practical scheme, which was for key distribution only, was published in 1977 by Diffie &amp; Hellman. The concept had been previously described in a classified report in 1970 by James Ellis (UK CESG) - and subsequently declassified in 1987. See History of Non-secret Encryption (at CESG) .
  • The prime q and primitive root α can be common to all using some instance of the D-H scheme. Note that the primitive root α is a number whose powers successively generate all the elements mod q. Alice and Bob choose random secrets x&apos;s, and then &amp;quot;protect&amp;quot; them using exponentiation to create the y&apos;s. For an attacker monitoring the exchange of the y&apos;s to recover either of the x&apos;s, they&apos;d need to solve the discrete logarithm problem, which is hard.
  • The actual key exchange for either party consists of raising the others &amp;quot;public key&apos; to power of their private key. The resulting number (or as much of as is necessary) is used as the key for a block cipher or other private key scheme. For an attacker to obtain the same value they need at least one of the secret numbers, which means solving a discrete log, which is computationally infeasible given large enough numbers
  • Up till now, have been concerned with protecting message content (ie secrecy) by encrypting the message. Will now consider how to protect message integrity (ie protection from modification), as well as confirming the identity of the sender. Generically this is the problem of message authentication, and in eCommerce applications is arguably more important than secrecy.
  • The first two requirements belong in the realm of message confidentiality, and are handled using the encryption techniques already discussed. The remaining requirements belong in the realm of message authentication. At its core this addresses the issue of ensuring that a message comes from the alleged source and has not been altered. It may also address sequencing and timeliness. The use of a digital signature can also address issues of repudiation.
  • Can also use block cipher chaining modes to create a separate authenticator, by just sending the last block. However this suffers from being a bit too small for acceptable use today.
  • Stallings Fig 11-5c.
  • These are the specifications for good hash functions. Essentially it must be extremely difficult to find 2 messages with the same hash, and the hash should not be related to the message in any obvious way (ie it should be a complex non-linear function of the message). There are quite a few similarities in the evolution of hash functions &amp; block ciphers, and in the evolution of the design requirements on both.
  • MD5 is the current, and very widely used, member of Rivest’s family of hash functions.
  • Some progress has been made analysing MD5, which along with the hash size of 128-bits means its starting to look too small. Hence interest in hash functions that create larger hashes.
  • SHA is one of the newer generation of hash functions, more resistant to cryptanalysis, and now probably preferred for new applications.
  • Compare using the design goals listed earlier. SHA-1 is probably the preferred hash function for new applications. Currently no problems are known with it.
  • See Stallings Tables 12.3 and 12.4 for details.
  • RIPEMD-160 is probably the most secure of the hash algorithms, so would be chosen if that is of major concern.
  • The idea of a keyed hash evolved into HMAC, designed to overcome some problems with the original proposals. Further have a design that has been shown to have the same security as the underlying hash alg. The hash function need only be used on 3 more blocks than when hashing just the original message (for the two keys + inner hash). Choose hash alg to use based on speed/security concerns.
  • Stallings Fig 12-10.
  • DSA is the US Govt approved signature scheme - designed to provide strong signatures without allowing easy use for encryption. The signature scheme has advantages, being both smaller (320 vs 1024bit) and faster (much of the computation is done modulo a 160 bit number) than RSA.
  • Signature creation is similar to ElGamal with the use of a per message temporary signature key k, but doing calculations first mod p, then mod q to reduce the size of the result. Note that the use of the hash function SHA is explicit. Note that only computing r involves calculation mod p and does not depend on message, hence can be done in advance.
  • Verification also consists of comparing two computations. Note that the difficulty of computing discrete logs is why it is infeasible for an opponent to recover k from r. Note that nearly all the calculations are mod q, and hence are much faster save for the last step.
  • Download It

    1. 1. CMSC 426/626 Notes Krishna M. Sivalingam UMBC [email_address]
    2. 2. Based on: Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown
    3. 3. Key Management <ul><li>public-key encryption helps address key distribution problems </li></ul><ul><li>have two aspects of this: </li></ul><ul><ul><li>distribution of public keys </li></ul></ul><ul><ul><li>use of public-key encryption to distribute secret keys </li></ul></ul>
    4. 4. Symmetric Encryption
    5. 5. Modern Block Ciphers <ul><li>will now look at modern block ciphers </li></ul><ul><li>one of the most widely used types of cryptographic algorithms </li></ul><ul><li>provide secrecy and/or authentication services </li></ul><ul><li>in particular will introduce DES (Data Encryption Standard) </li></ul>
    6. 6. Block vs Stream Ciphers <ul><li>block ciphers process messages in into blocks, each of which is then en/decrypted </li></ul><ul><li>like a substitution on very big characters </li></ul><ul><ul><li>64-bits or more </li></ul></ul><ul><li>stream ciphers process messages a bit or byte at a time when en/decrypting </li></ul><ul><li>many current ciphers are block ciphers </li></ul><ul><li>hence are focus of course </li></ul>
    7. 7. Data Encryption Standard (DES) <ul><li>most widely used block cipher in world </li></ul><ul><li>adopted in 1977 by NBS (now NIST) </li></ul><ul><ul><li>as FIPS PUB 46 </li></ul></ul><ul><li>encrypts 64-bit data using 56-bit key </li></ul><ul><li>has widespread use </li></ul><ul><li>has been considerable controversy over its security </li></ul>
    8. 8. DES History <ul><li>IBM developed Lucifer cipher </li></ul><ul><ul><li>by team led by Feistel </li></ul></ul><ul><ul><li>used 64-bit data blocks with 128-bit key </li></ul></ul><ul><li>then redeveloped as a commercial cipher with input from NSA and others </li></ul><ul><li>in 1973 NBS issued request for proposals for a national cipher standard </li></ul><ul><li>IBM submitted their revised Lucifer which was eventually accepted as the DES </li></ul>
    9. 9. DES Design Controversy <ul><li>although DES standard is public </li></ul><ul><li>was considerable controversy over design </li></ul><ul><ul><li>in choice of 56-bit key (vs Lucifer 128-bit) </li></ul></ul><ul><ul><li>and because design criteria were classified </li></ul></ul><ul><li>subsequent events and public analysis show in fact design was appropriate </li></ul><ul><li>DES has become widely used, especially in financial applications </li></ul>
    10. 10. Strength of DES – Key Size <ul><li>56-bit keys have 2 56 = 7.2 x 10 16 values </li></ul><ul><li>brute force search looks hard </li></ul><ul><li>recent advances have shown is possible </li></ul><ul><ul><li>in 1997 on Internet in a few months </li></ul></ul><ul><ul><li>in 1998 on dedicated h/w (EFF) in a few days </li></ul></ul><ul><ul><li>in 1999 above combined in 22hrs! </li></ul></ul><ul><li>still must be able to recognize plaintext </li></ul><ul><li>now considering alternatives to DES </li></ul>
    11. 11. Strength of DES – Timing Attacks <ul><li>attacks actual implementation of cipher </li></ul><ul><li>use knowledge of consequences of implementation to derive knowledge of some/all subkey bits </li></ul><ul><li>specifically use fact that calculations can take varying times depending on the value of the inputs to it </li></ul><ul><li>particularly problematic on smartcards </li></ul>
    12. 12. Strength of DES – Analytic Attacks <ul><li>now have several analytic attacks on DES </li></ul><ul><li>these utilise some deep structure of the cipher </li></ul><ul><ul><li>by gathering information about encryptions </li></ul></ul><ul><ul><li>can eventually recover some/all of the sub-key bits </li></ul></ul><ul><ul><li>if necessary then exhaustively search for the rest </li></ul></ul><ul><li>generally these are statistical attacks </li></ul><ul><li>include </li></ul><ul><ul><li>differential cryptanalysis </li></ul></ul><ul><ul><li>linear cryptanalysis </li></ul></ul><ul><ul><li>related key attacks </li></ul></ul>
    13. 13. Differential Cryptanalysis <ul><li>one of the most significant recent (public) advances in cryptanalysis </li></ul><ul><li>known by NSA in 70's cf DES design </li></ul><ul><li>Murphy, Biham & Shamir published 1990 </li></ul><ul><li>powerful method to analyse block ciphers </li></ul><ul><li>used to analyse most current block ciphers with varying degrees of success </li></ul><ul><li>DES reasonably resistant to it, cf Lucifer </li></ul>
    14. 14. Modes of Operation <ul><li>block ciphers encrypt fixed size blocks </li></ul><ul><li>eg. DES encrypts 64-bit blocks, with 56-bit key </li></ul><ul><li>need way to use in practise, given usually have arbitrary amount of information to encrypt </li></ul><ul><li>four were defined for DES in ANSI standard ANSI X3.106-1983 Modes of Use </li></ul><ul><li>subsequently now have 5 for DES and AES </li></ul><ul><li>have block and stream modes </li></ul>
    15. 15. Electronic Codebook Book (ECB) <ul><li>message is broken into independent blocks which are encrypted </li></ul><ul><li>each block is a value which is substituted, like a codebook, hence name </li></ul><ul><li>each block is encoded independently of the other blocks </li></ul><ul><ul><li>C i = DES K1 (P i ) </li></ul></ul><ul><li>uses: secure transmission of single values </li></ul>
    16. 16. Electronic Codebook Book (ECB)
    17. 17. Advantages and Limitations of ECB <ul><li>repetitions in message may show in ciphertext </li></ul><ul><ul><li>if aligned with message block </li></ul></ul><ul><ul><li>particularly with data such graphics </li></ul></ul><ul><ul><li>or with messages that change very little, which become a code-book analysis problem </li></ul></ul><ul><li>weakness due to encrypted message blocks being independent </li></ul><ul><li>main use is sending a few blocks of data </li></ul>
    18. 18. Cipher Block Chaining (CBC) <ul><li>message is broken into blocks </li></ul><ul><li>but these are linked together in the encryption operation </li></ul><ul><li>each previous cipher blocks is chained with current plaintext block, hence name </li></ul><ul><li>use Initial Vector (IV) to start process </li></ul><ul><ul><li>C i = DES K1 (P i XOR C i-1 ) </li></ul></ul><ul><ul><li>C -1 = IV </li></ul></ul><ul><li>uses: bulk data encryption, authentication </li></ul>
    19. 19. Cipher Block Chaining (CBC)
    20. 20. Advantages and Limitations of CBC <ul><li>each ciphertext block depends on all message blocks </li></ul><ul><li>thus a change in the message affects all ciphertext blocks after the change as well as the original block </li></ul><ul><li>need Initial Value (IV) known to sender & receiver </li></ul><ul><ul><li>however if IV is sent in the clear, an attacker can change bits of the first block, and change IV to compensate </li></ul></ul><ul><ul><li>hence either IV must be a fixed value (as in EFTPOS) or it must be sent encrypted in ECB mode before rest of message </li></ul></ul><ul><li>at end of message, handle possible last short block </li></ul><ul><ul><li>by padding either with known non-data value (eg nulls) </li></ul></ul><ul><ul><li>or pad last block with count of pad size </li></ul></ul><ul><ul><ul><li>eg. [ b1 b2 b3 0 0 0 0 5] <- 3 data bytes, then 5 bytes pad+count </li></ul></ul></ul>
    21. 21. Cipher FeedBack (CFB) <ul><li>message is treated as a stream of bits </li></ul><ul><li>added to the output of the block cipher </li></ul><ul><li>result is feed back for next stage (hence name) </li></ul><ul><li>standard allows any number of bit (1,8 or 64 or whatever) to be feed back </li></ul><ul><ul><li>denoted CFB-1, CFB-8, CFB-64 etc </li></ul></ul><ul><li>is most efficient to use all 64 bits (CFB-64) </li></ul><ul><ul><li>C i = P i XOR DES K1 (C i-1 ) </li></ul></ul><ul><ul><li>C -1 = IV </li></ul></ul><ul><li>uses: stream data encryption, authentication </li></ul>
    22. 22. Cipher FeedBack (CFB)
    23. 23. Advantages and Limitations of CFB <ul><li>appropriate when data arrives in bits/bytes </li></ul><ul><li>most common stream mode </li></ul><ul><li>limitation is need to stall while do block encryption after every n-bits </li></ul><ul><li>note that the block cipher is used in encryption mode at both ends </li></ul><ul><li>errors propagate for several blocks after the error </li></ul>
    24. 24. Output FeedBack (OFB) <ul><li>message is treated as a stream of bits </li></ul><ul><li>output of cipher is added to message </li></ul><ul><li>output is then feed back (hence name) </li></ul><ul><li>feedback is independent of message </li></ul><ul><li>can be computed in advance </li></ul><ul><ul><li>C i = P i XOR O i </li></ul></ul><ul><ul><li>O i = DES K1 (O i-1 ) </li></ul></ul><ul><ul><li>O -1 = IV </li></ul></ul><ul><li>uses: stream encryption over noisy channels </li></ul><ul><li>Note: the OFB mode description presented in Fig 3.14 on page 96 of Stallings’ text is incorrect. Refer to the NIST Spl Pubs 800-38A - Fig 4/page 14 </li></ul>
    25. 25. Advantages and Limitations of OFB <ul><li>used when error feedback a problem or where need to encryptions before message is available </li></ul><ul><li>superficially similar to CFB </li></ul><ul><li>but feedback is from the output of cipher and is independent of message </li></ul><ul><li>a variation of a Vernam cipher </li></ul><ul><ul><li>hence must never reuse the same sequence (key+IV) </li></ul></ul><ul><li>sender and receiver must remain in sync, and some recovery method is needed to ensure this occurs </li></ul><ul><li>originally specified with m-bit feedback in the standards </li></ul><ul><li>subsequent research has shown that only OFB-64 should ever be used </li></ul>
    26. 26. Counter (CTR) <ul><li>a “new” mode, though proposed early on </li></ul><ul><li>similar to OFB but encrypts counter value rather than any feedback value </li></ul><ul><li>must have a different key & counter value for every plaintext block (never reused) </li></ul><ul><ul><li>C i = P i XOR O i </li></ul></ul><ul><ul><li>O i = DES K1 (i) </li></ul></ul><ul><li>uses: high-speed network encryptions </li></ul>
    27. 27. Counter (CTR)
    28. 28. Advantages and Limitations of CTR <ul><li>efficiency </li></ul><ul><ul><li>can do parallel encryptions </li></ul></ul><ul><ul><li>in advance of need </li></ul></ul><ul><ul><li>good for bursty high speed links </li></ul></ul><ul><li>random access to encrypted data blocks </li></ul><ul><li>provable security (good as other modes) </li></ul><ul><li>but must ensure never reuse key/counter values, otherwise could break (cf OFB) </li></ul>
    29. 29. Triple DES <ul><li>clearly a replacement for DES was needed </li></ul><ul><ul><li>theoretical attacks that can break it </li></ul></ul><ul><ul><li>demonstrated exhaustive key search attacks </li></ul></ul><ul><li>AES is a new cipher alternative </li></ul><ul><li>prior to this alternative was to use multiple encryption with DES implementations </li></ul><ul><li>Triple-DES is the chosen form </li></ul>
    30. 30. Why Triple-DES? <ul><li>why not Double-DES? </li></ul><ul><ul><li>NOT same as some other single-DES use, but have </li></ul></ul><ul><li>meet-in-the-middle attack </li></ul><ul><ul><li>works whenever use a cipher twice </li></ul></ul><ul><ul><li>since X = E K1 [P] = D K2 [C] </li></ul></ul><ul><ul><li>attack by encrypting P with all keys and store </li></ul></ul><ul><ul><li>then decrypt C with keys and match X value </li></ul></ul><ul><ul><li>can show takes O(2 56 ) steps </li></ul></ul>
    31. 31. Triple-DES with Two-Keys <ul><li>hence must use 3 encryptions </li></ul><ul><ul><li>would seem to need 3 distinct keys </li></ul></ul><ul><li>but can use 2 keys with E-D-E sequence </li></ul><ul><ul><li>C = E K1 [D K2 [E K1 [P]]] </li></ul></ul><ul><ul><li>nb encrypt & decrypt equivalent in security </li></ul></ul><ul><ul><li>if K1=K2 then can work with single DES </li></ul></ul><ul><li>standardized in ANSI X9.17 & ISO8732 </li></ul><ul><li>no current known practical attacks </li></ul>
    32. 32. Triple-DES with Three-Keys <ul><li>although are no practical attacks on two-key Triple-DES have some indications </li></ul><ul><li>can use Triple-DES with Three-Keys to avoid even these </li></ul><ul><ul><li>C = E K3 [D K2 [E K1 [P]]] </li></ul></ul><ul><li>has been adopted by some Internet applications, eg PGP, S/MIME </li></ul>
    33. 33. AES - Origins <ul><li>clear a replacement for DES was needed </li></ul><ul><ul><li>have theoretical attacks that can break it </li></ul></ul><ul><ul><li>have demonstrated exhaustive key search attacks </li></ul></ul><ul><li>can use Triple-DES – but slow with small blocks </li></ul><ul><li>US NIST issued call for ciphers in 1997 </li></ul><ul><li>15 candidates accepted in Jun 98 </li></ul><ul><li>5 were short-listed in Aug-99 </li></ul><ul><li>Rijndael was selected as the AES in Oct-2000 </li></ul><ul><li>issued as FIPS PUB 197 standard in Nov-2001 </li></ul>
    34. 34. AES Requirements <ul><li>private key symmetric block cipher </li></ul><ul><li>128-bit data, 128/192/256-bit keys </li></ul><ul><li>stronger & faster than Triple-DES </li></ul><ul><li>active life of 20-30 years (+ archival use) </li></ul><ul><li>provide full specification & design details </li></ul><ul><li>both C & Java implementations </li></ul><ul><li>NIST have released all submissions & unclassified analyses </li></ul>
    35. 35. AES Evaluation Criteria <ul><li>initial criteria: </li></ul><ul><ul><li>security – effort to practically cryptanalyse </li></ul></ul><ul><ul><li>cost – computational </li></ul></ul><ul><ul><li>algorithm & implementation characteristics </li></ul></ul><ul><li>final criteria </li></ul><ul><ul><li>general security </li></ul></ul><ul><ul><li>software & hardware implementation ease </li></ul></ul><ul><ul><li>implementation attacks </li></ul></ul><ul><ul><li>flexibility (in en/decrypt, keying, other factors) </li></ul></ul>
    36. 36. AES Shortlist <ul><li>after testing and evaluation, shortlist in Aug-99: </li></ul><ul><ul><li>MARS (IBM) - complex, fast, high security margin </li></ul></ul><ul><ul><li>RC6 (USA) - v. simple, v. fast, low security margin </li></ul></ul><ul><ul><li>Rijndael (Belgium) - clean, fast, good security margin </li></ul></ul><ul><ul><li>Serpent (Euro) - slow, clean, v. high security margin </li></ul></ul><ul><ul><li>Twofish (USA) - complex, v. fast, high security margin </li></ul></ul><ul><li>then subject to further analysis & comment </li></ul><ul><li>saw contrast between algorithms with </li></ul><ul><ul><li>few complex rounds verses many simple rounds </li></ul></ul><ul><ul><li>which refined existing ciphers verses new proposals </li></ul></ul>
    37. 37. The AES Cipher - Rijndael <ul><li>designed by Rijmen-Daemen in Belgium </li></ul><ul><li>has 128/192/256 bit keys, 128 bit data </li></ul><ul><li>an iterative rather than feistel cipher </li></ul><ul><ul><li>treats data in 4 groups of 4 bytes </li></ul></ul><ul><ul><li>operates an entire block in every round </li></ul></ul><ul><li>designed to be: </li></ul><ul><ul><li>resistant against known attacks </li></ul></ul><ul><ul><li>speed and code compactness on many CPUs </li></ul></ul><ul><ul><li>design simplicity </li></ul></ul>
    38. 38. Implementation Aspects <ul><li>can efficiently implement on 32-bit CPU </li></ul><ul><ul><li>redefine steps to use 32-bit words </li></ul></ul><ul><ul><li>can pre-compute 4 tables of 256-words </li></ul></ul><ul><ul><li>then each column in each round can be computed using 4 table lookups + 4 XORs </li></ul></ul><ul><ul><li>at a cost of 16Kb to store tables </li></ul></ul><ul><li>designers believe this very efficient implementation was a key factor in its selection as the AES cipher </li></ul>
    39. 39. RC5 <ul><li>a proprietary cipher owned by RSADSI </li></ul><ul><li>designed by Ronald Rivest (of RSA fame) </li></ul><ul><li>used in various RSADSI products </li></ul><ul><li>can vary key size / data size / no rounds </li></ul><ul><li>very clean and simple design </li></ul><ul><li>easy implementation on various CPUs </li></ul><ul><li>yet still regarded as secure </li></ul>
    40. 40. RC5 Ciphers <ul><li>RC5 is a family of ciphers RC5-w/r/b </li></ul><ul><ul><li>w = word size in bits (16/32/64) nb data=2w </li></ul></ul><ul><ul><li>r = number of rounds (0..255) </li></ul></ul><ul><ul><li>b = number of bytes in key (0..255) </li></ul></ul><ul><li>nominal version is RC5-32/12/16 </li></ul><ul><ul><li>ie 32-bit words so encrypts 64-bit data blocks </li></ul></ul><ul><ul><li>using 12 rounds </li></ul></ul><ul><ul><li>with 16 bytes (128-bit) secret key </li></ul></ul>
    41. 41. Stream Ciphers <ul><li>process the message bit by bit (as a stream) </li></ul><ul><li>typically have a (pseudo) random stream key </li></ul><ul><li>combined (XOR) with plaintext bit by bit </li></ul><ul><li>randomness of stream key completely destroys any statistically properties in the message </li></ul><ul><ul><li>C i = M i XOR StreamKey i </li></ul></ul><ul><li>what could be simpler!!!! </li></ul><ul><li>but must never reuse stream key </li></ul><ul><ul><li>otherwise can remove effect and recover messages </li></ul></ul>
    42. 42. Stream Cipher Properties <ul><li>some design considerations are: </li></ul><ul><ul><li>long period with no repetitions </li></ul></ul><ul><ul><li>statistically random </li></ul></ul><ul><ul><li>depends on large enough key </li></ul></ul><ul><ul><li>large linear complexity </li></ul></ul><ul><ul><li>correlation immunity </li></ul></ul><ul><ul><li>confusion </li></ul></ul><ul><ul><li>diffusion </li></ul></ul><ul><ul><li>use of highly non-linear boolean functions </li></ul></ul>
    43. 43. RC4 <ul><li>a proprietary cipher owned by RSA DSI </li></ul><ul><li>another Ron Rivest design, simple but effective </li></ul><ul><li>variable key size, byte-oriented stream cipher </li></ul><ul><li>widely used (web SSL/TLS, wireless WEP) </li></ul><ul><li>key forms random permutation of all 8-bit values </li></ul><ul><li>uses that permutation to scramble input info processed a byte at a time </li></ul>
    44. 44. RC4 Security <ul><li>claimed secure against known attacks </li></ul><ul><ul><li>have some analyses, none practical </li></ul></ul><ul><li>result is very non-linear </li></ul><ul><li>since RC4 is a stream cipher, must never reuse a key </li></ul><ul><li>have a concern with WEP, but due to key handling rather than RC4 itself </li></ul>
    45. 45. Public Key Cryptography
    46. 46. Distribution of Public Keys <ul><li>can be considered as using one of: </li></ul><ul><ul><li>Public announcement </li></ul></ul><ul><ul><li>Publicly available directory </li></ul></ul><ul><ul><li>Public-key authority </li></ul></ul><ul><ul><li>Public-key certificates </li></ul></ul>
    47. 47. Public Announcement <ul><li>users distribute public keys to recipients or broadcast to community at large </li></ul><ul><ul><li>eg. append PGP keys to email messages or post to news groups or email list </li></ul></ul><ul><li>major weakness is forgery </li></ul><ul><ul><li>anyone can create a key claiming to be someone else and broadcast it </li></ul></ul><ul><ul><li>until forgery is discovered can masquerade as claimed user </li></ul></ul>
    48. 48. Publicly Available Directory <ul><li>can obtain greater security by registering keys with a public directory </li></ul><ul><li>directory must be trusted with properties: </li></ul><ul><ul><li>contains {name, public-key} entries </li></ul></ul><ul><ul><li>participants register securely with directory </li></ul></ul><ul><ul><li>participants can replace key at any time </li></ul></ul><ul><ul><li>directory is periodically published </li></ul></ul><ul><ul><li>directory can be accessed electronically </li></ul></ul><ul><li>still vulnerable to tampering or forgery </li></ul>
    49. 49. Public-Key Authority <ul><li>improve security by tightening control over distribution of keys from directory </li></ul><ul><li>has properties of directory </li></ul><ul><li>and requires users to know public key for the directory </li></ul><ul><li>then users interact with directory to obtain any desired public key securely </li></ul><ul><ul><li>does require real-time access to directory when keys are needed </li></ul></ul>
    50. 50. Public-Key Authority
    51. 51. Public-Key Certificates <ul><li>certificates allow key exchange without real-time access to public-key authority </li></ul><ul><li>a certificate binds identity to public key </li></ul><ul><ul><li>usually with other info such as period of validity, rights of use etc </li></ul></ul><ul><li>with all contents signed by a trusted Public-Key or Certificate Authority (CA) </li></ul><ul><li>can be verified by anyone who knows the public-key authorities public-key </li></ul>
    52. 52. Public-Key Certificates
    53. 53. Public-Key Distribution of Secret Keys <ul><li>use previous methods to obtain public-key </li></ul><ul><li>can use for secrecy or authentication </li></ul><ul><li>but public-key algorithms are slow </li></ul><ul><li>so usually want to use private-key encryption to protect message contents </li></ul><ul><li>hence need a session key </li></ul><ul><li>have several alternatives for negotiating a suitable session </li></ul>
    54. 54. Diffie-Hellman Key Exchange <ul><li>first public-key type scheme proposed </li></ul><ul><li>by Diffie & Hellman in 1976 along with the exposition of public key concepts </li></ul><ul><ul><li>note: now know that James Ellis (UK CESG) secretly proposed the concept in 1970 </li></ul></ul><ul><ul><li>http://en.wikipedia.org/wiki/James_H._Ellis </li></ul></ul><ul><li>is a practical method for public exchange of a secret key </li></ul><ul><li>used in a number of commercial products </li></ul>
    55. 55. Diffie-Hellman Key Exchange <ul><li>a public-key distribution scheme </li></ul><ul><ul><li>cannot be used to exchange an arbitrary message </li></ul></ul><ul><ul><li>rather it can establish a common key </li></ul></ul><ul><ul><li>known only to the two participants </li></ul></ul><ul><li>value of key depends on the participants (and their private and public key information) </li></ul><ul><li>based on exponentiation in a finite (Galois) field (modulo a prime or a polynomial) - easy </li></ul><ul><li>security relies on the difficulty of computing discrete logarithms (similar to factoring) – hard </li></ul>
    56. 56. Diffie-Hellman Setup <ul><li>all users agree on global parameters: </li></ul><ul><ul><li>large prime integer or polynomial q </li></ul></ul><ul><ul><li>α a primitive root mod q </li></ul></ul><ul><li>each user (eg. A) generates their key </li></ul><ul><ul><li>chooses a secret key (number): x A < q </li></ul></ul><ul><ul><li>compute their public key : y A = α x A mod q </li></ul></ul><ul><li>each user makes public that key y A </li></ul>
    57. 57. Diffie-Hellman Key Exchange <ul><li>shared session key for users A & B is K AB : </li></ul><ul><ul><li>K AB = α x A. x B mod q </li></ul></ul><ul><ul><li>= y A x B mod q (which B can compute) </li></ul></ul><ul><ul><li>= y B x A mod q (which A can compute) </li></ul></ul><ul><li>K AB is used as session key in private-key encryption scheme between Alice and Bob </li></ul><ul><li>if Alice and Bob subsequently communicate, they will have the same key as before, unless they choose new public-keys </li></ul><ul><li>attacker needs an x, must solve discrete log </li></ul>
    58. 58. Diffie-Hellman Example <ul><li>users Alice & Bob who wish to swap keys: </li></ul><ul><li>agree on prime q=353 and α =3 </li></ul><ul><li>select random secret keys: </li></ul><ul><ul><li>A chooses x A =97, B chooses x B =233 </li></ul></ul><ul><li>compute public keys: </li></ul><ul><ul><li>y A = 3 97 mod 353 = 40 (Alice) </li></ul></ul><ul><ul><li>y B = 3 233 mod 353 = 248 (Bob) </li></ul></ul><ul><li>compute shared session key as: </li></ul><ul><ul><li>K AB = y B x A mod 353 = 248 97 = 160 (Alice) </li></ul></ul><ul><ul><li>K AB = y A x B mod 353 = 40 233 = 160 (Bob) </li></ul></ul>
    59. 59. Elliptic Curve Cryptography <ul><li>majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large numbers/polynomials </li></ul><ul><li>imposes a significant load in storing and processing keys and messages </li></ul><ul><li>an alternative is to use elliptic curves </li></ul><ul><li>offers same security with smaller bit sizes </li></ul><ul><li>E.g. 256 bit key in ECC is equivalent to 3072-bit RSA encryption </li></ul>
    60. 60. Message Authentication and Hash Functions
    61. 61. Message Authentication <ul><li>message authentication is concerned with: </li></ul><ul><ul><li>protecting the integrity of a message </li></ul></ul><ul><ul><li>validating identity of originator </li></ul></ul><ul><ul><li>non-repudiation of origin (dispute resolution) </li></ul></ul><ul><li>will consider the security requirements </li></ul><ul><li>then three alternative functions used: </li></ul><ul><ul><li>message encryption </li></ul></ul><ul><ul><li>message authentication code (MAC) </li></ul></ul><ul><ul><li>hash function </li></ul></ul>
    62. 62. Security Requirements <ul><li>disclosure </li></ul><ul><li>traffic analysis </li></ul><ul><li>masquerade </li></ul><ul><li>content modification </li></ul><ul><li>sequence modification </li></ul><ul><li>timing modification </li></ul><ul><li>source repudiation </li></ul><ul><li>destination repudiation </li></ul>
    63. 63. Message Encryption <ul><li>message encryption by itself also provides a measure of authentication </li></ul><ul><li>if symmetric encryption is used then: </li></ul><ul><ul><li>receiver know sender must have created it </li></ul></ul><ul><ul><li>since only sender and receiver now key used </li></ul></ul><ul><ul><li>know content cannot of been altered </li></ul></ul><ul><ul><li>if message has suitable structure, redundancy or a checksum to detect any changes </li></ul></ul>
    64. 64. Message Encryption <ul><li>if public-key encryption is used: </li></ul><ul><ul><li>encryption provides no confidence of sender </li></ul></ul><ul><ul><li>since anyone potentially knows public-key </li></ul></ul><ul><ul><li>however if </li></ul></ul><ul><ul><ul><li>sender signs message using their private-key </li></ul></ul></ul><ul><ul><ul><li>then encrypts with recipients public key </li></ul></ul></ul><ul><ul><ul><li>have both secrecy and authentication </li></ul></ul></ul><ul><ul><li>again need to recognize corrupted messages </li></ul></ul><ul><ul><li>but at cost of two public-key uses on message </li></ul></ul>
    65. 65. Message Authentication Code (MAC) <ul><li>generated by an algorithm that creates a small fixed-sized block </li></ul><ul><ul><li>depending on both message and some key </li></ul></ul><ul><ul><li>like encryption though need not be reversible </li></ul></ul><ul><li>appended to message as a signature </li></ul><ul><li>receiver performs same computation on message and checks it matches the MAC </li></ul><ul><li>provides assurance that message is unaltered and comes from sender </li></ul>
    66. 66. MAC Properties <ul><li>a MAC is a cryptographic checksum </li></ul><ul><ul><li>MAC = C K (M) </li></ul></ul><ul><ul><li>condenses a variable-length message M </li></ul></ul><ul><ul><li>using a secret key K </li></ul></ul><ul><ul><li>to a fixed-sized authenticator </li></ul></ul><ul><li>is a many-to-one function </li></ul><ul><ul><li>potentially many messages have same MAC </li></ul></ul><ul><ul><li>but finding these needs to be very difficult </li></ul></ul>
    67. 67. Requirements for MACs <ul><li>taking into account the types of attacks </li></ul><ul><li>need the MAC to satisfy the following: </li></ul><ul><ul><li>knowing a message and MAC, is infeasible to find another message with same MAC </li></ul></ul><ul><ul><li>MACs should be uniformly distributed </li></ul></ul><ul><ul><li>MAC should depend equally on all bits of the message </li></ul></ul>
    68. 68. Using Symmetric Ciphers for MACs <ul><li>can use any block cipher chaining mode and use final block as a MAC </li></ul><ul><li>Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC </li></ul><ul><ul><li>using IV=0 and zero-pad of final block </li></ul></ul><ul><ul><li>encrypt message using DES in CBC mode </li></ul></ul><ul><ul><li>and send just the final block as the MAC </li></ul></ul><ul><ul><ul><li>or the leftmost M bits (16 ≤M≤64) of final block </li></ul></ul></ul><ul><li>but final MAC is now too small for security </li></ul>
    69. 69. Hash Functions <ul><li>condenses arbitrary message to fixed size </li></ul><ul><li>usually assume that the hash function is public and not keyed </li></ul><ul><ul><li>cf. MAC which is keyed </li></ul></ul><ul><li>hash used to detect changes to message </li></ul><ul><li>can use in various ways with message </li></ul><ul><li>most often to create a digital signature </li></ul>
    70. 70. Hash Functions & Digital Signatures
    71. 71. Hash Function Properties <ul><li>a Hash Function produces a fingerprint of some file/message/data </li></ul><ul><ul><li>h = H(M) </li></ul></ul><ul><ul><li>condenses a variable-length message M </li></ul></ul><ul><ul><li>to a fixed-sized fingerprint </li></ul></ul><ul><li>assumed to be public </li></ul>
    72. 72. Requirements for Hash Functions <ul><li>can be applied to any sized message M </li></ul><ul><li>produces fixed-length output h </li></ul><ul><li>is easy to compute h=H(M) for any message M </li></ul><ul><li>given h is infeasible to find x s.t. H(x)=h </li></ul><ul><ul><li>one-way property </li></ul></ul><ul><li>given x is infeasible to find y s.t . H(y)=H(x) </li></ul><ul><ul><li>weak collision resistance </li></ul></ul><ul><li>is infeasible to find any x,y s.t . H(y)=H(x) </li></ul><ul><ul><li>strong collision resistance </li></ul></ul>
    73. 73. Hash Algorithms
    74. 74. Hash Algorithms <ul><li>see similarities in the evolution of hash functions & block ciphers </li></ul><ul><ul><li>increasing power of brute-force attacks </li></ul></ul><ul><ul><li>leading to evolution in algorithms </li></ul></ul><ul><ul><li>from DES to AES in block ciphers </li></ul></ul><ul><ul><li>from MD4 & MD5 to SHA-1 & RIPEMD-160 in hash algorithms </li></ul></ul><ul><li>likewise tend to use common iterative structure as do block ciphers </li></ul>
    75. 75. MD5 <ul><li>designed by Ronald Rivest (the R in RSA) </li></ul><ul><li>latest in a series of MD2, MD4 </li></ul><ul><li>produces a 128-bit hash value </li></ul><ul><li>until recently was the most widely used hash algorithm </li></ul><ul><ul><li>in recent times have both brute-force & cryptanalytic concerns </li></ul></ul><ul><li>specified as Internet standard RFC1321 </li></ul>
    76. 76. Strength of MD5 <ul><li>MD5 hash is dependent on all message bits </li></ul><ul><li>Rivest claims security is good as can be </li></ul><ul><li>known attacks are: </li></ul><ul><ul><li>Berson 92 attacked any 1 round using differential cryptanalysis (but can’t extend) </li></ul></ul><ul><ul><li>Boer & Bosselaers 93 found a pseudo collision (again unable to extend) </li></ul></ul><ul><ul><li>Dobbertin 96 created collisions on MD compression function (but initial constants prevent exploit) </li></ul></ul><ul><li>conclusion is that MD5 looks vulnerable soon </li></ul>
    77. 77. Secure Hash Algorithm (SHA-1) <ul><li>SHA was designed by NIST & NSA in 1993, revised 1995 as SHA-1 </li></ul><ul><li>US standard for use with DSA signature scheme </li></ul><ul><ul><li>standard is FIPS 180-1 1995, also Internet RFC3174 </li></ul></ul><ul><ul><li>nb. the algorithm is SHA, the standard is SHS </li></ul></ul><ul><li>produces 160-bit hash values </li></ul><ul><li>now the generally preferred hash algorithm </li></ul><ul><li>based on design of MD4 with key differences </li></ul>
    78. 78. SHA-1 verses MD5 <ul><li>brute force attack is harder (160 vs 128 bits for MD5) </li></ul><ul><li>not vulnerable to any known attacks (compared to MD4/5) </li></ul><ul><li>a little slower than MD5 (80 vs 64 steps) </li></ul><ul><li>both designed as simple and compact </li></ul><ul><li>optimised for big endian CPU's (vs MD5 which is optimised for little endian CPU’s) </li></ul>
    79. 79. Revised Secure Hash Standard <ul><li>NIST have issued a revision FIPS 180-2 </li></ul><ul><li>adds 3 additional hash algorithms </li></ul><ul><li>SHA-256, SHA-384, SHA-512 </li></ul><ul><li>designed for compatibility with increased security provided by the AES cipher </li></ul><ul><li>structure & detail is similar to SHA-1 </li></ul><ul><li>hence analysis should be similar </li></ul>
    80. 80. RIPEMD-160 <ul><li>RIPEMD-160 was developed in Europe as part of RIPE project in 96 </li></ul><ul><li>by researchers involved in attacks on MD4/5 </li></ul><ul><li>initial proposal strengthen following analysis to become RIPEMD-160 </li></ul><ul><li>somewhat similar to MD5/SHA </li></ul><ul><li>uses 2 parallel lines of 5 rounds of 16 steps </li></ul><ul><li>creates a 160-bit hash value </li></ul><ul><li>slower, but probably more secure, than SHA </li></ul>
    81. 81. RIPEMD-160 verses MD5 & SHA-1 <ul><li>brute force attack harder (160 like SHA-1 vs 128 bits for MD5) </li></ul><ul><li>not vulnerable to known attacks, like SHA-1 though stronger (compared to MD4/5) </li></ul><ul><li>slower than MD5 (more steps) </li></ul><ul><li>all designed as simple and compact </li></ul><ul><li>SHA-1 optimised for big endian CPU's vs RIPEMD-160 & MD5 optimised for little endian CPU’s </li></ul>
    82. 82. Keyed Hash Functions as MACs <ul><li>have desire to create a MAC using a hash function rather than a block cipher </li></ul><ul><ul><li>because hash functions are generally faster </li></ul></ul><ul><ul><li>not limited by export controls unlike block ciphers </li></ul></ul><ul><li>hash includes a key along with the message </li></ul><ul><li>original proposal: </li></ul><ul><ul><li>KeyedHash = Hash(Key|Message) </li></ul></ul><ul><ul><li>some weaknesses were found with this </li></ul></ul><ul><li>eventually led to development of HMAC </li></ul>
    83. 83. HMAC <ul><li>specified as Internet standard RFC2104 </li></ul><ul><li>uses hash function on the message: </li></ul><ul><ul><li>HMAC K = Hash[(K + XOR opad) || </li></ul></ul><ul><ul><li>Hash[(K + XOR ipad)||M)]] </li></ul></ul><ul><li>where K + is the key padded out to size </li></ul><ul><li>and opad, ipad are specified padding constants </li></ul><ul><li>overhead is just 3 more hash calculations than the message needs alone </li></ul><ul><li>any of MD5, SHA-1, RIPEMD-160 can be used </li></ul>
    84. 84. HMAC Overview
    85. 85. HMAC Overview <ul><li>K, secret key shared between the two parties </li></ul><ul><li>K should be larger than L/2, where L is size of hash output (e.g. 160 bits) </li></ul><ul><li>Output of HMAC may be truncated (left most significant bits may be transmitted) </li></ul><ul><li>an arbitrary purported MAC of t bits on an arbitrary plaintext message may be successfully verified with an expected probability of (1/2)^ t </li></ul>
    86. 86. HMAC Security <ul><li>know that the security of HMAC relates to that of the underlying hash algorithm </li></ul><ul><li>attacking HMAC requires either: </li></ul><ul><ul><li>brute force attack on key used </li></ul></ul><ul><ul><li>birthday attack (but since keyed would need to observe a very large number of messages) </li></ul></ul><ul><li>choose hash function used based on speed verses security constraints </li></ul>
    87. 87. Digital Signatures
    88. 88. Digital Signatures <ul><li>have looked at message authentication </li></ul><ul><ul><li>but does not address issues of lack of trust </li></ul></ul><ul><li>digital signatures provide the ability to: </li></ul><ul><ul><li>verify author, date & time of signature </li></ul></ul><ul><ul><li>authenticate message contents </li></ul></ul><ul><ul><li>be verified by third parties to resolve disputes </li></ul></ul><ul><li>hence include authentication function with additional capabilities </li></ul>
    89. 89. Digital Signature Properties <ul><li>must depend on the message signed </li></ul><ul><li>must use information unique to sender </li></ul><ul><ul><li>to prevent both forgery and denial </li></ul></ul><ul><li>must be relatively easy to produce </li></ul><ul><li>must be relatively easy to recognize & verify </li></ul><ul><li>be computationally infeasible to forge </li></ul><ul><ul><li>with new message for existing digital signature </li></ul></ul><ul><ul><li>with fraudulent digital signature for given message </li></ul></ul><ul><li>be practical save digital signature in storage </li></ul>
    90. 90. Digital Signature Standard (DSS) <ul><li>US Govt approved signature scheme FIPS 186 </li></ul><ul><li>uses the SHA hash algorithm </li></ul><ul><li>designed by NIST & NSA in early 90's </li></ul><ul><li>DSS is the standard, DSA is the algorithm </li></ul><ul><li>a variant on ElGamal and Schnorr schemes </li></ul><ul><li>creates a 320 bit signature, but with 512-1024 bit security </li></ul><ul><li>security depends on difficulty of computing discrete logarithms </li></ul>
    91. 91. DSA Key Generation <ul><li>have shared global public key values (p,q,g): </li></ul><ul><ul><li>a large prime p = 2 L </li></ul></ul><ul><ul><ul><li>where L= 512 to 1024 bits and is a multiple of 64 </li></ul></ul></ul><ul><ul><li>choose q, a 160 bit prime factor of p-1 </li></ul></ul><ul><ul><li>choose g = h (p-1)/q </li></ul></ul><ul><ul><ul><li>where h<p-1, h (p-1)/q (mod p) > 1 </li></ul></ul></ul><ul><li>users choose private & compute public key: </li></ul><ul><ul><li>choose x<q </li></ul></ul><ul><ul><li>compute y = g x (mod p) </li></ul></ul>
    92. 92. DSA Signature Creation <ul><li>to sign a message M the sender: </li></ul><ul><ul><li>generates a random signature key k, k<q </li></ul></ul><ul><ul><li>nb. k must be random, be destroyed after use, and never be reused </li></ul></ul><ul><li>then computes signature pair: </li></ul><ul><ul><li>r = (g k (mod p))(mod q) </li></ul></ul><ul><ul><li>s = (k -1 .SHA(M)+ x.r)(mod q) </li></ul></ul><ul><li>sends signature (r,s) with message M </li></ul>
    93. 93. DSA Signature Verification <ul><li>having received M & signature (r,s) </li></ul><ul><li>to verify a signature, recipient computes: </li></ul><ul><ul><li>w = s -1 (mod q) </li></ul></ul><ul><ul><li>u1= (SHA(M).w)(mod q) </li></ul></ul><ul><ul><li>u2= (r.w)(mod q) </li></ul></ul><ul><ul><li>v = (g u1 .y u2 (mod p)) (mod q) </li></ul></ul><ul><li>if v=r then signature is verified </li></ul><ul><li>see book web site for details of proof why </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×