UMAC: Fast and Secure Message Authentication
Total Page:16
File Type:pdf, Size:1020Kb
The proceedings version of this paper appears in Advances in Cryptology—CRYPTO ’99 [7]. This is the full version. It is available from www.cs.ucdavis.edu/~rogaway/umac/ UMAC: Fast and Secure Message Authentication J. Black ∗ S. Halevi † H. Krawczyk ‡ T. Krovetz ∗ P. Rogaway ∗ August 4, 1999 Abstract We describe a message authentication algorithm, UMAC, which authenticates messages (in software, on contemporary machines) roughly an order of magnitude faster than current practice (e.g., HMAC-SHA1), and about twice as fast as previously reported times for the universal hash- function family MMH. To achieve such speeds, UMAC uses a new universal hash-function family, NH, and a design which allows effective exploitation of SIMD parallelism. The “cryptographic” work of UMAC is done using standard primitives of the user’s choice, such as a block cipher or cryptographic hash function; no new heuristic primitives are developed here. Instead, the security of UMAC is rigorously proven, in the sense of giving exact and quantitatively strong results which demonstrate an inability to forge UMAC-authenticated messages assuming an inability to break the underlying cryptographic primitive. Unlike conventional, inherently serial MACs, UMAC is parallelizable, and will have ever-faster implementation speeds as machines offer up increasing amounts of parallelism. We envision UMAC as a practical algorithm for next-generation message authentication. Key words: Fast software cryptography, Message authentication codes, Provable security, Universal hashing. ∗ Dept. of Computer Science, University of California, Davis, California, 95616, USA. E-mail: {blackj, krovetz, rogaway}@cs.ucdavis.edu WWW: www.cs.ucdavis.edu/~{blackj, krovetz, rogaway}/ † IBM T.J. Watson Research Center, Yorktown Heights, New York, 10598, USA. E-mail: [email protected] ‡ Department of Electrical Engineering, Technion, Haifa, Israel, and IBM T.J. Watson Research Center, New York, USA. Email: [email protected] Contents 1 Introduction 1 1.1Universal-HashingApproach................................ 1 1.2OurContributions..................................... 2 1.3RelatedWork........................................ 4 2OverviewofUMAC 5 2.1AnIllustrativeSpecialCase................................ 5 2.2UMACParameters..................................... 6 3 UMAC Performance 7 4 The NH Hash Family 10 4.1Preliminaries........................................ 10 4.2DefinitionofNH...................................... 10 4.3Analysis........................................... 11 4.4TheSignedConstruction:NHS.............................. 13 5 Reducing the Collision Probability: Toeplitz Extensions 15 5.1TheToeplitzApproach................................... 15 5.2TheUnsignedCase..................................... 15 5.3TheSignedCase...................................... 17 5.4ShorterKeys:T2...................................... 17 6 Arbitrary-Length Messages: Padding, Concatenation, Length Annotation 18 7 Final Extensions: Stride, Endianness, Key Shifts 19 8FromHashtoMAC 20 8.1SecurityDefinitions..................................... 20 8.2DefinitionofthePRF(HASH,Nonce)Construction................... 21 8.3Discussion.......................................... 23 8.4RealizingthePRF..................................... 24 9 Directions 25 References 25 1 Introduction This paper describes a new message authentication code, UMAC, and the theory that lies behind it. UMAC has been designed with two main goals in mind: • Extreme speed. We have aimed to create the fastest MAC ever described, and by a wide margin. We are speaking of speed with respect to software implementations on contemporary general-purpose computers. • Provable security. We insist that the MAC be demonstrably secure, by virtue of proofs carried out in the sense of provable-security cryptography. Namely, if the underlying cryp- tographic primitives are secure (we use pseudorandom functions) then the MAC is secure, too. There were of course other goals, avoiding excessive conceptual and implementation complexity being principal among them. UMAC is certainly fast. On our 350 MHz Pentium II PC, one version of UMAC (where the ad- versary has 2−60 chance of forgery) achieves peak-performance of 2.9 Gbits/sec (0.98 cycles/byte). Another version of UMAC (with 2−30 chance of forgery) achieves peak performance of 5.6Gbits/sec (0.51 cycles/byte). For comparison, our SHA-1 implementation runs at 12.6 cycles/byte. Note that SHA-1 speed upper bounds the speed of HMAC-SHA1 [3], a software-oriented MAC represen- tative of the speeds achieved by current practice. The previous speed champion among proposed universal hash functions (the main ingredient for making a fast MAC; see below) was MMH [14], which runs at about 1.2 cycles/byte (for 2−30 chance of forgery) under its originally envisioned implementation. How has it been possible to achieve these speeds? Interestingly, we have done this with the help of our second goal, provable security. We use the well-known universal-hashing approach to message authentication, introduced by [27], making innovations in its realization. Let us now review this approach and its advantages, and then describe what we have done to make it fly. 1.1 Universal-Hashing Approach Universal Hashing And Authentication. Our starting point is a universal hash-function fam- ily [9]. (Indeed the “U” in UMAC is meant to suggest the central role that universal hash-function families play in this MAC.) Remember that a set of hash functions is said to be “-universal” if for any pair of distinct messages, the probability that they collide (hash to the same value) is at most . The probability is over the random choice of hash function. As described in [27], a universal hash-function family can be used to build a secure MAC. The parties share two things: a secret and randomly chosen hash function from the universal hash- function family, and a secret encryption key. A message is authenticated by hashing it with the shared hash function and then encrypting the resulting hash (using the encryption key). Wegman and Carter showed that when the hash-function family is strongly universal (a similar but stronger property than the one we defined) and the encryption is realized by a one-time pad, the adversary cannot forge with probability better than that obtained by choosing a random string for the MAC. Why Universal Hashing? As suggested many times before, the above approach is a promising one for building a highly-secure and ultra-fast MAC [17, 24, 14]. The reasoning is like this. The speed of a universal-hashing MAC depends on the speed of the hashing step and the speed of the encrypting step. But if the hash function compresses messages well (i.e., its output is short) then the encryption shouldn’t take long simply because it is a short string that is being encrypted. On 1 the other hand, since the combinatorial property of the universal hash-function family is mathe- matically proven (making no cryptographic hardness assumptions), it needs no “over-design” or “safety margin” the way a cryptographic primitive would. Quite the opposite: the hash-function family might as well be the fastest, simplest thing that one can prove universal. And that should be much faster than any sort of “cryptographic” primitive. Equally important, the above approach makes for desirable security properties. Since the cryp- tographic primitive is applied only to the (much shorter) hashed image of the message, we can select a cryptographically conservative design for this step and pay with only a minor impact on speed. Further, the underlying cryptographic primitive is used only on short and secret messages, elimi- nating the typical avenues of attack. Under this approach security and efficiency are not conflicting requirements—quite to the contrary, they go hand in hand. The Quest For Fast Universal Hashing. At least in principle, the universal-hashing paradigm has reduced the problem of fast message authentication to the problem of fast universal hashing. Thus there has been much recent work on the design of fast-to-compute universal hash-function fam- ilies. Here is a brief overview of some of this work; a more complete overview is given in Section 1.3. Krawczyk [17] describes a “cryptographic CRC” construction, which has very fast hardware imple- mentations and reasonably fast software implementations; it needs about 6 cycles/byte, as shown by Shoup [25]. Rogaway’s “bucket hashing” construction [24] was the first universal hash-function family explicitly targeted for fast software implementation; it runs in about 1.5–2.5 cycles/byte. Halevi and Krawczyk devised the MMH hash-function family [14], which takes advantage of current CPU trends and hashes at about 1.5–3 cycles/byte on modern CPUs. With methods now in hand which hash so very quickly, one may ask if the hash-design phase of making a fast MAC is complete; after all, three cycles/byte may already be fast enough to keep up with high-speed network traffic. However, authenticating information at the rate that it is generated or transmitted is not the real goal. The goal is to use the smallest possible fraction of the CPU’s cycles by the simplest possible hash mechanism, and having the best proven bounds. In this way most of the machine’s cycles are available for other work. 1.2 Our Contributions UMAC represents the next step in the quest for a fast and secure MAC. Here we describe the main contributions associated to its design. New Hash Function Families And Their Tight Analyses. A hash-function family