Lecture Notes in Computer Science Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen TU Dortmund University, Germany Madhu Sudan Microsoft Research, Cambridge, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max Planck Institute for Informatics, Saarbruecken, Germany
6841
Phillip Rogaway (Ed.)
Advances in Cryptology – CRYPTO 2011 31st Annual Cryptology Conference Santa Barbara, CA, USA, August 14-18, 2011 Proceedings
13
Volume Editor Phillip Rogaway University of California Department of Computer Science Davis, CA 95616, USA E-mail:
[email protected]
ISSN 0302-9743 e-ISSN 1611-3349 ISBN 978-3-642-22791-2 e-ISBN 978-3-642-22792-9 DOI 10.1007/978-3-642-22792-9 Springer Heidelberg Dordrecht London New York Library of Congress Control Number: 2011932695 CR Subject Classification (1998): E.3, G.2.1, F.2.1-2, D.4.6, K.6.5, C.2, J.1 LNCS Sublibrary: SL 4 – Security and Cryptology
© International Association for Cryptologic Research 2011 This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India Printed on acid-free paper Springer is part of Springer Science+Business Media (www.springer.com)
Preface
CRYPTO 2011, the 31st Annual International Cryptology Conference, was held August 14–18 on the campus of the University of California, Santa Barbara. The event was sponsored by the International Association for Cryptologic Research (the IACR) in cooperation with the UCSB Computer Science Department and the IEEE Computer Society’s Technical Committee on Security and Privacy. We received 230 submissions, a new record, of which 43 were accepted for publication. With one pair of papers merged, these proceedings contain the revised versions of 42 papers. There were also two invited talks. On Monday, Ron Rivest delivered the 2011 IACR Distinguished Lecture. On Wednesday, Roger Dingledine spoke about Tor, a widely used system for online anonymous communication. For Tuesday afternoon, traditionally left free, Shai Halevi graciously offered a three-hour tutorial on Fully Homomorphic Encryption. That evening, Dan Bernstein and Tanja Lange chaired the traditional rump session. I have tried to assemble a technical program not only strong, but also balanced. Efforts in this direction included selection of a particularly large and broad Program Committee (PC), and a Call for Papers explicitly indicating receptiveness to cryptographic topics not routinely appearing at recent CRYPTOs. I encouraged PC members to focus on the positive aspects of submissions. When it came time to vote on second-round accepts, partitioning the papers into topical categories may also have helped. For the Best Paper Award, the PC overwhelmingly selected “ComputerAided Security Proofs for the Working Cryptographer,” by Gilles Barthe, Benjamin Gr´egoire, Sylvain Heraud, and Santiago Zanella B´eguelin. The Committee praised the work for its broad appeal, its connections to programming language, and its potential impact. Papers were reviewed in the customary way, double-blind, with non-PC contributions generally receiving three or more reviews, and PC contributions getting four or more. I encouraged (anonymized) questions from PC members to authors, and ended up relaying several tens of such messages. Throughout the review process I tried to treat each submission as its authors’ well-loved child, never as a three-digit number in need of categorization. I would like to most sincerely thank the authors of submissions—both those who did and who did not get their papers in. Contributing research from all corners of the earth, it is the fine work of the authors that makes a conference like ours possible and worthwhile. My deepest appreciation goes out to the PC. I find something wonderful and touching about so many busy and brilliant people putting in enormous amounts of time to perform so thankless and difficult a service. I was repeatedly impressed
VI
Preface
by the dedication, integrity, knowledge, and extraordinary technical skills of so many on our PC. A list of PC members appears after this note. The external reviewers play a key role in assessing the submissions, and are heartily thanked for their contribution. A list of external reviewers likewise appears after this note. My apologies in advance for any errors or omissions. I would like to thank Tom Shrimpton, the General Chair, for working closely with me and handling the myriad of matters associated to putting on a great conference. Rei Safavi-Naini served double duty as both PC member and Junior Chair. I kept in close touch with John Benaloh, my IACR point of contact, who could always be counted on for timely information and feedback. I repeatedly got invaluable and frank advice from Tal Rabin, the CRYPTO 2010 Program Chair. Shai Halevi wrote, explained, and maintained the superb websubrev software on which we conducted our business. Alfred Hofmann and his colleagues at Springer saw to the timely production of this volume. Finally, Bongkotrattana Lailert afforded me the time and space needed to do this piece of work as well as I possibly could, smilingly accepting her and Banlu’s exile to distant lands. In closing, I would like to acknowledge something that all old-timers know, but which, as authors, we may sometimes fail to internalize: that there’s an awful lot of randomness in the paper-selection process. Wonderful papers sometimes get rejected; mediocre papers sometimes get in. After serving as PC Chair I am more convinced than ever that it is fundamentally wrong to feel much of anything when any particular paper one submits does or doesn’t make the cut. I hope that, over a period of years, important papers do get in, and do get recognized as well. Serving as a CRYPTO Program Chair is a big job, and it can be a stressful one as well. Yet, somehow, I feel like I have grown more than gray hairs with this job, and am happy to have taken it on. June 2011
Phillip Rogaway
CRYPTO 2011 The 31st Annual International Cryptology Conference Santa Barbara, California, USA August 14–18, 2011 Sponsored by the International Association of Cryptologic Research (IACR) in cooperation with the Computer Science Department of the University of California, Santa Barbara and the IEEE Computer Society’s Technical Committee on Security and Privacy
General Chair Thomas Shrimpton
Portland State University, USA
Program Chair Phillip Rogaway
University of California, Davis, USA
Program Committee Masayuki Abe Michael Backes Paulo Barreto Mihir Bellare Alex Biryukov Dan Boneh Jung Hee Cheon Jean-S´ebastien Coron Marten van Dijk Yevgeniy Dodis Orr Dunkelman Serge Fehr Steven Galbraith Craig Gentry Louis Goubin Vipul Goyal Aggelos Kiayias Eike Kiltz Anja Lehmann Arjen Lenstra Stefan Mangard
NTT, Japan Saarland University and MPI-SWS, Germany University of S˜ ao Paulo, Brazil UC San Diego, USA University of Luxembourg Stanford, USA Seoul National University, Korea University of Luxembourg RSA Labs and MIT/CSAIL, USA New York University, USA University of Haifa and Weizmann Institute, Israel CWI, The Netherlands University of Auckland, New Zealand IBM Research, USA Universit´e de Versailles, France Microsoft Research, India University of Connecticut, USA Ruhr-Universit¨ at Bochum, Germany IBM Zurich, Switzerland EPFL, Switzerland Infineon Technologies, Germany
VIII
CRYPTO 2011
Program Committee (Continued) Daniele Micciancio Tal Moran Chanathip Namprempre Phong Nguyen Jesper Buus Nielsen Rafael Pass Kenny Paterson Benny Pinkas Bart Preneel Leonid Reyzin Vincent Rijmen
UC San Diego, USA Harvard, USA Thammasat University, Thailand INRIA and ENS, France Aarhus University, Denmark Cornell University, USA Royal Holloway, University of London, UK Bar Ilan University, Israel Katholieke Universiteit Leuven, Belgium Boston University, USA Katholieke Universiteit Leuven, Belgium and TU Graz, Austria Rei Safavi-Naini University of Calgary, Canada Andre Scedrov University of Pennsylvania, USA Adam Smith Pennsylvania State University, USA Fran¸cois-Xavier Standaert UCL, Belgium Stefano Tessaro UC San Diego, USA Bogdan Warinschi University of Bristol, UK Hoeteck Wee Queens College, CUNY, USA
Advisory Members Tal Rabin (CRYPTO 2010 Program Chair) IBM Research, USA Rei Safavi-Naini (CRYPTO 2012 Program Chair) University of Calgary, Canada
External Reviewers Michel Abdalla Divesh Aggarwal Hadi Ahmad Mohsen Alimomeni Joel Alwen Elena Andreeva Kazumaro Aoki Gilad Asharov Maxime Augier Paul Baecher Kfir Barhum Alexandre Berzati Ga¨etan Bisson Bruno Blanchet Andrey Bogdanov
Alexandra Boldyreva Joppe Bos Charles Bouillaguet Niek Bouman Colin Boyd Christina Brzuska Jan Camenisch Sebastien Canard Ran Canetti David Cash Nishanth Chandran Melissa Chase Hao Chen Alessandro Chiesa Sherman S.M. Chow
Kai-Min Chung Iwen Coisel Cas Cremers Dana Dachman-Soled Ivan Damg˚ ard Jean Paul Degabriele C´ecile Delerabl´ee Ante Derek Claus Diem Vivien Dubois Maria Dubovitskaya L´eo Ducas Andrej Dujella Iwan Duursma Stefan Dziembowski
CRYPTO 2011
Pooya Farshim Sebastian Faust Matthieu Finiasz Dario Fiore Marc Fischlin Pierre-Alain Fouque David Freeman Georg Fuchsbauer Eiichiro Fujisaki Jakob Funder Martin Gagne David Galindo Sanjam Garg Peter Gaˇzi Ran Gelles Rosario Gennaro Benedikt Gierlichs Henri Gilbert Michael Goodrich Thomas Gross Jeffrey Guarente Kil-Chan Ha Robbert de Haan Iftach Haitner Shai Halevi Sean Hallgren Mike Hamburg Safuat Hamdy Goichiro Hanaoka Danny Harnik Carmit Hazay Jens Hermans Mathias Herrmann Florian Hess Martin Hirt Viet Tung Hoang Dennis Hofheinz Susan Hohenberger Peter Hoyer Pavel Hubacek Andreas H¨ ulsing Sebastiaan Indesteege Yuval Ishai Tibor Jager Abhishek Jain
Dimitar Jetchev Shaoquan Jiang Antoine Joux Pascal Junod Seny Kamara Bhavana Kanukurthi Alexandre Karlov Shiva Kasiviswanathan Jonathan Katz Marcel Keller Jihye Kim Minkyu Kim Myungsun Kim Sungwook Kim Thorsten Kleinjung Robin K¨ unzler Ralf K¨ usters Soonhak Kwon Taekyoung Kwon Mario Lamberger Hyung Tae Lee Younho Lee Ga¨etan Leurent Allison Lewko Benoit Libert Changlu Lin Huijia Lin Yehuda Lindell Satya Lokam Adriana L´ opez-Alt Carolin Lunemann Anna Lysyanskaya Vadim Lyubashevsky Mohammad Mahmoody Alexander May Marcel Medwed Sebastian Meiser Florian Mendel Bart Mennink Alexander Meurer Petros Mol Hart Montogomery Kirill Morozov Elchanan Mossel Serban Nacu
IX
Tomislav Nad Michael Naehrig Arvind Narayanan Gregory Neven Ivica Nikolic Ryo Nishimaki Kobbi Nissim Peter Sebastian Nordholt Adam O’Neill Miyako Ohkubo Tatsuaki Okamoto Elisabeth Oswald Onur Ozen Pascal Paillier Paolo Palmieri Omkant Pandey Valerio Pastro Jacques Patarin Arpita Patra Thomas Peeters Serdar Pehlivanoglu Chris Peikert Robin Pemantle Olivier Pereira Edoardo Persichetti Christophe Petit Krzysztof Pietrzak David Pointcheval Manoj Prabhakaran Ananth Raghunathan Francesco Regazzoni Oded Regev Tzachy Reinman Renato Renner Thomas Ristenpart Matthieu Rivain Guy Rothblum Yannis Rouselakis Arnab Roy Nashad Safa Louis Salvail Juraj Sarinay Sumanta Sarkar Yu Sasaki Christian Schaffner
X
CRYPTO 2011
Martin Schl¨ affer Thomas Schneider Dominique Schr¨oder Gil Segev Jae Hong Seo Yannick Seurin Siamak Shahandashi Elaine Shi Thomas Shrimpton Marcos A. Simplicio Jr Thomas Sirvent William E. Skeith III Arkadii Slinko Nigel Smart Fang Song Martijn Stam
John Steinberger Marc Stevens Gabor Tardos Aris Tentes Enrico Thomae Mehdi Tibouchi Elmar Tischhauser Tomas Toft Nikos Triandopoulos Tomasz Truderung Wei-lung Tseng Ashraful Tuhin Yevgeniy Vahlis Vinod Vaikuntanathan Kerem Varıcı Damien Vergnaud
Ivan Visconti Huaxiong Wang Meiqin Wang Yongge Wang Brent Waters Gaven Watson Benne de Weger Ralf-Philipp Weinmann Daniel Wichs Steve Williams Christopher Wolf J¨ urg Wullschleger Andy Yao Sarah Zakarias Hong-Sheng Zhou Angela Zottarel
Table of Contents
Randomness and Its Use Leftover Hash Lemma, Revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Boaz Barak, Yevgeniy Dodis, Hugo Krawczyk, Olivier Pereira, Krzysztof Pietrzak, Fran¸cois-Xavier Standaert, and Yu Yu
1
Random Oracle Reducibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Paul Baecher and Marc Fischlin
21
Time-Lock Puzzles in the Random Oracle Model . . . . . . . . . . . . . . . . . . . . . Mohammad Mahmoody, Tal Moran, and Salil Vadhan
39
Physically Uncloneable Functions in the Universal Composition Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Christina Brzuska, Marc Fischlin, Heike Schr¨ oder, and Stefan Katzenbeisser
51
Computer-Assisted Cryptographic Proofs Computer-Aided Security Proofs for the Working Cryptographer . . . . . . . Gilles Barthe, Benjamin Gr´egoire, Sylvain Heraud, and Santiago Zanella B´eguelin
71
Outsourcing and Delegating Computation Optimal Verification of Operations on Dynamic Sets . . . . . . . . . . . . . . . . . . Charalampos Papamanthou, Roberto Tamassia, and Nikos Triandopoulos
91
Verifiable Delegation of Computation over Large Datasets . . . . . . . . . . . . . Siavosh Benabbas, Rosario Gennaro, and Yevgeniy Vahlis
111
Secure Computation on the Web: Computing without Simultaneous Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shai Halevi, Yehuda Lindell, and Benny Pinkas Memory Delegation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Kai-Min Chung, Yael Tauman Kalai, Feng-Hao Liu, and Ran Raz
132 151
XII
Table of Contents
Symmetric Cryptanalysis and Constructions Automatic Search of Attacks on Round-Reduced AES and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Charles Bouillaguet, Patrick Derbez, and Pierre-Alain Fouque
169
How to Improve Rebound Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mar´ıa Naya-Plasencia
188
A Cryptanalysis of PRINTcipher: The Invariant Subspace Attack . . . . Gregor Leander, Mohamed Ahmed Abdelraheem, Hoda AlKhzaimi, and Erik Zenner
206
The PHOTON Family of Lightweight Hash Functions . . . . . . . . . . . . . . . . . . . Jian Guo, Thomas Peyrin, and Axel Poschmann
222
Secure Computation Perfectly-Secure Multiplication for Any t < n/3 . . . . . . . . . . . . . . . . . . . . . Gilad Asharov, Yehuda Lindell, and Tal Rabin
240
The IPS Compiler: Optimizations, Variants and Concrete Efficiency . . . . Yehuda Lindell, Eli Oxman, and Benny Pinkas
259
1/p-Secure Multiparty Computation without Honest Majority and the Best of Both Worlds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Amos Beimel, Yehuda Lindell, Eran Omri, and Ilan Orlov
277
Leakage and Side Channels Leakage-Resilient Zero Knowledge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sanjam Garg, Abhishek Jain, and Amit Sahai A Comprehensive Evaluation of Mutual Information Analysis Using a Fair Evaluation Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Carolyn Whitnall and Elisabeth Oswald
297
316
Key-Evolution Schemes Resilient to Space-Bounded Leakage . . . . . . . . . . . Stefan Dziembowski, Tomasz Kazana, and Daniel Wichs
335
Generic Side-Channel Distinguishers: Improvements and Limitations . . . Nicolas Veyrat-Charvillon and Fran¸cois-Xavier Standaert
354
Cryptography with Tamperable and Leaky Memory . . . . . . . . . . . . . . . . . . Yael Tauman Kalai, Bhavana Kanukurthi, and Amit Sahai
373
Table of Contents
XIII
Quantum Cryptography Merkle Puzzles in a Quantum World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gilles Brassard, Peter Høyer, Kassem Kalach, Marc Kaplan, Sophie Laplante, and Louis Salvail
391
Classical Cryptographic Protocols in a Quantum World . . . . . . . . . . . . . . . Sean Hallgren, Adam Smith, and Fang Song
411
Position-Based Quantum Cryptography: Impossibility and Constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Harry Buhrman, Nishanth Chandran, Serge Fehr, Ran Gelles, Vipul Goyal, Rafail Ostrovsky, and Christian Schaffner
429
Lattices and Knapsacks Analyzing Blockwise Lattice Algorithms Using Dynamical Systems . . . . . Guillaume Hanrot, Xavier Pujol, and Damien Stehl´e Pseudorandom Knapsacks and the Sample Complexity of LWE Search-to-Decision Reductions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Daniele Micciancio and Petros Mol
447
465
Invited Talk Tor and Circumvention: Lessons Learned . . . . . . . . . . . . . . . . . . . . . . . . . . . . Roger Dingledine
485
Public-Key Encryption Fully Homomorphic Encryption over the Integers with Shorter Public Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jean-S´ebastien Coron, Avradip Mandal, David Naccache, and Mehdi Tibouchi Fully Homomorphic Encryption from Ring-LWE and Security for Key Dependent Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Zvika Brakerski and Vinod Vaikuntanathan Bi-Deniable Public-Key Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adam O’Neill, Chris Peikert, and Brent Waters Better Security for Deterministic Public-Key Encryption: The Auxiliary-Input Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Zvika Brakerski and Gil Segev
487
505 525
543
XIV
Table of Contents
Symmetric Schemes The Collision Security of Tandem-DM in the Ideal Cipher Model . . . . . . . Jooyoung Lee, Martijn Stam, and John Steinberger Order-Preserving Encryption Revisited: Improved Security Analysis and Alternative Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alexandra Boldyreva, Nathan Chenette, and Adam O’Neill A New Variant of PMAC: Beyond the Birthday Bound . . . . . . . . . . . . . . . Kan Yasuda Authenticated and Misuse-Resistant Encryption of Key-Dependent Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mihir Bellare and Sriram Keelveedhi
561
578 596
610
Signatures Round Optimal Blind Signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sanjam Garg, Vanishree Rao, Amit Sahai, Dominique Schr¨ oder, and Dominique Unruh Optimal Structure-Preserving Signatures in Asymmetric Bilinear Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Masayuki Abe, Jens Groth, Kristiyan Haralambiev, and Miyako Ohkubo
630
649
Oblivious Transfer and Secret Sharing Constant-Rate Oblivious Transfer from Noisy Channels . . . . . . . . . . . . . . . Yuval Ishai, Eyal Kushilevitz, Rafail Ostrovsky, Manoj Prabhakaran, Amit Sahai, and J¨ urg Wullschleger The Torsion-Limit for Algebraic Function Fields and Its Application to Arithmetic Secret Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ignacio Cascudo, Ronald Cramer, and Chaoping Xing
667
685
Multivariate and Coding-Based Schemes Public-Key Identification Schemes Based on Multivariate Quadratic Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Koichi Sakumoto, Taizo Shirai, and Harunaga Hiwatari Inverting HFE Systems Is Quasi-Polynomial for All Fields . . . . . . . . . . . . Jintai Ding and Timothy J. Hodges
706 724
Table of Contents
Smaller Decoding Exponents: Ball-Collision Decoding . . . . . . . . . . . . . . . . Daniel J. Bernstein, Tanja Lange, and Christiane Peters
XV
743
McEliece and Niederreiter Cryptosystems That Resist Quantum Fourier Sampling Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hang Dinh, Cristopher Moore, and Alexander Russell
761
Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
781
Leftover Hash Lemma, Revisited Boaz Barak1 , Yevgeniy Dodis2 , Hugo Krawczyk3, Olivier Pereira4, Krzysztof Pietrzak5, Fran¸cois-Xavier Standaert4 , and Yu Yu6 1
Microsoft Research New England
[email protected] 2 New York University
[email protected] 3 IBM Research
[email protected] 4 Universit´e Catholique de Louvain {Olivier.Pereira,fstandae}@uclouvain.be 5 CWI Amsterdam
[email protected] 6 East China Normal University
[email protected] Abstract. The famous Leftover Hash Lemma (LHL) states that (almost) universal hash functions are good randomness extractors. Despite its numerous applications, LHL-based extractors suffer from the following two limitations: – Large Entropy Loss: to extract v bits from distribution X of minentropy m which are ε-close to uniform, one must set v ≤ m − def 2 log (1/ε), meaning that the entropy loss L = m − v ≥ 2 log (1/ε). For many applications, such entropy loss is too large. – Large Seed Length: the seed length n of (almost) universal hash function required by the LHL must be at least n ≥ min(u − v, v + 2 log (1/ε)) − O(1), where u is the length of the source, and must grow with the number of extracted bits. Quite surprisingly, we show that both limitations of the LHL — large entropy loss and large seed — can be overcome (or, at least, mitigated) in various important scenarios. First, we show that entropy loss could be reduced to L = log (1/ε) for the setting of deriving secret keys for a wide range of cryptographic applications. Specifically, the security of these schemes √ with an LHL-derived key gracefully degrades from ε to at most ε + ε2−L . (Notice that, unlike standard LHL, this bound is meaningful even when one extracts more bits than the min-entropy we have!) Based on these results we build a general computational extractor that enjoys low entropy loss and can be used to instantiate a generic key derivation function for any cryptographic application. Second, we study the soundness of the natural expand-then-extract approach, where one uses a pseudorandom generator (PRG) to expand a short “input seed” S into a longer “output seed” S , and then use the resulting S as the seed required by the LHL (or, more generally, by any randomness extractor). We show that, in general, the expandthen-extract approach is not sound if the Decisional Diffie-Hellman assumption is true. Despite that, we show that it is sound either: (1) when P. Rogaway (Ed.): CRYPTO 2011, LNCS 6841, pp. 1–20, 2011. c International Association for Cryptologic Research 2011
2
B. Barak et al. extracting a “small” (logarithmic in the security of the PRG) number of bits; or (2) in minicrypt. Implication (2) suggests that the expandthen-extract approach is likely secure when used with “practical” PRGs, despite lacking a reductionist proof of security!
1
Introduction
The famous Leftover Hash Lemma [18] (LHL; see also [18] for earlier formulations) has found a huge number of applications in many areas of cryptography and complexity theory. In its simplest form, it states that universal hash functions [7] are good (strong) randomness extractors [31]. Specifically, if X is a distribution of min-entropy m over some space X , H is a family of universal functions (see Definition 2) from X to {0, 1}v , and H is a random member of H, then, even conditioned on the “seed” H, the statistical distance √ between H(X) and the uniform distribution Uv on {0, 1}v is bounded by 2−L , where def
L = m − v. The parameter L is defined as the entropy loss and it measures the amount of min-entropy “sacrificed” in order to achieve good randomness extraction. Thus, no application can tell apart the “extracted” randomness H(X) def √ from uniform randomness Uv , with advantage greater than ε = 2−L , even if the seed H is published (as long as H is independent of X). The LHL is extremely attractive for many reasons. First, and foremost, it leads to simple and efficient randomness extractors, and can be used in many applications requiring good secret randomness. One such major setting is that of cryptographic key derivation, which is needed in many situations, such as privacy amplification [4], Diffie-Hellman key exchange [14,25], biometrics [11,5] and random number generators from physical sources of randomness [3,2]. Second, many simple functions, such as the inner product or, more generally, matrixvector multiplication, are universal. Such elegant functions have nice algebraic properties which can be used for other reasons beyond randomness extraction (for a few examples, see [26,10,29]). Third, many simple and efficient constructions of (almost) universal hash functions are known [7,37,30,24], making LHLbased extractors the most efficient extractors to date. Finally, LHL achieves the optimal value of the entropy loss L = m − v sufficient to achieve the desired statistical distance ε. Specifically, LHL achieves L = 2 log (1/ε), which is known to be the the smallest possible entropy loss for any extractor [34]. Despite these extremely attractive properties, LHL-based extractors are not necessarily applicable or sufficient in various situations. This is primarily due to the following two limitations of the LHL: large entropy loss and large seed. Large Entropy Loss. In theory, the entropy loss of 2 log (1/ε) might appear quite insignificant, especially in the asymptotic sense. However, in practical situations it often becomes a deal-breaker, especially when applied to the setting of key derivation. In this case the main question is to determine the smallest min-entropy value m sufficient to extract a v-bit key with security ε. Minimizing this value m, which we call startup entropy, is often of critical importance, especially in entropy
Leftover Hash Lemma, Revisited
3
constrained scenarios, such as Diffie-Hellman key exchange (especially on elliptic curves) or biometrics. For example, for the Diffie-Hellman key exchange, the value m corresponds to the size of the elliptic curve group, which directly affects efficiency. This is one of the reasons why statistical extractors are often replaced in practice with heuristic constructions based on cryptographic hash functions. Large Seed. Another significant hurdle in the use of LHL comes from the fact that universal hash functions require long description, which means that LHLbased extractors have long seeds. Indeed, Stinson [37] showed that (perfectly) universal hash functions require the length of the seed to be linear in the length of the source X. More generally, even “good-enough” almost universal hash functions for LHL require seeds of length at least min(|X| − v, v + 2 log (1/ε)) − O(1) [37], and, thus, must grow with the number of extracted bits. This large seed length makes it inconvenient in many applications of extractors (e.g., [6,35,25]), including any use of extractors for derandomization, where one must be able to enumerate over all the seeds efficiently. Large (and variable-length) seeds are also inconvenient for standardized cryptographic applications where fixed-size keys, independent of the size of inputs, are favored (as in the case of block ciphers or cryptographic hash functions). When extractors are used in cryptographic settings, seeds are viewed as keys and hence fixed-size seeds are very desirable. In applications of extractors, where the attacker is assumed to be sufficiently limited as to not make the source X dependent on the seed (e.g., when extracting keys from biometrics, physical measurements or in the Diffie-Hellman key exchange), one might consider fixing a good public seed, and use it repeatedly with a fast provably secure extractor. As said, this is not possible with universal hash functions as their seed length must grow with the length of X.1 Our Results. Quite surprisingly, we show that both limitations of the LHL — large entropy loss and large seed — can be overcome or, at least, mitigated in various important scenarios. We describe these results below. 1.1
Reducing the Entropy Loss
At first, reducing the entropy loss L might seem impossible since we already mentioned that any extractor must have entropy loss L ≥ 2 log (1/ε) − O(1) [34]. However, the impossibility is for general applications of extractors, where we must ensure that the extracted string R cannot be distinguished from random by any statistical test D. In contrast, when extractors are used to derive cryptographic keys, we only care about limited types of statistical tests D. Concretely, the tests that correspond to the security game between the attacker A and the challenger C. For example, when deriving the key for a signature scheme, the only tests we care about correspond to the attacker seeing several signatures and then outputting a 1
In theory one can build (non-LHL-based) extractors where the length n of the seed H is roughly logarithmic in the length of the source X (see [16,36] and many references therein). However, the resulting constructions are mainly of theoretical value and lose the extreme simplicity and efficiency of LHL-based extractors.
4
B. Barak et al.
new signature. Namely, we only care that the probability of a successful forgery does not suddenly become non-negligible when the secret key is obtained using an extractor instead of being random. And since the signature scheme is assumed to be secure with a truly random key, we can restrict our attention to a very restricted class of statistical tests which almost never output 1. Similar restrictions on the distinguisher naturally arise for other cryptographic primitives, which gives us hope that the lower bound of [34] might be overcome in such settings. Generalized LHL and Applications. Indeed, we derive a tighter form of the LHL, called generalized LHL (see Theorem 1), which non-trivially depends on the type of distinguisher D we care about. Our improved bound contains a novel term informally measuring the standard deviation of the distinguisher’s advantage (the standard LHL is a particular case where this term is bounded by 1). Applying this new bound to the analysis of cryptographic functions, we obtain much tighter bounds for the security of a wide class cryptographic applications. These include key derivation for all “unpredictability” applications, such as signatures, MACs, one-way functions, identification schemes, etc. More surprisingly, they also include key derivation for some prominent “indistinguishability” applications that include all stateless encryption schemes, both CPA- and CCA-secure and in the publicand symmetric-key settings, as well as weak pseudorandom functions. Specifically, in each of these cases, denote by ε the security of the cryptographic primitive (i.e., the best success probability or advantage of an attacker with certain resources) when keyed with a perfectly random v-bit key, and by ε the corresponding security value when the key is derived from an imperfect m-bit entropy source via the LHL. We show (recall that L = m − v represents the entropy loss): √ √ ε ≤ ε + ε2v−m = ε + ε2−L (1) Comparing √ with Standard LHL. Let us first compare this bound with the regular ε + 2−L LHL bound. The latter required L ≥ 2 log (1/ε) to achieve the same type of security O(ε) as with the ideal randomness. Using our improved bound, we show that only half of that amount, L = log (1/ε), already suffices. In fact, not only do we get improved bounds on the entropy loss L, but we also get meaningful security bounds for arbitrary values of L, even negative ones (when the entropy loss becomes “entropy gain”)! E.g., standard LHL does √ not give anything for L ≤ 0, while we achieve significant ε ≈ ε security for L = 0 (no entropy loss!), and even start to “gracefully borrow” security from our application when we extract more bits than the min-entropy of the source, up to L = − log (1/ε) (i.e., v = m + log (1/ε)). Computational Extractor with Improved Loss. Although our improved bound, as stated, is not applicable to all cryptographic applications (the most important omission being pseudorandom functions and stream ciphers), in Section 3.2 we use our results to build general-purpose key derivation function for any (computationally-secure) cryptographic application, while providing the full entropy benefits derived from Equation (1). The scheme combines any LHLbased extractor with any (weak) pseudorandom function family.
Leftover Hash Lemma, Revisited
1.2
5
Reducing the Seed Length
Expand-then-Extract. A natural idea to reduce the seed length is to use a pseudorandom generator (PRG) to expand a short “input seed” S into a longer “output seed” S , and then use the resulting S as the seed required by the LHL, or, more generally, by any randomness extractor. Let us call this natural approach expand-then-extract. Of course, as long as one hides the short S and uses the long S as the public seed for the extractor, the extracted bits are pseudorandom. But is it possible to ensure the pseudorandomness of the extractor’s output if the actual short seed S is made public? Had this been the case, we would obtain efficient LHL-based extractors with a short seed and, moreover, an extractor whose seed length is independent of the length of the input, as desired for the practical scenarios discussed earlier. Counter-Example. In Section 4.1 we show that the expand-then-extract approach will not work in general. We construct a simple PRG (which is secure under the Decisional Diffie-Hellman (DDH) assumption) and an extractor (which is a natural, perfectly universal hash function), where the output of the extractor — on any (e.g., even uniform) distribution — can be efficiently distinguished from random with probability close to 1, when given the short seed S used to generate the pseudorandom long seed S for the extractor. Despite the above, we also show two positive results which nicely complement our counter-example. Extracting Few Bits. First, in Section 4.2 we show that the expand-thenextract approach always works provided the number of extracted bits v is “small”. Here “small” means logarithmic in the security level of the PRG, which could range from O(log k) to Ω(k) (where k is the security parameter), depending on whether PRG is assumed to be polynomially or exponentially hard. Quite interestingly, in this case we do not even have to settle for pseudorandom bits: our small number v of extracted bits is actually statistically random, as long as the PRG is secure against circuits whose size is exponential in v. The intuition for this result comes from the fact that we can test, in time exponential in v, whether a given n-bit extractor seed s is “good” or “bad” for our source X. We also know that most random long seeds s ← Un must be good. Hence, by the PRG security, the same must be true for “most” pseudorandom seeds s ← Prg(Uk ), which is precisely what we need to show. Security in minicrypt. Second, although our original counterexample is fairly simple and natural, it involves an assumption (DDH) from the “public-key world”. In Section 4.3, we show, somewhat surprisingly, that such “public-key” type assumption is indeed necessary for any counter-example. We do this by showing that the expand-then-extract approach is sound in minicrypt [22] (i.e. in a hypothetical world where pseudorandom generators exist, but public-key cryptography does not). In particular, we construct a simple 2-message protocol (built from a PRG and an extractor) which constitutes a secure keyagreement protocol for any PRG/extractor combination for which the
6
B. Barak et al.
expand-then-extract approach is insecure. Since our protocol only has 2 messages, we even get semantically secure public-key encryption (PKE). Hence, since no such protocol/PKE exist in minicrypt, expand-then-extract must be secure. Practical Interpretation. This leads to the following practical interpretation of our results indicating that using the expand-then-extract approach with common pseudorandom primitives, such as AES, is secure in spite of a lack of direct (reductionist) proof of security. Indeed, consider the expand-then-extract scheme implemented via AES (in some stream cipher mode). Our results show that, if this extraction scheme fails, then we have found a public-key encryption scheme that is provable secure based on the security of AES as a block cipher! Moreover, the resulting PKE has a very restrictive form, where the secret key is a PRG seed S, and the public-key is the PRG output S = Prg(S). (E.g., in the case of AES, the public key is simply the evaluation of AES on several distinct points.) As we argue in Section 4.3, the existence of such a PKE appears to be extremely unlikely, and would be a major breakthrough given current stateof-the-art. Thus, our results give strong evidence that the expand-then-extract approach might be secure “in practice”, — when used with “fast” ciphers (like AES), — despite being (generally) insecure “in theory”! We also remark that all our results elegantly handle side information Z the attacker might have about our source X (as advocated by [11], such “average-case” extractors are very handy in cryptographic applications), and also generalize to the case of almost universal hash functions. 1.3
Related Work
Hast [17] also observed that for certain cryptographic applications, the relevant attackers correspond to restricted classes of distinguishers, which allowed him to obtain improved security bounds when the Goldreich-Levin hardcore bit [15] is used as a “computational” randomness extractor. This result is incomparable to ours. On the one hand, we consider general (multi-bit) LHL-based extractors and not just the single bit inner-product function (which is the form of the GoldreichLevin predicate). On the other hand, Hast was working in the computational setting, and had to make an explicit reduction from the distinguisher to the predictor of the source X, which is not required in our setting. We also mentioned the notion of slice extractors defined by Radhakrishnan and Ta-Shma [34], which limits the type of statistical tests to “rare distinguishers”. To the best of our understanding, this definition was not motivated by applications, but rather was a convenient “parametrization” on a road to other results. Still, this notion roughly correspond to the setting of key derivation for authentication applications, when the attacker rarely succeeds. Interestingly, [34] showed a lower bound for the entropy loss of slice extractors (which was lower than that of general extractors), and matched this lower bound by an existential construction. As it turns out, our improved LHL immediately gives a constructive way to match this lower bound, showing that LHL-based extractors are
Leftover Hash Lemma, Revisited
7
optimal slice extractors in terms of the entropy loss. This connection is outlined in more detail in the full version of this paper [1]. In a very different (non-cryptographic) context of building hash tables, Mitzenmacher and Vahdan [27] also observed that improved bounds on the “entropy loss” could be obtained when the standard deviation of the “distinguisher” is much less than 1. In their setting the entropy loss was the minimum entropy required from the input stream to hash well, and the distinguisher was the characteristic function of a set of occupied buckets. We note that our “win-win” result for the expand-then-extract approach is similar in spirit to several other “win-win” results [13,32,12,33], where a (hypothetical) adversary for one task is turned into a “surprising useful” protocol for a seemingly unrelated task. Among the above, the result most similar to ours is [13], where a PRG is used to expand the key for “forward secure storage”, which is a concept related to “locally computable” extractors. On the more practical side of our results, particularly in what refers to key derivation, it is worth mentioning the work of [9,25] that analyze constructions of key derivation functions (KDFs) based on cryptographic hash functions. These constructions do not use standard, generic assumptions, such as pseudorandomness, but build on specific modes of operations on their compression function f , and rely on dedicated, sometimes idealized, assumptions. Under such idealized assumptions, these schemes support situations where the KDF needs to be modeled as a random oracle, or where the source only has “unpredictability entropy” [21]. On the other hand, outside of the random oracle heuristics, much of the analysis of [9,25] studied sufficient conditions on compression function f and/or the source input distribution, under which cryptographic hash functions are “universal enough” so as to apply the standard LHL. As such, these analyses suffer the same drawbacks as any other LHL-based extractor. In particular, our results regarding the improved entropy loss for LHL-based extractors should carry over to improve the results of [9,25], while our results on the expand-thenextract approach could be viewed as partial justification of the heuristic where a fixed-description-length compression function is replaced by random in most (but not all) of the analyses of [9,25].
2
Standard Leftover Hash Lemma
Notation. For a set S, we let US denote the uniform distribution over S. For an integer v ∈ N, we let Uv denote the uniform distribution over {0, 1}v , the bit-strings of length v. For a distribution or random variable X we write x ← X to denote the operation of sampling a random x according to X. For a set S, we write s ← S as shorthand for s ← US . Min-Entropy and Extractors. The min-entropy of a random variable X def is defined as H∞ (X) = − log(maxx Pr[X = x]). In cryptographic applications, one often uses the average min-entropy of a random variable X conditioned on another random variable Z. This is defined as
8
B. Barak et al.
∞ (X|Z) def H = − log Ez←Z max Pr[X = x|Z = z] = − log Ez←Z 2−H∞ (X|Z=z) x
where Ez←Z denotes the expected value over z ← Z, and measures the worstcase predictability of X by an adversary that may observe a correlated variable Z. We denote with ΔD (X, Y ) the advantage of a circuit D in distinguishing the def random variables X, Y : ΔD (X, Y ) = | Pr[D(X) = 1] − Pr[D(Y ) = 1] |. The statistical distance between two random variables X, Y is defined by def 1 SD(X, Y ) = |Pr[X = x] − Pr[Y = x]| = max ΔD (X, Y ) D 2 x where the maximum is taken over all (potentially computationally unbounded) D. Given side information Z, we write ΔD (X, Y |Z) and SD(X, Y |Z) as shorthands for ΔD ((X, Z), (Y, Z)) and SD((X, Z), (Y, Z)), respectively.2 An extractor [31] can be used to extract uniform randomness out of a weaklyrandom value which is only assumed to have sufficient min-entropy. Our definition follows that of [11], which is defined in terms of conditional min-entropy. Definition 1 (Extractors). An efficient function Ext : X × {0, 1}n → {0, 1}v is an (average-case, strong) (m, ε)-extractor (for space X ), if for all X, Z such ∞ (X|Z) ≥ m, we get that X is distributed over X and H SD( Ext(X; S) , Uv | (S, Z)) ≤ ε where S ≡ Un denotes the coins of Ext (called the seed). The value L = m − v is called the entropy loss of Ext, and the value n is called the seed length of Ext. Universal hashing and Leftover Hash lemma. We now recall the definition of universal-hashing [7,37] and the leftover-hash lemma [18], which states that universal hash functions are also good extractors. Definition 2 (ρ-Universal Hashing). A family H of (deterministic) functions h : X → {0, 1}v is a called ρ-universal hash family (on space X ), if for any x1 = x2 ∈ X we have Prh←H [h(x1 ) = h(x2 )] ≤ ρ. When ρ = 1/2v , we say that H is universal. We can finally state the Leftover Hash Lemma (LHL). (Multiple versions of this lemma have appeared; we use the formulation of [38, Theorem 8.1], augmented by [11, Lemma 2.4] for the conditional entropy case; see [18] and references therein for earlier formulations.) Lemma 1 (Leftover-Hash Lemma). Assume that the family H of functions def h : X → {0, 1}v is a 1+γ -universal hash family. Then the extractor Ext(x; h) = 2v v h(x), where h is uniform over H, is an (m, ε)-extractor, where ε = 12 · γ + 22m = 2 1 γ + 21L (recall, L = m−v is the entropy loss). In particular, 1+3ε 2· 2v -universal hash functions yield (v + 2 log (1/ε) , ε)-extractors. 2
Notice, ΔD (X, Y |Z) ≤ Ez←Z [ΔD (X|Z=z , Y |Z=z )], maxD Ez←Z [ΔD (X|Z=z , Y |Z=z )].
but
SD(X, Y |Z)
=
Leftover Hash Lemma, Revisited
3
9
Reducing the Entropy Loss
As we mentioned, the entropy loss of 2 log (1/ε) is optimal when one is concerned with general distinguishers D [34]. As we show, in various cryptographic scenarios we only care about a somewhat restrictive class of distinguishers, which will allow us to reduce the entropy loss for such applications. Below, we state a generalization of the LHL (Theorem 1), which will include a novel term measuring the standard deviation of the distinguisher’s advantage, and then derive some useful special cases (Theorem 2). In Section 3.1, we then apply our tighter bound to derive improved entropy loss bounds for various cryptographic applications, including bounds for all authentication applications (Theorem 3) and some privacy applications,including chosen plaintext secure encryption (Theorem 4) and weak PRFs. In Section 3.2 we further extend our results to get a generic key derivation function with improved entropy loss for any computationally secure application, including stream ciphers and PRFs. Collision Probability and c-Variance. Given a distribution Y , its collidef 2 −H∞ (Y ) sion probability is Col(Y ) = . Given a joint distriy Pr[Y = y] ≤ 2
bution (Y, Z), we let Col(Y |Z) = Ez [Col(Y |Z = z)] ≤ 2−H∞ (Y |Z) . We also use the notation (UY , Z) to denote the probability distribution which first samples (y, z) ← (Y, Z), but then replaces y by an independent, uniform sample from UY . Finally, given a random variable W and a constant c, we define its c-variance def def as Varc [W ] = E[(W − c)2 ] and its c-standard deviation as σc [W ] = Varc [W ]. When c = E[W ], we recover the standard notion of variance and standard deviation, Var[W ] and σ[W ], and notice that these are the smallest possible values for Varc [W ] and σc [W ]. Still, we will later find it easier to use (slightly weaker) bounds obtained with specific values of c ∈ {0, 12 }. We start with an useful lemma of independent interest which generalizes Lemma 4.5.1 of [27]. def
Lemma 2. Assume (Y, Z) is a pair of correlated random variables distribution on a set Y × Z. Then for any (deterministic) real-valued function f : Y × Z → R and any constant c, we have | E[f (Y, Z)] − E[f (UY , Z)] | ≤ σc [f (UY , Z)] · |Y|Col(Y |Z) − 1 (2) The proof of this lemma can be found in the full version of this paper [1]. The useful feature of the bound given in Equation (2) comes from the fact that the value σc [f (UY , Z)] does not depend on the actual distribution Y used to replace the uniform distribution, while the value |Y|Col(Y |Z) − 1 does not depend on the function f whose average we are trying to preserve (by using Y in place of UY ). In particular, we get the following corollary which will allow us to eventually get all our improved bounds. Theorem 1 (Generalized LHL). Let (X, Z) be some joint distribution over X × Z, H = {h : X → {0, 1}v } be a family of 1+γ 2v -universal hash functions, def H be a random member of H, and let L = H∞ (X|Z) − v be the entropy loss.
10
B. Barak et al.
Then, for any constant c ∈ [0, 1] and any (possibly probabilistic) distinguisher D(r, h, z), we have 1 ΔD (H(X), Uv | (H, Z)) ≤ σc Pr[D(Uv , H, Z) = 1] · γ + L (3) D 2 The proof of the theorem can be found in the full version of this paper [1]. Equation (3) bounds the advantage of D in distinguishing real and extracted randomness using two terms. The second term (under the square root) depends on the universality of H and the entropy loss L (but not on D). The novel term is the c-standard deviation σc [PrD [D(Uv , H, Z) = 1]] of D, which we will simply call c-standard deviation of D and denote V (D, c). Intuitively, it measures how “concentrated” the expected output of D is to some value c in the “ideal setting” (when fed Uv rather than H(X)). We notice that for any D and any c ∈ [0, 1], the c-standard deviation V (D, c) ≤ 1. Plugging this trivial bound in Equation (3) removes the dependence on D, and (essentially)3 gives us the statement of the standard LHL from Lemma 1. As mentioned, though, this forces the entropy loss to be at least 2 log (1/ε) to achieve security ε. Below, √ we show several special cases when we can upper bound V (D, c) by roughly ε, which means that the entropy loss L only needs to be roughly log (1/ε) (say, with perfectly universal H) to achieve security ε. Theorem 2. Let (X, Z) be some joint distribution over X × Z, H = {h : X → {0, 1}v } be a family of 1+γ -universal hash functions, H be a random member 2v def ∞ (X|Z) − v be the entropy loss, and D(r, h, z) be some (possibly of H, L = H probabilistic) distinguisher. Then, for each of the values ε defined in scenarios (a)-(c) below it holds:
1 ΔD (H(X), Uv | (H, Z)) ≤ ε · γ + L (4) 2 (a) Assume for some c, δ, τ ∈ [0, 1], ε = τ 2 + δ and the following condition is satisfied:4 Pr
r←Uv ,h←H,z←Z
[ | Pr[D(r, h, z) = 1] − c| ≥ τ ] ≤ δ D
(5)
(b) Assume Pr[D(Uv , H, Z) = 1] ≤ ε (where probability is taken over Uv , H, Z and the coins of D). (c) For fixed r, h, and z, define the distinguisher D (r, h, z) as follows. First, ˜ d ← D(r, h, z). Then, if d˜ = 1, return d make two independent samples d, else return (1 − d). Assume further that Pr[D (Uv , H, Z) = 1] ≤ 12 + 2 . The proof of this Theorem is given in the full version [1]. In the following section, we demonstrate the use of Theorem 2 by concentrating on the important case of key derivation using LHL, where the value ε will essentially correspond to the “cryptographic security” of the application at hand. 3 4
The exact bound claimed in Lemma 1 follows when V (D, c) ≤ 12 , which is true for c = 1/2. Note that the condition below implies | Pr[D(Uv , H, Z) = 1] − c| ≤ τ + δ.
Leftover Hash Lemma, Revisited
3.1
11
Improved LHL for Key Derivation
Consider any cryptographic primitive P (e.g., signature, encryption, etc.), which uses randomness R ∈ {0, 1}v to derive its secret (and, public, if needed) key(s). Without loss of generality, we can assume that R itself is the secret key. In the “ideal” setting, R = Uv is perfectly uniform and independent from whatever side information Z available to the attacker. In the ”real setting”, the key owner has a randomness source, represented by a random variable X and possibly correlated with the attacker’s side information Z. It then samples a universal hash function H using (fresh) public randomness and uses the extracted value R = H(X) as its key. We would like to argue that if P is “ε-secure” in the ideal setting (against attackers with resources5 less than T ), then P is also “ε -secure” in the real setting (against attackers with resources less than T ≈ T ), where ε is not much larger than ε. Of course, to have a hope of achieving this, H ∞ (X|Z) − v must “high-enough”. To must be “universal-enough” and L = H parameterize this, we will sometimes explicitly write (L, γ)-real model to denote ∞ (X|Z) ≥ v + L. the real model above, where H is (1 + γ)2−v -universal and H We formalize this general setting as follows. Abstract Security Games. We assume that the security of P is defined via an interactive game between a probabilistic attacker A(h, z) and a probabilistic challenger C(r). Here one should think of h and z as particular values of the hash function and the side information, respectively, and r as a particular value used by the challenger in the key generation algorithm of P . We note that C only uses the secret key r and does not depend on h and z. In the ideal setting, where r ← Uv , the attacker A does not use the values h and z (and anyway the optimal values of h and z can be hardwired into A in the non-uniform model), yet, for notation convenience, we will still pass h and z to A even in the ideal setting. At the end of the game, C(r) outputs a bit b, where b = 1 indicates that the attacker “won the game”. Since C is fixed by the definition of P (e.g., C runs the unforgeability game for signature or the semantic security game for encryption, etc.), we denote by DA (r, h, z) the (abstract) distinguisher which simulates the entire game between A(h, z) and C(r) and outputs the bit b, and by WinA (r, h, z) = Pr[DA (r, h, z) = 1] the probability that A(h, z) wins the game against C(r). With this notation, the probability of winning the game in the “real setting” is given by the random variable WinA (H(X), H, Z), and the same probability in the ideal setting becomes WinA (Uv , H, Z). Moreover, the difference between these probabilities is simply the distinguishing advantage of DA of telling apart real and extracted randomness when given H, Z: |WinA (H(X), H, Z) − WinA (Uv , H, Z)| = ΔDA (H(X), Uv | (H, Z))
(6)
As we justify next, to argue the security of P in the real setting assuming its security in the ideal setting, it is sufficient for us to argue that the above 5
We use the word “resource” to include all the efficiency measures we might care about, such as running time, circuit size, number of oracle queries, etc.
12
B. Barak et al.
distinguishing advantage is “small” for all legal attackers A. And since the security of P will usually restrict the power of attackers A (hence, also the power of abstract distinguishers DA ), we may use the results of Theorem 2 to argue ∞ (X|Z) − v. better bounds on the entropy loss L = H Definition 3. Let c = 0 for unpredictability applications P (signature, MAC, one-way function, etc.) and c = 12 for indistinguishability applications P (encryption, pseudorandom function/permutation, etc.). Fix also the (1 + γ)2−v ∞ (X|Z) ≥ universal hash family H and the joint distribution (X, Z) satisfying H v + L, so that the real and the ideal model are well-defined. We say that P is (T, ε)-secure in the ideal model if for all attackers A with resources less than T , we have WinA (Uv , H, Z) ≤ c + ε. Similarly, P is (T , ε )-secure in the real model if for all attackers A have resources less than T , we have WinA (H(X), H, Z) ≤ c + ε . Triangle inequality coupled with Equation (6) immediately yields the following Corollary. Lemma 3. Fix L and γ defining the real and the ideal models. Assume P is (T, ε)-secure in the ideal model, and for all attackers A with resources less than T (where T ≤ T ) we have ΔDA (H(X), Uv | (H, Z)) ≤ δ. Then P is (T , ε + δ)secure in the (L, γ)-real model. We are now ready to apply Lemma 3 and Theorem 2 to various cryptographic primitives P . Below, we let c ∈ {0, 12 } be the constant governing the security of P (0 for unpredictability and 1/2 for indistinguishability applications). Due to space constraint, we leave the application of part (a) of Theorem 2 to so called “strongly secure” primitives, where (for some τ and δ) any attacker has advantage more than τ on at most δ the fraction of keys r, to the full version [1] of the paper, and move directly to other applications which use parts (b) and (c) of Theorem 2. We also give several concrete examples in the full version [1]. Improved Bound for Unpredictability Applications. Recall, authentication applications correspond to c = 0, and include signature schemes, MACs, one-way functions/permutations, etc. In this case (T, ε)-security in the ideal model implies that for any T -bounded attacker A, E[WinA (Uv , H, Z)] ≤ ε. Recalling the definition of the abstract distinguisher DA , this is the same as Pr[DA (Uv , H, Z) = 1] ≤ ε, which is precisely the pre-condition for part (b) of Theorem 2. Thus, combining Equation (4) with Lemma 3, we immediate get: Theorem 3. Fix L and γ defining the real and the ideal models. Assume authentication primitive P (corresponding to c = 0) is (T, ε)-secure in the ideal model. Then P is (T, ε )-secure in the (L, γ)-real model, where
1 ε ≤ ε+ ε γ+ L 2
(7)
Leftover Hash Lemma, Revisited
13
In particular, if γ = 0 and L = log (1/ε), then ε ≤ 2ε. Moreover, when γ = 0, the security bound is meaningful even for negative entropy “loss” 0 ≥ L > ∞ (X|Z) and − log (1/ε), when one extracts more bits than the min-entropy H “borrows the security deficit” from the ideal security of P . Intuitively, Theorem 3 uses the fact that for authentication applications one only cares about distinguishers which almost never output 1, since the attacker almost never forges successfully. Improved Bound for Some Indistinguishability Applications. We now move to the more difficult case of indistinguishability applications, where c = 1/2. In general, we do not expect to outperform the standard LHL, as illustrated by the one-time pad example. Quite surprisingly, we show that the for a class of applications, including chosen plaintext attack (CPA) secure encryption, one can still get improved bounds as compared to the standard LHL. Specifically, as long as the primitive P allows the attacker A to “test” its success before playing the actual “challenge” from C, we still get significant savings. We start by defining the general type of security games where our technique applies. Bit-Guessing Games. As usual the game is played by the attacker A = A(h, z) and the challenger C(r). The game can have an arbitrary structure, except the winning condition is determined as follows. At some point A asks C for a “challenge”. C flips a random bit b ∈ {0, 1}, and sends A a value e = e(b, r). The game continues in an arbitrary way and ends with A making a guess b . A wins if b = b . So far, this still includes all standard indistinguishability games, including the one-time pad. The extra assumption we make is the following. For any valid attacker A having resources less than T there exists another valid attacker A (having somewhat larger resources T ≥ T ) such that: (1) The execution between A and C(r) defines four bits b, b , ˜b, ˜b , such that the joint distribution of (b, b , ˜b, ˜b ) is the same as two independent tuples (b, b ) obtained when A runs with C(r). (2) The bits b and b are precisely the secret bit of C and the guess of A , so that A wins iff b = b . (3) A learns if ˜b = ˜b before outputting b . We will call such indistinguishability games (T , T )-simulatable. In the full version [1], we show a general result stating improved bounds on entropy loss for any (T , T )-simulatable application, and also show that CPA-secure (public- or symmetric-key) encryption schemes are simulatable, where, as expected, the “resources” T are roughly doubled compared to T . (Intuitively, the attacker can run the challenger in “his head” and see if it won.) In particular, we get the following theorem as a corollary of this general result: Theorem 4. Fix L and γ defining the real and the ideal models, and set ε = ε + ε(γ + 2−L ).
14
B. Barak et al.
Assume P is public-key encryption scheme which is ε-secure, in the ideal model, against attackers with running time 2t + tenc , where tenc is the runtime of the encryption process. Then P is ε -secure, in the (L, γ)-real model, against attackers with running time t. Similarly, assume P is a symmetric-key encryption scheme which is ε-secure, in the ideal model, against attackers with running time 2t + O(1) and making 2q + 1 encryption queries. Then P is ε -secure, in the (L, γ)-real model, against attackers with running time t and making q encryption queries. Limitations and Extensions. Unfortunately, several other indistinguishability primitives, such as pseudorandom generators, functions or permutations, do not appear to be simulatable. The problem seems to be in verifying the winning condition (condition (3) of simulatability), since this has to be done with respect to the actual secret key r not known to the attacker. For PRFs (or PRPs), it is tempting to solve the problem by using an equivalent definition, where the attacker can learn the value of PRF at any point, but then, as a challenge, must distinguish the value of the PRF at an un-queried point from random. Although this variant allows the attacker to check the winning condition during the first “virtual” run, it now creates a different problem in that the challenge point during the second “actual” run might have been queried during the first run, making such an attacker A invalid. Interestingly, the above “fix” works for a useful relaxation of PRFs, known as weak PRFs (wPRFs). Here the attacker only gets to see the values of the PRF at several random points, and has to distinguish a new value from random. Assuming a large enough input domain, the probability of collision between the PRF values revealed in the first first run and challenged in the second run, is negligible, which allows to complete the (valid) simulation. Similarly, it works for a slightly stronger relaxation of PRFs, known as random-challenge PRFs. As with wPRFs, A gets as the challenge a real-or-random evaluations of the PRF at a random point, but can additionally query the PRF at arbitrary points different from the challenge point. In Section 3.2 we show that wPRFs are all we need to apply our results to a generic key derivation function. 3.2
A Generic Key Derivation Function
So far we have discussed the applications of our generalized Leftover Hash Lemma and Theorem 2 to the derivation of cryptographic keys in entropyconstraint environments for specific applications. Although our analysis covers many such applications, it does not cover all, including PRFs and stream ciphers. In this section we make a simple observation which allows us to overcome this limitation and design a generic key derivation function (KDFs) which is (computationally) secure for any cryptographic application while still enjoying the same entropy loss savings. The idea is to compose universal hash functions a weak PRF (wPRF), where the random input to the wPRF now becomes part of the extractor seed, and use the fact that wPRFs fall under the class of simulatable applications as defined in Section 3.1.
Leftover Hash Lemma, Revisited
15
Specifically, we define the KDF on the basis of a (1 + γ)/2v -universal hash family H with v-bit outputs and a wPRF F taking a k-bit input w and a vbit key r, and outputting a v-bit output y = Fr (w), as follows. The public seed s for the KDF Ext is a pair s = (h, w), where h is a random universal function from H and w is a random element in the domain of F . We then define def Ext(x, (h, w)) = Fh(x) (w); i.e., the initially extracted value h(x) is used as a wPRF key, which is then used to evaluate F on w. We also notice that if one needs to extract multiple keys for several applications, we can simply use the output of our computational KDF as a seed of a regular PRG or PRF, since such applications are now “covered”. Remark 1. For the case of deriving multiple keys, as above, we notice that the wPRF step is not needed provided all the keys are for cryptographic applications covered by our technique (i.e., strongly secure, unpredictable, or simulatable primitives). Namely, in such a case we can directly use the initially extracted key H(X) as a seed for the (regular) PRF/PRG to derive all the required keys. This allows us to avoid increasing the seed length by k bits, and saves one application of wPRF. The proof of this claim follows by a simple hybrid argument (which we omit). In general, though, the wPRF-based solution is preferable, as it adds considerable generality at a relatively moderate cost.
4
Reducing the Seed Length
In this section we study the soundness of the natural expand-then-extract approach described in the Introduction, showing our negative result in Section 4.1 and our two positive results in Section 4.2 and Section 4.3. Negligible and Friends. We use k to denote a security parameter. A function μ : N → [0, 1] is negligible if for any c > 0 there is a k0 such that μ(k) ≤ 1/kc for all k ≥ k0 . To the contrary, μ is non-negligible if for some c > 0 we have μ(k) ≥ 1/k c for infinitely many k. Throughout, negl(k) denotes a negligible function in k. A function τ (·) : N → [0, 1] is overwhelming if 1 − τ (·) is negligible. A function φ : N → [0, 1] is noticeable if for some c > 0 there is an k0 such that φ(k) ≥ 1/k c for all k ≥ k0 . Note that non-negligible is not the same as noticeable. For def
example, μ(k) = k mod 2 is non-negligible but not noticeable. def
Computational Extractors and PRGs. Recall that with ΔD (X, Y ) = | Pr[D(X) = 1] − Pr[D(Y ) = 1] | we denote the advantage of a circuit D in distinguishing the random variables X and Y . Let Dt denote the class of all probabilistic circuits of size t. With CDt (X, Y ) = maxD ΔD (X, Y ) we denote the computational distance of X and Y , here the maximum is over D ∈ Dt . When t = ∞ in unbounded, we recover the notion of statistical distance SD(X, Y ). When X = Xk and Y = Yk are families of distributions indexed by the security parameter k, we will say that X and Y are computationally indistinguishable, denoted X ≈c Y , if for every polynomial t(.), CDt(k) (Xk , Yk ) = negl(k).
16
B. Barak et al.
Definition 4 (Computational Extractor). We say that an efficient function Ext : X × {0, 1}n → {0, 1}v is an (average-case, strong) computational mextractor (for space X ), if for all efficiently samplable X, Z such that X is ∞ (X|Z) ≥ m (here X , n, v, m are all indexed by a distributed over X and H security parameter k) (Ext(X; S), S, Z) ≈c (Uv , S, Z) Definition 5 (Pseudorandom Generator). A length increasing function Prg : {0, 1}k → {0, 1}n is a pseudorandom generator (PRG) if 6 Prg(Uk ) ≈c Un . We also say that Prg is (T, δ)-secure if CDT (Prg(Uk ), Un ) ≤ δ. Computational Extractors with Short Seeds? We are ready to formalize our main question: Is it safe to expand an extractor seed using a PRG? Hypothesis 1. [Expand-then-Extract] If Ext is an (m(k), ε(k))-extractor with seed length n(k) where ε(.) is negligible and Prg : {0, 1}k → {0, 1}n(k) is a pseudorandom generator, then Ext defined as Ext (x; s) = Ext(x; Prg(s)) is a computational m-extractor. 4.1
Counter-Example: Expanding Seeds Is Insecure in General
In this section we show that, unfortunately, Hypothesis 1 is wrong in general. Theorem 5 (Hypothesis 1 wrong assuming DDH). Under the DDH assumption, there exists a pseudorandom generator Prg(.) and a strong extractor Ext(.; .) (which is a perfectly universal hash function) such that Ext (x; s) = Ext(x; Prg(s)) can be efficiently distinguished from uniform on any input distribution (i.e. Ext is not a computational extractor.) def
Proof (of Theorem 5). Let G be a prime order p cyclic group with generator g where the DDH problem is hard. Then Prg : Z3p → G 6 defined as Prg(a, b, c) = (g a , g b , g ab , g ac , g bc , g abc ) is a a secure pseudorandom generator [28]. Let Ext : Z3p × G 6 → G 2 be Ext((x, y, z); (A, B, C, D, E, F )) = (Ax B y C z , D x E y F z ) It is easy to see that Ext is a perfectly universal hash function from Z3p → G 2 (and, by Lemma 1, strong (2 log p + 2 log (1/ε) , ε)-extractor). Now consider the distribution [Ext((x, y, z); Prg(a, b, c)) , (a, b, c)] = [(g ax g by g abz , g acx g bcy g abcz ) , (a, b, c)] (8) The distribution (8) is not pseudorandom as any tuple (α, β), (a, b, c) ∈ G 2 × Z3p of the form (8) satisfies αc = β, which can be efficiently verified, while a random distribution will satisfy this relation with probability 1/p. 6
In order to avoid an extra parameter, we simply assume wlog that the seed length of our PRG is equal to the security parameter k.
Leftover Hash Lemma, Revisited
4.2
17
Expanding Seeds Is Safe When Extracting Few Bits
By the following theorem, the expand-then-extract Hypothesis does hold, if the pseudorandom generator Prg used for expansion is sufficiently strong. The required hardness depends exponentially on the output length v of the extractor. The proof of the following Theorem is given in the full version of this paper [1]. Theorem 6. Assume Ext : X ×{0, 1}n → {0, 1}v is √ a (m, ε)-extractor with running time tExt , and Prg : {0, 1}k → {0, 1}n is a (T, ε)-pseudorandom generator, for some
T ∈ O 22v (n + v)tExt /ε (9) √ def Then Ext (x; s) = Ext(x; Prg(s)) is a (m, 4 ε)-extractor. In particular, if the running time of Ext is polynomial in k, its error ε(k) = negl(k), its output size v = O(log k), and Prg is secure against polynomial (in k) size distinguishers, then Ext is an (m, ε )-extractor for ε (k) = negl(k). 4.3
Expanding Seeds Is Safe in Minicrypt
Before we can state the main result of this section, we need a few more definitions. Bit-Agreement. Bit-agreement is a protocol between two efficient parties, which we refer to as Alice and Bob. They get the security parameter k in unary (denoted 1k ) as a common input and can communicate over an authentic channel. Finally, Alice and Bob output a bit bA and bB , respectively. The protocol has correlation = (k), if for all k, Pr[bA = bB ] ≥ (1 + (k))/2. Furthermore, the protocol has security δ = δ(k), if for every efficient adversary Eve, which can observe the whole communication C, and for all k, Pr[Eve(1k , C) = bB ] ≤ 1−δ(k)/2. Key-Agreement & PKE. If (·) and δ(·) are overwhelming then such a protocol achieves key-agreement. Using parallel repetition and privacy amplification, it is known [20,19] that any protocol which achieves bit-agreement with noticeable correlation (·) and overwhelming security δ(·) can be turned into a key-agreement protocol, without increasing the number of rounds. A 2-message key-agreement protocol is equivalent to public-key encryption (PKE). The proof of the following Theorem is given in the full version of this paper [1]. Theorem 7 (Hypothesis 1 holds in minicrypt). If there exists a secure pseudef dorandom generator Prg and a strong extractor Ext where Ext (.; .) = Ext(Prg(.); .) is not a computational extractor, then the protocol from Figure 1 is a twomessage bit-agreement protocol with noticeable correlation and overwhelming security (and thus implies PKE). Remark 2. In the above theorem not being a secure computational extractor means that there exists an efficient uniform D that can distinguish Ext(Prg(.); .) with noticeable advantage (in the security parameter k). If Ext(Prg(.); .) is only insecure against non-uniform adversaries, then also the resulting protocol (which uses D) will be non-uniform. If the distinguisher D only has non-negligible advantage (i.e. only works for infinitely many, but not all, security parameters k), then
18
B. Barak et al. Alice s ← Uk ; s ← Prg(s)
s
Bob (x, z)←(X, Z) bB ←U1 if bB = 0 then r ← Ext(x; s )
r, z
else if bB = 1 then r ← Uv
bA ← D(r, s, z) Fig. 1. A bit agreement protocol from any Prg, Ext that constitute a counterexample (via distinguisher D) to Hypothesis 1
also the protocol will work for infinitely many k. This issue is inherent in win-win type results where an adversary is turned into a “useful” protocol [13,32,12,33]. It roots in the fact that in cryptography we usually put weak requirements for adversaries to be considered efficient (can be non-uniform and only have nonnegligible advantage), whereas we usually require from practical algorithms to be uniform and secure for all (sufficiently large) security parameters. We obtain the following corollary whose proof is immediate from Figure 1. Corollary 1. Assume Prg is a secure pseudorandom generator. Assume further that there exists no public-key encryption scheme (with non-negligible gap between security and decryption correctness) with pseudorandom ciphertexts, whose secret key is the seed of Prg and whose public key is the output of Prg. Then the expand-then-extract hypothesis is true for Prg. Discussion. Corollary 1 reduces the soundness of the expand-then-extract approach to the impossibility of constructing public-key encryption from the given PRG in a very particular way, where the ciphertexts are pseudorandom and, more importantly, the key-generation algorithm samples a random s and sets sk = s, pk = Prg(s). To the best of our knowledge, this impossibility assumption seems very likely for “practical” PRGs, such as AES. For example, not only there is no black-box construction of PKE (or key agreement) from a PRG alone, as shown by Impagliazzo and Rudich [23], but, in fact, it is entirely consistent with current knowledge that these two tasks are separable, in the sense that there is some computational model/complexity class (e.g., perhaps some extension of BQP or AM ∩ coAM ) that is powerful enough to break all public key schemes, but not powerful enough to break AES. If this is the case, then the AES-bases expand and extract scheme is secure with respect to all efficient input distributions and distingiuishers (even those that are based on public key tools such as factoring, lattices etc.). Moreover, we do not know any black-box construction of PKE from PRG and any other “cryptomania” assumption (like non-interactive zero-knowledge proofs, fully-homomorphic or identity-based encryption, etc.), where the public key of the PKE is simply the output of the PRG. To summarize, our results give strong evidence that the expand-then-extract approach is secure using any practical PRG (like AES), despite being (generally) insecure in theory.
Leftover Hash Lemma, Revisited
19
Acknowledgements. We would like to thank Russell Impagliazzo and Ronen Shaltiel for useful discussions.
References 1. Barak, B., Dodis, Y., Krawczyk, H., Pereira, O., Pietrzak, K., Standaert, F.-X., Yu, Y.: Leftover hash lemma, revisited. Cryptology ePrint Archive, Report 2011/088 (2011), http://eprint.iacr.org/ 2. Barak, B., Halevi, S.: A model and architecture for pseudo-random generation with applications to /dev/random. In: ACM CCS (2005) 3. Barak, B., Shaltiel, R., Tromer, E.: True Random Number Generators Secure in a Changing Environment. In: Walter, C.D., Ko¸c, C ¸ .K., Paar, C. (eds.) CHES 2003. LNCS, vol. 2779, pp. 166–180. Springer, Heidelberg (2003) 4. Bennett, C.H., Brassard, G., Robert, J.-M.: Privacy amplification by public discussion. SIAM Journal on Computing 17(2), 210–229 (1988) 5. Boyen, X., Dodis, Y., Katz, J., Ostrovsky, R., Smith, A.: Secure Remote Authentication Using Biometric Data. In: Cramer, R. (ed.) EUROCRYPT 2005. LNCS, vol. 3494, pp. 147–163. Springer, Heidelberg (2005) 6. Canetti, R., Dodis, Y., Halevi, S., Kushilevitz, E., Sahai, A.: Exposure-resilient functions and all-or-nothing transforms. In: Preneel, B. (ed.) EUROCRYPT 2000. LNCS, vol. 1807, p. 453. Springer, Heidelberg (2000) 7. Carter, J.L., Wegman, M.N.: Universal classes of hash functions. Journal of Computer and System Sciences 18, 143–154 (1979) 8. Chevalier, C., Fouque, P.-A., Pointcheval, D., Zimmer, S.: Optimal randomness extraction from a diffie-hellman element. In: Joux, A. (ed.) EUROCRYPT 2009. LNCS, vol. 5479, Springer, Heidelberg (2009) 9. Dodis, Y., Gennaro, R., H˚ astad, J., Krawczyk, H., Rabin, T.: Randomness extraction and key derivation using the cbc, cascade and hmac modes. In: Franklin, M. (ed.) CRYPTO 2004. LNCS, vol. 3152, Springer, Heidelberg (2004) 10. Dodis, Y., Katz, J., Reyzin, L., Smith, A.: Robust fuzzy extractors and authenticated key agreement from close secrets. In: Dwork, C. (ed.) CRYPTO 2006. LNCS, vol. 4117, Springer, Heidelberg (2006) 11. Dodis, Y., Ostrovsky, R., Reyzin, L., Smith, A.: Fuzzy extractors: How to generate strong keys from biometrics and other noisy data. SIAM Journal on Computing 38(1), 97–139 (2008) 12. Dubrov, B., Ishai, Y.: On the randomness complexity of efficient sampling. In: STOC (2006) 13. Dziembowski, S.: On Forward-Secure Storage. In: Dwork, C. (ed.) CRYPTO 2006. LNCS, vol. 4117, pp. 251–270. Springer, Heidelberg (2006) 14. Gennaro, R., Krawczyk, H., Rabin, T.: Secure hashed diffie-hellman over nonddh groups. In: Cachin, C., Camenisch, J.L. (eds.) EUROCRYPT 2004. LNCS, vol. 3027, Springer, Heidelberg (2004) 15. Goldreich, O., Levin, L.: A hard-core predicate for all one-way functions. In: STOC (1989) 16. Guruswami, V., Umans, C., Vadhan, S.: Unbalanced expanders and randomness extractors from parvaresh–vardy codes. J. ACM 56(4) (2009) 17. Hast, G.: Nearly one-sided tests and the goldreich?levin predicate. J. Cryptology 17(3), 209–229 (2004)
20
B. Barak et al.
18. H˚ astad, J., Impagliazzo, R., Levin, L.A., Luby, M.: Construction of pseudorandom generator from any one-way function. SIAM Journal on Computing 28(4), 1364– 1396 (1999) 19. Holenstein, T.: Key agreement from weak bit agreement. In: STOC (2005) 20. Holenstein, T.: Strengthening Key Agreement using Hard-Core Sets. PhD thesis, ETH Zurich, Zurich, Switzerland (2006) 21. Hsiao, C.-Y., Reyzin, L.: Finding Collisions on a Public Road, or Do Secure Hash Functions Need Secret Coins? In: Franklin, M. (ed.) CRYPTO 2004. LNCS, vol. 3152, pp. 92–105. Springer, Heidelberg (2004) 22. Impagliazzo, R.: A personal view of average-case complexity. In: Structure in Complexity Theory Conference, pp. 134–147 (1995) 23. Impagliazzo, R., Rudich, S.: Limits on the provable consequences of one-way permutations. In: STOC (1989) 24. Ishai, Y., Kushilevitz, E., Ostrovsky, R., Sahai, A.: Cryptography with constant computational overhead. In: STOC (2008) 25. Krawczyk, H.: Cryptographic Extraction and Key Derivation: The HKDF Scheme. In: Rabin, T. (ed.) CRYPTO 2010. LNCS, vol. 6223, pp. 631–648. Springer, Heidelberg (2010) 26. Maurer, U., Wolf, S.: Privacy amplification secure against active adversaries. In: Kaliski Jr., B.S. (ed.) CRYPTO 1997. LNCS, vol. 1294, Springer, Heidelberg (1997) 27. Mitzenmacher, M., Vadhan, S.P.: Why simple hash functions work: exploiting the entropy in a data stream. In: SODA (2008) 28. Naor, M., Reingold, O.: Number-theoretic constructions of efficient pseudo-random functions. In: FOCS (1997) 29. Naor, M., Segev, G.: Public-key cryptosystems resilient to key leakage. In: Halevi, S. (ed.) CRYPTO 2009. LNCS, vol. 5677, Springer, Heidelberg (2009) 30. Nevelsteen, W., Preneel, B.: Software Performance of Universal Hash Functions. In: Stern, J. (ed.) EUROCRYPT 1999. LNCS, vol. 1592, p. 24. Springer, Heidelberg (1999) 31. Nisan, N., Zuckerman, D.: Randomness is linear in space. Journal of Computer and System Sciences 52(1), 43–53 (1996) 32. Pietrzak, K.: Composition implies adaptive security in minicrypt. In: Vaudenay, S. (ed.) EUROCRYPT 2006. LNCS, vol. 4004, Springer, Heidelberg (2006) 33. Pietrzak, K., Sj¨ odin, J.: Weak pseudorandom functions in minicrypt. In: Aceto, L., Damg˚ ard, I., Goldberg, L.A., Halld´ orsson, M.M., Ing´ olfsd´ ottir, A., Walukiewicz, I. (eds.) ICALP 2008, Part II. LNCS, vol. 5126, pp. 423–436. Springer, Heidelberg (2008) 34. Radhakrishnan, J., Ta-Shma, A.: Bounds for dispersers, extractors, and depth-two superconcentrators. SIAM Journal on Computing 13(1), 2–24 (2000) 35. Renner, R., Wolf, S.: Unconditional authenticity and privacy from an arbitrarily weak secret. In: Boneh, D. (ed.) CRYPTO 2003. LNCS, vol. 2729, Springer, Heidelberg (2003) 36. Shaltiel, R.: Recent developments in explicit constructions of extractors. Bulletin of the EATCS 77, 67–95 (2002) 37. Stinson, D.R.: Universal hashing and authentication codes. Designs, Codes, and Cryptography 4(4), 369–380 (1994) 38. Stinson, D.R.: Universal hash families and the leftover hash lemma, and applications to cryptography and computing. Journal of Combinatorial Mathematics and Combinatorial Computing 42, 3–31 (2002), http://www.cacr.math.uwaterloo.ca/~ dstinson/publist.html
Random Oracle Reducibility Paul Baecher and Marc Fischlin Darmstadt University of Technology, Germany www.minicrypt.de
Abstract. We discuss a reduction notion relating the random oracles in two cryptographic schemes A and B. Basically, the random oracle of scheme B reduces to the one of scheme A if any hash function instantiation of the random oracle (possibly still oracle based) which makes A secure also makes B secure. In a sense, instantiating the random oracle in scheme B is thus not more demanding than the one for scheme A. If, in addition, the standard cryptographic assumptions for scheme B are implied by the ones for scheme A, we can conclude that scheme B actually relies on weaker assumptions. Technically, such a conclusion cannot be made given only individual proofs in the random oracle model for each scheme. The notion of random oracle reducibility immediately allows to transfer an uninstantiability result from an uninstantiable scheme B to a scheme A to which the random oracle reduces. We are nonetheless mainly interested in the other direction as a mean to establish hierarchically ordered random-oracle based schemes in terms of security assumptions. As a positive example, we consider the twin Diffie-Hellman (DH) encryption scheme of Cash et al. (Journal of Cryptology, 2009), which has been shown to be secure under the DH assumption in the random oracle scheme. It thus appears to improve over the related hashed ElGamal encryption scheme which relies on the random oracle model and the strong DH assumption where the adversary also gets access to a decisional DH oracle. As explained above, we complement this believe by showing that the random oracle in the twin DH scheme actually reduces to the one of the hashed ElGamal encryption scheme. We finally discuss further random oracle reductions between common signature schemes like GQ, PSS, and FDH. Keywords: Random Oracle Model, Uninstantiability, Diffie Hellman, Encryption.
1
Introduction
Suppose you have a cryptographic scheme A which can be shown to be secure in the random oracle model [4] under some assumption A, say, the RSA assumption. Assume furthermore that someone presents to you a scheme B for the same purpose which is also secure in the random oracle, but now under the potentially weaker assumption B like factoring. Clearly, if it was not for the random oracle, and scheme B would also improve over A in other relevant aspects like efficiency, then scheme B should be preferred. Unfortunately, the random oracle model introduces some undesirable uncertainty when simply following the strategy of picking the scheme with the weaker assumption. P. Rogaway (Ed.): CRYPTO 2011, LNCS 6841, pp. 21–38, 2011. c International Association for Cryptologic Research 2011
22
P. Baecher and M. Fischlin
Formally, proofs in the random oracle model (ROM) all rely on equally powerful random hash functions, but very often the exact requirements for the hash functions to conduct a security proof for a scheme remain unclear. This is all the more true since the random oracle in some schemes is uninstantiable in the sense that no efficient hash function can securely replace the random oracle [9]. For our example of schemes A and B above this means that scheme B may rely on a weaker assumption B, but the actual requirements on the hash function may be much stronger than the ones for A. In the extreme, the hash function in scheme B may be uninstantiable, whereas the hash function for A may rely on a very mild cryptographic assumption like collision-resistance (albeit no proof has been found for this so far). A natural approach to overcome the problem would be to determine the exact requirements on the hash function and to show that scheme B also relies on weaker assumptions for the hash function than scheme A. However, pinning down these properties of random oracles is often tedious and does not yield the desired result, especially since one would also need to show that the properties are necessary. One example are the hash function properties for OAEP, where Boldyreva and Fischlin [6,7] and later Kiltz et al. [19] gave necessary and, for much weaker security notions than IND-CCA, sufficient conditions on the hash function (in combination with further assumption about the underlying trapdoor permutation). None of these results, however, shows the desired kind of strong security. To complement these results, Kiltz and Pietrzak [20] claimed that for arbitrary trapdoor permutations the hash function in OAEP cannot be instantiated securely to derive IND-CCA security. The latter result is not known to be applicable to specific trapdoor permutations like RSA, though. Random Oracle Reducibility. The strategy we suggest here is based on the classical reductionist approach to relate cryptographic assumptions: Show that any hash function H, ranging from efficient instantiations to random oracles, which makes scheme A secure under assumptions A also makes scheme B secure under assumptions B. Technically, this seems to be too optimistic because hash functions in different schemes often cannot be used unchanged but rely on different domains, ranges etc. We thus allow for a “structural” transformation T H of H for scheme B, possibly depending on the specific hash function. There are three possibilities to relate the hash functions in the schemes: Definition 1 (Random Oracle Reducibility — Informally). Let A and B be some sets of assumptions. A random oracle in scheme B strictly resp. strongly resp. weakly reduces to the random oracle in scheme A if for every hash function H there exists a transformation T such that H
strictly: AH secure under A =⇒ scheme B T secure under B H scheme B T secure under A ∪ B H strongly: A secure under A =⇒ H and B T secure under B for some H H H weakly: A secure under A =⇒ scheme B T secure under A ∪ B
Random Oracle Reducibility
23
Several details are hidden in this informal definition, of course, e.g., what a “secure” scheme is, which properties the transformation must satisfy, or how cryptographic assumptions of hash function instantiations are dealt with. We fill in these details in the formal definition and keep it informally for now. We note, however, that the formal definition covers any type of hash function, i.e., both oracle-based ones, as well as keyed hash functions with succinct descriptions, or mixtures thereof. In particular, the security of scheme B in the strong case may only be known for a random oracle H . For identical assumptions A = B, or even if A ⊆ B, all three notions coincide. The difference can be best explained for the case B A, i.e., that the assumptions A are strictly stronger than B. The strict notion can in this case be put informally as saying “Scheme B is strictly superior to scheme A in regard of the assumptions, even for the hash function.” The strong and presumably more accessible approach can be described as “Scheme B is at least as good as scheme A in regard of the assumptions, but potentially superior.” The weak case says that “Scheme B is at least as good as scheme A.” In terms of security assumptions it seems that the strict and strong versions are the interesting ones (hence the names); the weak version does not provide any potential improvement concerning the assumption. We note that in the strong case often a security proof for scheme B in the random oracle model can be given without assuming security of A. We merely introduced the dependence via the prerequisite of the implication to make the notions comparable. As a first sanity check note how previous uninstantiability results relate to either kind of definition. If the hash function security of B can be (weakly, strongly, or strictly) reduced to the hash function security of A and B turns out to be uninstantiable, then this also follows for scheme A (else T H would be a valid instantiation for B). In this regard the reduction approach also allows to extend uninstantiability results without directly showing the ineffectiveness of efficient hash functions. Vice versa, any new result about secure instantiations of A would immediately transfer to B. Also, uninstantiability immediately implies that there are schemes A (allowing efficient instantiations) and B (being uninstantiable) such that the random oracle for B does not (even weakly) reduce to the one for scheme A. Example: Hashed ElGamal Encryption. To show that the strong approach is applicable and the definition non-trivial we discuss the case of Hashed ElGamal encryption [1] and its chosen-ciphertext security proof under the strong DiffieHellman (DH) assumption in the random oracle model [12]. Here the strong DH assumption says that computing DH keys is infeasible even if given (restricted) access to a decisional DH oracle. Cash et al. [10] present a variant which can be shown to be CCA secure under the (regular) DH assumption in the random oracle model. This is a clear example of two schemes where the variant seems to improve over the original one in terms of assumption, but where this conclusion is technically not known to be sound because of the random oracle model. The original hashed ElGamal encryption scheme encrypts a message under public key X = g x as (Y, c), where Y = g y and c = Enc(k, m) for the hashed Diffie-Hellman key k = H(Y, X y ) and the symmetric encryption scheme
24
P. Baecher and M. Fischlin
Enc. The variant in [10] instead computes two related ephemeral Diffie-Hellman keys from public keys X0 = g x0 and X1 = g x1 , and derives a ciphertext (Y, c) for Y = g y and c = Enc(k, m) for k = H(Y, X0y , X1y ). We show (for a slight derivate of the scheme in [10]) that the random oracles can be strongly reduced to the one of hashed ElGamal. Ciphertexts in our variant are defined as (Y, c, k1 ),
where Y = g y , c = Enc(k0 , m) for k0 = H(Y, X0y ), k1 = H(Y, X1y ),
i.e., we split the hashing into two evaluations, one for each public key part, and use the second key as a kind of confirmation that the first key is computed correctly. We can view this as the transformation T H (Y, Z0 , Z1 ) = H(Y, Z0 )||H(Y, Z1 ) and where we use a special symmetric encryption scheme where the key part k1 is output in clear. We then prove that IND-CCA security for hashed ElGamal implies security of (our variant) of the twin DH scheme for any hash function H for the same assumptions that the hashed ElGamal is secure for. We also show that our variant is secure in the random oracle model assuming only the assumptions given in [10]. It follows that the random oracle in our scheme is strongly reducible to the one of hashed ElGamal. Note that yet another hashed ElGamal scheme, related to the original scheme, has been shown to be uninstantiable [2]. The scheme differs in two important aspects from our scheme, though. First, their hashed ElGamal encryption does not use randomness and is thus deterministic. Second, the security notion considered in [2] is IND-CCA-preservation which gives the adversary simultaneously access to the algorithms of the public-key scheme and the symmetric scheme involving secret keys. In contrast, we use the standard notion of IND-CCA security for the hybrid (public-key) scheme. We note that the security reduction for our variant to the underlying primitives like the Diffie-Hellman problem for random oracle H is looser than the one in [10] in terms of concrete bounds.1 At the same time our scheme relates the random oracle to the one in the original scheme. Of course, concreteness of security bounds is another important aspect, besides efficiency, when considering random oracle reducibility. In principle, it could be incorporated as an explicit requirement in the notion. We relinquish to do so because both aspects, tightness and efficiency, depend to some extend on the individual willingness to pay for the additional security guarantees through the random oracle reducibility. Reductions for Signature Schemes. We give further examples of the applicability of the notion of random oracle reducibility by considering common signature schemes like Guillou-Quisquater [17] or PSS [5] and showing that the random oracle of a probabilistic version of FDH [11] (Full-Domain Hash) reduces to the random oracles in these schemes. However, note that FDH signatures are 1
Note that both proofs are in the random oracle model where concrete bounds must be taken with a grain of salt anyway.
Random Oracle Reducibility
25
only known to be uninstantiable according to [14,13] for plain hash evaluations over the message (i.e., no randomness). The first result only applies to random trapdoor permutations (i.e., the result is not known to apply to RSA), and the second more recent result holds when RSA is treated as a black-box group. Any progress in terms of uninstantiability of FDH signatures to our probabilistic case would thus immediately allow to conclude that the Guillou-Quisquater signature scheme and the PSS scheme are uninstantiable. This would somehow extend the uninstantiability result of Goldwasser and Kalai [16] about general (and somewhat contrived) Fiat-Shamir schemes to the “more natural” species. We discuss another random oracle reduction of (probabilistic) BLS signatures [8] to the Schnorr signature scheme [25]. In this case, however, we need a nonstandard assumption to make the reduction work, namely, the knowledge of exponent assumption KEA1 [18,3] which roughly says that when complementing a value X to a Diffie-Hellman tuple (X, Y, DH(X, Y )) one must know the discrete logarithm y of Y . For the random oracles this means that, if our version of the BLS scheme is uninstantiable, then so is the Schnorr signature scheme, or the KEA1 assumption is false.2 Some Words of Caution. Just as reductions between number-theoretic assumptions merely relate problems like factoring and RSA, but do not touch the question if RSA is really hard, a reduction for random oracles does not mean that scheme B, in and of itself, is secure (under assumptions B) or that the hash function can be securely instantiated. The reduction only says that scheme B can be made as secure as scheme A in regard of the hash function. Since we do not put any formal prerequisite about the security of scheme A, which could thus be insecure, the reduction could potentially be trivial. However, as for relating number-theoretic assumptions, where the stronger assumption is usually accompanied by some hardness analysis, scheme A typically comes with some form of security guarantee. Often, this is at least a security proof in the random oracle model, or sometimes for a relaxation thereof like non-programmable random oracles [24,15], traceable random oracles [23], or leaky random oracles [26]. The advantage of our approach is that it follows immediately that B can also be shown secure under the corresponding assumption about the hash function. One caveat is that the transformed hash function T H , unlike random oracles, obeys some structure, as the “split” evaluation in our ElGamal example. Hence, when instantiated with some efficient hash function h, scheme B could become insecure for the transformed hash function T h , despite the reduction and a proof that T H makes B secure for random oracle H. Noteworthy, at the same time B could be secure when instantiated with h directly, instead of going through the transformation T ! We observe, however, that this is an inherent limitation of the random oracle model: It solely provides a heuristic which does not allow to conclude security under concrete instantiations. Our approach at least gives 2
To be precise need the KEA1 assumption to hold even if one can get additional Schnorr signatures under the key X.
26
P. Baecher and M. Fischlin
some confidence in the choice of the hash function in the sense that the security is at least as good as the one of another, hopefully well-examined scheme.
2
Random Oracle Reducibility
Hash Functions. We consider families H of hash functions H where it is understood that H is (not necessarily efficiently) sampleable from H according to a security parameter λ. It is thus also clear that a hash function H may have a restricted input or output length, depending on λ. We write H ← H(1λ ) for the sampling. For example, to model a random oracle we let H(1λ ) be the family of all functions with the specified domain and range and the sampling picks a random function from this set. In the sequel we usually simply identify the hash function H(·) with its description H itself. We assume that hash functions are deterministic in the sense that, once a hash function has been sampled, its behavior is fixed. A hash function family may rely on some cryptographic assumptions H; in case of random oracles no assumption H is necessary as the sampling of a random function already provides all desirable security properties. Given a hash function H for a scheme A we write AH for the scheme where each party or algorithm gets oracle access to H. Furthermore, the hash function H may include a public description part which is then also given to all parties and algorithms as additional input. This public part may be for example the full description of H, or only parts thereof, e.g., if H is a hybrid between a random oracle and a keyed hash function. A hash function family is efficient if it follows the usual notion of an efficient keyed hash function, i.e., the sampling is efficient, a sampled function H is efficiently computable and entirely described through a public part. Transformations. A hash function H used in a cryptographic scheme A may not be immediately applicable to another scheme B for the mere fact that the domain and range do not fit. We therefore “slot in” a transformation algorithm T in, such that scheme B then uses the hash function T H (with the semantic that any algorithm or party gets public descriptions of T H as additional input). We write T H for the corresponding hash function family (described by sampling H ← H(1λ ) and evaluating T H ). Ideally, the transformation should only make structural modifications (like adapting the domain and range) and should be deterministic. There is, however, one technical subtlety concerning the statefulness of transformations. Namely, we explicitly require that the transformation is stateless. The reason is that if we would allow stateful transformations, it is possible to construct particular contrived transformations that trivialize our notion, in the sense that some scheme B always reduces to any scheme A. To get a sense of the problem, consider arbitrary schemes A and B which are secure in the random oracle model. Let T denote the stateful transformation which ignores its oracle H H and (efficiently) implements a random oracle via lazy sampling. Since B T is then clearly secure, scheme B is —as per Definition 1— reducible to scheme
Random Oracle Reducibility
27
A, despite the arbitrary choice of the two schemes. A similar issue arises with instantiations: Suppose scheme B is now instantiable for some hash function family H. Construct the transformation T which again ignores its oracle and instead initially samples a function H ← H and answers subsequent queries according to H . Again, scheme B remains secure and reduces to any scheme A. Both examples rely on a stateful transformation function —to answer consistently and to remember the choice of the hash function, respectively. Thus, in order to rule out such trivial cases, we ask that transformations are always stateless. This may seem overly restrictive at first glance, but, in fact, is easily justified because hash functions are inherently stateless entities. One can nonetheless allow for rather general transformations, possibly even considering transformations which themselves rely on assumptions T. Security of Schemes. We consider security of schemes to be defined via a general notion of games, albeit our games also allow to state simulation-based security properties (by saying that the game returns 1 iff for any simulator there exists a successful distinguisher). As we can subsume several games like the ones for blindness and unforgeability for blind signature schemes into a single game, with corresponding sub games for which the adversary initially decides to mount the attack against, we consider a single game G only. We let Adv(A, G) denote the advantage of adversary A playing game G, i.e., the adversary’s success probability of winning the game. This makes Adv an implicit part of G. Here, in decisional games the advantage usually denotes the adversary’s success probability minus the trivial guessing probability of 1/2, and in computational games the advantage is usually the adversary’s probability of computing a solution. Analogously to hash functions, we write GH for a security game in which all parties and algorithms get access to H in the same manner. It is understood that the choice of H ← H(1λ ) is part of the security game. We write GH for a game for which a hash function is chosen from the family H. We envision security assumptions A for a scheme A as a set of elementary properties such as unforgeability of an underlying MAC or number-theoretic assumptions like the hardness of factoring. We can then apply common set operations and relations to assumptions in a well-defined way, e.g., A ∪ B comprises all assumptions stated in A and B, and B ⊆ A means that assumptions in B hold if A holds. This approach is too applicable for the hash function assumptions H and possibly the transformation assumptions T. We also assume that assumptions are “opt-in”, i.e., need to specified in the set, or else the assumption does not hold. Formally we can define this by considering a universe U of assumptions and say that any assumption in U \ A is false. Note that we keep the formal specifications of games and assumptions at a minimal level. This is possible as we later demand random oracle reducibility with respect to specific games and assumptions. It is thus up to the reduction statement to consider “reasonable” games and assumptions. We only need very limited syntactical requirements here and can, for example, even allow conflicting assumptions in A∪B (in which case, however, the claims usually become trivial).
28
P. Baecher and M. Fischlin
Definition 2 (Game-based Security). Let A denote a cryptographic scheme and GH A an associated security game for hash family H. Scheme A is called GH A -secure under assumptions A for hash family H relying on assumptions H if for any efficient adversary A we have that Adv(A, GH A ) ≈ 0 is negligible in the security parameter, where the probability is over all random choices of the game (including the choice of the hash function), the algorithms, and the adversary. As an example consider the IND-CCA security game for an encryption scheme A (in the random oracle model), in which the game GH A proceeds in stages where A in the first phase receives a public key (in case of an asymmetric scheme) and gets access to a decryption oracle plus the random oracle, then outputs a pair of equal-length messages m0 , m1 to receive a single challenge ciphertext of mb for secret random bit b, and finally continues asking decryption queries except for the challenge ciphertext. The adversary wins if correctly predicts b, and the advantage of the adversary is the probability for a correct prediction minus 1/2. In the notation above an IND-CCA secure encryption scheme relying on some cryptographic assumption A is GH A -secure under A for random oracle H. Random Oracle Reducibility. As explained in the introduction we introduce a weak, strong, and strict notion of random oracle reducibility: Definition 3 (Random Oracle Reducibility). Let A be a cryptographic scheme with security game GA and assumptions A, and let B be a cryptographic scheme with game GB and assumptions B. Then the random oracle in scheme B (strictly resp. strongly resp. weakly) reduces to the random oracle in scheme A if for every hash function family H relying on assumptions H there exists a stateless transformation T such that H
T strict: A is GH A -secure under A ⇒ B is GB -secure under B ⎧ H ⎨ B is GTB -secure under A ∪ B and TH strong: A is GH A -secure under A ⇒ ⎩ B is GB -secure under B for some H relying on H TH weak: A is GH -secure under A ⇒ B is G -secure under A ∪ B A B
We say that (B, GH B , B) is (weakly or strongly or strictly) random oracle reducible to (A, GH , A). It is polynomial-time (weakly or strongly or strictly) ranA dom oracle reducible if it is random oracle reducible via (deterministic) stateless polynomial-time transformations T for any hash function family H. We occasionally simply say that B is random oracle reducible (RO-reducible) to A if the games and assumptions are clear from the context. Some remarks about the definition and variations follow: – The above does not rule out trivial examples where scheme B actually relies on stronger assumptions B than scheme A, e.g., if A is a subset of B. As explained in the introduction, the most interesting examples seem to be the ones where assumptions B are weaker than A or at least incomparable.
Random Oracle Reducibility
29
Occasionally, however, one may be interested in a scheme B which requires stronger assumptions B but which is more efficient (or has other desirable properties). – We can devise stronger notions concerning the order of quantification for our reducibility notion. Above, the transformation can depend on the specific hash function family H, and thus possibly specific properties of H. One could alternatively demand that the transformation needs to be universal in the sense that it works for any H. – The above definition assumes that transformation T does not rely on additional assumptions. More generally, one could specify assumptions T and say that scheme B is secure under assumptions B = B ∪ T. – According to our syntax the adversary B in game GB with the transformed random oracle would get access to T H , but not H itself. This can be easily patched by letting the transformation T give direct access to H through a special query mode.
3
Basic Results
Relating the Reducibility Notions. We first show that strict reducibility implies strong reducibility which implies weak reducibility. The proof is rather syntactical and omitted for space reasons. Proposition 1 (Strict ⇒ Strong ⇒ Weak Reducibility). Let A be a cryptographic scheme with security game GA and assumptions A, and let B be a cryptographic schemes with game GB and assumptions B. If the random oracle in scheme B strictly reduces to the random oracle in scheme A, then it also strongly reduces to it. If it strongly reduces to it, then it also weakly reduces to it. We next discuss a scheme which supports a strong reduction, but not a strict one. Note that for A ⊆ B this claim would be trivial because then the notions coincide. Instead, our separation example even holds for B A. Proposition 2 (Strong ⇒ Strict Reducibility). There exists schemes A, B H for games GH A and GB and assumptions A, B such that B A, and the random oracle of B strongly reduces to the one of scheme A, but not strictly. Proof. Let scheme A run two copies of Lamport’s one-time signature scheme [21], one based on an alleged one-way function f , and the other one by using the given hash function (oracle). Verification checks if both signatures are valid. Let GH A be the standard unforgeability game for one-time signature schemes, and let A be the assumption that an underlying function f is really one-way. Let B and GH B be the same scheme and game, but let B be the empty set. Consider the hash function family H which samples trivial functions H : {0, 1}∗ → {0} only and where H is empty. Then scheme A is still unforgeable if f is one-way, independently of the H-part of the signature. In contrast, B would be insecure under B and for the trivial hash function family, because, by assumption about the “minimalistic” approach for the set B, the function f is
30
P. Baecher and M. Fischlin
not one-way then. Hence, the random oracle in B cannot be strictly reduced to the one in A. Finally, note that for a hash function family H which is one-way the signature scheme B becomes secure even under B, because any forger would need to forge the one-time signature scheme for the hash function. At the same time, for any hash function family scheme B is secure under A ∪ B. These two properties show that the random oracle in B strongly reduces to the one in A.
For the next separation we further need to exclude contrived examples where the hash function assumptions H “makes up” for assumptions in A\B to make scheme B secure. We say that H is non-interfering with A and B iff H ∩ (A \ B) = ∅. In this case we say that the random oracle in scheme B reduces to the one in scheme A under non-interfering hash assumptions if reducibility holds for all hash function families H with non-interfering assumption H. Proposition 3 (Weak ⇒ Strong Reducibility). There exists schemes A, B H for games GH A and GB and assumptions A, B such that B A, and the random oracle of B weakly reduces to the one of scheme A, but not strongly for noninterfering hash functions. Proof. Consider again Lamport’s one-time signature scheme as scheme A, relying on a one-way function f (whose one-wayness is postulated in A). The scheme ignores the hash function. Let GH B be again the unforgeability game for one-time signature schemes. Let B the same scheme with the same security game, but let B be empty. Any hash function makes both schemes secure under assumptions A ∪ B such that the (irrelevant) random oracle of B weakly reduces to the one of A. Since B cannot be secure assuming only B, because the hash function cannot include the assumption about the one-wayness of f by the non-interference, the scheme cannot strongly reduce the random oracle.
Uninstantiability Implications. In this section we briefly show fundamental results about (un)instantiable random oracles. We define uninstantiability with respect to a very loose requirement on the assumptions, leaving it up to the reduction statement to consider only “standard” cryptographic assumptions in A and B. Definition 4 (Uninstantiability). Let A be GH A -secure under assumptions A for random oracle H. Then the random oracle is uninstantiable for GH A and A if for any efficient hash function family H with assumption H the scheme A is not GH A -secure under assumptions A. Proposition 4 (B uninstantiable ⇒ A uninstantiable). Assume that scheme B with game GH B and assumptions B is (strictly resp. strongly resp. weakly) polynomial-time RO-reducible to scheme A for GH A and (true) assumptions A. If B is uninstantiable for GH under B (for strict reductions) resp. A ∪ B (for B strong or weak reduction), then so is A for GH and assumptions A. A
Random Oracle Reducibility
31
The proof is again rather straightforward from the definitions. It is clear that this, vice versa, implies that any instantiability result about A transfers accordingly to B. Given the uninstantiability notion we next note that there are schemes for which the random oracles are not (even weakly) reducible to each other: Proposition 5 (Impossibility of Reducibility). There exists schemes A, B H for games GH A and GB and (true) assumptions A, B such that the random oracle of B does not support a weak or strong or strict polynomial-time reduction to the one of scheme A, even though B is secure in the random oracle model. The proof appears in the full version of the paper.
4
Example: Hashed ElGamal
In this section we show that the hash function in (a variant) the Twin DiffieHellman encryption scheme is RO-reducible to the hash function in hashed ElGamal. We remark that we are not aware if the original twin DH scheme allows the same reduction. Hashed ElGamal. We first review the classical hashed ElGamal-encryption scheme as presented in [1]. This scheme, denoted by A = (KGenA , EncA , DecA ) is based on the Diffie-Hellman problem and uses a hash function H and a symmetric cipher (Enc, Dec). Specifically, Construction 1 (Hashed ElGamal Encryption Scheme). The hashed ElGamal encryption scheme A = (KGenA , EncA , DecA ) in the ROM is defined as follows: KGenA (λ) pick (G, g, q) x ← Zq ; X ← g x sk ← x; pk ← (G, g, q, X) Return (sk, pk)
EncA (pk, m) y ← Zq ; Y ← g y Z ← X y ; k ← H(Y, Z) c ← Enck (m) Return (Y, c)
DecA (sk, Y, c) Z ←Yx k ← H(Y, Z) m ← Deck (c) Return m
Assuming that the symmetric cipher is secure against chosen ciphertext attacks3 and that the strong Diffie-Hellman assumption holds (where the adversary has access to a restricted DH decisional oracle), it is proven in [12] that scheme A is secure against chosen ciphertext attacks if H is modeled as a random oracle. The milder ordinary DH assumption is not known to be sufficient to prove CCA security, since the attacker obtains a decision oracle through the decryption oracle here, such that some information about the key may be leaked. Twin DH Scheme. Subsequently, Cash et al. [10] introduce the so-called strong twin DH assumption which holds if and only if the regular DH assumption holds. Their corresponding DH problems are equally hard but the twin case includes 3
We always refer to attacks involving a single challenge only throughout the paper.
32
P. Baecher and M. Fischlin
access to a decision oracle. This enables a clean security proof for a variant of the hashed ElGamal scheme, because the decryption oracle is not more powerful than the decision oracle in the strong twin DH case. Thus, the twin ElGamal scheme allows for milder number-theoretic assumptions while preserving CCA security. However, the random oracle in the twin ElGamal scheme is used slightly differently than in the original scheme: Its domain is the set of group element triples, as opposed to tuples in the original scheme. While this is unproblematic in the ROM for hash functions H : {0, 1}∗ → {0, 1}λ with arbitrary input length, the implications for other security properties for instantiations are less clear. For example, it may be that the twin Diffie-Hellman scheme demands stronger properties from the hash function. We show via our notion of RO-reducibility that this is not the case, at least for our slight variation: Construction 2 (Twin Diffie-Hellman Encryption Scheme). The twin DH encryption scheme B = (KGenB , EncB , DecB ) in the ROM is defined as follows: KGenB (λ) pick (G, g, q) x0 ← Zq ; X0 ← g x0 x1 ← Zq ; X1 ← g x1 sk ← (x0 , x1 ) pk ← (G, g, q, X0 , X1 ) Return (sk, pk)
EncB (pk, m) y ← Zq ; Y ← g y Z0 ← X0y ; k0 ← H(Y, Z0 ) Z1 ← X1y ; k1 ← H(Y, Z1 ) c ← Enck0 (m) Return (Y, c, k1 )
DecB (sk, Y, c, k1 ) Z0 ← Y x0 Z1 ← Y x1 k0 ← H(Y, Z0 ) m ← Deck0 (c) if k1 = H(Y, Z1 ) set m ← ⊥ Return m
We can view the transformation T H : G 3 → {0, 1}2λ of the hash function H : G 2 → {0, 1}λ as follows: T H (Y, Z0 , Z1 ) = H(Y, Z0 )||H(Y, Z1 ). Splitting the actual encryption of the message into an encryption for one key half and where we output the other half in clear can then be seen as a special encryption scheme (with double-length keys). RO-Reducibility. We first show that our twin DH scheme weakly reduces the random oracle to the one of the hashed ElGamal scheme for IND-CCA security, i.e., assuming the strong DH assumption. We discuss afterward that the scheme is also secure in the random oracle model assuming the regular DH assumption, implying that the reducibility is also strong: Theorem 3. Consider the hashed ElGamal encryption scheme for the INDCCA security game and the assumptions A that the symmetric encryption scheme is IND-CCA secure and the strong DH assumption holds. Then the twin DH encryption scheme B with the IND-CCA security game and the assumptions B that the symmetric encryption scheme is IND-CCA secure and that the DH assumption holds, is strongly RO-reducible to the hashed ElGamal encryption scheme via T H (Y, Z0 , Z1 ) = H(Y, Z0 )||H(Y, Z1 ).
Random Oracle Reducibility
33
The proof follows from the following two propositions. Proposition 6. Under the assumptions as in Theorem 3 the twin DH encryption scheme is weakly RO-reducible to the hashed ElGamal encryption scheme. Proof. Assume towards contradiction that there exists an algorithm B that breaks the CCA-security of B. We then describe an adversary A that breaks the CCA-security of A. This adversary essentially simulates the “second key half” of the scheme by itself. Description. To initialize the simulation adversary A on input (G, g, q, X0 ) = (G, g, q, g x0 ) chooses the other half of the secret key x1 ← Zq and calculates the corresponding public key X1 ← g x1 . Adversary A next runs adversary B with input (G, g, q, (X0 , X1 )) and answers B’s oracle queries as follows: – First, A translates any hash query H(A, B, C) from B into two queries to A’s own hash oracle. More precisely, A answers an (A, B, C) query with (H(A, B), H(A, C)) = T H (A, B, C). – In order to answer B’s challenge query (m0 , m1 ), the adversary submits (m0 , m1 ) to his own challenge oracle and parses the corresponding ciphertext answer as (Y, c). It remains to compute the extra value by re-using the randomness Y obtained from the oracle. Adversary A thus computes k1 = H(Y, Y x1 ) = H(Y, X1y ) and finally returns the ciphertext (Y, c, k1 ) to B. – On a decryption query (Y, c, k1 ) of B adversary A first checks if (Y, c) corresponds to the value in the challenge ciphertext, or if k1 = H(Y, Y x1 ). If so, then A immediately returns ⊥. Else A asks its own decryption oracle for the decryption m of (Y, c). To answer the query, it then returns m. – Note also that we can grant B direct access to the H oracle. Adversary A would simply forward this query and hand back the answer. When B eventually outputs a guess b then A outputs the same bit. Analysis. The simulation is perfect in the following sense: B cannot submit a ciphertext (Y, c, k1∗ ) to the decryption oracle (after receiving the challenge ciphertext (Y, c, k1 )) for k1∗ = k1 which would decrypt correctly. Hence, A can reject such ciphertexts immediately and therefore only submits “pruned” ciphertexts to its decryption oracle which have never appeared before. Hence, A, too, represents a successful attacker on the hashed ElGamal scheme if B is one for the twin DH scheme. Moreover, the advantages of both algorithms in their corresponding IND-CCA game are identical.
To complete the proof for a strong reduction we finally show that our version is secure in the random oracle model: Proposition 7. The twin DH encryption scheme B with the assumptions B that the symmetric encryption scheme is IND-CCA secure and that the DH assumption holds, is IND-CCA-secure in the random oracle model.
34
P. Baecher and M. Fischlin
Proof. The proof is more involved that then one in [10], owned to the fact that the random oracle H(X, Z0 , Z1 ) in [10] ties together the twin DH tuples and that this property is required for the twin DH oracle. In contrast, in our scheme the pairs (X, Z0 ) and (X, Z1 ) are only loosely connected. We show that this loose connection can be made a strong one with multiple simulations of the adversary. In a first step we can “normalize” an adversary A against IND-CCA of our twin DH scheme. First we may assume that A never makes a hash query twice. Second, we can assume that A never submits a tuple (Yi , ci , ki ) to the decryption oracle before receiving the challenge ciphertext (Y, c, k) where Yi = Y . This decreases the adversary’s success probability by a negligible amount D/q for the polynomial number D of A’s decryption queries. Third, we can assume that adversary A never submits a decryption request (Yi , ci , ki ) such that, in case Yi = Y , it has not queried the hash function about (Yi , Yix1 ) for Yi = Y before. The loss is at most D · 2−λ for this. Fourth, we assume that the adversary never submits (Yi , ci , ki ) to the decryption oracle where Yi = Y but ki = k; such a query cannot be valid. Fifth, we assume that X0 = X1 which happens with probability 1 − 1/q. Taming Hash Queries. Consider a normalized adversary A against our twin DH scheme. We assume that A in addition to T H also has direct access to the random oracle H : G 2 → {0, 1}∗. In fact, we assume from now on that all algorithms, including the adversary and the scheme’s algorithms, never call T H , but use H to simulate T H with two queries. Define the following event HashQuery that, during the IND-CCA attack, A at some point asks a query (Y, Z) to H such that Y appears in the challenge ciphertext, and Z = Y x0 or Z = Y x1 for the public key entries X0 = g x0 and X1 = g x1 . We show that the probability (λ) of event HashQuery must be negligible. Assume toward contradiction that this was not the case. We then show how to break the the twin DH problem (and thus the DH problem) via algorithm B. Algorithm B receives a group description (G, g, q) and values Y, X0 , X1 as input. It can also query a twin DH oracle about values (g a , B0 , B1 ) which outputs 1 iff B0 = X0a and B1 = X1a. The values X0 , X1 serve as the public key presented to A, and Y will be placed in the challenge ciphertext. Algorithm B runs A’s attack by using the input data as the public key, and simulating the random oracle and decryption queries as follows: – B will maintain a list L of tuples of the form (A, B, k) or (dh, A, Xb , k) where the former type corresponds to direct hash queries of A and the latter type to implicit hash queries. Initially, B sets L := {(dh, Y, X0 , k0 ), (dh, Y, X1 , k1 )} for random values k0 , k1 for the hash values to compute the challenge ciphertext (note that Y is already known at the outset). – Whenever A makes a hash query (A, B) algorithm B first searches for an entry (A, C, k) in L such that (A, B, C) or (A, C, B) forms a correct twin DH tuple (under X0 , X1 ). Since X0 = X1 only one case can happen. If found, and there exists an entry (dh, A, X0 , k) in L for the case (A, B, C) resp. (dh, A, X1 , k) for the case (A, C, B), then replace this entry by (A, B, k) in L. In any other case, pick k at random and store (A, B, k) in L. Return k.
Random Oracle Reducibility
35
– If A makes a decryption request (Yi , ci , ki ) then check whether Yi = Y or not. In case Yi = Y look up the entry (dh, Y, X0 , k0 ) in L and use k0 to decrypt ci . (Note that, by assumption, k1 must be correct.) Suppose Yi = Y . Then, since the adversary is normalized, there must be an entry (Yi , Z1 , k1 ) in L already, caused by a hash query, where Z1 = Yix1 . (There cannot exist another entry (Yi , Z1 , k1 ) for k1 = k1 as hash queries never repeat.) Given (Yi , Z1 , k1 ) check for an entry (Yi , Z0 , k0 ) such that (Yi , Z0 , Z1 ) forms a valid twin DH tuple for X0 , X1 . If such an entry exist then use k0 to decrypt ci . If no such entry exist, check for a tuple (dh, Yi , X0 , k0 ) in L and use k0 to decrypt. Else, pick a new value k0 , store (dh, Yi , X0 , k0 ) in L, and use k0 to decrypt. Return the decrypted message. To prepare the challenge ciphertext B uses the previously chosen values k0 , k1 placed in L, also picks one of the two messages m0 , m1 at random, and returns (Y, Enc(k0 , mb ), k1 ). If A finishes algorithm B records all entries (A, B) in L with A = Y and now reruns the above procedure, with the same group but for re-randomized data s1−a Y = Y s , X0 := Xasa , X1 := X1−a for random s, s0 , s1 ← Z∗q and random bit a. Every other random choice is based on fresh randomness. Any query (A, B, C) to the twin DH oracle in this second run is first transformed into (A, B 1/s0 , C 1/s1 ) for a = 0 resp. (A, C 1/s0 , B 1/s1 ) for a = 1. At the end, B transforms all pairs (A , B ) in the list L of the second run by computing ((A )1/s , (B )1/s0 ) and ((A )1/s , (B )1/s1 ), effectively doubling the number of pairs. Sieve to keep only those with first element Y . Run on all combinations of the two (sieved) lists the twin DH oracle to find a solution (Y, Z0 , Z1 ) to the twin DH problem. Analysis. The maintenance of the hash list L provides a more fine-grained implementation of how a random oracle would behave: Since any decryption query for Yi = Y must already contain a corresponding entry (Yi , Yix1 , k1 ) by assumption, we can check via the twin DH oracle if we already have a matching entry (Yi , Z0 , k0 ). If not, we generate a fresh random string and store the implicit representation (dh, Yi , X0 , k0 ) in L, and will later carefully check if a hash query for Yix0 is made (in which case we update the entry in L and re-use the value k0 ). As for B’s success probability, we call a group (G, g, q) good if A’s success probability conditioned on this group exceeds /2. By an averaging argument a group is good with probability at least /2. Hence, given such a good group, and the fact that B provides a perfect simulation, B obtains a valid entry (Y, Y x0 ) or (Y, Y x1 ) with probability at least /2 in the first run. The same applies in the second run where the re-randomization is correctly undone for each twin DH oracle query. With probability 1/2 algorithm B then obtains matching values (Y, Y x0 ) and (Y, Y x1 ) because the order bit a in the second run is informationtheoretically hidden from A. Overall, and neglecting the minor loss due to normalization of A, algorithm B thus solves the twin DH problem with probability at least 3 /16. By assumption this is still non-negligible.
36
P. Baecher and M. Fischlin
Conditioning on the adversary not making bad hash queries, it is now easy to give a reduction to the IND-CCA security of the symmetric cipher (with the attacker against the symmetric scheme providing all the public-key operations itself).
5
Reductions among Signature Schemes
In this section we briefly outline a few more applications of our notion. Specifically, we give three relations among signature schemes including the GuillouQuisquater (GQ) signature scheme [17] which we reduce to a probabilistic version of FDH, the PSS signature scheme [5] which we also reduce to a probabilistic FDH variation, and finally a reduction from Schnorr signatures [25] to a (probabilistic version of) BLS signatures [8]. GQ ⇒ FDH. We first consider the RSA-based Guillou-Quisquater identification scheme and its derived signature scheme via the Fiat-Shamir heuristic [17]. For public key pk = (X, N, e) and secret key x with X = xe mod N the signer computes a signature as (R, y) for random R = re mod N , and where y = rc x mod N for c = H(pk, R, m). A probabilistic full-domain hash (FDH) RSA signature scheme with signatures of the form (R, σ) for σ = (H(pk, R, m))d mod N is (strictly) random oracle reducible to the aforementioned Guillou-Quisquater scheme via the transformation T H (pk, R, m) = RH(pk,R,m) X mod N for any type of forgery attack under the RSA assumption. The reason is that any GuillouQuisquater signature for H can be seen as a FDH signature for T H : {0, 1}∗ → Z∗N , and any successful forgery for the FDH scheme for T H is vice versa a valid forgery for the Guillou-Quisquater scheme. PSS ⇒ FDH. The reduction of another probabilistic version of FDH to the PSS signature scheme is similar to the GQ case. Consider FDH signatures (T H (r, m))d mod N for the PSS-encoding T H (r, m) = str2int(0||w||r∗ ||H2 (w)) for w = H0 (r, m) and r∗ r⊕ = H1 (w). Here, H0 , H1 , H2 are hash functions derived from H as in the PSS scheme. Then any successful attack on FDH with hash function T H easily yields a forgery against PSS with hash function H. Hence, PSS allows a strict random oracle reduction to the probabilistic version of FDH under the RSA assumption for any type of forgery attack. Schnorr ⇒ BLS. Consider a probabilistic version of the BLS signature scheme [8], where signatures are of the form σ = (R, H(R, X, m)x ) for randomness R, message m, private key x and public key X = gx . Verification is performed analogously to the original scheme via a pairing computation. We argue that the Schnorr signature scheme (recall that a signature there is of the form σ = (c, r + cx mod q) for public key x = g x , R = g r , and c = H(R, m)) is (strictly) random oracle reducible to the BLS version via the transformation T H (R, X, m) = RX H(R,m) . This holds assuming the discrete logarithm assumption and under an augmented version of the KEA1 assumption [18,3] which states
Random Oracle Reducibility
37
that, for any adversary A which for input a description of the group, g, X, and with access to a Schnorr signing oracle under key X and a hash function oracle, outputs a pair (Y, Y x ), there exists an adversary A which, on the same input and with access to the same oracles, outputs y with X y = Y x . The probability that A succeeds, but A does not, must be negligible for all A. Suppose now that there exists some successful adversary B against our version of BLS. Construct adversary A against the Schnorr scheme as follows. Whenever B makes some query m, adversary A forwards this query to its own signing oracle. It uses the answer (c, y) to calculate h = X y , computes R = g y X −c (such that H(R, m) = c) and finally answers B’s query with (R, h). This simulates a correct signature since B expects R and T H (R, X, m)x = (RX H(R,m) )x = (g y )x = X y = h. It remains to construct a Schnorr forgery from B’s forgery, denoted by (m∗ , R∗ , Z ∗ ). To this end we note that, under the augmented KEA1 assumption, for A (running B as a subroutine) outputting Y ∗ = T H (R∗ , X, m∗ ) and Z ∗ = (Y ∗ )x for the valid forgery (m∗ , R∗ , Z ∗ ), there must exist an adversary ∗ A returning y ∗ with Z ∗ = X y . This must be true with non-negligible probability, because A succeeds with non-negligible probability, and otherwise the augmented KEA1 assumption would be false. Hence, there exists an adversary which creates a valid forgery (m∗ , H(R∗ , m∗ ), y ∗ ) for the Schnorr scheme with non-negligible probability. Acknowledgments. We thank the anonymous reviewers for valuable comments, especially Mihir Bellare. We also thank Anja Lehmann, Adam O’Neill, and Tom Ristenpart for listening to this idea and providing feedback at an early stage. Both authors are supported by grants Fi 940/2-1 and Fi 940/4-1 of the German Research Foundation (DFG). This work was also supported by CASED (www.cased.de).
References 1. Abdalla, M., Bellare, M., Rogaway, P.: The oracle diffie-hellman assumptions and an analysis of DHIES. In: Naccache, D. (ed.) CT-RSA 2001. LNCS, vol. 2020, pp. 143–158. Springer, Heidelberg (2001) 2. Bellare, M., Boldyreva, A., Palacio, A.: An uninstantiable random-oracle-model scheme for a hybrid-encryption problem. In: Cachin, C., Camenisch, J.L. (eds.) EUROCRYPT 2004. LNCS, vol. 3027, pp. 171–188. Springer, Heidelberg (2004) 3. Bellare, M., Palacio, A.: The knowledge-of-exponent assumptions and 3-round zeroknowledge protocols. In: Franklin, M. (ed.) CRYPTO 2004. LNCS, vol. 3152, pp. 273–289. Springer, Heidelberg (2004) 4. Bellare, M., Rogaway, P.: Random oracles are practical: A paradigm for designing efficient protocols. In: ACM CCS 1993, pp. 62–73 (1993) 5. Bellare, M., Rogaway, P.: The exact security of digital signatures - how to sign with RSA and rabin. In: Maurer, U.M. (ed.) EUROCRYPT 1996. LNCS, vol. 1070, pp. 399–416. Springer, Heidelberg (1996) 6. Boldyreva, A., Fischlin, M.: Analysis of random oracle instantiation scenarios for OAEP and other practical schemes. In: Shoup, V. (ed.) CRYPTO 2005. LNCS, vol. 3621, pp. 412–429. Springer, Heidelberg (2005)
38
P. Baecher and M. Fischlin
7. Boldyreva, A., Fischlin, M.: On the security of OAEP. In: Lai, X., Chen, K. (eds.) ASIACRYPT 2006. LNCS, vol. 4284, pp. 210–225. Springer, Heidelberg (2006) 8. Boneh, D., Lynn, B., Shacham, H.: Short signatures from the Weil pairing. Journal of Cryptology 17(4), 297–319 9. Canetti, R., Goldreich, O., Halevi, S.: The random oracle methodology, revisited (preliminary version). In: 30th ACM STOC, pp. 209–218 10. Cash, D., Kiltz, E., Shoup, V.: The twin DiffieHellman problem and applications. Journal of Cryptology 22(4), 470–504 11. Coron, J.S.: On the exact security of full domain hash. In: Bellare, M. (ed.) CRYPTO 2000. LNCS, vol. 1880, pp. 229–235. Springer, Heidelberg (2000) 12. Cramer, R., Shoup, V.: Design and analysis of practical public-key encryption schemes secure against adaptive chosen ciphertext attack. SIAM Journal on Computing 33(1), 167–226 (2003) 13. Dodis, Y., Haitner, I., Tentes, A.: On the (in)security of rsa signatures. Cryptology ePrint Archive, Report 2011/087 (2011), http://eprint.iacr.org/ 14. Dodis, Y., Oliveira, R., Pietrzak, K.: On the generic insecurity of the full domain hash. In: Shoup, V. (ed.) CRYPTO 2005. LNCS, vol. 3621, pp. 449–466. Springer, Heidelberg (2005) 15. Fischlin, M., Lehmann, A., Ristenpart, T., Shrimpton, T., Stam, M., Tessaro, S.: Random oracles with(out) programmability. In: Abe, M. (ed.) ASIACRYPT 2010. LNCS, vol. 6477, pp. 303–320. Springer, Heidelberg (2010) 16. Goldwasser, S., Kalai, Y.T.: On the (in)security of the Fiat-Shamir paradigm. In: 44th FOCS, pp. 102–115. IEEE Computer Society Press, Los Alamitos 17. Guillou, L.C., Quisquater, J.-J.: A practical zero-knowledge protocol fitted to security microprocessor minimizing both transmission and memory. In: G¨ unther, C.G. (ed.) EUROCRYPT 1988. LNCS, vol. 330, pp. 123–128. Springer, Heidelberg (1988) 18. Hada, S., Tanaka, T.: On the existence of 3-round zero-knowledge protocols. In: Krawczyk, H. (ed.) CRYPTO 1998. LNCS, vol. 1462, pp. 408–423. Springer, Heidelberg (1998) 19. Kiltz, E., O’Neill, A., Smith, A.: Instantiability of RSA-OAEP under chosenplaintext attack. In: Rabin, T. (ed.) CRYPTO 2010. LNCS, vol. 6223, pp. 295–313. Springer, Heidelberg (2010) 20. Kiltz, E., Pietrzak, K.: On the security of padding-based encryption schemes – or – why we cannot prove OAEP secure in the standard model. In: Joux, A. (ed.) EUROCRYPT 2009. LNCS, vol. 5479, pp. 389–406. Springer, Heidelberg (2009) 21. Lamport, L.: Constructing digital signatures from a one-way function. Technical Report SRI-CSL-98, SRI International Computer Science Laboratory 22. Maurer, U.M., Renner, R., Holenstein, C.: Indifferentiability, impossibility results on reductions, and applications to the random oracle methodology. In: Naor, M. (ed.) TCC 2004. LNCS, vol. 2951, pp. 21–39. Springer, Heidelberg (2004) 23. Naito, Y., Yoneyama, K., Wang, L., Ohta, K.: How to confirm cryptosystems security: The original merkle-damg˚ ard is still alive! In: Matsui, M. (ed.) ASIACRYPT 2009. LNCS, vol. 5912, pp. 382–398. Springer, Heidelberg (2009) 24. Nielsen, J.B.: Separating random oracle proofs from complexity theoretic proofs: The non-committing encryption case. In: Yung, M. (ed.) CRYPTO 2002. LNCS, vol. 2442, pp. 111–126. Springer, Heidelberg (2002) 25. Schnorr, C.P.: Efficient signature generation by smart cards. Journal of Cryptology 4(3), 161–174 (1991) 26. Yoneyama, K., Miyagawa, S., Ohta, K.: Leaky random oracle (extended abstract). In: Baek, J., Bao, F., Chen, K., Lai, X. (eds.) ProvSec 2008. LNCS, vol. 5324, pp. 226–240. Springer, Heidelberg (2008)
Time-Lock Puzzles in the Random Oracle Model Mohammad Mahmoody1, Tal Moran2 , and Salil Vadhan2
1
Department of Computer Science, Cornell University
2 School of Engineering and Applied Sciences and Center for Research on Computation and Society, Harvard University Abstract. A time-lock puzzle is a mechanism for sending messages “to the future”. The sender publishes a puzzle whose solution is the message to be sent, thus hiding it until enough time has elapsed for the puzzle to be solved. For time-lock puzzles to be useful, generating a puzzle should take less time than solving it. Since adversaries may have access to many more computers than honest solvers, massively parallel solvers should not be able to produce a solution much faster than serial ones. To date, we know of only one mechanism that is believed to satisfy these properties: the one proposed by Rivest, Shamir and Wagner (1996), who originally introduced the notion of time-lock puzzles. Their puzzle is based on the serial nature of exponentiation and the hardness of factoring, and is therefore vulnerable to advances in factoring techniques (as well as to quantum attacks). In this work, we study the possibility of constructing time-lock puzzles in the random-oracle model. Our main result is negative, ruling out time-lock puzzles that require more parallel time to solve than the total work required to generate a puzzle. In particular, this should rule out black-box constructions of such timelock puzzles from one-way permutations and collision-resistant hash-functions. On the positive side, we construct a time-lock puzzle with a linear gap in parallel time: a new puzzle can be generated with one round of n parallel queries to the random oracle, but n rounds of serial queries are required to solve it (even for massively parallel adversaries).
1 Introduction In this paper we revisit the subject of “timed-release crypto” based on “time-lock puzzles”. The goal of timed-release crypto, introduced by May [22], is to encrypt a message in such a way that it will be readable at some specified time in the future (even without additional help from the sender), but not before then. In addition to the basic use of “sending messages to the future”, there are many other potential uses of timed-release crypto. Rivest, Shamir and Wagner [25] suggest, among other uses, delayed digital cash payments, sealed-bid auctions and key escrow. Boneh and Naor [9] define timed commitments and timed signatures and show that they can be used for fair contract signing, honesty-preserving auctions and more. Supported by NSF grant CNS-0831289. P. Rogaway (Ed.): CRYPTO 2011, LNCS 6841, pp. 39–50, 2011. c International Association for Cryptologic Research 2011
40
M. Mahmoody, T. Moran, and S. Vadhan
A natural approach to building a timed-release crypto scheme is the use of timelock puzzles: puzzles that take a prespecified amount of time to solve (which should be significantly longer than the time to generate the puzzle). Intuitively, using the solution of a time-lock puzzle as the key to an encryption scheme would force anyone wanting to decrypt the message to perform the computation for the time required to solve the puzzle. By tuning the diÆculty of the solution according to the time we would like the message to remain secure, we can ensure that decryption will take at least that amount of time. Inverting a (suitably weak) one-way function seems like an obvious candidate for a time-lock puzzle. However, as Rivest et al. observed, for many uses a generic oneway function would not suÆce. This is because a potential adversary may have access to much larger computational resources than an honest party. Even if the processors available to the adversary are not be significantly faster than those available to the honest parties, it is reasonable to assume that a well-funded adversary could have access to many more processors (that could be used in parallel). Thus, we require that time-lock puzzles be “essentially sequential” in nature: having many parallel processors should not give a large advantage over a single processor in solving the puzzle. The puzzles proposed in [25] are based on the conjecture that exponentiation (modulo an RSA integer) is such a task. In particular, if the factorization of the modulus is not known, the best known method for exponentiation is repeated squaring (which is conjectured to be essentially sequential). Given the factors of the modulus, however, there is a shortcut that allows the exponentiation to be performed much faster (so that the puzzles can be generated eÆciently). Thus, there seems to be a super-polynomial gap between the work required to generate the puzzle and the parallel time required to solve it (for a polynomial number of parallel processors). To the best of our knowledge, this construction of time-lock puzzles is the only one currently known that is resistant to parallel attack. The construction of Boneh and Naor [9] uses essentially the same idea. This leads to the natural question of whether we can construct time-lock puzzles based on other assumptions, preferably weaker and more general ones. Biham, Goren and Ishai [5] suggest an additional motivation as well: obtaining (weak) key-agreement protocols based on one-way functions that resist quantum attack. They show that in the classical world there do exist weak key-agreement protocols based on one-way functions (of exponential strength) that force an adversary to work in time quadratic in the time of the honest parties, based on a variant of Merkle puzzles [23]. However, both their construction and the original Merkle puzzles are vulnerable to quantum attack via Grover’s search algorithm [20]. Biham et al. note that Grover’s speedup only applies to parallel search, and leave as an open problem whether such puzzles exist that are resistant to parallel attack (and thus, potentially, to quantum attack as well). In this paper, we study time-lock puzzles in the random oracle model. In the random oracle model, we assume all parties have access to an oracle, H, modeled as a random function. In a real implementation, the random oracle is usually “instantiated” with a cryptographic hash function. We assume the adversary in this model is computationally
Time-Lock Puzzles in the Random Oracle Model
41
unbounded, and measure the diÆculty of the time-lock puzzle by the number of queries the adversary is required to make to the random oracle in order to solve it. The random oracle model is interesting for several reasons. First, negative results in this model rule out “black-box” constructions from one-way permutations and collisionresistant hash functions (since a random function is collision-resistant and indistinguishable from a random permutation using only a small number of queries; see e.g., [21,19,3] for details). Second, most “natural” protocols that have been proven secure in the random oracle model appear to be secure in practice as well (even though some “artificial” protocols are secure in this model but insecure for any explicit instantiation of the random oracle [11]), and constructing a protocol in this model is sometimes a first step towards constructing a provably-secure protocol in the plain model (e.g., the first eÆcient IBE scheme was proven secure in the random oracle model [8], after which constructions were found in the standard model as well [12,6,7]). Finally, the random oracle model is much simpler to analyze than models that incorporate computational complexity, and better understanding the problem in this setting may give insight into the complexity-theoretic case. We can think of a time-lock puzzle generator as a randomized oracle algorithm f . The output of f H (rA ) (where rA is the random input and H the random oracle) is a pair (M ): the puzzle M and a solution validator . The solver, given M, must output a solution x such that (x) 1. When a time-lock puzzle has a single solution, such as when it is used to hide an encrypted message, just compares its input to that constant value. In general, however, may perform more complex verification and our negative results hold even when is not eÆcient (note that does not have access to the random oracle). For this to be a good time-lock puzzle, we would like f to be easy to compute but moderately hard to solve, even for a parallel adversary. More precisely, if we can compute (M ) f H (rA ) using n queries to H, we would like f to satisfy:
Completeness – There exists a (randomized) polynomial-time algorithm g (the honest solver) that solves puzzles generated by f : with high probability (over the random coins of f and g and the random oracle H), if we generate (M ) f H (rA ) and x H g (rB M) then (x) 1. We use the shorthand notation [(M ) f H (rA ); x H g (rB M); (x) 1] to denote the event that the puzzle was generated as described above, the solver was run and its solution was valid. We denote by m n the number of queries g makes to H. m measures the diÆculty for the honest solver and should be moderately larger than n, e.g., a large polynomial in n.
Soundness
– Any algorithm that solves f and makes up to q m queries to H must use at least m¼ m levels of adaptivity. For example, we might take q n (1) and m¼ m2. The number of levels of adaptivity measures the complexity for a parallelized adversary; this requirement means that unless the adversary makes a very large number of queries, using parallelism won’t give it an advantage over the honest solver.
42
M. Mahmoody, T. Moran, and S. Vadhan
1.1 Our Results Time-lock puzzles with large diÆculty gap are impossible. Our main result is a negative one. We show that for every time-lock puzzle there exists a parallel adversary that can solve the puzzle in no more time than it takes to generate and makes only polynomially more queries to the random oracle than the best honest (serial) solver. Thus, constructing time-lock puzzles with a “gap” between the work of the puzzle generator and the parallel time of the solver cannot be done in the random-oracle model. Concretely, we prove two similar theorems but with incomparable parameters. The first provides an adversary that makes an optimal number of parallel query rounds, but may require super-polynomial time to run, even if the honest solver is eÆcient. Our second theorem gives a much simpler adversary construction that runs in polynomial time if the honest solver does, but has slightly worse adaptivity. Formally, we prove the following two theorems: Theorem 1 (Optimally Adaptive but IneÆcient Adversary). Let f be an oracle algorithm that makes at most n queries to a random oracle H and g an oracle algorithm that makes at most m n queries to H. If Pr (M
)
f
H
(rA ); x
g
H
(rB M);
(x) 1
1
(i.e., when a puzzle is randomly generated after which the solver g is executed, its output is a valid solution with probability at least 1 over the random coins rA rB and H) then ˜ for all (0 1) there exists an adversary, Ivy, that makes O(nm ) queries to H, uses only n levels of adaptivity and satisfies Pr (M ) f H (rA ); x hH (rI M); (x) 1 1 (where rI is the variable denoting the random coins used by Ivy).
Theorem 2 (EÆcient but Non-Optimal Adversary). Let f be an oracle algorithm that makes at most n queries to a random oracle H and g an oracle algorithm that makes at most m n queries to H. If Pr (M ) f H (rA ); x gH (rB M); (x) 1 1 then for all (0 1) there exists a deterministic adversary Javier (denoted by J) who makes at most nm queries to H, uses only n levels of adaptivity and satisfies Pr (M ) f H (rA ); x J H (M); (x) 1 1 . Moreover, the running time of J is O(n) times the running time of g.
Some intuition for the proofs of both theorems, as well as the full proof of Theorem 2, can be found in Section 2. Due to space considerations, the proof of Theorem 1 is deferred to the full version. By combining Theorem 1 with the result of [4], we partially resolve the open question of Biham et al. [5] by showing that every key-agreement protocol in the randomoracle model can be broken by a parallel attack that makes polynomially many queries to the random-oracle: Biham et al. were interested in whether there exist key-agreement protocols that resist quantum attack, but as a step towards this goal asked the question of whether there exist such protocols secure against a parallel classical attacker, and specifically whether such protocols could be based on random functions. Corollary 1. Let be a two-party protocol in the random oracle model such that when executing the two parties Alice and Bob make at most n queries each and their outputs
Time-Lock Puzzles in the Random Oracle Model
43
are identical with probability at least 1 . Then for every 0 1 there exists an adversary that, given the public transcript of the protocol, outputs a value that agrees with Bob’s output with probability 1 using 2n levels of adaptivity and making ˜ 3 3 ) total queries to H. O(n Proof. Let f H (rA rB ) (M ), where M is the complete public transcript of when Alice uses the random coins rA and Bob the random coins rB . Define the corresponding solution validator to be (x)
1 0
if x is Bob’s output in the execution of in f H (rA rB ) otherwise
By the result of [4], there exists an adversary that makes at most O(n2 2 ) queries to H and outputs a “correct” solution to this puzzle (i.e., an output that agrees with Bob) with probability 1 2. Think of this adversary as the solver, g. By Theorem 1, this implies that there exists a solver that succeeds with probability 1 , makes 2 2 ˜ ˜ 3 3 ) total queries to H and uses only 2n levels of adaptivity O((2n ) n ) O(n (the 2n is because the total number of queries made by f is bounded by the total number of queries made by both Alice and Bob).
A time-lock puzzle with a linear gap in parallel time. Although our negative results rule out “strong” time-lock puzzles, they still leave open the possibility for a weaker version: one that can be generated with n parallel queries to the oracle but requires n rounds of adaptive queries to solve. In a positive result, we show that such a puzzle can indeed be constructed. More formally, we prove: Theorem 3. Let k be a security parameter. There exist oracle functions f and g that satisfy:
1. (EÆciency) (M M ) f H (k r) can be computed using n parallel (non-adaptive) queries to H. 2. (Completeness) x gH (k M) can be computed using n serial (adaptive) queries to H and the output of g always satisfies M (x) 1 (g is deterministic). 3. (Soundness) For every oracle function h that makes less than n serial rounds of queries to H and poly(k) queries overall to H in total, Pr (M M ) f H (k r); x hH (k r J M); M (x) 1 neg(k) (where neg is some negligible function in k).
The idea behind the construction is to force the solver to make sequential queries by “encrypting” each successive query with the result of an oracle call on its predecessor. The full construction and a sketch of its security proof appear in Section 3. 1.2 Related Work Timed-Release Crypto Constructions. The notion of timed-release crypto was introduced by May [22]. May’s proposal was to publish an encrypted message and distribute the decryption key between several trusted agents. The agents would be instructed to
44
M. Mahmoody, T. Moran, and S. Vadhan
publish their shares of the key at a specified future date. Rivest, Shamir and Wagner [25] introduced the idea of using time-lock puzzles instead of requiring a sender to trust an external entity and also developed May’s “trusted-agent” approach, suggesting a scheme where the trusted agents’ storage does not grow with the number of timedrelease messages (as it does in May’s scheme). These two approaches, one based on puzzles and the other on trusted agents, have remained the basis of all new timed-release crypto schemes that we know of. There have been many improvements in the agent-based approach, focusing on reducing interaction between the agents and the users, achieving various verifiability and privacy properties ([8,13,14], among others). On the other hand, to the best of our knowledge, all existing time-lock puzzle constructions (that are resistant to parallel attack) are based on the problem originated by Rivest et al., namely that of exponentiation modulo an RSA integer. Puzzles. The term “puzzle” to describe a cryptographic construction that is “meant to be broken” was first used by Merkle in the context of key agreement protocols [23]. Merkle’s key-exchange protocol allows two users to exchange a key by solving a single puzzle, while forcing an adversary to solve multiple puzzles in order to discover it. The protocol does not require much structure from the puzzles, and can be instantiated with black-box use of one-way functions. The computation gap between the honest users and the adversary is quadratic in Merkle’s scheme: if an honest user requires O(N) time to recover the key, an adversary can recover it in O(N 2 ) time. Barak and Mahmoody showed that this is essentially optimal [4], improving a previous result by Impagliazzo and Rudich [21]. Both of these works give an upper bound for the computation gap of arbitrary key-exchange protocols in the random oracle model (including protocols that require multiple rounds of interaction between the two honest parties). Our work considers only one-message protocols, but bounds the parallel complexity of the adversary (in contrast to [21,4], who analyze the complexity of serial adversaries). Puzzles have also been proposed as proof-of-work mechanisms for controlling spam and preventing denial-of-service-attacks. The idea was first introduced by Dwork and Naor [17], and was developed in multiple subsequent works [1,2,16,18]. Rivest and Shamir even suggest one variant for use as a micropayment system [24]. One major dierence between these types of puzzles and those we consider in this work is that resistance to parallel attack is not as critical: for example, an adversary generating spam messages can always parallelize at the message level rather than by attacking a specific puzzle. Proofs-of-work, on the other hand, must be resistant to amortization (solving one puzzle should not help in solving others), whereas this is usually not a concern for time-lock puzzles. For both types of puzzles, it is still important to take into account the gap between the computational capability of an honest user and that of the adversary. Abadi, Burrows, Manasse and Wobbler suggest basing the diÆculty of a puzzle on memory access time [1], under the assumption that this has less variance among users than CPU speed. In a subsequent work, Dwork, Goldberg and Naor [16] construct such a function in the random oracle model that uses “pointer-chasing” in a large random table. This has a very similar flavor to our time-lock puzzle construction in Section 3, although the goal
Time-Lock Puzzles in the Random Oracle Model
45
is somewhat dierent and the analysis focuses on bounding memory accesses (to the table) rather than layers of adaptivity or queries to the random oracle.
2 Negative Results for Time-Lock Puzzles In this section we give the intuition behind the proofs of our main results (Theorems 1 and 2) as well as the full proof of Theorem 2. Following the seminal work of Impagliazzo and Rudich [21] on key agreement protocols in the random oracle model, our adversaries (for both theorems) attempt to find all intersection queries between the puzzle-generator f (Alice) and the solver g (Bob) — all queries made by both Alice and Bob. If successful, the adversary can then simulate an honest solver without asking additional queries. The novelty of our work is that we care not just about the total number of queries made by the adversary, but about the number of levels of adaptivity. Both adversary constructions work in rounds, and query the random oracle only at the end of a round. Our aim is to reduce the total number of rounds (this is the “adaptivity level” of the adversary). The constructions dier in how they choose which queries to ask in each round, and in the corresponding proofs that the adversary succeeds in learning all of the intersection queries with high enough probability. 2.1 Intuition for Theorem 1 For the proof of Theorem 1, we use ideas (and a construction) of Impagliazzo and Rudich [21] (and later improvements by Barak and Mahmoody [4]), but modified to minimize the number of query rounds used by the adversary. Our attacker, Ivy, selects her queries to the random oracle in n rounds (n is the number of queries made by Alice). In round j, Ivy computes a set of heavy queries on which she will query the oracle at the end of the round. Heavy queries are those that have a high probability (given Ivy’s view) of having been made by Alice, where “high” is a parameter that depends on n, m (the number of queries made by the honest solver) and (the probability with which Ivy is allowed to fail). The intuition for why Ivy’s attack works is that, as long as Bob has not hit any of Alice’s “private” queries (those not made by Ivy), Bob doesn’t know any more than Ivy about Alice’s view. Thus, any private query must be “light” conditioned on his view. By definition, the probability that Bob hits a light query is small. We can then take a union bound over all of Bob’s queries, and conclude that the total probability that Bob hits a private query is small. Unfortunately, the intuition above isn’t entirely correct: even querying an index that was not queried by Alice may give Bob information about Alice’s view: the fact that Alice didn’t query a particular index. We observe, however, that this is the only information about Alice’s view that Bob can gain from making a non-intersection query. Thus, if we condition on Bob not having made any private intersection queries so far, our intuition still holds. The main technical diÆculty in the proof is making sure that Ivy can ask many queries in parallel, in order to bound the number of rounds of adaptivity. Our solution to this is to have Ivy condition her probability space after each query on the event that
46
M. Mahmoody, T. Moran, and S. Vadhan
this query was not an intersection query (rather than on the response to the query). Since this event does not require Ivy to query the oracle in order to compute the new query probabilities, she can ask multiple parallel queries in each round. Loosely speaking, Ivy’s query strategy ensures that if there are any remaining heavy queries, then one of her queries will be an intersection query with high probability. Since the number of intersection queries can be at most n, within n rounds Ivy can ensure that there are no remaining heavy queries. Note that in order to find heavy queries, Ivy uses her unbounded computational power (e.g., if Alice queries the oracle on an index i and sends Bob an encryption of i, the index i is heavy conditioned on Ivy’s view, but Ivy may have to break the encryption to find it). 2.2 Proof of Theorem 2 Javier, the adversary constructed in the proof of Theorem 2, works by running the honest solver in each round, but replacing its queries to the random oracle with a simulated oracle (so no queries to the real oracle are made during an execution). After the simulation, Javier updates the simulated oracle by querying the real oracle (in parallel) on every index that was queried during the simulated execution. The main idea in the proof is that, since the puzzle generator asks only n queries, there can be at most n rounds in which the simulated execution “hits” an intersection query that was not already known to Javier. In the remaining rounds, Javier does know all the intersection queries, and hence the simulated solver will behave just like the real honest solver (and output a correct solution to the puzzle with the same probability). Formally: Proof (of Theorem 2). The adversary Javier follows Alg. 1. In the algorithm description, Qi (J) is the set of queries Javier made to H up to (but not including) round i, while Q(Bi ) is the set of queries the simulated Bob made to Hi in Javier’s ith round.
Algorithm 1. Javier’s query algorithm on message M and oracle H with parameter 1: Randomly choose i [n ]. 2: for i 1 i do 3: Run Bob to get: xi gHi (rB M) where Hi is an oracle that answers any query x Q(J) the same as H does, and Hi answers any new query q Q(J) uniformly at random. Note that to run gHi (rB M) we do not need to ask any new query to H because all the answers to queries in Q(J) are already known and the rest are answered at random. 4: Query H on all indices in Q(Bi ) Qi (J) where Q(Bi) is the queries Bob made to Hi . 5: Output xi .
The total number of queries made by Javier is at most nm and Javier’s running time is O(n) times the running time of Bob. It remains to show that the probability that Javier’s output is accepted by the solution validator is at least 1 . Denote the event that Javier’s output is accepted by the solution validator:
Success
de f
(M
)
f
H
(rA )
x g i
H i
(rB M)
(xi ) 1
Time-Lock Puzzles in the Random Oracle Model
47
Call a round i good if Javier did not ask any new intersection queries in round i (i.e., Q(Bi ) Q(A) Qi (J)). Denote Goodi the event that round i was good. Since Alice asks at most n queries, there can be at most n rounds that are not good. Thus, Pr [Goodi ] 1 . Note that if Goodi holds, the tuple ( f H (rA ) gHi (rB M)) is distributed identically to ( f H (rA ) gH (rB M)), because as long as Bob’s queries in round i£ were not queried by Alice, H and Hi both choose their answers at random and independently of all previous queries and answers. Therefore, for an arbitrary event E defined over the joint view of f H (rA ) and that of Javier till the end of round i£ , to know the quantity Pr [E Goodi ] it does not matter weather we use the oracle H or Hi in round i£ , and the probabilities will remain the same. By misusing the notation, we also use Goodi to refer to the similar event when Javier uses the oracle H in his simulation of Bob in round i£ . Thus, we finally conclude:
Pr [Success]
Pr [Success Good ] Pr (M ) f (r ); x g (r M); (x ) 1 Good Pr (M ) f (r ); x g (r M); (x) 1 Good Pr (M ) f (r ); x g (r M); (x) 1 (1 Pr [Good ]) 1 i
H H H
A A A
Hi
i
H H
i
B
i
i
B
i
B
Æ
3 A Time-Lock Puzzle with a Linear Di culty Gap In this section we give the construction and proof for Theorem 3. In the description below, we omit the security parameter k: the security parameter is only used to determine the range of the random oracle — we assume w.l.o.g. that H(q) returns k bits (if the random oracle returns fewer bits, we can interpret a query H(q) as concatenation of multiple queries (e.g., H(kq) H(kq 1) H(kq k 1)). To further simplify notation, our definition of f only generates the message M. The (implicit) solution validator M checks whether its input is equal to f ’s input (our soundness proof is slightly stronger — we show that no adversary making less than n serial rounds of queries to H can find any valid preimage of M under f ). We define the puzzle-generating function f to be:
f H (x0
xn )
de f
(x0 H(x0 )
x
1
H(xn 1 )
x ) n
(where the input is interpreted as n 1 k-bit query indices). The honest solver g inverts f by running Algorithm 2: Proof (Sketch for Theorem 3). By inspection, f can be computed with n non-adaptive queries: the values H(x1 ) H(xn ) can be obtained in parallel. The correctness of the honest inverter (Alg. 2) and the fact that it uses n serial queries is also easy to see. The main part of the proof is to show that every inverter making poly(k) queries to H needs to use at least n rounds of adaptive queries. To prove this, we first claim that any algorithm that outputs xi1 with non-negligible probability must query H on
48
M. Mahmoody, T. Moran, and S. Vadhan
Algorithm 2. Honest solver g on input M
(M0
Mn ) and oracle H
1: x0 M0 x0 is not “encrypted”. 2: for i 1 n do 3: xi H(xi 1 ) Mi “decrypting” xi requires an oracle query on index xi 1 . 4: Output (x0 xn )
xi . This is because, even taken together, the value of f H (x0 xn ), the values of x0 xn xi1 and the responses of the random oracle on all queries except xi give no information (in the information-theoretic sense) about xi1 . Thus, the probability that an algorithm outputs xi1 without querying H on xi is negligible in k (the output size of H). Note that this remains true if we allow the algorithm to output a polynomial number of guesses for xi1 . Now, consider an algorithm h making multiple rounds of queries to the oracle H, such that in each round the indices queried depend only on the responses from previous rounds. We can think of h as also outputting the indices it queries in each round (and the total number of indices output by h is polynomial in k). If h correctly inverts f on input M f H (x0 xn ), it must output xn at some round (since f is injective). By induction (and using the reasoning above), the probability that h first outputs (queries) xi and xi1 in the same round is negligible (since we showed it must query xi before xi1 ). Therefore, the algorithm must use at least n rounds of adaptivity.
3.1 Increasing the ComputationCommunication Ratio Note that while our positive construction of a time-lock puzzle in the random-oracle model is optimal with respect to query complexity, the description of a puzzle that requires n adaptive queries to solve is also linear in n. When the cost of communication is comparable to an oracle query, simply communicating the puzzle takes O(n) time, negating the benefit of parallel queries. We improve this ratio arbitrarily by replacing each oracle call with d composed calls (i.e., each call querying the oracle on the response to the previous call). This will increase both the (parallel) generation and solution time by a factor of d without changing the size of the puzzle description. Formally, let H (1) H and for d 1 let H (d) (q) H(H (d 1) (q)). Then the function (d) f H (x0 xn ) can be computed with d rounds of n non-adaptive queries, and the soundness condition from Theorem 3 holds with the increased parameters: de f
de f
Claim. For every oracle function h that makes less than dn serial rounds of queries to H and poly(k) queries overall to H in total, Pr (M
M)
f
H (d)
(k r); x
h
H
(k r J M);
M (x)
1 neg(k)
(where neg is some negligible function in k). Proof (Sketch). The main idea is that any algorithm that outputs H (i) (x) with nonnegligible probability must query H on H (i 1) (x) (otherwise the algorithm has no information about H (i) (x)). By induction, it follows that an algorithm that makes only a
Time-Lock Puzzles in the Random Oracle Model
49
polynomial number (in k) of queries to H needs d adaptive rounds to compute H (d) (x). Composing this idea with the induction in the proof of Theorem 3, we get the required parameters.
4 Discussion and Open Questions The most obvious open question relating to time-lock puzzles is finding constructions based on assumptions other than the diÆculty of factoring. Although this work rules out black-box constructions (with a super-constant gap) from one-way permutations and collision-resistant hash functions, we have no reason to believe that time-lock puzzles based on other concrete problems (e.g., lattice-based problems) do not exist. Extending our approach to other general assumptions (e.g., trapdoor permutations) is also an interesting open problem. One of the motivations for looking at time-lock puzzles in the random-oracle model is the search for puzzles that are resistant to quantum attack. In this direction there still remains work to be done: on the positive side, our construction may not be secure against adversaries with quantum access to the random oracle (e.g., Dagdelen et al. show protocols that are secure in the random oracle model but can be broken by attackers with quantum access to the random oracle [15]). On the other hand, when the honest parties are quantum, the lower bound question is still open as well (Brassard and Salvail [10] and, independently, Biham et al [5], give a quantum version of Merkle puzzles that require the adversary to make n3 2 queries in order to recover the shared key, but do not prove optimality).
Acknowledgements. We thank the anonymous reviewers for their helpful comments and suggestions.
References 1. Abadi, M., Burrows, M., Manasse, M.S., Wobber, T.: Moderately hard, memory-bound functions. ACM Trans. Internet Techn. 5(2), 299–327 (2005) 2. Back, A.: Hashcash — a denial of service counter-measure (2002), 3. Barak, B., Mahmoody, M.: Lower bounds on signatures from symmetric primitives. In: FOCS 2007, pp. 680–688. IEEE Computer Society, Los Alamitos (2007) 4. Barak, B., Mahmoody-Ghidary, M.: Merkle puzzles are optimal — an O(n2 )-query attack on any key exchange from a random oracle. In: Halevi, S. (ed.) CRYPTO 2009. LNCS, vol. 5677, pp. 374–390. Springer, Heidelberg (2009) 5. Biham, E., Goren, Y.J., Ishai, Y.: Basing weak public-key cryptography on strong one-way functions. In: Canetti, R. (ed.) TCC 2008. LNCS, vol. 4948, pp. 55–72. Springer, Heidelberg (2008) 6. Boneh, D., Boyen, X.: EÆcient selective-id secure identity-based encryption without random oracles. In: Cachin, C., Camenisch, J.L. (eds.) EUROCRYPT 2004. LNCS, vol. 3027, pp. 223–238. Springer, Heidelberg (2004) 7. Boneh, D., Boyen, X.: Secure identity based encryption without random oracles. In: Franklin, M. (ed.) CRYPTO 2004. LNCS, vol. 3152, pp. 443–459. Springer, Heidelberg (2004)
50
M. Mahmoody, T. Moran, and S. Vadhan
8. Boneh, D., Franklin, M.K.: Identity-based encryption from the weil pairing. SIAM J. Comput. 32(3), 586–615 (2003) 9. Boneh, D., Naor, M.: Timed commitments. In: Bellare, M. (ed.) CRYPTO 2000. LNCS, vol. 1880, pp. 236–254. Springer, Heidelberg (2000) 10. Brassard, G., Salvail, L.: Quantum merkle puzzles. In: ICQNM, pp. 76–79. IEEE Computer Society, Los Alamitos (2008) 11. Canetti, R., Goldreich, O., Halevi, S.: The random oracle methodology, revisited. J. ACM 51(4), 557–594 (2004) 12. Canetti, R., Halevi, S., Katz, J.: A forward-secure public-key encryption scheme. In: Biham, E. (ed.) EUROCRYPT 2003. LNCS, vol. 2656, pp. 255–271. Springer, Heidelberg (2003) 13. Cathalo, J., Libert, B., Quisquater, J.-J.: EÆcient and non-interactive timed-release encryption. In: Qing, S., Mao, W., L´opez, J., Wang, G. (eds.) ICICS 2005. LNCS, vol. 3783, pp. 291–303. Springer, Heidelberg (2005) 14. Di Crescenzo, G., Ostrovsky, R., Rajagopalan, S.: Conditional oblivious transfer and timedrelease encryption. In: Stern, J. (ed.) EUROCRYPT 1999. LNCS, vol. 1592, pp. 74–89. Springer, Heidelberg (1999) 15. Dagdelen, O., Fischlin, M., Lehmann, A., Schaner, C.: Random oracles in a quantum world. Cryptology ePrint Archive, Report 2010 428 (2010), 16. Dwork, C., Goldberg, A., Naor, M.: On memory-bound functions for fighting spam. In: Boneh, D. (ed.) CRYPTO 2003. LNCS, vol. 2729, pp. 426–444. Springer, Heidelberg (2003) 17. Dwork, C., Naor, M.: Pricing via processing or combatting junk mail. In: Brickell, E.F. (ed.) CRYPTO 1992. LNCS, vol. 740, pp. 139–147. Springer, Heidelberg (1993) 18. Dwork, C., Naor, M., Wee, H.: Pebbling and proofs of work. In: Shoup, V. (ed.) CRYPTO 2005. LNCS, vol. 3621, pp. 37–54. Springer, Heidelberg (2005) 19. Gennaro, R., Gertner, Y., Katz, J., Trevisan, L.: Bounds on the eÆciency of generic cryptographic constructions. SIAM J. Comput. 35(1), 217–246 (2005) 20. Grover, L.K.: A fast quantum mechanical algorithm for database search. In: STOC 1996, pp. 212–219. ACM, New York (1996) 21. Impagliazzo, R., Rudich, S.: Limits on the provable consequences of one-way permutations. In: STOC 1989, pp. 44–61. ACM, New York (1989) 22. May, T.C.: Timed-release crypto (February 1993), ! 23. Merkle, R.C.: Secure communications over insecure channels. Commun. ACM 21(4), 294– 299 (1978) 24. Rivest, R.L., Shamir, A.: Payword and micromint: Two simple micropayment schemes. In: Lomas, M. (ed.) Security Protocols 1996. LNCS, vol. 1189, pp. 69–87. Springer, Heidelberg (1997) 25. Rivest, R.L., Shamir, A., Wagner, D.A.: Time-lock puzzles and timed-release crypto. Technical Report MIT LCS TR-684, MIT (February 1996)
Physically Uncloneable Functions in the Universal Composition Framework Christina Brzuska, Marc Fischlin, Heike Schr¨ oder, and Stefan Katzenbeisser Darmstadt University of Technology Center for Advanced Security Research Darmstadt
Abstract. Recently, there have been numerous works about hardwareassisted cryptographic protocols, either improving previous constructions in terms of efficiency, or in terms of security. In particular, many suggestions use Canetti’s universal composition (UC) framework to model hardware tokens and to derive schemes with strong security guarantees in the UC framework. In this paper, we augment this approach by considering Physically Uncloneable Functions (PUFs) in the UC framework. Interestingly, when doing so, one encounters several peculiarities specific to PUFs, such as the intrinsic non-programmability of such functions. Using our UC notion of PUFs, we then devise efficient UC-secure protocols for basic tasks like oblivious transfer, commitments, and key exchange. It turns out that designing PUF-based protocols is fundamentally different than for other hardware tokens. For one part this is because of the non-programmability. But also, since the functional behavior is unpredictable even for the creator of the PUF, this causes an asymmetric situation in which only the party in possession of the PUF has full access to the secrets.
1
Introduction
Cryptographic protocols which simultaneously satisfy high efficiency demands as well as strong security requirements (like composable security), are scarce. One recent trend in this regard is to use the potential of hardware components like signature cards [20], one-time programs [14], standard smart cards [19], or even more complex tokens [21]. Most of these hardware-assisted protocols actually achieve security in Canetti’s universal composition (UC) framework [4] and thus provide strong security guarantees. 1.1
Physically Uncloneable Functions
In this paper, we consider another type of hardware component which recently gained a lot of attention because of the irresistible progress in their realization: Physically Uncloneable Functions (PUFs) [27,26]. Basically, a PUF is a noisy device derived through a complex physical manufacturing process such that the behavior of the PUF is hard to clone. The PUF itself can be evaluated by a physical stimulus (aka. challenge) on which it provides a noisy response. P. Rogaway (Ed.): CRYPTO 2011, LNCS 6841, pp. 51–70, 2011. c International Association for Cryptologic Research 2011
52
C. Brzuska et al.
Modeling PUFs appropriately is a highly non-trivial task. Most importantly, there are different types of PUFs with different (physical) properties. Furthermore, there does not seem to be a general agreement upon common security properties of PUFs, even for a single type (e.g., whether a PUF is one-way or not, or if the output is pseudorandom). See [29,23] for more information. We thus consider a very minimalistic model which basically says that only the party in possession of a PUF can evaluate it by sending some stimulus to the PUF and observing the output, and where learning outputs for some stimuli does not facilitate the task of predicting the function’s output for other stimuli. There have been several approaches to define PUFs cryptographically, see [27,17,12,2,29,11,30]. However, these definitions usually are either rather informal, or follow the more stringent game-based approach, but stipulate uncloneability and tamper-resistance as an external property “outside of the game”. A recent exception is the work of Armknecht et al. [1] which provides a game-based definition for uncloneability on a physical level. In the UC world, such features are more handy to specify. We hence follow previous approaches for other tokenbased protocols to model PUFs formally in the UC framework, exposing several peculiarities for this kind of hardware. 1.2
PUFs and the UC Framework
The UC Framework. The UC framework supports an easy modeling of tamperproof hardware tokens via ideal functionalities. Roughly, the ideal functionality captures the abstract security properties of the token, and one considers a hybrid world in which real-world protocols and parties also have access to this ideal functionality (and thus the token). This is the approach which has been used extensively in the literature [21,19,24,16,15] and which we also use to model PUFs in the UC framework, in particular, to model restricted access depending on possession of the token or uncloneability. In its original form the hybrid model supports the decomposition of cryptographic tasks into basic building blocks and to conclude security of protocols which are composed out of such building blocks. Loosely speaking, Canetti’s composition theorem—or, actually a corollary of a more general statement— says that, if a protocol πF UC-securely realizes some functionality G in the hybrid world with efficient functionality F , and some protocol ρ UC-securely realizes F , then the composed protocol π ρ which invokes ρ whenever π would call F , also UC-securely realizes G. PUFs in the UC Framework. Our ideal functionality for PUFs only allows the party in possession to stimulate it in order to retrieve a response, thus ensuring restricted access. Uncloneability is enforced through unpredictability. Parties can hand over the PUF to other parties. During transition, we allow the adversary temporary access before the PUF reaches the recipient. This models the classical example of PUF-augmented credit cards, sent via postal service, which are read out before getting delivered. As in other works about hardware based tokens, we assume some kind of tamper-evidence in the sense that the receiver can later
Physically Uncloneable Functions in the Universal Composition Framework
53
verify the authenticity and integrity of the PUF. We note that this need not be ensured by the PUF technology itself. One may also consider reliable delivery (in which case the adversary may have read-only access during the manufacturing process). Our ideal functionality covers different kinds of PUF technologies and comprises even PUFs with small input or output size (in which case unpredictability should be understood relative to the small output size). We note that for designing secure protocols, the intermediate access of the adversary also necessitates that the challenge space of the PUF is super-polynomial; else the adversary could clone the PUF easily. This domain requirement may currently not be true for all kinds of PUF technology; we comment on this in the full version of the paper. The usage of hardware components in the UC context, especially of PUFs, causes several unpleasant side effects, though. At foremost, PUFs are not known to be implementable by probabilistic polynomial-time (PPT) Turing machines; the manufacturing process seems to be inherently based on physical properties. Hence, while the claims in the hybrid model are technically sound, any realization in practice through actual PUFs leaves a gap in the security claim of the composed protocol, as, strictly speaking, the composition theorem only applies to probabilistic polynomial-time computable functionalities F . Fortunately, Canetti [4] proves the composition theorem to hold for a broader class of interactive Turing machines, and we sketch in the full version of this paper that the same holds for PUFs. The uninstantiability of PUFs through efficient algorithms causes another issue when it comes to complex cryptographic protocols. For any PUF-based protocol relying on further cryptographic assumptions like the hardness of computing discrete logarithms, the assumption would need to hold relative to the additional computational power given through PUFs. That is, the underlying problem must be hard to solve even for attackers with “more than probabilistic polynomial-time power”. It is therefore advantageous to avoid additional cryptographic assumptions in protocols and provide solutions with statistical security. Non-Programmability. For PUFs, another aspect is the intrinsic non-programmability of these tokens: Even the manufacturer usually has no control over the functional behavior of the PUF. Hence, the ability of the ideal-world simulator to adapt the outcome of a PUF measurement adaptively, as guaranteed when modeling the PUF through an ideal functionality in the hybrid world, appears to be exceedingly optimistic. A similar observation has been made by Nielsen [25] about the (non-)programmability of random oracles in the UC framework. Roughly, Nielsen takes away the ability of the simulator to program the random oracle by giving the environment direct access to the random oracle. To support the argument in favor of non-programmable PUFs we also note that for random oracles it is straightforward to program consistently given a partial view of the function for other values, namely, by providing independent random values; for PUFs this is less clear since one would need to take the (not necessarily efficiently computable) conditional distribution of the specific PUF type into account.
54
C. Brzuska et al.
We adopt Nielsen’s approach and augment the environment’s ability by giving it also access to the concrete PUF instantiation used in a protocol. Unlike in the case of the publicly available random oracle, though, the environment can only access this PUF when it is in possession of the adversary, i.e., we assume that a PUF, once in possession of the user, can only be accessed by this user. This corresponds to an honest user who prevents further unauthorized access. In a stronger version one could also allow further “uncontrolled” interaction between the environment, i.e., other protocols, and the PUF even when in possession of the honest user. This would somehow correspond to a permanently shared PUF functionality in the GUC model [5]. However, many advantages of deploying PUFs for designing efficient protocols would then disappear. With the restriction on temporary access we can still devise efficient solutions, e.g., circumventing impossibility results for UC commitment schemes in the plain model [6] and for GUC commitment schemes in the common reference string model [5]. 1.3
PUF-Based Protocols in the UC Framework
We finally exemplify the usability of our PUF modeling by presenting PUFbased protocols for three classical areas: oblivious transfer (OT), commitments, and key exchange. Our protocols are UC-secure in the hybrid world (where we grant the environment access to the PUF instantiation as described above), and typically require only a few operations besides PUF evaluations. In particular, all protocols require only sending one party a token in the first step. The protocols do not rely on additional cryptographic assumptions, except for authenticated channels. Designing PUF-based protocols is not just a matter of adopting other tokenbased solutions. One reason is clearly the non-programmability property which is usually not stipulated for other tokens (cf. [21,14]). In fact, most protocols take advantage of the ability to adapt the token’s outputs on the fly. But more importantly, the main difference between PUFs and other tokens is that PUFs are by nature even unpredictable for the manufacturer. It follows that only the party in possession of the PUF has full access to the secrets; other parties may only draw from a small set of previously sampled values. In comparison, for the wrapper tokens [21], for example, the creator still knows the program placed inside the token, and the token holder can fully access this program in a blackbox way. Hence, both parties somehow share a complete view of the secret. For PUFs the situation is rather “asymmetric”. Our oblivious transfer protocol bears some similarity to a PUF-based protocol of R¨ uhrmair [28]. His protocol, however, has a high round complexity due to an interactive hashing step. Still, [28] points out that, using symmetry of oblivious transfer [32] in the sense that one can change the roles of sender and receiver, one obtains an oblivious transfer protocol in which the other party sends the PUF. We confirm that this symmetry also holds in the UC setting. Designing a UC-secure commitment scheme with the help of our PUFs turns out to be quite challenging. The non-programmability of our PUFs inhibits equivocality, a property which allows to adapt committed values appropriately,
Physically Uncloneable Functions in the Universal Composition Framework
55
and which is usually required for such commitments [6]. We therefore use our PUF-based oblivious transfer protocol to derive a UC-secure bit commitment scheme. Interestingly, while the standard construction of commitment schemes out of OT [9] uses cut-and-choose techniques with a linear number of oblivious transfers, our transformation does not add any significant overhead. It only needs a single execution of the OT protocol and one extra message. We were not able to trace this idea back to any previous work. A noteworthy aspect is that, while our OT protocol only withstands static corruptions, our derived commitment scheme is secure in presence of adaptive corruptions. The reason is that for commitments, in contrast to OT, the receiver does not obtain any external input; the values used in the OT sub protocol are chosen internally. This facilitates the simulation of the receiver’s side. Hence, if we use our transformation we derive an adaptively secure commitment protocol from a concrete statically secure OT protocol! Finally, our key exchange protocol follows the folklore approach of using the PUF to transport the key, only that our protocol is stated and formalized in the UC framework. That is, the sender samples some challenge/response pairs, sends the PUF, and later reveals a challenge to the receiver who recovers the image with the help of the PUF. Both parties use the images as the key, after applying a fuzzy extractor for error correction and smoothing the output. It is clear that for a key exchange protocol where only one party sends a PUF, some additional, one-sided authentication mechanism is required. Else the adversary with temporary access to the PUF could impersonate the honest sender. All our protocols allow to re-use the PUF for multiple executions. By the unpredictable nature of PUFs, however, it is clear that the number of executions must be fixed in advance and must be known to the parties: The sender, once having sent the PUF, cannot access the PUF anymore and must thus challenge the PUF before sufficiently often, unless the PUF is frequently exchanged or further PUF tokens are sent. Note that in this case, attacks such as described in [31] will also be covered by the security proof. An interesting feature of PUFs is that, unlike other hardware tokens (e.g., [21]), protocols using PUFs are automatically secure against reset attacks because they implement (noisy) functions.
2
Physically Uncloneable Functions
A Physically Uncloneable Function (PUF) is a source of randomness that is implemented by a physical system. Roughly speaking, the randomness of PUFs relies on uncontrollable manufacturing variations during their fabrication. For PUF evaluation, the physical system is queried with a stimulus, usually called challenge. The device then produces a physical output, which is usually referred to as response. A pair of a stimulus and an output is called a challenge/response pair (CRP). Furthermore, a PUF, being a physical system, might not necessarily implement a mathematical function, i.e., querying the PUF twice on the same challenge may yield distinct responses. However, we require such “noise” to be bounded so that the two responses are closely related in terms of distance.
56
2.1
C. Brzuska et al.
Defining PUFs
A PUF-family P consists of two (not necessarily efficient) algorithms Sample and Eval. The index sampling algorithm Sample which obtains as input the security parameter and returns as output an index id of the PUF family corresponds to the PUF fabrication process. The evaluation algorithm Eval takes as input a challenge c, evaluates the PUF on c, and generates as output the corresponding response r. Note that we require the challenge space to be equal to a full set of strings of a certain length. For some classes of PUFs, this is naturally satisfied, for example arbiter PUFs and SRAM PUFs For others types this can be achieved through appropriate encoding, as for angles in optical PUFs. Definition 1 (Physically Uncloneable Functions). Let rg indicate the dimension of the range of the PUF responses of PUF-family, and let dnoise be a bound on the PUF’s noise. A pair P = (Sample, Eval) is a family of (rg, dnoise )PUFs if it satisfies the following properties: Index Sampling. Let Iλ be an index set. The sampling algorithm Sample outputs, on input the security parameter 1λ , an index id ∈ Iλ . We do not require that the index sampling can be done efficiently. Each index id ∈ Iλ corresponds to a set Did of distributions. For each challenge c ∈ {0, 1}λ , Did contains a distribution Did (c) on {0, 1}rg(λ) . We do not require that Did has a short description or an efficient sampling algorithm. Evaluation. The evaluation algorithm Eval gets as input a tuple (1λ , id, c), where c ∈ {0, 1}λ. It outputs a response r ∈ {0, 1}rg(λ) according to distribution Did (c). It is not required that Eval is a PPT algorithm. Bounded Noise. For all indices id ∈ I, for all challenges c ∈ {0, 1}λ, we have that when running Eval(1λ , id, c) twice, then the Hamming distance of any two outputs r1 , r2 of the algorithm is smaller than dnoise (λ). Instead of Did (c), we usually write PUFid (c). Moreover, if misunderstandings are unlikely to occur, we write D(c) instead of Did (c) and PUF instead of PUFid . Finally, we usually write rg instead of rg(λ) and I instead of Iλ . 2.2
Security of PUFs
Various security properties of PUFs have been introduced in the literature (see [1,23,29] for overviews) such as unpredictability, uncloneability, bounded noise, uncorrelated outputs, one-wayness, and tamper-evidence. We give a detailed analysis of these properties in the full version of this paper as well as the relation to our security notions. The main security properties of PUFs are uncloneability and unpredictability. Unpredictability is covered via an entropy condition on the PUF distribution. This condition also implies mild forms of uncloneability as well as uncorrelated outputs. Moreover, one usually requires that tampering with PUFs can be detected easily, the idea being that a user does not use the PUF anymore after detecting it has been tampered with. Our UC-functionality
Physically Uncloneable Functions in the Universal Composition Framework
57
will cover this property implicitly, as we permit the adversary black-box access to the PUF and the choice of delivering the PUF or not. Tampering with the PUF is treated as not delivering it. For an explicit treatment of tamper-evidencen. We will now turn to our main security definition of PUFs, namely the unpredictability. The behavior of the PUF on input a challenge c should be unpredictable, i.e., have some significant amount of intrinsic entropy, even if the PUF has been measured before on several challenge values. Here, (conditional ) min-entropy is the main tool. It indicates the residual min-entropy on a response value for a challenge c, when one has already measured the PUF on (not necessarily different) challenges c1 , ..., c before. Since the random responses are not under adversarial control we can look at the residual entropy for the answer to r by taking the (weighted) average over all possible response values r1 , ..., r . Demanding that a PUF has a certain average min-entropy [10] is weaker than asking for all possible responses r1 , ..., r , that the residual entropy remains above a certain level. This weaker requirement suffices for our purposes. However, as the challenges c are chosen by the adversary, we ask the average min-entropy to be high for all challenges and defined by the maximal probability of a possible response r. Definition 2 (Average Min-Entropy). The average min-entropy of PUF(c) conditioned on the measurements of challenges C = (c1 , . . . , c ) is defined by ˜ ∞ (PUF(c)|PUF(C)) H := − log Eri ←PUF(ci ) max Pr[PUF(c) = r|r1 = PUF(c1 ), . . . , r = PUF(c )] r −H∞ (PUF(c)|r1 =PUF(c1 ),...,r =PUF(c )) , := − log Eri ←PUF(ci ) 2 where the probability is taken over the choice of id from I and the choice of possible PUF responses on challenge c. The term PUF(C) denotes a sequence of random variables PUF(c1 ), ..., PUF(c ) each corresponding to an evaluation of the PUF on challenge ck . ˜ ∞ (PUF(c)| ˜ ∞ (PUF(c)|C) as an abbreviation for H We occasionally also write H PUF(C)). We now turn to our definition of unpredictability, which is derived from the notion of unpredictability for random variables. Definition 3 (Unpredictability). A (rg, dnoise )-PUF family P = (Sample, Eval) for security parameter 1λ is (dmin (λ), m(λ))-unpredictable if for any c ∈ {0, 1}λ and any challenge list C = (c1 , . . . , c ), one has that, if for all 1 ≤ k ≤ the Hamming distance satisfies disham (c, ck ) ≥ dmin (λ), then the average min˜ ∞ (PUF(c)|PUF(C)) ≥ m(λ). Such a PUF-family is called a entropy satisfies H (rg, dnoise , dmin , m)-PUF family. Note that one could also define a computational version of unpredictability via computational min-entropy (aka. HILL entropy, named after [18]) where the entropy is defined via the entropy of computationally indistinguishable random variables. All proofs considered in this paper carry through when replacing statistical by computational min-entropy; we nonetheless use the statistical variant
58
C. Brzuska et al.
for sake of simplicity. As explained in the introduction, indistinguishability for defining computational min-entropy then needs to be considered with respect to distinguishers that have PUF power (see also full version), and not with respect to mere PPT algorithms. Also, one could define unpredictability in terms of a game where an efficient adversary, after seeing some challenge/response pairs, tries to predict the response for another challenge which is not within close distance to the previous queries (see full version); the success probability should then be negligible. Clearly, the PUF would need super-logarithmic min-entropy in the above sense to make it unpredictable according to this game, but the lower bound on the entropy would vary with the adversary. We do not take this approach because the fuzzy extractors, which are necessary to eliminate the noise of a PUF, usually need a fixed lower bound on the min-entropy in order to be applicable. Also, while it is easy to incorporate a distributional property as above into the ideal functionality, using game-based properties to specify abstract and ideal security requirements appears to be very peculiar. 2.3
PUFs and Fuzzy Extractors
By nature, PUF evaluation is noisy, so that same stimuli results in closely related but different outputs. We use fuzzy extractors of Dodis et al. [10] to convert noisy, high-entropy measurements of PUFs into reproducible random values. An (m, , t, )-fuzzy extractor consists of a pair of algorithms (Gen, Rep). The generation algorithm Gen takes as input a noisy measurement w and generates as output an -bit secret st together with helper data p. The helper data can be stored publicly, since it does not reveal information about the secret: as long as the measurement contains m bits of min-entropy the secret has statistical distance to the uniform distribution, even if given p. The helper data is later used to reproduce the same secret st from related measurements within a certain distance t according to some metric space. We now determine parameters to combine a PUF and the fuzzy extractor in order to achieve almost uniformly random values. Let λ be the security parameter. We let the parameters of the fuzzy extractor depend on the parameters of the PUF. Assume that we have a (rg(λ), dnoise (λ), dmin (λ), m(λ))-PUF family with dmin being in the order of o(λ/ log λ). We now determine the corresponding parameters for the fuzzy extractor as follows. Let (λ) := λ be the length parameter for value st. Let (λ) be a negligible function and let t(λ) = dnoise (λ). For each λ, let (Gen, Rep) be a (m(λ), (λ), t(λ), (λ))-fuzzy extractor. The metric space M is {0, 1}rg(λ) with Hamming distance disham .1 1
Note that such fuzzy extractors only exist if rg(λ) and m(λ) are sufficiently large. In order to achieve this, several PUFs can be combined. When combining two PUFs of the same family, rg gets doubled and so does m. Thus, if there are PUFs with m(λ) being non-negligible they can be combined to a useful PUF-family — even if a PUF-family has less than one bit entropy, it still can be combined to obtain a good PUF-family with outputs which has high entropy of many bits. Thus, we may assume that the PUF has corresponding parameters.
Physically Uncloneable Functions in the Universal Composition Framework
59
Definition 4. If a PUF and a fuzzy extractor (Gen, Rep) satisfy the above requirements, then they are said to have matching parameters. If a PUF and a fuzzy extractor have matching parameters, then the following properties of a well-spread domain, extraction independence and response consistency hold. A formal proof is given in the full version of this paper. Well-Spread Domain: For all polynomials p(λ) and all sets of challenges c1 , ..., cp(λ) , the probability of a random challenge to be within distance smaller dmin of any of the ck is negligible. Extraction Independence: For all challenges c1 , ..., cp(λ) , it holds that the PUF evaluation on a challenge c with dis(ck , c) > dmin for all 1 ≤ k ≤ p(λ) and subsequent application of Gen yields an almost uniform value st even for those who observe p. Response Consistency: The fuzzy extractor maps two evaluations of the same PUF to the same random string, i.e., if PUF is measured on challenge c twice and returns r and r , then for (st, p) ← Gen(r), one has st ← Rep(r , p).
3
Universally Composable Security and PUFs
We model PUFs in the universal composition framework introduced by Canetti in [4]. Note that we use, among other things, well-studied UC basics, such as authenticated message transmissions. 3.1
Modeling PUFs in UC
In the following we propose an ideal functionality FPUF that will model PUFs. The functionality is presented in Figure 1 and handles the following operations: (1) a party Pi is allocated a PUF; (2) Pi can query the PUF; (3) Pi gives the PUF to another party Pj who can also query the device; (4) an adversary can query the PUF during transition. The functionality FPUF maintains a list L of tuples (sid, Pi , id, τ ) where sid is the (public) session identifier and id is the (internal) PUF-identifier, essentially describing the output distribution. Note that the PUF itself does not use sid. The element τ ∈ {trans(Pj ), notrans} denotes whether the PUF is in transition to Pj . For trans(Pj ), indicating that the PUF is in transition to Pj , the adversary is able to query the PUF. In turn, if it is set to notrans then only the possessing party can query the PUF. The PUF functionality FPUF is indexed by the PUF parameters (rg, dnoise , dmin , m) and gets the security parameter λ in unary encoding as additional input. It is required to satisfy the bounded noise property for dnoise (λ) and the unpredictability property for (dmin (λ), m(λ)). This enforces that the outputs obey the basic entropic requirements of PUFs (analogously to the requirement for the random oracle functionality to produce random and independent outputs). We write FPUF and FPUF (rg, dnoise , dmin , m) interchangeably.
60
C. Brzuska et al.
FPUF (rg, dnoise , dmin , m) receives as initial input a security parameter 1λ and runs with parties P1 , ..., Pn and adversary S. • Whenever a party Pi writes (initPUF , sid, Pi ) on the input tape of FPUF then FPUF checks whether L already contains a tuple (sid, ∗, ∗, ∗, ∗): If this is the case then turn into the waiting state. Else, draw id ← Sample(1λ ) from the PUF-family. The functionality FPUF puts the following tuple in L: (sid, id, Pi , ∗, notrans) and writes (initializedPUF , sid) on the communication input tape of Pi . • Whenever a party Pi writes (evalPUF , sid, Pi , c) on FPUF ’s input tape then FPUF first checks, if there exists a tuple (sid, id, Pi , notrans) in L: If this is not the case then turn into the waiting state. Else, run r ← Eval(1λ , id, c) and write (eval edPUF , sid, c, r) on Pi ’s communication input tape. • Whenever a party Pi sends (handoverPUF , sid, Pi , Pj ) to FPUF then FPUF first checks, if there exists a tuple (sid, ∗, Pi , notrans) in L: If this is not the case then turn into the waiting state. Else, modify the tuple (sid, id, Pi , notrans) to the updated tuple (sid, id, ⊥, trans(Pj )). Write invokePUF (sid, Pi , Pj ) on S’s communication input tape to indicate that a handoverPUF occurs between Pi and Pj . • Whenever the adversary writes (evalPUF , sid, S, c) on the input tape of FPUF then FPUF first checks, if L contains a tuple (sid, id, ⊥, trans(∗)): If this is not the case then turn into the waiting state. Else, run r ← Eval(1λ , id, c) and return (eval edPUF , sid, c, r) to S. • Whenever the adversary writes (readyPUF , sid, S) on FPUF ’s input tape then FPUF searches for a tuple (sid, id, ⊥, trans(Pj )) in L: If such a tuple does not exist then turn into the waiting state. Else, modify the tuple (sid, id, ⊥, trans(Pj )) to the updated tuple (sid, id, Pi , notrans). Write the message (handoverPUF , sid, Pi ) on Pj ’s communication input tape and store the tuple (receivedPUF , sid, Pi ). • Whenever the adversary sends (receivedPUF , sid, Pi ) to FPUF , FPUF checks if a tuple (receivedPUF , sid, Pi ) has been stored. If so, it writes this tuple to the communication input tape of Pi . Else, FPUF turns into the waiting state.
Fig. 1. The ideal functionality FPUF for PUFs
Also note that our definition requires that a PUF is somehow certified. That is, the adversary cannot replace a PUF sent to an honest party by a fake token including some “software emulation”; the adversary can only measure the PUF when in transition. The receiver can verify the constitution and authenticity of the received hardware. Our functionality also implies that the sender knows when the PUF has been delivered to the receiver. Relaxing this requirement is delicate as the adversary could then still be in possession of the PUF. Formally, delivery confirmation can be ensured by having the receiver send an acknowledgment message (via an authenticated channel). 3.2
Non-programmability
As explained in the introduction we envision a non-programmable version of PUFs. The functionality above, if used in the standard way within the hybrid model, would be programmable, though, because the environment would not have direct access (even if the PUF is in possession of the adversary). One way to enforce non-programmability is to switch to the extended UC (EUC) model [5] where all parties, including the environment, share the above functionality.
Physically Uncloneable Functions in the Universal Composition Framework
61
The PUF could then also be evaluated by the environment in which case the simulator is informed about the challenge and response. To simplify we linger within the basic UC framework and instead allow the environment to dispatch special PUF queries to the adversary/simulator. This query needs to be answered faithfully by forwarding it to a genuine PUF instance, and the response is handed back to the environment. Put differently, we put some restriction on the how the simulator behaves, formally giving a UC-security proof which would transfer to the EUC model.
4
Oblivious Transfer with PUFs
In a 1-out-of-2 oblivious transfer (OT) protocol the sender possesses two secrets s0 , s1 and the receiver holds a selection bit b ∈ {0, 1}, thereby choosing one of the two secrets. A 1-out-of-2 OT-protocol assures that at the end of the protocol execution, the receiver learns the secret sb , but nothing about s1−b , and the sender does not learn anything about the selection bit b. Oblivious Transfer is a widely used cryptographic primitive for many cryptographic applications [22,9,13]. However, in many of those applications a bottleneck of OT is the computational requirements since, for instance, several public key operations are necessary. We here show how to avoid the number of public key operations by adopting hardware. In the following, we recall the oblivious transfer ideal functionality and then provide a PUF-based oblivious transfer protocol. As noted in the introduction, we envision a scenario in which the PUF is used multiple times. In the plain UC model, however, a fresh PUF would need be sent for each OT execution. An alternative would be to switch to the joint-state theorem (JUC) [8] for the UC framework. However, JUC applies a transformation to the original protocol, and if a single session of a PUF protocol requires to hand over a PUF once, the JUC transformation would also require a handover per session. Nothing would be gained. Thus, we define and analyze multi-session protocols instead of the more common one-session protocols. 4.1
The Oblivious Transfer Ideal Functionality
1-out-of-2 oblivious transfer is an interaction between a sender Pi and a receiver Pj where the environment Z provides Pi with two inputs s0 , s1 and Pj with an input bit b. As soon as both parties provided their inputs (and the simulator S allows delivery), the ideal functionality returns the secret sb to the receiver. The ideal functionality for oblivious transfer FOT is given in Figure 2. We stress that this functionality only supports static corruption and can be used a bounded number of times, and only by the parties which have exchanged the PUF. Each execution will be accompanied by a unique sub session identifier ssid. 4.2
Oblivious Transfer Scheme
In Figure 3, we provide an oblivious transfer protocol. For simplicity of exposition, we use the following notation. For a possibly empty set C we let
62
C. Brzuska et al.
FOT is parameterized by an integer N and receives as input a security parameter 1λ , and runs with parties P1 , ..., Pn and adversary S. The functionality initially sets (n, S, R) = (1, ⊥, ⊥). In the following, the functionality ignores any input if n > N , or if n > 1 and (S, R) = (Pi , Pj ) for the parties’ identities (Pi , Pj ) in the input. Else, • Whenever Pi writes (sendOT , sid, ssid, Pi , Pj , (s0 , s1 )) with s0 , s1 ∈ {0, 1}λ ∪ {⊥} on FOT ’s input tape, FOT stores (sendOT , sid, ssid, Pi , Pj , (s0 , s1 )) and writes (sendOT , sid, ssid, Pi , Pj ) to the communication input tape of S. The functionality increments n to n + 1 and stores (S, R) = (Pi , Pj ) if n = 2 now. • Whenever Pj writes (choose-secretOT , sid, ssid, Pi , Pj , b) on the input tape of FOT , the functionality FOT stores this tuple and writes (choose-secretOT , ssid, sid, Pi , Pj ) on the input tape of S. • When S writes (deliverOT , sid, ssid, Pi , Pj ) on FOT ’s input communication tape then FOT checks if tuples (sendOT , sid, ssid, Pi , Pj , (s0 , s1 )) and (choose-secretOT , sid, ssid, Pi , Pj , b) have been stored. If so, write (deliver OT , sid, ssid, Pi , Pj , sb ) on the input communication tape of Pj .
Fig. 2. The ideal functionality for oblivious transfer adapted from [4] Sender Pi
session sid
Receiver Pj (initPUF , sid0 , Pi , λ) k = 1, ..., N : ck ←{0, 1}λ rk ← (evalPUF , sid0 , Pi , ck )
C := ∅
(handoverPUF , sid0 , Pi , Pj ) ←−−−−−−−−− L := (c1 , r1 , ..., c , r ), C := ∅ Repeat at most N times with fresh ssid
Input: s0 , s1 ∈ {0, 1}λ , sid (sendauth , sid, ssid, Pi , Pj , (x0 , x1 )) $ x0 , x1 ← {0, 1}λ −−−−−−−−−→
Input: b ∈ {0, 1}, sid $
Draw (c, r) ← L v := c ⊕ xb , c := c ⊕ x0 ⊕ x1
(sendauth , sid, ssid, Pi , Pj , v) dis(v ⊕ x0 , C) > dmin ? ←−−−−−−−−− dis(c, C) > dmin ? dis(v ⊕ x1 , C) > dmin ? dis(c , C) > dmin ? Add v ⊕ x0 , v ⊕ x1 to C Add c, c to C r0 ← (evalPUF , sid0 , Pi , v ⊕ x0 ) Delete (c, r) in L r1 ← (evalPUF , sid0 , Pi , v ⊕ x1 ) (st0 , p0 ) ← Gen(r0 ) (st1 , p0 ) ← Gen(r1 ) (sendauth , sid, ssid, Pi , Pj , (S0 , p0 , S1 , p1 )) S0 := s0 ⊕ st0 , −−−−−−−−−→ stb ← Rep(r, pb ) S1 := s1 ⊕ st1 sb = Sb ⊕ stb
Fig. 3. Oblivious transfer scheme with PUFs
dis(c, C) > dmin denote the check that each element ci in C satisfies the bound dis(c, ci ) > dmin . If not, we assume that the corresponding party aborts. Also, when interacting with the PUF (functionality), we simply write for example r ← (evalPUF , sid0 , Pi , c) to denote the fact that, for a call (evalPUF , sid0 , Pi , c) the functionality has replied with (eval edPUF , sid0 , c, r). Here, sid0 is the session identifier for FPUF , as opposed to sid and ssid for the oblivious transfer protocol. We note that the protocol does not achieve perfect completeness in the sense that executions between honest parties may fail. The probability for this is
Physically Uncloneable Functions in the Universal Composition Framework
63
negligible, though. This follows straightforwardly again from the fact that the domain is well-spread: All (at most polynomial) challenges are independent random values such that one is within small distance of the others with negligible probability only. If all challenges are sufficiently far apart, the receiver always obtains the correct value. We now sketch the security arguments for the OT-protocol in Figure 3, i.e., at the end of the OT protocol (1) a malicious sender learns nothing about the bit b and (2) a malicious receiver learns only the secret sb and remains oblivious about s1−b . For case (1), the receiver chooses the challenge c at random. Thus, v = c ⊕ xb hides xb information-theoretically and thus also b. We now consider case (2). For simplicity, assume that b = 0. Then, the sender shall remain oblivious about any information about s1 . If st1 looks uniform to the sender, then s1 is information-theoretically hidden. If the fuzzy extractor and the PUF have matching parameters (see Definition 4), then with overwhelming probability this is the case, as — due to the well-spread domain property (see Subsection 2.3) — the probability that the receiver queried the PUF on values ck with disham (ck , v ⊕ x1 ) < dmin is negligible, and the checks on the sender side about list L provided that the sender does not reveal PUF responses to critical challenges. Theorem 1. Assuming that (Gen, Rep) is a (m, , t, )-fuzzy generator and that PUF = (Sample, Eval) is a PUF-family with matching parameters (see Definition 4), then protocol PUFOT securely realizes the functionality FOT in the FPUF hybrid model. Security holds in a statistical sense, i.e., the environment’s views in the two worlds are statistically close. This remains true for unbounded algorithms A, S, and Z, as long as the number of PUF evaluations is polynomially bounded. The proof is delegated to the full version of the paper. 4.3
Oblivious Transfer with Sender-PUF
Our OT-protocol requires the receiver to send a PUF to the sender. Sometimes it may be desirable to have the sender prepare the PUF, though. This can be achieved by switching the roles of the sender and the receiver via the protocol by Wolf and Wullschleger [32], but at the expense of having to run linear many OT executions for strings of length λ. This is unavoidable since the receiver in an OT-protocol just enters a bit such that, when acting as a sender, it can only transmit a single bit. In this protocol the sender of the outer OT-protocol acts as a receiver in the inner OT-protocol, thus sending the PUF. The protocol in [32] requires only a single round of additional communication. It is UC-secure in the FOT -hybrid world and inherits the security properties (statistical vs. computational security, and adaptive vs. static corruptions). With a linear overhead [3] and another extra round of communication one can then get an OT-protocol for strings, which is also UC-secure in the FOT -hybrid world for bit-functionality FOT . The final protocol is now a UC-secure OT-protocol for strings with linear many calls to FOT , a few extra rounds, and inheriting all security characteristics from FOT .
64
5
C. Brzuska et al.
PUF-Based Commitment Scheme
A commitment scheme is a two-party protocol between a sender and a receiver where the sender (also called committer) first sends a disguised version of the value to the receiver such that, later, only this value can be revealed. More precisely, a commitment scheme allows the committer to compute to a value msg a pair (com, decom) such that com reveals nothing about the value msg but using the pair (com, decom) one can open msg. Moreover it should be infeasible to find a value decom such that (com, decom ) reveals msg = msg. 5.1
The Commitment Scheme Ideal Functionality
In the UC world, the commitment scheme is realized by the (bounded) functionality Fcom as follows: Fcom receives an input (commit, sid, ssid, msg) from some committer Pi where msg is the value committed to. After verifying the validity of the session identifier sid, Fcom records the value msg. Subsequently, the functionality lets both the receiver Pj and the adversary S know that the committer has committed to some value by computing a public delayed output (receipt, sid, ssid) and sending it to Pj (this phase is called the commitment phase). To initiate the decommitment phase, the committer Pi sends (open, sid, ssid) to the functionality Fcom . Thereupon, Fcom checks if there exists a value msg; if so, the functionality computes a public delayed output (open, sid, ssid, msg) and sends it to Pj . When the adversary corrupts the committer by sending (corrupt-committer, sid, ssid) to Fcom , the functionality reveals the recorded value msg to the adversary S. Furthermore, if the receipt value was not yet delivered to Pj , then Fcom allows the adversary to modify the committed value. This is in order to deal with adaptive corruptions. The ideal functionality for commitment schemes Fcom is given in Figure 4. Fcom is parameterized by an integer N and runs with parties Pi , Pj , and adversary S. It initially sets (n, S, R) = (1, ⊥, ⊥). The functionality ignores any commit-input if n > N , or if n > 1 and (S, R) = (Pi , Pj ) for the parties’ identities in the input. Else, • Upon receiving input (commit, sid, ssid, Pi , Pj , msg) from party Pi , Fcom proceeds as follows: Records msg, generate a public delayed output (receipt, sid, ssid), and send the output to Pj . Increment n to n + 1 and store (S, R) = (Pi , Pj ) if now n = 2. • Upon receiving input (open, sid, ssid) from party Pi , Fcom proceeds as follows: If a value msg is recorded, generate a public delayed output (open, sid, ssid, msg) and send it to Pj . Otherwise, do nothing. • Upon receiving the input (corrupt-committer, sid, ssid) from the adversary S, Fcom proceeds as follows: Send the value msg to S. If S provides a value msg and the receipt output was not yet written on Pj ’s tape, then S can change the recorded value to msg .
Fig. 4. The ideal functionality for commitment schemes adapted from [4]
Physically Uncloneable Functions in the Universal Composition Framework
5.2
65
PUF-Based Commitment Scheme
We now provide a universal transformation from OT-protocols to bit commitment schemes which—to our knowledge—has not been considered so far. Previous transformations [22,9] rely on cut-and-choose and require linear many executions of the OT-protocol. Our transformation only requires a single additional message to be sent after executing the OT-protocol. The main idea of the protocol in Figure 5 is to inverse the roles of the sender and the receiver. The OT-protocol transfers two secrets, and the committer only learns one of them, namely the one corresponding to its secret bit b. This secret is then used to open the commitment. The main idea is to inverse the roles of the sender and the receiver. The commitment protocol uses the OT-protocol as a building block or, more precisely, since we work in the UC framework, the corresponding ideal OT-functionality. Consider a commitment scheme with OT-sender Pi and OT-receiver Pj . Then, Pj is the committer and has a secret bit b which it submits to the OT-functionality. The receiver Pi draws two sufficiently long random strings s0 and s1 which it submits to the OT-functionality. The OT-functionality then provides Pj with the secret sb . This terminates the commitment phase. In the opening phase, the committer Pj sends the pair (b, sb ). The receiver Pi then checks whether sb matches the b-th secret. The protocol is binding, as the OT-functionality does not allow to modify the secret bit b and the secret s1−b is statistically hidden from Pi . Thus, Pi can determine s1−b only with negligible probability. The protocol is hiding, as the OT-functionality does not reveal information about the bit b to Pi . Sender Pi Input: b ∈ {0, 1} v := sb
session sid Repeat at most N times with fresh ssid: (choose-secretOT , b) (sendOT , (s0 , s1 )) −−−−−−−−−→ ←−−−−−−−−− (deliverOT , sb ) ←−−−−−−−−−
FOT
(sendauth , sid, ssid, b, v) −−−−−−−−−→
Receiver Pj
Draw $ s0 , s1 ← {0, 1}λ v = sb ?
Fig. 5. Commitment scheme with FOT
Theorem 2. The commitment protocol in Figure 5 securely UC-realizes the functionality Fcom in the FOT -hybrid model. If functionality FOT is replaced by some OT-protocol, then the derived commitment protocol basically inherits the characteristics of the OT-protocol. That is, it is secure against adaptive corruptions if OT is, and it is statistically secure if OT is. Remarkably, we show in the next section that our PUF-based OTprotocol, while being only statically secure, makes the commitment scheme even adaptively secure.
66
C. Brzuska et al.
We merely provide a proof sketch for Theorem 2 here. Note that in the case where both users are honest, only the modeling of the final message needs to be taken into consideration. The simulator learns the secret bit b from the commitment functionality Fcom . It then draws a random string v from {0, 1}λ and sends (sendauth , sid, ssid, b, v). If the receiver is dishonest, then it provides FOT with two secrets s0 , s1 . The simulator lets the sender provide a random bit b to the simulated FOT . It receives back the secret sb . In the opening phase, S learns the (real) secret bit b from the commitment functionality and simulates the final protocol message as (sendauth , sid, ssid, b, sb ). If the sender is corrupt then it provides the simulated FOT with a secret bit b. The simulator creates two random strings s0 , s1 and passes them to the simulated FOT which passes sb to the receiver. The simulator commits to the sender’s bit b in the ideal world. If the sender sends a message (sendauth , sid, ssid, b, v) then S checks if sb = v. If so, it instructs Fcom to open the commitment. All simulations are perfect. 5.3
Adaptively Secure Commitments
Consider the concrete commitment protocol where we plug in our OT-protocol from the previous section into the abstract scheme above (and work in the FPUF hybrid model instead of the FOT -hybrid model then), then we observe the following: In the commitment phase (i.e., the OT-phase), the message sent by the OT-receiver (the commitment sender) is statistically independent from its secret input: the OT-receiver merely sends a single uniformly random message. For the OT-sender, this is not the case: When having access to the PUF, one can extract both secrets from the mere transcript of the protocol. This enables the simulator S to derive both secrets from the protocol, as it accesses the PUF. It can thus provide the simulated committer with open messages for both bit values. As the remaining part of the committer’s state merely consists in challenge/response-pairs, the simulator can thus provide genuine internal state.
6
Key Exchange with PUFs
In a key exchange (ke) protocol two parties interact over an insecure network to establish a common secret key κ. This common secret key can then be used to build a secure channel or to ensure confidentiality of transmitted data. 6.1
The Key Exchange Ideal Functionality
The main idea of the key exchange ideal functionality Fke is the following: if both parties are honest, the functionality provides them with a common random value which is invisible to the adversary. If one of them is corrupted, though, the adversary determines the session key entirely thus modeling the participation of a corrupted party. The definition of the key exchange functionality Fke is depicted in Figure 6, adapted from [7].
Physically Uncloneable Functions in the Universal Composition Framework
67
Fke is parameterized by an integer N and receives as input a security parameter 1λ , and runs with parties P1 , ..., Pn and adversary S. Fke obtains a list of corrupt parties. It initially sets (n, S, R) = (1, ⊥, ⊥). Ignore any establish-session ke -input if n > N , or if n > 1 and (S, R) = (Pi , Pj ) for the parties’ identities in the input. Else, • When a message (establish-session ke , sid, ssid, Pi , Pj ) is written on Fke ’s input tape by a party Pi . Then Fke stores the tuple (establish-session ke , sid, ssid, Pi , Pj ) (and refuses if there already is a tuple (establish-session ke , sid, ssid, Pj , Pi ) or a tuple (establish-session ke , sid, ssid, Pi , Pj )). Fke outputs (establish-sessionke , sid, ssid, Pi , Pj ) to the adversary S. If both users are honest then draw a random value κ from {0, 1}λ and store the messages (deliver ke , sid, ssid, κ, Pi ) and (deliverke , sid, ssid, κ, Pj ). Increment n to n + 1. • When S writes (choose-valueke , sid, ssid, Pi , Pj , κ) on Fke ’s input tape then check whether there is a message (establish-session ke , sid, ssid, Pi , Pj ) or a message (establish-session ke , sid, ssid, Pj , Pi ) and whether at least one of the users Pi and Pj is corrupt. If so, store the messages (deliverke , sid, ssid, κ, Pi ) and (deliver ke , sid, ssid, κ, Pj ). • S writes (deliverke , sid, ssid, Pi ) on Fke ’s input communication tape. Check if a tuple (deliverke , sid, ssid, κ, Pi ) is stored. If so, write (deliver ke , sid, ssid, κ, Pi ) to Pi ’s input tape and delete (deliverke , sid, ssid, κ, Pi ). Else, do nothing.
Fig. 6. The key exchange ideal functionality adapted from [7]
6.2
Minimal Requirements
We present a key exchange protocol in Section 6.3 which sends a PUF in a setup phase. Afterwards, a single message per protocol execution is sent via a unidirectional authenticated channel. As mentioned in the introduction, it is desirable to circumvent the use of complexity-theoretic assumptions. However, for practical reasons, PUF transfers should also be minimized. If only a single PUF transfer occurs, then the assumption of a unidirectional authenticated channel cannot be dropped: The sender of the PUF measured the PUF several times and sent it to the receiver. The adversary can query the PUF during its transition. If the sender does not have any further secret information for authentication, then the adversary can can carry out the same computations as the sender. Thus, the protocol cannot be secure against impersonation attacks. In the following, we use the standard bidirectional Fauth functionality. Deriving corresponding unidirectional definitions is straightforward. 6.3
PUF-Based Key Exchange Scheme
Intuitively, our key exchange protocol proceeds as follows. In an enrollment phase, a server issues a PUF, measures for a set of randomly chosen challenges the corresponding responses, and finally ensures a noisy-free PUF measurement by generating for each response r a fuzzy extractor secret st from a set of random secrets as well as a corresponding helper data p. The server then sends the PUF to the client. Upon finishing the enrollment phase the server broadcasts a randomly chosen challenge c including its helper data p to the client and sets κ = st to obtain the protocol key. The client evaluates the PUF on the challenge c, computes the corresponding fuzzy secret st due to the helper data p, and obtains the protocol key by setting κ = st. Consequently, both parties use the fuzzy extractor secret st as their common protocol key κ. We again note that
68
C. Brzuska et al.
Server Pi
Client Pj
(initPUF , sid, Pi , λ) Repeat N times: r ← (evalPUF , sid, Pi , c) (st, p) ← Gen(r) (handoverPUF , sid, Pi , Pj ) −−−−−−−−−→
add (c, r, st, p) to L
Repeat at most N times pick (c, r, st, p)←L remove the entry from L κ = st
(sendauth , sid, ssid, Pj , (c, p)) −−−−−−−−−→
r ← (evalPUF , sid, Pj , c) st ← Rep(r , p) κ = st
Fig. 7. Key exchange scheme with PUFs
the sender is informed about the point in time when the receiver is in possession of the PUF. Theorem 3. Protocol PUFKE securely realizes functionality Fke in the FPUF hybrid model. In the following we merely provide a proof sketch for Theorem 3. The idea is that, for an honest sender, the simulator can easily emulate the setup phase by simply querying the PUF honestly. The simulator simply reveals these samples step by step. If the receiver is honest then, due to the well-spread domain, the adversary will most likely not have queried the PUF about any of the sampled values during the transition phase, such that all the derived keys are statistically indistinguishable from random. It follows that the simulation is statistically close to an actual protocol execution. Finally note that, if one of the parties in the key exchange protocol is corrupt, then the simulator can easily set the key to one of the obtained PUF measurements (after running the fuzzy extractor). Acknowledgments. We thank the anonymous reviewers for valuable comments. Marc Fischlin is supported by the Emmy Noether Program Fi 940/2-1 of the German Research Foundation (DFG). This work was supported by CASED (http://www.cased.de).
References 1. Armknecht, F., Maes, R., Sadeghi, A.-R., Standaert, F.-X., Wachsmann, C.: A formal foundation for the security features of physical functions. To appear at IEEE S&P (2011) 2. Armknecht, F., Maes, R., Sadeghi, A.-R., Sunar, B., Tuyls, P.: Memory LeakageResilient Encryption Based on Physically Unclonable Functions. In: Matsui, M. (ed.) ASIACRYPT 2009. LNCS, vol. 5912, pp. 685–702. Springer, Heidelberg (2009) 3. Brassard, G., Cr´epeau, C., Robert, J.-M.: Information theoretic reductions among disclosure problems. In: FOCS, pp. 168–173. IEEE, Los Alamitos (1986)
Physically Uncloneable Functions in the Universal Composition Framework
69
4. Canetti, R.: Universally composable security: A new paradigm for cryptographic protocols. In: FOCS, pp. 136–145 (2001) 5. Canetti, R., Dodis, Y., Pass, R., Walfish, S.: Universally Composable Security with Global Setup. In: Vadhan, S.P. (ed.) TCC 2007. LNCS, vol. 4392, pp. 61–85. Springer, Heidelberg (2007) 6. Canetti, R., Fischlin, M.: Universally composable commitments. In: Kilian, J. (ed.) CRYPTO 2001. LNCS, vol. 2139, pp. 19–40. Springer, Heidelberg (2001) 7. Canetti, R., Krawczyk, H.: Universally composable notions of key exchange and secure channels. In: Knudsen, L.R. (ed.) EUROCRYPT 2002. LNCS, vol. 2332, pp. 337–351. Springer, Heidelberg (2002) 8. Canetti, R., Rabin, T.: Universal Composition with Joint State. In: Boneh, D. (ed.) CRYPTO 2003. LNCS, vol. 2729, pp. 265–281. Springer, Heidelberg (2003) 9. Cr´epeau, C.: Equivalence between Two Flavours of Oblivious Transfers. In: Pomerance, C. (ed.) CRYPTO 1987. LNCS, vol. 293, pp. 350–354. Springer, Heidelberg (1988) 10. Dodis, Y., Ostrovsky, R., Reyzin, L., Smith, A.: Fuzzy extractors: How to generate strong keys from biometrics and other noisy data. SIAM J. Comput. 38, 97–139 (2008) 11. Frikken, K.B., Blanton, M., Atallah, M.J.: Robust Authentication Using Physically Unclonable Functions. In: Samarati, P., Yung, M., Martinelli, F., Ardagna, C.A. (eds.) ISC 2009. LNCS, vol. 5735, pp. 262–277. Springer, Heidelberg (2009) 12. Gassend, B., van Dijk, M., Clarke, D.E., Torlak, E., Devadas, S., Tuyls, P.: Controlled physical random functions and applications. ACM Trans. Inf. Syst. Secur. 10(4) (2008) 13. Goldreich, O., Micali, S., Wigderson, A.: How to play any mental game or a completeness theorem for protocols with honest majority. In: STOC, pp. 218–229. ACM, New York (1987) 14. Goldwasser, S., Kalai, Y.T., Rothblum, G.N.: One-Time Programs. In: Wagner, D. (ed.) CRYPTO 2008. LNCS, vol. 5157, pp. 39–56. Springer, Heidelberg (2008) 15. Goyal, V., Ishai, Y., Mahmoody, M., Sahai, A.: Interactive Locking, ZeroKnowledge PCPs, and Unconditional Cryptography. In: Rabin, T. (ed.) CRYPTO 2010. LNCS, vol. 6223, pp. 173–190. Springer, Heidelberg (2010) 16. Goyal, V., Ishai, Y., Sahai, A., Venkatesan, R., Wadia, A.: Founding Cryptography on Tamper-Proof Hardware Tokens. In: Micciancio, D. (ed.) TCC 2010. LNCS, vol. 5978, pp. 308–326. Springer, Heidelberg (2010) 17. Guajardo, J., Kumar, S.S., Schrijen, G.-J., Tuyls, P.: FPGA Intrinsic PUFs and Their Use for IP Protection. In: Paillier, P., Verbauwhede, I. (eds.) CHES 2007. LNCS, vol. 4727, pp. 63–80. Springer, Heidelberg (2007) 18. H˚ astad, J., Impagliazzo, R., Levin, L.A., Luby, M.: A pseudorandom generator from any one-way function. SIAM J. Comput. 28(4), 1364–1396 (1999) 19. Hazay, C., Lindell, Y.: Constructions of truly practical secure protocols using standard smartcards. In: ACM CCS, pp. 491–500. ACM, New York (2008) 20. Hofheinz, D., Unruh, D., M¨ uller-Quade, J.: Universally composable zero-knowledge arguments and commitments from signature cards. Tatra Mt. Math. Pub., 93–103 (2007) 21. Katz, J.: Universally Composable Multi-party Computation Using Tamper-Proof Hardware. In: Naor, M. (ed.) EUROCRYPT 2007. LNCS, vol. 4515, pp. 115–128. Springer, Heidelberg (2007) 22. Kilian, J.: Founding cryptography on oblivious transfer. In: STOC, pp. 20–31. ACM, New York (1988)
70
C. Brzuska et al.
23. Maes, R., Verbauwhede, I.: hysically Unclonable Functions: a Study on the State of the Art and Future Research Directions, section 1. Towards Hardware-Intrinsic Security. Springer, Heidelberg (2010) 24. Moran, T., Segev, G.: David and Goliath Commitments: UC Computation for Asymmetric Parties Using Tamper-Proof Hardware. In: Smart, N.P. (ed.) EUROCRYPT 2008. LNCS, vol. 4965, pp. 527–544. Springer, Heidelberg (2008) 25. Nielsen, J.B.: Separating random oracle proofs from complexity theoretic proofs: The non-committing encryption case. In: Yung, M. (ed.) CRYPTO 2002. LNCS, vol. 2442, pp. 111–126. Springer, Heidelberg (2002) 26. Pappu, R., Recht, B., Taylor, J., Gershenfeld, N.: Physical one-way functions. Science 297, 2026–2030 (2002) 27. Pappu, R.S.: Physical One-Way Functions. Phd thesis, Massachusetts Institut of Technology (2001) 28. R¨ uhrmair, U.: Oblivious Transfer Based on Physical Unclonable Functions. In: Acquisti, A., Smith, S.W., Sadeghi, A.-R. (eds.) TRUST 2010. LNCS, vol. 6101, pp. 430–440. Springer, Heidelberg (2010) 29. R¨ uhrmair, U., S¨ olter, J., Sehnke, F.: On the foundations of physical unclonable functions. Cryptology ePrint Archive, Report 2009/277 (2009) 30. Sadeghi, A.-R., Visconti, I., Wachsmann, C.: Enhancing RFID Security and Privacy by Physically Unclonable Functions. Towards Hardware-Intrinsic Security. Springer, Heidelberg (2010) 31. R¨ uhrmair, C.J.U., Algasinger, M.: An attack on puf-based session key exchange and a hardware-based countermeasure: Erasable pufs. In: Proc. Financial Cryptoghraphy (2011) 32. Wolf, S., Wullschleger, J.: Oblivious Transfer Is Symmetric. In: Vaudenay, S. (ed.) EUROCRYPT 2006. LNCS, vol. 4004, pp. 222–232. Springer, Heidelberg (2006)
Computer-Aided Security Proofs for the Working Cryptographer Gilles Barthe1 , Benjamin Gr´egoire2, Sylvain Heraud2 , and Santiago Zanella B´eguelin1 1
2
IMDEA Software Institute, Madrid, Spain INRIA Sophia Antipolis-M´editerran´ee, France
Abstract. We present EasyCrypt, an automated tool for elaborating security proofs of cryptographic systems from proof sketches—compact, formal representations of the essence of a proof as a sequence of games and hints. Proof sketches are checked automatically using off-the-shelf SMT solvers and automated theorem provers, and then compiled into verifiable proofs in the CertiCrypt framework. The tool supports most common reasoning patterns and is significantly easier to use than its predecessors. We argue that EasyCrypt is a plausible candidate for adoption by working cryptographers and illustrate its application to security proofs of the Cramer-Shoup and Hashed ElGamal cryptosystems. Keywords: Provable security, verifiable security, game-based proofs, Cramer-Shoup cryptosystem, ElGamal encryption.
1
Introduction
The game-playing technique [8, 17, 20] is an established methodology for structuring cryptographic proofs. Its essence lies in giving precise mathematical descriptions, referred to as games, of the interaction between adversaries and oracle systems. Proofs are organized as sequences of games, starting from a game that represents a security goal (e.g. indistinguishability against chosen-ciphertext attacks), and proceeding to games that represent security assumptions (e.g. Decision Diffie-Hellman) by successive transformations that can be shown to preserve, or alter only slightly the overall security. In a typical step in a game-based proof the goal is to relate the probability of an event A in a game G to the probability of a possibly different event A in a game G . For example, the goal may be to establish an inequality of the form Pr [G : A] ≤ Pr [G : A ] + Δ, where Δ is an arithmetic expression that depends on the number of oracle queries made by an adversary. The prevailing practice for proving the validity of such proof steps is to use standard mathematical tools, which interleave reasoning about the semantics of games with information-theoretic or arithmetical arguments.
Partially funded by European Project FP7-256980 NESSoS, French project ANR SESUR-012 SCALP, Spanish project TIN2009-14599 DESAFIOS 10, and Madrid Regional project S2009TIC-1465 PROMETIDOS.
P. Rogaway (Ed.): CRYPTO 2011, LNCS 6841, pp. 71–90, 2011. c International Association for Cryptologic Research 2011
72
G. Barthe et al.
In the code-based approach to the game-playing technique [8, 17] games are cast as probabilistic algorithms. The adoption of programming idioms allows to give precise definitions of games, and paves the way for applying programming language methods to justify proof steps rigorously. As anticipated by their proponents, code-based game-playing proofs are amenable to formal verification, and a number of tools provide support for building them. CryptoVerif [11] is a tool for conducting security proofs in a game-based setting in which games are modeled as processes and transitions are justified by means of process-algebraic concepts such as bisimulations. One strength of CryptoVerif, apart from being the first tool to have supported game-based proofs, is that it applies both to protocols and primitives; it has been successfully applied to verify Kerberos [10] and the Full-Domain Hash (FDH) signature scheme [12]. CertiCrypt [6] is another framework that allows for the interactive construction of game-based proofs in the Coq proof assistant [22]. One specificity of CertiCrypt is that proofs can be verified independently and automatically by a small trustworthy checker; it has been successfully applied to verify prominent cryptographic constructions, including OAEP [5], FDH [24], and zero-knowledge protocols [7]. While the developments based on CryptoVerif and CertiCrypt make a convincing case that computer-aided cryptographic proofs are indeed plausible, neither tool has reached a wide audience among cryptographers. In [5], we contrast the high guarantees given by CertiCrypt with the effort and expertise required to build machine-checked proofs, and conclude that cryptographers are unlikely to adopt verifiable security in its current form. In this sense, it can be considered that CryptoVerif and CertiCrypt only provide a partial realization of Halevi’s programme of systematically building computer-aided cryptographic proofs [17]. The thesis of this article is that verifiable security can dramatically benefit from automation using state-of-the-art verification technology, and that verifiable game-based proofs can be constructed with only a moderate effort. The thesis is realized with the presentation of EasyCrypt, an automated tool that builds machine-checked proofs from proof sketches, which offer a machine-processable representation of the essence of a security proof. We argue that EasyCrypt is significantly easier to use than previous tools, making an important step towards the adoption of computer-aided security proofs by working cryptographers and hence towards fulfilling Halevi’s programme. To substantiate our claim, we present computer-aided proofs of security of Hashed ElGamal encryption and the Cramer-Shoup cryptosystem. EasyCrypt adopts the principled approach mandated by CertiCrypt to conduct game-based proofs and imposes a clear separation between program verification and information-theoretic reasoning. Transitions between games are justified in two steps: first, one proves logical relations between the games using probabilistic Relational Hoare Logic (pRHL); second, one applies information-theoretic reasoning to derive claims about the probability of events from pRHL judgments. We provide for each step highly effective mechanisms that build upon a combination of off-the-shelf and purpose-specific tools. Specifically, EasyCrypt implements an automated procedure that computes for any pRHL judgment
Computer-Aided Security Proofs for the Working Cryptographer
73
a set of sufficient conditions for its validity, known as verification conditions. The outstanding feature of this procedure, and the key to the effectiveness of EasyCrypt, is that verification conditions are expressed in the language of firstorder logic, without any mention of probability, and can be discharged automatically by state-of-the-art tools such as SMT solvers and theorem provers. The verification condition generator is proof-producing, in the sense that it generates Coq files that can be machine-checked using the CertiCrypt framework. Moreover, the connection to CertiCrypt makes it possible to benefit from the expressivity and flexibility of a general-purpose proof assistant for advanced verification goals that fall out of the scope of automated techniques. Additionally, EasyCrypt implements an automated mechanism for proving claims about probability. The mechanism combines some elementary rules to compute (bounds on) probabilities of events—e.g. the probability of a uniformly sampled element to belong to a list—with rules to derive (in)equalities between probabilities of events in games from judgments in pRHL. The combination of these tools with other more mundane features such as a limited form of specification inference for procedures provides substantial leverage towards making verifiable security practical and makes EasyCrypt a plausible candidate for adoption by working cryptographers.
2
Introductory Example: Hashed ElGamal Encryption
This section illustrates the application of EasyCrypt to a proof of IND-CPA security of Hashed ElGamal encryption in the Random Oracle Model. The example serves to introduce the notion of proof sketch and to give the reader an idea of the input that the tool expects. It also allows for a preliminary comparison between EasyCrypt and CertiCrypt. We refer the reader to [4] for a proof of the same result in CertiCrypt. Hashed ElGamal is a variant of ElGamal encryption that does not require plaintexts to be elements of a group. Instead, plaintexts are bitstrings of a certain length k and group elements are mapped into bitstrings using a hash function H : G → {0, 1}k . Let G be a multiplicative cyclic group of order q with generator g. Formally, the scheme is defined by the following triple of algorithms: def $ Z ; return (g x , x) KG( ) = x← q def $ E(α, m) = y ← Zq ; h ← H(αy ); return (g y , h ⊕ m) D(x, (β, ζ)) def = h ← H(β x ); return (ζ ⊕ h)
The security of Hashed ElGamal can be reduced to the Computational DiffieHellman (CDH) assumption on the underlying group family. This is the assumption that it is hard to compute g xy given g x and g y where x and y are uniformly random elements in Zq . To match the existing proof in CertiCrypt, we exhibit a reduction to the LCDH assumption, the set version of the CDH assumption—the reduction from LCDH to CDH is immediate.
74
G. Barthe et al.
Figure 1 shows the sequence of games used to justify the security reduction. This is an essential part of the proof sketch that is input to EasyCrypt, and which is composed of five ingredients:1 1. Type, constant and operator declarations, which introduce the objects manipulated by the scheme. In this case, they include a type for elements of the cyclic group G, constants representing the length of messages k, the order of the group q and a generator g, and operators denoting the group law and exponentiation, and exclusive or on bitstrings; 2. Axioms, which capture mathematical properties of these objects, and are used by automated tools to check the validity of the proof sketch. We use axioms to state properties of the group law and exponentiation, and the exclusive or operator; 3. Game definitions, where adversaries are specified as abstract procedures with access to oracles. In all games in the figure the hash function H is modeled as a random oracle and the adversary is represented as two procedures A1 and A2 that share state. The procedures representing the adversary are given access to a wrapper HA for the hash oracle that just stores queries in a list LA before forwarding them to H: $ {0, 1}k ; L[x] ← h end if; return L[x] H(x) def / dom(L) then h ← = if x ∈ def HA (x) = LA ← x :: LA ; m ← H(x); return m
4. Judgments in pRHL. The general form of judgments is |= G1 ∼ G2 : Ψ ⇒ Φ, where G1 and G2 are games, and the pre-condition Ψ and the post-condition Φ are relations on program memories (memories map program variables to values). Pre- and post-conditions are first-order formulae built from relational expressions, in which language expressions are tagged with 1 or 2
to denote their interpretation in the first or second game. We often consider equivalence of memories on a set of variables X; we use =X as a shorthand for the formula ∀x ∈ X. x 1 = x 2 ; 5. Claims about probability, built from probability quantities (the probability of an event in a game), arithmetic operators, and mathematical relations (e.g. =, <, ≤). The final statement that expresses the overall security guarantee brought by the proof sketch is usually a claim that upper bounds the probability of adversary success in an initial attack game in terms of the probabilities of one or more adversaries breaking security assumptions. We briefly comment on the sequence of games in Figure 1. The first and last games encode the IND-CPA and LCDH experiments, respectively. We obtain G1 by inlining the key generation and encryption procedures in the initial game and rearranging instructions so that random choices are made upfront. We prove that games IND-CPA and G1 yield identical distributions on the result of the game (denoted by the keyword res). We deduce from this that the probability of the event b = b is the same in both games. 1
The first two are omitted from the figure. We include an extract of the actual input file for reference in Appendix A.
Computer-Aided Security Proofs for the Working Cryptographer
Game IND-CPA : (α, x) ← KG( ); (m0 , m1 ) ← A1 (α); $ {0, 1}; b← (β, γ) ← E(α, mb ); b ← A2 (β, γ); return (b = b )
75
Game G1 : $ Z ; α ← gx; x← q $ y ← Zq ; yˆ ← αy ; (m0 , m1 ) ← A1 (α); $ {0, 1}; b← h ← H(ˆ y ); b ← A2 (g y , h ⊕ mb ); return (b = b )
|= IND-CPA ∼ G1 : true ⇒ ={res} Pr [IND-CPA : b = b ] = Pr [G1 : b = b ] Game G1 : $ Z ; α ← gx; x← q y $ Z ; y y← q ˆ← α ; (m0 , m1 ) ← A1 (α); $ {0, 1}; b← h ← H(ˆ y ); b ← A2 (g y , h ⊕ mb ); return (b = b )
Game G2 : $ Z ; α ← gx; x← q y $ Z ; y y← q ˆ← α ; (m0 , m1 ) ← A1 (α); $ {0, 1}; b← $ {0, 1}k ; h← b ← A2 (g y , h ⊕ mb ); return (b = b ) |= G1 ∼ G2 : true ⇒ (ˆ y ∈ LA )1 ↔ (ˆ y ∈ L A )2 ∧ (ˆ y∈ / LA )1 → ={res} |Pr [G1 : b = b ] − Pr [G2 : b = b ] | ≤ Pr [G2 : yˆ ∈ LA ] Game G2 : Game G3 : $ Z ; α ← gx; $ Z ; α ← gx; x← x← q q y $ $ y ← Zq ; yˆ ← α ; y ← Zq ; yˆ ← αy ; (m0 , m1 ) ← A1 (α); (m0 , m1 ) ← A1 (α); $ {0, 1}; $ {0, 1}k ; b← γ← k $ {0, 1} ; h← b ← A2 (g y , γ); y $ {0, 1}; b ← A2 (g , h ⊕ mb ); b← return (b = b ) return (b = b )
|= G2 ∼ G3 : true ⇒ ={res,y,L ˆ A} Pr [G2 : b = b ] = Pr [G3 : b = b ] = 1/2 Game G3 : $ Z ; α ← gx; x← q y $ Z ; y y← q ˆ← α ; (m0 , m1 ) ← A1 (α); $ {0, 1}k ; γ← b ← A2 (g y , γ); $ {0, 1}; b← return (b = b )
Pr [G2 : yˆ ∈ LA ] = Pr [G3 : yˆ ∈ LA ] Game LCDH : $ Z ; y $ Z ; x← ← q q L ← B(g x , g y ); return (g xy ∈ L) Adversary B(α, β) : (m0 , m1 ) ← A1 (α); $ {0, 1}k ; γ← b ← A2 (β, γ); return LA
|= G3 ∼ LCDH : true ⇒ (ˆ y ∈ LA )1 ↔ res2 Pr [G3 : yˆ ∈ LA ] = Pr [LCDH : g xy ∈ L]
Pr [IND-CPA : b = b ] − 1 ≤ Pr [LCDH : g xy ∈ L] 2 Fig. 1. Proof sketch of Hashed ElGamal security
76
G. Barthe et al.
In game G2 we substitute the value H(ˆ y) used to compute the challenge ciphertext by a uniformly chosen value. This only makes a difference if A1 queries yˆ to H, and this happens with the same probability in either game. Thus, the difference in the probability of any event in these games is bounded by the probability of yˆ ∈ LA in G2 . This can be seen as a semantic variant of the Fundamental Lemma of Game-Playing; the logic allows to dispense with the code instrumentation needed to apply the syntactic counterpart of the lemma. The transition from G2 to G3 uses a code transformation known as optimistic sampling: instead of sampling h and defining a value γ as h ⊕ mb , we sample γ and define h = γ ⊕ mb ; we then remove the definition of h as dead code. This transformation is proven admissible within the logic and removes the dependency of the adversary’s output from the challenge bit b. The final transition performs the reduction to LCDH by exhibiting an adversary B that uses A as a sub-procedure and for which the semantics of games LCDH and G3 coincide. Finally, from the preceding claims, the advantage of A can be bounded by the probability of B in solving LCDH. The resulting proof sketch is about 250 lines long, about 5 times shorter than the proof in CertiCrypt reported in [4]—and arguably much simpler and close to a pen-and-paper proof.
3
An Overview of EasyCrypt
Programming Language. Games are modeled as programs in a typed, probabilistic, procedural, imperative language. Types include Booleans, integers, bitstrings, pairs, lists, maps, and user-defined types. Expressions are built from variables and operators in the usual way; for instance, Boolean-valued operators include the usual connectives, equality, list membership, arithmetic comparisons. The commands of the language are defined by the following grammar: I ::= V ← E $ DE | V← | if E then C else C | V ← P(E, . . . , E) C ::= skip | I; C
assignment random sampling conditional procedure call nop sequence
where V is a set of variables, P is a set of procedures, and DE is a set of distribution expressions. For the purpose of this article, distribution expressions are restricted to uniform distributions over specific domains, for instance integers in Zq or (non-neutral) elements of some group G. Adversaries are modeled as abstract procedures with an interface that specifies the oracles they may query. Games can be given a semantics as memory distribution transformers, in the style of [6]. Formally, memories are well-typed mappings from variables to values, and the semantics of a game G is a function, denoted G, that returns for an initial memory m the (sub-)distribution on final memories resulting from executing G in m. Given an initial memory m and an event A (a Boolean expression), we let Pr [G, m : A] denote the probability of A w.r.t. the distribution G m; we simply write Pr [G : A] when the initial memory is not relevant.
Computer-Aided Security Proofs for the Working Cryptographer
77
Relational Judgments. Pre- and post-conditions in pRHL judgments are firstorder formulae built from relational expressions. Relational expressions are arbitrary Boolean expressions over logical variables and program variables tagged with 1 , 2 ; the only restriction is that logical variables may only appear quantified. By abuse of notation, we write e i for the expression e in which all variables have been tagged with i . Let b stand for an arbitrary Boolean expression over tagged and logical variables, then logical formulae are defined by the following grammar: Ψ, Φ ::= b | ¬Φ | Ψ ∧ Φ | Ψ ∨ Φ | Ψ → Φ | Ψ ↔ Φ | (Φ) | ∀x. Φ | ∃x. Φ A logical formula is interpreted as a relation on program memories. For example, the formula x 1 + y 2 ≤ z 1 is interpreted as the relation R = {(m1 , m2 ) | m1 (x) + m2 (y) ≤ m1 (z)} A pRHL judgment |= G1 ∼ G2 : Ψ ⇒ Φ is valid iff for any pair of initial memories m1 , m2 satisfying the pre-condition Ψ , the distributions G1 m1 and G2 m2 satisfy the lifting of post-condition Φ, (G1 m1 ) L(Φ) (G2 m2 ). The lifting of a relation to a distribution is defined as a max-cut min-flow problem, in the style of [18]. Formally, let μ1 be a probability distribution on a set A and μ2 a probability distribution on a set B. We define the lifting μ1 L(R) μ2 of a relation R ⊆ A × B to μ1 and μ2 as follows:2 ∃μ : D(A×B). π1 (μ) = μ1 ∧ π2 (μ) = μ2 ∧ ∀(a, b) : A×B. μ(a, b) > 0 =⇒ a R b where the projections π1 (μ) and π2 (μ) of μ are defined as π1 (μ)(a) def μ(a, b) π2 (μ)(b) def μ(a, b) = = b∈B
a∈A
Claims about probability can be derived from valid relational judgments by means of the following rules: m1 Ψ m2
|= G1 ∼ G2 : Ψ ⇒ Φ
Φ → (A 1 ↔ B 2 )
Pr [G1 , m1 : A] = Pr [G2 , m2 : B] m 1 Ψ m2
|= G1 ∼ G2 : Ψ ⇒ Φ
Φ → (A 1 → B 2 )
Pr [G1 , m1 : A] ≤ Pr [G2 , m2 : B]
[PrEq]
[PrLe]
Automated Proofs of Relational Judgments Most practical verification tools adopt a similar methodology: a weakest precondition (wp) calculus is used to compute from a program and its specification a set of sufficient conditions, known as verification conditions, and these conditions are discharged by automated 2
For the clarity of presentation, we assume that A and B are discrete and cast our definitions using the usual representation of distributions. However, the tool builds on a monadic representation of distributions, as in [6].
78
G. Barthe et al.
tools. Extending the methodology to the logic pRHL is a significant challenge, for two reasons: first, generating verification conditions for a relational program logic is an open topic of research, and second, there is no prior application of the methodology to procedural nor probabilistic programs. There are at least two natural strategies for defining a wp calculus in a relational setting. The calculus can either operate on both games in lockstep, or else it can operate on each game separately, in the style of self-composition [2]. Both strategies are incomplete: the lockstep wp calculus fails on programs that are not structurally equivalent, whereas self-composition fails to handle random assignments and adversary calls. In order to circumvent these limitations, EasyCrypt implements an alternative approach that mixes both strategies: 1. Calls to non-adversary procedures are eliminated from the games by successive inlining their definitions. In the absence of recursion, the transformation terminates successfully and only adversary calls remain; 2. Random assignments are moved upfront. The resulting code consists of a sequence of random assignments followed by deterministic code, possibly with adversary calls; 3. A relational weakest precondition calculus is applied to the deterministic fragment of the game, using relational specifications to deal with adversary calls. Each adversary specification induces a proof obligation, expressed as a pRHL judgment, on the oracles in its interface. Self-composition is applied to verify the code of oracles with respect to these pRHL judgments. This results in a judgment of the form $ T ;...x $ $ $ |= x1 ← 1 l ← Tl ∼ y1 ← U1 ; . . . yn ← Un : Ψ ⇒ Φ
4. A mapping f : T1 × · · · × Tl → U1 × · · · × Un is selected, and used to generate the verification condition Φ ⇒f Ψ , defined as3 ∀m1 m2 t1 . . . tl . m1 Ψ m2 =⇒ m1 t/ x Φ m2 {f (t1 , . . . , tl )/ y} Under specific conditions on f , see [23], the validity of Φ ⇒f Ψ entails the validity of the corresponding pRHL judgment. In practice, it is generally sufficient to require that f is a 1-1 mapping, and taking f as the identity function works most of the time. However, in some cases other mappings must be used. For example, to prove the equivalence between games G2 and G3 in the proof of Hashed ElGamal described in the previous section, it is necessary to prove a judgment like the following: $ {0, 1}k ; γ ← h ⊕ m ∼ γ $ {0, 1}k ; h ← γ ⊕ m : = |= h ← ← b b {mb } ⇒ ={h,γ}
The wp will stop after computing the weakest precondition for the deterministic fragment of the two programs, yielding
3
$ {0, 1}k ∼ γ $ {0, 1}k : = |= h ← ← {mb } ⇒ (h 1 = γ 2 ⊕ mb 2 )
The memory m1 t/x maps xi to ti for i = 1 . . . l and y to m1 (z) for z ∈ {x1 . . . xl }. Likewise, m2 {f (t1 , . . . , tl )/ y } is the memory that maps yi to πi (f (t1 , . . . , tl )) for i = 1 . . . n and z to m2 (z) for z ∈ {y1 . . . yn }.
Computer-Aided Security Proofs for the Working Cryptographer
79
This equivalence is proved in EasyCrypt by providing the bijective function f (x) = x ⊕ mb as a witness. The fact that f is bijective is established automatically since f is idempotent. In the general case this is proved by providing also the inverse mapping. 5. Since Φ ⇒f Ψ is a first-order formula, its validity can be established by off-the-shelf tools. In order to target multiple tools, EasyCrypt generates its verification conditions in the intermediate format of the Why tool [16]. We then use the Simplify prover [15] and the alt-ergo SMT solver [13] to discharge the conditions (although many others provers are supported, including interactive theorem provers such as Coq). Verification condition generation is incomplete (in the logical sense), and would fail on pRHL judgments where games perform calls to adversaries in a different order. Pleasingly, the strategy is extremely effective in practice—so that we have found no need to implement alternatives for dealing with programs not handled by our approach. A Mechanized Probabilistic Relational Hoare Logic. EasyCrypt implements a simple tactic language to prove the validity of judgments using rules of the logic and program transformations. The tactics allow the application of twosided rules, which require that the two commands of a judgment have the same shape, and one-sided rules, which operate on only one of the games in a judgment. All language constructs admit both one-sided and two-sided rules, except for random assignments and adversary calls, for which only two-sided rules exist. The lack of one-sided rules for random assignments and adversary calls limits $ X; y ← A(z) the applicability of the logic: e.g., it cannot relate the programs x ← $ X, because instructions are executed in a different order. and y ← A(z); x ← To mitigate this limitation, EasyCrypt implements program transformations for code motion, allowing to swap instructions that are independent. Moreover, EasyCrypt implements tactics for inlining procedure calls and eagerly/lazily sample random values. Basic tactics can be combined using tacticals to increase automation. The tactic language provides the necessary infrastructure for making most components of EasyCrypt proof-producing, as discussed below. Reasoning about Failure Events. Game-based proofs often include steps in which it is argued that two games G1 and G2 behave identically unless a designated failure event F occurs. Such transitions are justified using the so-called Fundamental Lemma [20, 8], which allows to bound the difference between the probability of an event A in game G1 and a possibly different event B in game G2 by the probability of F in either game. Although a syntactical characterization of this lemma is often used, in which the failure event is represented by a Boolean flag in the code of the games, we state a more general version of the lemma using relational logic.
80
G. Barthe et al.
Lemma 1 (Fundamental Lemma). Let G1 , G2 be two games and A, B, and F be events such that |= G1 ∼ G2 : Ψ ⇒ (F 1 ↔ F 2 ) ∧ (¬F 1 → (A 1 ↔ B 2 )) Then, if m1 Ψ m2 , 1. Pr [G1 , m1 : A ∧ ¬F ] = Pr [G2 , m2 : B ∧ ¬F ], 2. |Pr [G1 , m1 : A] − Pr [G2 , m2 : B] | ≤ Pr [G1 , m1 : F ] = Pr [G2 , m2 : F ] The hypothesis of the lemma can be checked using the pRHL prover. The key to proving the validity of the judgment is finding an appropriate specification for adversaries. EasyCrypt infers for each adversary call x ← A( e) a relation Θ and checks the validity of the judgment |= A ∼ A : (¬F 1 ∧ ¬F 2 ∧ =args(A) ∧ Θ) ⇒ (F 1 ↔ F 2 ) ∧ ¬F 1 → ={res} ∧ Θ where args(A) denotes the set of formal parameters of A. This in turn, requires inferring and checking similar specifications for oracles. Although these heuristically inferred specifications suffice in most cases, the user can choose to prove their own specifications for one or more oracles or adversaries when needed, leaving the tool to infer the rest. Computing Probabilities. EasyCrypt can prove claims about the probability of events in games using properties of probability (e.g. inclusion-exclusion principle), arithmetic laws, and the rules [PrEq] and [PrLe] above, which allow deriving probability claims from valid relational judgments. We also implement a simple mechanism for computing probability bounds. This mechanism can establish, for instance, that the probability that a value uniformly chosen from a set T is equal to an arbitrary expression is 1/|T |, or the probability it belongs to a list of n values is at most n/|T |. Generating Verifiable Evidence. EasyCrypt implements a compiler that turns proof sketches into Coq files that are compatible with the CertiCrypt framework and can be verified using the type checker of Coq. The compiler serves two purposes: first, it significantly increases confidence in proof sketches by producing independently verifiable proofs, and providing means of checking the consistency of the set of axioms used in a proof sketch. Second, it opens the possibility to conduct in a general-purpose proof assistant proof steps that fall out of the scope of automated methods. We briefly describe the workings of the compiler. The declarations, definitions of games, and axioms of a proof sketch admit an immediate translation into CertiCrypt. The recommended practice is to prove the axioms used by EasyCrypt in CertiCrypt. In most cases, the axioms already exist in CertiCrypt, or are simple consequences of proven facts. Then, using the proof-producing option of the pRHL prover, all judgments of a proof sketch are compiled into pRHL derivations in CertiCrypt. Finally, the compiler generates for each claim in a proof sketch a Coq lemma that may need to be completed manually with justifications of the probability reasoning performed by EasyCrypt.
Computer-Aided Security Proofs for the Working Cryptographer
4
81
Advanced Application: Cramer-Shoup Cryptosystem
The Cramer-Shoup cryptosystem is a public-key encryption scheme based on ElGamal encryption that gained fame for being the first efficient asymmetric encryption scheme to be proven secure against adaptive chosen-ciphertext attacks under standard assumptions—the length of ciphertexts is just twice the length of ElGamal ciphertexts. Given a cyclic group (family) G of order q and a keyed hash function {Hk : G 3 → Zq }k∈K mapping triples of group elements into integers in Zq , key generation, encryption, and decryption are defined as follows: KG( ) def E((k, g, gˆ, e, f, h), m) def = = $ G \ {1}; $ Z ; a ← gu ; a g, gˆ ← u← ˆ ← gˆu ; c ← hu · m; q $ Z ; k $ K; x1 , x2 , y1 , y2 , z1 , z2 ← v ← Hk (a, a ˆ, c); d ← eu · f uv ; ← q e ← g x1 gˆx2 ; return (a, aˆ, c, d) f ← g y1 gˆy2 ; D((k, g, gˆ, x1 , x2 , y1 , y2 , z1 , z2 ), (a, aˆ, c, d)) def = h ← g z1 gˆz2 ; v ← Hk (a, a ˆ, c); pk ← (k, g, gˆ, e, f, h); if d = ax1 +vy1 · a ˆx2 +vy2 then z1 sk ← (k, g, gˆ, x1 , x2 , y1 , y2 , z1 , z2 ); return c/(a · a ˆz2 ) return (pk, sk) else return ⊥ We prove that the Cramer-Shoup cryptosystem is secure against adaptive chosenciphertext attacks (IND-CCA secure) in the standard model assuming the DDH problem is hard in the underlying group family and the hash function H is target collision-resistant (i.e., universal one-way). Definition 1 (Target Collision-Resistance). Let {Hk : A → B}k∈K be a keyed family of hash functions. The advantage of an adversary C against the target collision-resistance of H is defined as def AdvCTCR = Pr [TCR : Hk (x) = Hk (y) ∧ x = y]
where the experiment TCR is defined by means of the following game: $ K; y ← C (k) Game TCR : x ← C1 ( ); k ← 2
Definition 2 (CCA-advantage). Let (KG, E, D) be an asymmetric encryption scheme. The CCA-advantage of an adversary A limited to qD decryption queries against the adaptive chosen-ciphertext security of the scheme is defined as 1 def AdvA (q ) Pr [IND-CCA : b = b ] − = CCA D 2 where the experiment IND-CCA is defined by means of the following game: Game IND-CCA : (pk, sk) ← KG( ); (m0 , m1 ) ← A1 (pk); $ {0, 1}; b← ∗ γ ∗ ← E (pk, mb ); γdef ← true; ∗ b ← A2 (γ ); return (b = b )
Oracle DA (γ) : ∗ if |LD | < qD ∧ ¬(γdef ∧ γ = γ ∗ ) then LD ← γ :: LD ; return D(sk, γ) else return ⊥
82
G. Barthe et al.
Theorem 1 (Security of Cramer-Shoup). Let A be an adversary against the IND-CCA security of Cramer-Shoup limited to qD decryption queries. Then, there exists an algorithm B for solving the DDH problem in G and an adversary C against the target collision-resistance of the hash function H such that B C AdvA CCA (qD ) ≤ Adv DDH + Adv TCR +
4 qD qD + 2 + q4 q
Figures 2-4 show a proof sketch of the above theorem in EasyCrypt. The proof follows closely the one presented in [17]; we give only a high-level description here. Game G1 in the figure is obtained directly from the IND-CCA game instantiated for Cramer-Shoup by inlining the definitions of the key generation and encryption procedures, propagating assignments, and replacing expressions by equivalent ones. We observe that all verification conditions that ensure the validity of this transformation can be discharged automatically using an SMT solver. This surpasses Halevi’s expectations [17], who suggested this transformation be split in three steps so that it could be handled by an automated tool. We then build a DDH distinguisher B such that the output distribution on the value of (b = b ) is identical in games DDH0 (where B receives valid DDH triples) and G1 , on the one hand, and in games DDH1 (where B receives random triples) and G2 , on the other. In addition, we instrument the decryption oracle in G2 to raise a flag bad whenever A queries for the decryption of a valid ciphertext with loga a ˆ = logg gˆ. We then show using our semantic characterization of the Fundamental Lemma that the difference in the probability of (b = b ) in this game and in game G3 , where D rejects such ciphertexts, is bounded by the probability of bad in the latter game. We also change the way e, f and h are computed in a semantics-preserving way. Up to this point, by the triangular inequality we have |Pr [IND-CCA : b = b ] − Pr [G3 : b = b ]| ≤ AdvB DDH + Pr [G3 : bad] The next game in the sequence, G4 , removes the dependency of the adversary’s output from bit b by choosing uniformly r and setting c = g r . This requires to be able to compute z2 from logg (c) = uz + (u − u )wz2 + logg (mb ), which is not possible if u = u , but this happens only with probability 1/q. We use again the semantic formulation of the Fundamental Lemma to bound the difference in the probability of (b = b ) between G3 and G4 by 1/q. After straightforward information-theoretic reasoning we get |Pr [IND-CPA : b = b ] − 1/2| ≤ AdvB DDH + 2/q + Pr [G4 : bad ∧ u = u ]
We can now move most of the code of the game before the call to A1 . This in turn allows to make d random by uniformly choosing r = logg (d) and defining x2 in terms of it, rather than the other way around. Since now the game computes the challenge ciphertext in advance, we can instrument D to raise a flag bad1 when the challenge is queried during the first phase of the game. Note that at this point the challenge ciphertext is a 4-tuple of uniformly random elements,
Computer-Aided Security Proofs for the Working Cryptographer
83
Game G1 : Oracle D(a, a ˆ, c, d) : ∗ $ G \ {1}; x , x , y , y , z , z $ g, gˆ ← if |LD | < qD ∧ ¬(γdef ∧ (a, a ˆ, c, d) = γ ∗ ) 1 2 1 2 1 2 ← Zq ; $ k ← K; then e ← g x1 gˆx2 ; f ← g y1 gˆy2 ; h ← g z1 gˆz2 ; LD ← γ :: LD ; $ {0, 1}; ˆ, c); (m0 , m1 ) ← A1 (k, g, gˆ, e, f, h); b ← v ← Hk (a, a $ Z ; a ← gu; a if d = ax1 +vy1 · a ˆ ← gˆu ; ˆx2 +vy2 then u← q z1 z2 z1 ˆ · mb ; ˆ z2 ) c←a ·a return c/(a · a ˆ, c); d ← ax1 +vy1 · a ˆx2 +vy2 ; v ← Hk (a, a else return ⊥ ∗ γ ∗ ← (a, a else return ⊥ ˆ, c, d); γdef ← true; ∗ b ← A2 (γ ); return (b = b ) |= G1 ∼ DDH0 : true ⇒ ={res}
Pr [G1 : b = b ] = Pr [DDH0 : b = b ]
Oracle D(a, a ˆ, c, d) : Game DDH0 DDH1 : ∗ $ G \ {1}; x $ Z∗ ; y $ Z ; if |LD | < qD ∧ ¬(γdef ∧ (a, a ˆ, c, d) = γ ∗ ) g← ← q ← q $ then z ← xy z ← Zq ; LD ← γ :: LD ; return B(g, g x , g y , g z ) ˆ, c); v ← Hk (a, a Adversary B(g, gˆ, a, a ˆ) : x1 +vy1 if d = a ·a ˆx2 +vy2 then $ Z ; k $ K; x1 , x2 , y1 , y2 , z1 , z2 ← ← q z1 · a ˆ z2 ) return c/(a e ← g x1 gˆx2 ; f ← g y1 gˆy2 ; h ← g z1 gˆz2 ; else return ⊥ $ {0, 1}; (m0 , m1 ) ← A1 (k, g, gˆ, e, f, h); b ← else return ⊥ z1 z2 ˆ · mb ; c←a ·a ˆ, c); d ← ax1 +vy1 · a ˆx2 +vy2 ; v ← Hk (a, a ∗ ∗ ˆ, c, d); γdef ← true; γ ← (a, a b ← A2 (γ ∗ ); return (b = b ) |= DDH1 ∼ G2 : true ⇒ ={res}
Pr [DDH1 : b = b ] = Pr [G2 : b = b ]
Game G2 : Oracle D(a, a ˆ, c, d) : w ∗ $ G \ {1}; w $ Z∗ ; g g← if |LD | < qD ∧ ¬(γdef ∧ (a, a ˆ, c, d) = γ ∗ ) ← q ˆ←g ; $ Z ; a ← gu; a then ˆ ← gˆu ; u, u ← q $ Z ; k $ K; ˆ, c); LD ← γ :: LD ; v ← Hk (a, a x1 , x2 , y1 , y2 , z1 , z2 ← ← q if a ˆ = aw then ; e ← g x1 gˆx2 ; f ← g y1 gˆy2 ; h ← g z1 gˆz2 ; $ {0, 1}; if d = ax1 +vy1 · a ˆx2 +vy2 then (m0 , m1 ) ← A1 (k, h, gˆ, e, f, h); b ← z ˆ z2 ) return c/(a 1 · a ˆ z 2 · mb ; c ← az 1 · a x1 +vy1 x2 +vy2 else return ⊥ v ← Hk (a, a ˆ, c); d ← a ·a ˆ ; ∗ ˆx2 +vy2 then elsif d = ax1 +vy1 · a ˆ, c, d); γdef ← true; γ ∗ ← (a, a ∗ bad ← true; return c/(az1 · a ˆ z2 ) b ← A2 (γ ); else return ⊥ return (b = b ) else return ⊥ Fig. 2. Proof sketch of the IND-CCA security of the Cramer-Shoup cryptosystem
therefore, the probability of bad1 is bounded by (qD /q)4 —this is achieved by means of an intermediate game, not shown in the figure, that stores the 4 components of queried ciphertexts in different lists, and by independently bounding the probability of each component of the challenge appearing in the corresponding list. Hence, we have Pr [G4 : bad ∧ u = u ] ≤ Pr [G5 : bad ∧ u = u ] + (qD /q)4
84
G. Barthe et al.
Game G3 : Oracle D(a, a ˆ, c, d) : w ∗ $ G \ {1}; w $ Z∗ ; g $ K; g← if |LD | < qD ∧ ¬(γdef ∧ (a, a ˆ, c, d) = γ ∗ ) ← q ˆ←g ; k← x $ x, x2 ← Zq ; x1 ← x − wx2 ; e ← g ; then $ Z ; y ← y − wy ; f ← g y ; ˆ, c); y, y2 ← LD ← γ :: LD ; v ← Hk (a, a q 1 2 $ Z ; z ← z − wz ; h ← g z ; z, z2 ← if a ˆ = aw then q 1 2 $ {0, 1}; (m0 , m1 ) ← A1 (k, h, gˆ, e, f, h); b ← if d = ax+vy then return c/az $ u u else return ⊥ ˆ ← gˆ ; u, u ← Zq ; a ← g ; a ˆx2 +vy2 then elsif d = ax1 +vy1 · a c ← a z1 · a ˆ z 2 · mb ; bad ← true; return ⊥ ˆ, c); d ← ax1 +vy1 · a ˆx2 +vy2 ; v ← Hk (a, a ∗ else return ⊥ ˆ, c, d); γdef ← true; γ ∗ ← (a, a else return ⊥ b ← A2 (γ ∗ ); return (b = b ) |= G3 ∼ G4 : true ⇒ (u = u )1 ↔ (u = u )2 ∧ (u = u )1 →={res,bad} Pr [G4 : b = b ] = 1/2 |Pr [G3 : b = b ] − Pr [G4 : b = b ]| ≤ Pr [G3 : u = u ] = 1/q Game G4 : Oracle D(a, a ˆ, c, d) : w ∗ $ G \ {1}; w $ Z∗ ; g $ K; ∧ (a, a ˆ, c, d) = γ ∗ ) g← if |LD | < qD ∧ ¬(γdef ← q ˆ←g ; k← $ Z ; x ← x − wx ; e ← g x ; x, x2 ← then q 1 2 $ Z ; y ← y − wy ; f ← g y ; ˆ, c); y, y2 ← LD ← γ :: LD ; v ← Hk (a, a q 1 2 $ Z ; h ← gz ; z← if a ˆ = aw then q $ Z ; a ← gu; a if d = ax+vy then return c/az ˆ ← gˆu ; u, u ← q r $ else return ⊥ r ← Zq ; c ← g ; ˆx2 +vy2 then elsif d = ax1 +vy1 · a v ← Hk (a, a ˆ, c); d ← ax1 +vy1 · a ˆx2 +vy2 ; $ {0, 1}; bad ← true; return ⊥ (m0 , m1 ) ← A1 (k, h, gˆ, e, f, h); b ← ∗ else return ⊥ ˆ, c, d); γdef ← true; γ ∗ ← (a, a else return ⊥ b ← A2 (γ ∗ ); return (b = b )
|= G4 ∼ G4 : true ⇒ (u = u )1↔ (u = u )2 ∧ (u = u)1 → ={bad} |= G4 ∼ G5 : true ⇒ ={bad1 } ∧ ¬bad1 1 → ={bad,u,u } Pr [G4 : bad ∧ u = u ] ≤ Pr [G5 : bad ∧ u = u ] + (qD /q)4
Fig. 3. Proof sketch of the IND-CCA security of the Cramer-Shoup cryptosystem
The decryption oracle in game G5 also raises a flag bad2 when a valid ciphertext with Hk (a, a ˆ, c) = Hk (g u , gˆu , g r ) is queried. Since this leads to a collision, we can build an adversary C against the TCR of H such that its success probability is lower bounded by the probability of bad2 being raised in G5 . Thus, Pr [G5 : bad ∧ u = u ] ≤ AdvCTCR + Pr [G5 : bad ∧ u = u ∧ ¬bad2 ] The proof concludes by showing that the probability in G5 of bad being set while bad2 is not is bounded by qD /q. This is done by reformulating the test under which bad2 is set so that it does not depend on x1 , x2 , y1 , y2 . Therefore, the probability of this test succeeding in any decryption query (under the condition that u = u ) is the probability of the adversary guessing a random value in the group, at most qD /q summing over all queries. The bound in the statement follows.
Computer-Aided Security Proofs for the Working Cryptographer
Game G4 G5 : w $ G \ {1}; w $ Z∗ ; g $ K; g← ← q ˆ←g ; k← u $ Z ; a ← gu; a ˆ ← g ˆ ; u, u ← q $ Z ; y ← y − wy ; f ← g y ; y, y2 ← q 1 2 $ Z ; e ← gx ; r $ Z ; d ← gr ; x← ← q q x2 ← (r − u(x + vy))/(w(u − u)) − vy2 ; $ Z ; h ← gz ; x1 ← x − wx2 ; z ← q $ Z ; c ← gr; r← q ˆ, c); γ ∗ ← (a, a ˆ, c, d); v ← Hk (a, a (m0 , m1 ) ← A1 (k, h, gˆ, e, f, h); ∗ ← true; b ← A2 (γ ∗ ); return (b = b ) γdef
85
Oracle D(a, a ˆ, c, d) : ∗ ∧ (a, a ˆ, c, d) = γ ∗ if |LD | < qD ∧ ¬γdef then bad1 ← true; ∗ ∨ (a, a ˆ, c, d) = γ ∗ ) if |LD | < qD ∧ ( ¬γdef then LD ← γ :: LD ; v ← Hk (a, a ˆ, c); if a ˆ = aw then if d = ax+vy then return c/az else return ⊥ ˆx2 +vy2 then elsif d = ax1 +vy1 · a bad ← true; if v = Hk (g u , gˆu , g r ) then bad2 ← true else return ⊥ else return ⊥
|= G5 ∼ TCR : true ⇒ bad2 1 → res2 Pr [G5 : bad ∧ u = u ] ≤ Pr [TCR : Hk (m0 ) = Hk (m1 ) ∧ m0 = m1 ] + Pr [G5 : bad ∧ u = u ∧ ¬bad2 ] Game TCR : Oracle D(a, a ˆ, c, d) : $ K; m ← C (k); ˆ, c, d) = γ ∗ then m0 ← C1 ( ); k ← if |LD | < qD ∧ (a, a 1 2 return (Hk (m0 ) = Hk (m1 ) ∧ m0 = m1 ) LD ← γ :: LD ; ˆ, c); v ← Hkˆ (a, a Adversary C1 () : w $ G \ {1}; w $ Z∗ ; g if a ˆ = aw then g← ← q ˆ←g ; if d = ax+vy then return c/az $ Z ; a ← gu; a u, u ← ˆ ← gˆu ; q else return ⊥ $ Z ; c ← g r ; return (a, a ˆ, c) r← q elsif d = ax1 +vy1 · a ˆx2 +vy2 then Adversary C2 (k) : u u $ Z ; if v = Hkˆ (g , gˆ , g r ) then r, x, y, z ← q r x y z m ˆ ← (a, a ˆ, c); d ← g ;e ← g ;f ← g ; h ← g ; return ⊥ ˆ $ Z ; y ← y − wy ; k y2 ← ← k; q 1 2 else return ⊥ ˆ, c); v ← Hk (a, a else return ⊥ x2 ← (r − u(x + vy))/(w(u − u)) − vy2 ; x1 ← x − wx2 ; (m0 , m1 ) ← A1 (h, gˆ, e, f, h); ˆ, c, d); b ← A2 (γ ∗ ); return m ˆ γ ∗ ← (a, a
Fig. 4. Proof sketch of the IND-CCA security of the Cramer-Shoup cryptosystem
5
Limitations and Extensions
EasyCrypt is in its early stages of development; we briefly comment on some of its main limitations and possible extensions: – Programming language: in comparison with CertiCrypt, the language of EasyCrypt lacks loops, recursive procedures, and drawing from skewed distributions. We do not see the need for extending the current language with recursive procedures. In contrast, we believe that more general forms for sampling and bounded loops are useful and foresee no specific difficulty in
86
G. Barthe et al.
adding them to the language (note that annotating loops with invariants may be required for verification condition generation); – Verifiable evidence: EasyCrypt only generates partial verifiable evidence. As there is currently no SMT solver that generates Coq proofs, the verification conditions are admitted in order to make the output derivations checkable by the Coq proof assistant. Making SMT solvers proof-producing is an active subject of research [21], and advances towards this goal shall benefit immediately to EasyCrypt; – Computation of probability: EasyCrypt generates proof skeletons for claims about probability rather than fully machine-checked proofs. While it is entirely feasible to extend the compiler for justifying more reasonings, a more principled solution would require a tool that can symbolically compute the probability of an event in a distribution. Further research into the theory of cryptographic proofs, in the line of [3], is needed to broaden the scope of applications and effectiveness of EasyCrypt. Essential goals include providing a formal account of useful reasoning principles, such as rewinding arguments or coin-fixing, and notions, such as statistical distance, that have not yet been considered in our setting. There remain ample opportunities to apply methods from programming languages and formal verification to computer-aided cryptographic proofs. We mention two exciting avenues for improving automation in EasyCrypt. The first avenue is to improve our mechanism for inferring relational specifications of adversaries: there is a large body of knowledge on inferring invariants, and it would be beneficial to transpose them to our setting. More speculatively, program synthesis could be used to discover part of the sequence of games needed to conclude a proof, and to build adversaries that justify reductions to cryptographic assumptions. Both specification inference and program synthesis rely on verification condition generation and SMT solving, hence the basic blocks for such an investigation are in place. Finally, Halevi [17] stresses that “the usefulness of (a) tool will depend crucially on the willingness of the customers (in this case the cryptographic community) to use it”, and suggests on this account that an appropriate user interface will be a crucial component of the tool. We fully adhere to his view, and see building such an interface as an important objective for further work. 5.1
Comparison with CertiCrypt
Table 1 compares CertiCrypt and EasyCrypt on various security proofs formalized in both systems. Times are measured on a 2.8GHz Intel Core 2 Duo processor with 4GB of RAM under Mac OS X 10.6.7. For comparison, we show the size and checking time of CertiCrypt proofs extracted from EasyCrypt proof sketches. This is not an altogether fair comparison, because extracted proofs assume as axioms proof obligations checked by automated provers. As an experiment, we completed interactively the extracted proof of security of ElGamal encryption,
Computer-Aided Security Proofs for the Working Cryptographer
87
Table 1. Comparison of proof size and checking time between CertiCrypt and EasyCrypt CertiCrypt Lines Time ElGamal (IND-CPA) 565 45s Hashed ElGamal (IND-CPA) 1255 1m05s Full-Domain Hash (EF-CMA) 2035 5m46s Cramer-Shoup (IND-CCA) n/a n/a OAEP (IND-CPA) 2451 3m27s OAEP (IND-CCA) 11162 37m32s
EasyCrypt Lines Time 190 12s 243 33s 509 1m26s 1637 5m12s n/a n/a n/a n/a
Extracted Lines Time 1130 23s 1772 41s 2724 1m11s 5504 3m14s n/a n/a n/a n/a
thus obtaining a full proof verifiable under Coq. The resulting proof is 1173 long (meaning that only 43 lines are needed to prove in Coq the proof obligations checked by automated provers) and takes 25s to check.
6
Conclusion
Computer-aided verification of cryptographic protocols in the symbolic model is an established field of research: robust tools are available and have been used successfully to analyze realistic protocols (e.g. [1,9,14,19]). In contrast, there is little prior work on computer-aided cryptographic proofs in the computational model. The importance of such proofs was suggested independently by Bellare and Rogaway [8] and, more explicitly, by Halevi [17], who convincingly argues that they can be viewed as the “natural next step along the way of viewing cryptographic proofs as a sequence of probabilistic games”. To date, there are two main tools for computer-aided cryptographic proofs: CertiCrypt, which favors generality and verifiable proofs, and CryptoVerif, which favors automation. We have presented EasyCrypt, a new tool which provides the first flexible and automated framework for building machine-checkable cryptographic proofs, and illustrated its use through computer-aided security proofs of Hashed ElGamal encryption in the Random Oracle Model and the Cramer-Shoup cryptosystem in the standard model. These examples demonstrate that proofs in EasyCrypt are significantly easier and faster to build than in any previous tool, while providing guarantees similar to CertiCrypt. Overall, we believe that EasyCrypt makes an important step towards the adoption of computer-aided proofs by working cryptographers. Acknowledgments. We are grateful to Daniel Hedin and Anne Pa