Introduction to Modern Cryptography Sharif University Data and Network Security Lab Sharif University of Technology Department of Computer Engineering.

Slides:



Advertisements
Similar presentations
Foundations of Cryptography Lecture 10 Lecturer: Moni Naor.
Advertisements

The Theory of NP-Completeness
Introduction to Modern Cryptography Lecture 6 1. Testing Primitive elements in Z p 2. Primality Testing. 3. Integer Multiplication & Factoring as a One.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
CS 395T Computational Soundness of Formal Models.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 18-1 Complexity Andrei Bulatov Probabilistic Algorithms.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Adapted from Oded Goldreich’s course lecture notes.
Complexity and Cryptography
Analysis of Security Protocols (V) John C. Mitchell Stanford University.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
The Theory of NP-Completeness
Analysis of Algorithms CS 477/677
Security Arguments for Digital Signatures and Blind Signatures Journal of Cryptology, (2000) 13: Authors: D. Pointcheval and J. Stern Presented.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Chapter 11: Limitations of Algorithmic Power
Complexity ©D. Moshkovitz 1 And Randomized Computations The Polynomial Hierarchy.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
NP-complete and NP-hard problems. Decision problems vs. optimization problems The problems we are trying to solve are basically of two kinds. In decision.
Introduction to Computer and Network Security Iliano Cervesato 26 August 2008 – Modern Cryptography.
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
The RSA Algorithm Rocky K. C. Chang, March
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
How to play ANY mental game
Programming & Data Structures
MCS312: NP-completeness and Approximation Algorithms
Introduction to Modern Cryptography Sharif University Spring 2015 Data and Network Security Lab Sharif University of Technology Department of Computer.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Introduction to Modern Cryptography Sharif University Spring 2015 Data and Network Security Lab Sharif University of Technology Department of Computer.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Approximation Algorithms Pages ADVANCED TOPICS IN COMPLEXITY THEORY.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Introduction to Modern Cryptography Sharif University Spring 2015 Data and Network Security Lab Sharif University of Technology Department of Computer.
Introduction to Modern Cryptography Sharif University Spring 2015 Data and Network Security Lab Sharif University of Technology Department of Computer.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Chapter 3 Encryption Algorithms & Systems. csci5233 computer security & integrity (Chap. 3) 2 Outline NP-completeness & Encryption Symmetric (secret key)
Introduction to Modern Cryptography Sharif University Spring 2015 Data and Network Security Lab Sharif University of Technology Department of Computer.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
NP-Complete Problems Algorithm : Design & Analysis [23]
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1 Introduction to Quantum Information Processing CS 467 / CS 667 Phys 467 / Phys 767 C&O 481 / C&O 681 Richard Cleve DC 3524 Course.
Lattice-based cryptography and quantum Oded Regev Tel-Aviv University.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
Lecture 4 Overview. Data Encryption Standard Combination of substitution and transposition – Repeated for 16 cycles – Provides confusion and diffusion.
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
1 Introduction to Quantum Information Processing QIC 710 / CS 667 / PH 767 / CO 681 / AM 871 Richard Cleve DC 2117 Lectures
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Probabilistic Algorithms
Modern symmetric-key Encryption
Analysis and design of algorithm
Objective of This Course
Chapter 11 Limitations of Algorithm Power
Our old list of problems
Presentation transcript:

Introduction to Modern Cryptography Sharif University Data and Network Security Lab Sharif University of Technology Department of Computer Engineering A Primer on Modern Cryptography (2) Author & Instructor: Mohammad Sadeq Dousti 1 / 37

Introduction to Modern Cryptography Sharif University  These set of slides are licensed under Creative Commons Attribution-NonCommercial- ShareAlike (CC BY-NC-SA) 4.0.  Basically, this license allows others to use the slides verbatim, and even modify and incorporate them into their own work, as long as: 1. They credit the original author(s); 2. Their work is used non-commercially; 3. They license their work under CC BY-NC-SA 4.0.  For further information, please consult: o o sa/4.0/legalcode sa/4.0/legalcode Copyright Notice 2 / 37

Introduction to Modern Cryptography Sharif University  Review of previous session  Complexity classes P, BPP, and NP  NP-completeness  Difficulty of constructing NP-hard cryptographic schemes  “Definition” vs. “model” in cryptography  Applications of games in cryptography Outline 3 / 37

Introduction to Modern Cryptography Sharif University  Topics of previous session: o Introduction: The course at a glance o Provable security demystified o Concrete vs. asymptotic approaches to computational security o A review of theory of computation (algorithms and Turing machines) Review of previous session 4 / 37

Introduction to Modern Cryptography Sharif University Complexity Classes P, BPP, and NP 5 / 37

Introduction to Modern Cryptography Sharif University  Modern cryptography is based on problems which are: o Easy to compute for friends; o Hard to foil for enemies.  The easiness and hardness of problems are formally stated as their complexity.  The study of problems and their complexity lays the foundation of complexity theory. Complexity & Modern Cryptography 6 / 37

Introduction to Modern Cryptography Sharif University  From elementary school, we feel that multiplication is more complex than addition. o = ? o 96 * 83 = ?  Is this complexity inherent?  How can we formalize our feeling? o We need a model of computation… o … as well as a measurement for resources.  Let’s pick (deterministic) Turing machines as the model of computation.  Time, (scratch) space, etc. can be resources to be measured. Problems and Complexity 7 / 37

Introduction to Modern Cryptography Sharif University  Consider a problem with “fixed input”: o = ?  While seemingly complex, this problem can be solved in O (1) by a Turing machine that hard-codes the output.  We have to somehow define a family of problems: o Each member of the family has fixed input (size). o There are infinitely many members.  Examples: o Multiplication of two n-bit numbers, for n ∈ ℕ ; o Decryption of an n-bit RSA, for n ∈ ℕ. Family of Problems 8 / 37

Introduction to Modern Cryptography Sharif University  If the type of resource is omitted, time complexity is implied.  (Intrinsic) complexity of a family is a function of the input length.  Example: ADDITION has intrinsic complexity of Θ(n). o I.e., two n-bit numbers can be added in Θ(n) steps.  Complexity can be stated for worst-, average-, and best-case scenarios. Measuring Intrinsic Complexity 9 / 37

Introduction to Modern Cryptography Sharif University  Decision Problem: Does the given input belong to a certain set? o Hamiltonicity: Is graph G a Hamiltonian graph? o Primality: Is number N a prime?  Search Problem: Find something in the input which satisfies a certain predicate. o Find a Hamiltonian cycle in graph G. o Find a prime factor of number N.  Optimization Problem: Find something in the input which maximizes/minimizes a certain function. o Find the shortest path between two vertices of graph G. o Find the largest prime factor of N. Types of Problems 10 / 37

Introduction to Modern Cryptography Sharif University  A complexity class is a set of problem families.  The intrinsic complexities of the families are related.  This is a worst-case complexity class. o Why?  Example: ADDITION ∈ P.  Non-examples? Complexity Classes and P Complexity Class P: The set of decision problems that can be solved by a Turing machine in time polynomial in the size of the input. 11 / 37

Introduction to Modern Cryptography Sharif University   n, 6n 12, 1  30n n 200, etc.  In general, denoted as n O(1) or poly(n).  What’s so special about polynomials? o Problems with super-polynomial time complexity are considered “hard”. o Composition: A polynomial-time algorithm can use another polynomial-time algorithm as a subroutine (and invoke it arbitrarily). The composition remains polynomial-time. o Few natural problems exist with high-degree polynomial time complexity. o Most high-degree poly-time algorithms for natural problems are later simplified to low-degree poly-time algorithms.  The notion of “easiness” is often associated with polynomial time complexity. Polynomials For any polynomial p(n), we can construct an artificial problem with time complexity p(n). 12 / 37

Introduction to Modern Cryptography Sharif University  There are certain problems with the following property: It’s “easy” to verify whether an alleged solution is in fact a solution to the problem. Solving vs. Verification It’s easy to be wise after the event It’s easy to be smart after the fact معما چو حل گشت آسان شود ! It’s easy to be wise after the event It’s easy to be smart after the fact معما چو حل گشت آسان شود ! Images reproduced from GNOME Sudoku. 13 / 37

Introduction to Modern Cryptography Sharif University  Yes-instance: Inputs which belong to the “certain set” in the definition of decision problems.  Easily verified: The verification algorithm has polynomial time-complexity (in n, the size of the input).  Short witness: An auxiliary input, whose length is bounded by a polynomial (in n). Class NP Complexity Class NP: The set of decision problems whose yes-instances can be “easily” verified using a short witness. 14 / 37

Introduction to Modern Cryptography Sharif University  Class P trivially belongs to class NP, i.e., P ⊆ NP. o Why?  Is P identical to NP, or are they different classes? o Perhaps the most important open problem in computer science.  What if P = NP? o Automated proofs are possible: Proofs are NP-witnesses to the validity of the theorems. If P = NP, not only proofs can be “easily” verified, but also they can be “easily” constructed. o Cryptography is devastated: Except for a few schemes, all other cryptographic constructs are broken. Why? P vs. NP 15 / 37

Introduction to Modern Cryptography Sharif University  Algorithm A easily solves a problem p using algorithm B for p, if algorithm A uses B as a subroutine, and solves p after polynomial number of steps. o Each invocation of B contributes 1 step in the time complexity of A.  PROB is complete for C if (1) it is hard for C, and (2) it belongs to C.  Complete problems capture the essence of complexity classes. Hard & Complete Problems Problem PROB is hard for complexity class C, if all problems in C can be “easily” solved “using” an algorithm which solves PROB. Reduction 16 / 37

Introduction to Modern Cryptography Sharif University  Both complexity classes P and NP admit natural complete problems. o P-completeness is defined with different type of reductions.  Sample NP-complete (NPC) problems: o Hamiltonicity o Graph 3-coloring ( G3C ) o Satisfiability ( SAT )  complete_problems complete_problems  What if one NPC problem has poly-time algorithm? NP-Completeness 17 / 37

Introduction to Modern Cryptography Sharif University Current relationships between P, NP, and NPC 18 / 37

Introduction to Modern Cryptography Sharif University  Random choices can sometimes speed up computation.  Example: Sampling in statistics Randomness in Computation 19 / 37

Introduction to Modern Cryptography Sharif University  BPP is similar to complexity class P, but the underlying computational model is probabilistic Turing machines (PTM).  A PTM can perform random computations. o Formalized by providing the PTM with a random tape.  Consider decision problems. A PTM can err in its final verdict. o Completeness error: The input belongs to the “certain set”, but the PTM erroneously outputs 0. o Soundness error: The input doesn’t belong to the “certain set”, but the PTM erroneously outputs 1.  Both errors should be less than ⅓. Complexity Class BPP (1) Any constant strictly less than ½ will do. Amplification lemma: The errors can be reduced exponentially by repetition and taking majority. Any constant strictly less than ½ will do. Amplification lemma: The errors can be reduced exponentially by repetition and taking majority. 20 / 37

Introduction to Modern Cryptography Sharif University  We currently don’t know whether P = BPP or not. o Derandomization: Removing randomness (or using as little of it as possible) from algorithms.  BPP captures our intuition of efficiently solvable problems.  Fun fact: There is no known complete problems for BPP. Complexity Class BPP (2) Complexity Class BPP: The set of decision problems that can be solved by a PTM in time polynomial in the size of the input. 21 / 37

Introduction to Modern Cryptography Sharif University Current relationships between P, BPP, NP, and NPC 22 / 37

Introduction to Modern Cryptography Sharif University  Cryptographic schemes are hard on average. o Example: Consider RSA. On average, when we pick two random primes p and q and compute n = pq, factoring n must be hard.  NP is defined for worst-case problems.  Can we construct a cryptographic scheme with the following property: o Breaking the scheme is NP-hard?  Pass [Pas06] provided strong evidence that such reduction does not exist. Constructing NP-hard cryptographic schemes 23 / 37

Introduction to Modern Cryptography Sharif University “Definition” vs. “Model” In Cryptography 24 / 37

Introduction to Modern Cryptography Sharif University  Model; Etymology from American Heritage Dictionary: o From French modèle, from Italian modello, diminutive of modo, form, from Latin modus, measure, standard.  Model is a “smaller form” of the reality. o Smaller size o Less details o More abstract Model Model of Karim Khan's Court. Photo taken by M.S. Dousti in Karim Khan’s Castle, Shiraz. 25 / 37

Introduction to Modern Cryptography Sharif University  Projectile motion o Friction is abstracted out  Point mass o The object is zero- dimensional o All mass is concentrated at one point o What is abstracted? Example of Abstraction in Models (Physics) 26 / 37

Introduction to Modern Cryptography Sharif University  In cryptography, a bare minimum model includes the following: o Model of computation: The underlying model of computation for all parties (including the adversary). o Adversarial model: The possible interactions between the adversary and other parties, and the type of attacks which can be mounted on honest parties.  In addition, the model can include: o Execution model: Stand alone, parallel, concurrent, etc. o Channel model: Authenticated, private, etc. o Timing model: Synchronous, asynchronous with timeouts, fully asynchronous, etc. o Infrastructure/trust model: BPK, PKI, CRS, ROM, etc. o…o… Model in Cryptography 27 / 37

Introduction to Modern Cryptography Sharif University  A model includes only two parties: o Honest party F; o Adversary ;  Both parties are polynomial-time PTMs;  has only one type of interaction (attack) with F: o can send the NextBit query to F. o F responds with 0 or 1. Example Note that the model does not define the cryptographic construct in question. In fact, the model can be very general, encompassing multiple security definitions. A model as simple as this is often embedded into the definition itself. Note that the model does not define the cryptographic construct in question. In fact, the model can be very general, encompassing multiple security definitions. A model as simple as this is often embedded into the definition itself. 28 / 37

Introduction to Modern Cryptography Sharif University  A cryptographic definition clarifies and formalizes what is being defined, using both syntax and semantics.  Syntax: The “type” of object that we aim to make. o Syntax is more concerned with validity/correctness, rather than security.  Semantics: Defines when the scheme is deemed secure.  The semantics is often formulated as a “winning condition” for the adversary. o The scheme is secure if the adversary can satisfy the “winning condition” only with a very small probability. Definitions in Cryptography 29 / 37

Introduction to Modern Cryptography Sharif University  Syntax: A public key encryption scheme is a triple (G, E, D) of efficient algorithms. o On input 1 n, algorithm G outputs a pair (pk, sk), where |pk|, |sk| ≥ n. o On input pk and any message m ∈ {0, 1} n, algorithm E outputs a ciphertext c. o (Validity) For all n ∈ ℕ, all pairs (pk, sk) in the support of G(1 n ), and all messages m ∈ {0, 1} n, we have D(sk, E(pk, m)) = m with probability 1. Example of Syntax 30 / 37

Introduction to Modern Cryptography Sharif University  Semantics is often stated in one of two flavors: o Game based o Simulation based  Game-based definitions are discussed in the first half of this course.  We will pertain to simulation-based definitions in the second half of the course. Semantics in Cryptographic Definitions 31 / 37

Introduction to Modern Cryptography Sharif University Applications of Games In Cryptography 32 / 37

Introduction to Modern Cryptography Sharif University  Cryptographic constructs can be seen as “games” played between honest parties in one side, and the adversary in the other side.  A “winning condition” is defined for the adversary.  The construct is deemed secure if and only if the adversary has a negligible probability of winning the game.  How to formalize “negligible” quantity? o A quantity is negligible if putting together “many” quantities of the same type does not make it one unit! Defining Security in Terms of Games 33 / 37

Introduction to Modern Cryptography Sharif University  You cannot quantify one paper’s thickness using a tape measure.  However, given 500 papers, you can easily use a tape measure quantify a single paper’s thickness.  Can you do the same for an electron?  What’s the difference? Analogy: How to Measure a Paper’s Thickness 34 / 37

Introduction to Modern Cryptography Sharif University Negligible Quantity 35 / 37

Introduction to Modern Cryptography Sharif University  We’ll see real-world examples in the next session… Example of Game-based Definitions 36 / 37

Introduction to Modern Cryptography Sharif University [Gol01] O. Goldreich. Foundations of Cryptography Volume 1: Basic Tools. Cambridge University Press, [Pas06] R. Pass. Parallel Repetition of Zero-Knowledge Proofs and the Possibility of Basing Cryptography on NP-Hardness. In Proceedings of the 21 st Annual IEEE Conference on Computational Complexity (CCC'06), [Rog05] P. Rogaway. On the Role of Definitions in and Beyond Cryptography. In Proceedings of the 9 th Asian Computing Science conference on Advances in Computer Science (ASIAN'04), [Sho06] V. Shoup. Sequences of Games: A Tool for Taming Complexity in Security Proofs. Cryptology ePrint Archive, Available from References 37 / 37