1 Basic Number Theory

Size: px
Start display at page:

Download "1 Basic Number Theory"

Transcription

1 ECS 228 (Franklin), Winter 2013, Crypto Review 1 Basic Number Theory This section has some basic facts about number theory, mostly taken (or adapted) from Dan Boneh s number theory fact sheets for his course on cryptography and computer security at Stanford (CS255). 1.1 Arithmetic Modulo Primes For a prime p let Z p = {0,1,...p 1}. Elements of Z p can be added modulo p and multiplied modulo p. Fermat s theorem: g p 1 = 1 mod p, for any g 0 mod p. Invertible elements: The inverse of x Z p is an element a satisfying a x = 1 mod p. The inverse of x modulo p is denoted by x 1. All elements x Z p except for x = 0 are invertible. Let Zp be the set of invertible elements in Z p, that is, Zp = {1,2,...,p 1}. Structure of Z p: Z p is a cyclic group. That is, there exists g Z p such that Z p = {1,g,g 2 mod p,g 3 mod p,...,g p 2 mod p}. Such a g is called a generator of Z p. Not every element of Z p is a generator. Order of Group Element: The order of g Z p (denoted ord p(g)) is the smallest positive integer a such that g a = 1 mod p. Lagrange s Theorem: ord p (g) divides p 1, for all g Z p. Computational Considerations: For our cryptographic applications, we are dealing with primes p on the order of 300 digits long (1024 bits). Since p is huge, it cannot be stored in a single register. Elements of Z p are stored in 32-bit or 64-bit long buckets (depending on the processor s chip size). Adding two elements x,y Z p can be done in linear time in the length of p. Multiplying two elements x,y Z p can be done in quadratic time in the length of p. If p is n bits long, more clever (and practical) algorithms work in time O(n 1.7 ) (rather than O(n 2 )). Inverting an element x Zp can be done in quadratic time in the length of p. Elements of Zp can be efficiently inverted using Euclid s algorithm. If gcd(x,p) = 1 then using Euclid s algorithm it is possible to efficiently construct two integers a,b Z such that ax + bp = 1. Reducing this relation modulo p leads to ax = 1 mod p. Hence a = x 1 mod p. 1

2 Using the repeated squaring algorithm, x r mod p can be computed in time (log 2 r)o(n 2 ) where p is n bits long. Note that this algorithm for modular exponentiation takes linear time in the length of r. Discrete Log Problem: Let p be a 1024-bit prime, and let g be a generator of Z p. Given x Z p, find an r such that x = g r mod p. This problem is believed to be hard. Computational Diffie-Hellman Problem: Let p be a 1024-bit prime, and let g be a generator of Z p. Given x,y Z p where x = gr 1 and y = g r 2, find z = g r 1r 2. This problem is believed to be hard. Decision Diffie-Hellman Problem: Let p be a 1024-bit prime, and let g be a generator of Zp. Given an instance of the Computational Diffie- Hellman Problem x,y Zp, and given z which is either the solution to the Computational Diffie-Hellman problem (with probability 1/2) or a random element of Zp (with probability 1/2), try to distinguish which is the case. This problem is not hard: Given g r 1 and g r 2, one can efficiently compute the Legendre Symbol of g r 1r 2, and this can be used to help distinguish g r 1r 2 from random z Zp (details omitted). Large Prime Order Subgroup: The Discrete Log, Computational Diffie- Hellman, and Decision Diffie-Hellman problems are believed to be hard when the order of g is a large prime factor of p 1. Note that g is not a generator of Zp in this case (in fact, we say that g generates a large prime order subgroup of Zp ). 1.2 Arithmetic Modulo Composites Unless otherwise stated, we assume N is the product of two primes of roughly equal size. For a composite N let Z N = {0,1,2,...,N 1}. Elements of Z N can be added and multiplied modulo N. Invertible Elements: The inverse of x Z N is an element y Z N such that x y = 1 mod N. An element x Z N has an inverse if and only if x and N are relatively prime (that is, gcd(x,n) = 1). Let ZN denote the set of invertible elements in Z N. Euler s Phi Function: Let φ(n) denote the number of elements in Z N. When N = pq is the product of two primes, φ(n) = (p 1)(q 1). Euler s Theorem: For any a Z N we have that aφ(n) = 1 mod N. Chinese Remainder Theorem (special case): Let p,q be distinct primes and let N = pq. Given r 1 Z p and r 2 Z q there exists a unique element 2

3 s Z N such that s = r 1 mod p and s = r 2 mod q. Furthermore, s can be computed efficiently. Structure of Z N : The CRT implies that each element s Z N can be viewed as a pair (s 1,s 2 ) where s 1 = s mod p and s 2 = s mod q. The uniqueness guarantee shows that each pair (s 1,s 2 ) Z p Z q corresponds to one element of Z N. The CRT also shows that an element s Z N is invertible if and only if s mod p is invertible in Z p and s mod q is invertible in Z q. This yields an alternative explanation for why φ(n) = (p 1)(q 1) when N is the product of two distinct primes. Computational Considerations: For our cryptographic applications, we are dealing with integers N on the order of 300 digits long (1024 bits). All of the observations about computing in Z p for prime p carry over without change to the setting of computing in Z N. Here is one computational trick that is unique to the setting of Z N for composite N. If the factorization p,q of N is known, then the repeated squaring algorithm for modular exponentiation (mod N) can be speeded up by about a factor of four, by exploiting the Chinese Remainder Theorem (details omitted). RSA Problem: Let e be relatively prime to φ(n). Given N and e, and given y = x e mod N for some x ZN, find x. This is believed to be hard if the factorization of N is unknown, but becomes easy if the factorization of N is known. RSA Trapdoor: Given the factorization p,q of N, it is easy to compute φ(n) = (p 1)(q 1), and then it is easy to compute d = e 1 mod φ(n), and then it is easy to compute y d mod N, which is equal to x (by Euler s Theorem). The factorization p,q (or the value d) is called a trapdoor for the RSA problem. 2 Basic Secret Sharing This section has some basic facts about secret sharing schemes, mostly taken (or adapted) from CRC Handbook of Applied Cryptography (Chapt 12, pp ), Menezes et al. (eds), (t,t) Threshold Secret Sharing: Let S be a secret integer, 0 S m 1. Here is a way to divide S into t shares, such that all of them are 3

4 required in order to recover it: Choose t 1 independent random numbers S i, 0 S i m 1, 1 i t 1. Compute S t = S t 1 i=1 S i mod m. The secret is recovered as S = t i=1 S i mod m. A similar idea works when S is a bitstring of length l: Choose t 1 independent random bitstrings S 1,...,S t 1 of length l. Compute S t = S S 1... S t 1. The secret is recovered as S = S 1... S t. Shamir s (t, n) Threshold Secret Sharing: Let S be a secret integer 0 S m 1. Here is a way to divide S into n shares, such that any t of them are necessary and sufficient to recover it. Let p be an arbitrary prime number greater than m 1 and n. Sharing Phase: Select t 1 random, independent coefficients a 1,...,a t 1, 0 a j p 1. Let f(x) be the following polynomial of degree t 1 over Z p : f(x) = S + t 1 j=1 a jx j. Compute S i = (i,f(i) mod p), 1 i n. Reconstruction Phase: Any subset of t or more shares can be combined to recover the secret. The shares provide t distinct points of the form (i,f(i) mod p), allowing computation of the coefficients a j, 0 j t 1 of f(x) over Z p by Lagrange interpolation (see below). The secret is recovered by noting f(0) = a 0 = S. Lagrange Interpolation: The coefficients of an unknown polynomial f(x) of degree at most t 1, defined by distinct points (x i,y i ), 1 i t, are given by the Lagrange interpolation formulae: f(x) = t i=1 y i 1 j t,j i (x x j )/(x i x j ). Since f(0) = a 0 = S, the shared secret may be expressed as S = t i=1 c i y i mod p, where c i = 1 j t,j i x j(x j x i ) 1 mod p. Note that the c i values are non-secret constants, which for a fixed subset of t shares may be pre-computed. 3 Basic Cryptographic Primitives This section has some information about basic cryptographic primitives, mostly taken (or adapted) from Introduction to Modern Cryptography, Katz and Lindell, Chapman & Hall/CRC, Basic One-Way Primitives negligible: A function f is negligible if for every polynomial p(.) there exists an N such that for all integers n > N it holds that f(n) < 1/p(n). We typically denote an arbitrary negligible function by negl. 4

5 One-Way Function: A function f : {0,1} {0,1} is one-way if the following two conditions hold: 1. (Easy to compute:) There exists a polynomial-time algorithm M f computing f; that is, M f (x) = f(x) for all x. 2. (Hard to invert:) For every probabilistic polynomial-time algorithm A, there exists a negligible function negl such that the the following inverting experiment succeeds with probability at most negl(n): Choose input x {0,1} n ; Compute y = f(x); Give 1 n and y as input to A; The experiment succeeds if A outputs any x such that f(x ) = y. One-Way Function Family: The above definition of one-way function is very convenient in that it considers a single function over an infinite domain and range. However, most candidate one-way functions that we know of do not fit naturally into this framework. Rather, there is typically an algorithm that generates some parameters I which define some function f I ; the requirement is essentially that f I should be one-way with all but negligible probability over choice of I. Exponentiation Modulo a Prime: Let p be any prime, and let g be a generator of Z p. Let f p,g (x) = g x mod p, for x Z p. This family of functions is believed to be one-way (which is closely related to the belief that the Discrete Log problem is hard over Z p when p is a sufficiently large prime). In fact, this is believd to be a family of one-way permutations, since every f p,g is a one-to-one mapping on Z p. SHA: The SHA family includes cryptographically strong hash functions that seem hard to invert in practice. They fall outside of the asymptotic security framework developed here, since the output lengths are fixed. 3.2 Basic Pseudorandom Primitives Pseudorandom generator: Let l(.) be a polynomial and let G be a deterministic polynomial-time algorithm such that for any input s {0,1} n, algorithm G outputs a string of length l(n) (for simplicity, assume G is defined for all positive integers n). We say that G is a pseudorandom generator if the following two conditions hold: 1. (expansion) For every n it holds that l(n) > n. 2. (pseudorandom) For all probabilistic polynomial-time distinguishers D, there exists a negligible function negl such that Pr[D(r) = 1] Pr[D(G(s)) = 1] negl(n), where r is chosen uniformly at random from {0,1} l(n), the 5

6 seed s is chosen uniformly at random from {0,1} n, and the probabilities are taken over the random coins used by D and the choice of r and s. Stated another way, for all p.p.t. algorithms D, for all polynomials p, there exists a positive integer N such that, for all n > N, prob[d(r) = 1] prob[d(g(s)) = 1] < 1/p(n). Pseudorandom function: A keyed function F is a two-input function F : {0,1} {0,1} {0,1}, where the first input is called the key and denoted k, and the second input is just called the input. In general, the key k will be chosen and then fixed, and we will then be interested in the single-input function F k : {0,1} {0,1} defined by F k (x) = F(k,x). For simplicity, we will generally assume that F is length-preserving meaning that the key, input, and output lengths of F are all the same. That is, we assume that the function F is only defined when the key k and the input x have the same length, in which case F k (x) = x = k. Let F : {0,1} {0,1} be an efficiently computable, length-preserving, keyed function. We say that F is a pseudorandom function if for all probabilistic polynomial-time distinguishers D, there exists a negligible function negl such that Pr[D F k(.) (1 n ) = 1] Pr[D f(.) (1 n ) = 1] negl(n), where k is chosen uniformly at random from {0,1} n, and where f is chosen uniformly at random from the set of functions mapping n-bit strings to n-bit strings. [Note that the definition of pseudorandom function] gives D oracle access to the function in question (either F k or f). D is allowed to query the oracle at any point x {0,1} n, in response to which the oracle returns the value of the function evaluated at x. 3.3 Basic Symmetric Key Primitives Message Authentication Codes: A message authentication code (or MAC) is a tuple of probabilistic polynomial-time algorithms (Gen, Mac, Vrfy) such that: 1. The key generation algorithm Gen takes as input the security parameter 1 n and outputs a key k with k n. 2. The tag-generation algorithm Mac takes as input a key k and a message m {0,1}, and outputs a tag t. Since this algorithm may be randomized, we write this as t Mac k (m). 3. The verification algorithm Vrfy takes as input a key k, a message m, and a tag t. It outputs a bit b, with b = 1 meaning valid and b = 0 meaning 6

7 invalid. We assume without loss of generallity that Vrfy is deterministic and so write this as b := Vrfy k (m,t). 4. (Consistency) For every n, every key k output by Gen(1 n ), and every m {0,1}, it holds that Vrfy k (m,mac k (m)) = 1. Security for Message Authentication Codes: A message authentication code (Gen, Mac, Vrfy) is existentially unforgeable under an adaptive chosen-message attack, or just secure, if for all probabilistic polynomialtime adversaries A, there exists a negligible function negl such that the following forgery experiment succeeds with probability at most negl(n): 1. A random key k s generated by running Gen(1 n ). 2. The adversary A is given input 1 n and oracle access to Mac k (.). The adversary eventually outputs a pair (m,t). Let Q denote the set of all queries that A asked to its oracle. 3. The experiment succeeds if Vrfy k (m,t) = 1 and m Q. Symmetric Key Encryption: A symmetric key encryption scheme (sometimes called private key or secret key or shared key in the literature), is a tuple of probabilistic polynomial-time algorithms (Gen, Enc, Dec) such that: 1. The key generation algorithm Gen takes as input the security parameter 1 n and outputs a key k; we write this as k Gen(1 n ) (thus emphasizing the fact that Gen is a randomized algorithm). We will assume without loss of generality that any key k output by Gen(1 n ) satisfies k n. 2. The encryption algorithm Enc takes as input a key k and a plaintext message m {0,1}, and outputs a ciphertext c. Since Enc may be randomized, we write this as c Enc k (m). 3. The decryption algorithm Dec takes as input a key k and a ciphertext c and outputs a message m. We assume that Dec is deterministic, and so write this as m := Dec k (c). 4. (Consistency) For every n, every key k output by Gen(1 n ), and every m {0,1}, it holds that Dec k (Enc k (m)) = m. CPA-Security for Symmetric Key Encryption: A symmetric key encryption scheme (Gen, Enc, Dec) has indistinguishable encryptions in the presence of a chosen-plaintext attack (or is CPA-secure) if for all probabilistic polynomial-time adversaries A there exists a negligible function negl 7

8 such that the following distinguishing experiment succeeds with probability at most 1/2 + negl(n): 1. A key k is generated by running Gen(1 n ). 2. The adversary A is given input 1 n and oracle access to Enc k (.), and outputs a pair of messages m 0,m 1 of the same length. 3. A random bit b {0,1} is chosen, and then a ciphertext c Enc k (m b ) is computed and given to A. We call c the challenge ciphertext. 4. The adversary A continues to have oracle access to Enc k (.), and outputs a bit b. 5. The experiment succeeds if b = b. CPA-Secure Symmetric Key Encryption from PRF: If F is a pseudorandom function, then the following symmetric key encryption scheme can be proven to be CPA-secure: Gen(1 n ) outputs a random n-bit key; Enc(k,m) chooses a random n-bit value r and outputs ciphertext (r,f k (r) m); Dec(k,(r,s)) outputs m = F k (r) s. CCA-Security for Symmetric Key Encryption: A stronger security notion for symmetric key encryption is indistinguishability of encryptions in the presence of a chosen-ciphertext attack (or CCA-security). The definition is the same as for CPA-security, except that the adversary A gets oracle access to both Enc k (.) and Dec k (.) in steps 2 and 4 of the distinguishability experiment (although forbidden from using the decryption oracle in step 4 to decrypt the challenge ciphertext itself). CCA-Secure Symmetric Key Encryption from MAC: If (Gen E,Enc,Dec) is a CPA-secure encryption, and if (Gen M,Mac,V rfy) is a secure MAC, then the following symmetric key encryption scheme can be proven to be CCA-secure: Gen (1 n ) runs Gen E (1 n ) and Gen M (1 n ) to get encryption key k 1 and MAC key k 2 ; Enc (k 1,k 2,m) computes c Enc k1 (m) and t MAC k2 (c) and outputs the ciphertext (c,t); Dec (k 1,k 2,c,t) outputs Dec k1 (c) if V rfy k2 (c,t) = 1 and otherwise outputs (reserved null element in the message space). 3.4 Basic Public Key Primitives Key Exchange Protocol: Alice and Bob begin by holding the security parameter 1 n ; they then choose (independent) random coins and run the 8

9 key exchange protocol. At the end of the protocol, Alice and Bob output keys k A,k B {0,1} n, respectively. The basic correctness requirement is that it should always hold that k A = k B (i.e., for all choices of random coins by Alice and Bob). Since we only deal with protocols that satisfy this requirement, we will speak simply of the key k = k A = k B generated by an honest execution of the protocol. Passive Security for Key Exchange: A key exchange protocol is secure in the presence of an eavesdropper if for every probabilistic polynomial-time adversary A there exists a negligible function negl such that the following distinguishing experiment succeeds with probability at most negl(n): 1. Two parties holding 1 n execute the key exchange protocol. This execution results in a transcript trans containing all the messages sent by the parties, and the key k that is output by each of the parties. 2. A random bit b {0,1} is chosen. If b = 0 then choose ˆk {0,1} n uniformly at random, and if b = 1 set ˆk := k. 3. A is given trans and ˆk, and outputs bit b. 4. The experiment succeeds if b = b. Diffie-Hellman Key Exchange: The Diffie-Hellman Key Exchange protocol is secure in the presence of an eavesdropper, under the assumption that the (Large Prime-Order Subgroup) Decision Diffie-Hellman problem is hard. Alice and Bob agree on an element g Z p of order q, for suitably large primes p,q (where q is a divisor of p 1). Alice chooses a random α Z q and sends y = g α mod p. Bob chooses a random β Z q and sends z = gβ mod p. Alice computes k A = z α mod p. Bob computes K B = y β mod p. Public Key Encryption Scheme: A public key encryption scheme is a tuple of probabilistic polynomial-time algorithms (Gen, Enc, Dec) such that: 1. The key generation algorithm Gen takes as input the security parameter 1 n and outputs a pair of keys (pk,sk). We refer to the first of these as the public key and the second as the private key. We assume for convenience that pk and sk each have length at least n, and that n can be determined from pk,sk. 2. The encryption algorithm Enc takes as input a public key pk and a message m from some underlying plaintext space (that may depend on pk). It outputs a ciphertext c, and we write this as c Enc pk (m). 9

10 3. The decryption algorithm Dec takes as input a private key sk and a ciphertext c, and ouutputs a message m or a special symbol denoting failure. We assume without loss of generality that Dec is deterministic, and write this as m := Dec sk (c). 4. (Consistency) There exists a negligible function negl such that for every n, every (pk,sk) output by Gen(1 n ), and every message m in the appropriate underlying plaintext space, it holds that Pr[Dec sk (Enc pk (m)) m] negl(n). CPA Security for Public Key Encryption: A public key encryption scheme (Gen, Enc, Dec) has indistinguishable encryptions under a chosenplaintext attack ( CPA-secure ; sometimes called IND-CPA-secure in the literature) if for all probabilistic polynomial-time adversaries A there exists a negligible function negl such that the following distinguishing experiment succeeds with probability at most negl(n): a. Gen(1 n ) is run to obtain keys (pk,sk). b. Adversary A is given pk as well as oracle access to Enc pk (.). The adversary outputs a pair of messages m 0,m 1 of the same length. (These messages must be in the plaintext space associated with pk.) c. A random bit b {0,1} is chosen, and then a ciphertext c Enc pk (m b ) is computed and given to A. We call c the challenge ciphertext. d. A continues to have access to Enc pk (.), and outputs bit b. e. The distinguishing experiment succeeds if b = b. ElGamal Public Key Encryption: The ElGamal public key encryption scheme is CPA-secure, under the assumption that the (Large Prime- Order Subgroup) Decision Diffie-Hellman Problem is hard. The keys are pk = (g,g x mod p), sk = x R Z q, where p is a large prime, q is a large prime factor of p 1, and ord p (g) = q. To encrypt a message M (in the subgroup generated by g) under public key (g,y), choose a random r Z q and compute the ciphertext (g r mod p,my r mod p). To decrypt ciphertext (u,v) with secret key x, compute M = v(u 1 ) x mod p. CCA Security for Public Key Encryption: A public key encryption scheme (Gen, Enc, Dec) has indistinguishable encryptions under a chosenciphertext attack ( CCA-secure ; sometimes called IND-CCA2-secure in the literature) if for all probabilistic polynomial-time adversaries A there 10

11 exists a negligible function negl such that the following distinguishing experiment succeeds with probability at most negl(n): a. Gen(1 n ) is run to obtain keys (pk,sk). b. Adversary A is given pk as well as oracle access to Dec sk (.). The adversary outputs a pair of messages m 0,m 1 of the same length. (These messages must be in the plaintext space associated with pk.) c. A random bit b {0,1} is chosen, and then a ciphertext c Enc pk (m b ) is computed and given to A. We call c the challenge ciphertext. d. A continues to interact with Dec sk (.), but may not request decryption of c itself. Finally, A outputs bit b. e. The distinguishing experiment succeeds if b = b. Homomorphic Publc Key Encryption: A public key encryption scheme is homomorphic if there is an easy way to combine ciphertexts to perform some arithmetic operation on the underlying encrypted values. The ElGamal public key encryption scheme is multiplicatively homomorphic : If (u 1,v 1 ) and (u 2,v 2 ) are ElGamal encryptions of M 1 and M 2 (under the same public key), then (u 1 u 2 mod p,v 1 v 2 mod p) is an ElGamal encyrption of M 1 M 2 mod p. Paillier constructed an efficient public key encryption scheme that is additively homomorphic (details omitted). Digital Signature Scheme: A signature scheme is a tuple of three probabilistic polynomial-time algorithms (Gen, Sign, Vrfy) satisfying the following: 1. The key generation algorithm Gen takes as input a security parameter 1 n and outputs a pair of keys (pk, sk). These are called the public key and the private key respectively. We assume for convenience that pk and sk each have length at least n, and that n can be determined from pk,sk. 2. The signing algorithm Sign takes as input a private key sk and a message m {0,1}. It outputs a signature σ, denoted as σ Sign sk (m). 3. The deterministic verification algorithm Vrfy takes as input a public key pk, a message m, and a signature σ. It outputs a bit b, with b = 1 meaning valid and b = 0 meaning invalid. We write this as b := Vrfy pk (m,σ). 4. (Consistency) For every n, every (pk,sk) output by Gen(1 n ), and every m {0,1}, it holds that Vrfy pk (m,sign sk (m)) = 1. 11

12 Signature Scheme Security: A signature scheme (Gen, Sign, Vrfy) is existentially unforgeable under an adaptive chosen-message attack if for all probabilistic polynomial-time adversaries A, there exists a negligible function negl such that the following forging experiment succeeds with probability at most negl(n): 1. Gen(1 n ) is run to obtain keys (pk,sk). 2. Adversary A is given pk and oracle access to Sign sk (.). (This oracle returns a signature Sign sk (m) for any message m of the adversary s choice.) The adversary then outputs (m,σ). Let Q denote the set of messages whose signatures were requested by A during its execution. 3. The forging experiment succeeds if Vrfy pk (m,σ) = 1 and m Q. 4 Other Cryptographic Protocols 4.1 Proofs of Knowledge Schnorr Protocol: At the start of the Schnorr protocol, the Prover holds a pair g,y of elements in Z p where g has large prime order q. The protocol enables the Prover to convince the Verifier that he knows the discrete log of y with respect to the base g, i.e., that g r = y for some r Z q known to the Prover. The Prover chooses random s Z q and sends a = g s to the Prover. The Verifier chooses random c Z q and sends c to the Prover. The Prover sends t = s + cr mod q to the Verifier. The Verifier accepts if g t = ay c. Chaum-Pedersen Protocol: At the start of the Chaum-Pedersen protocol, the Prover holds a tuple (g,x,y,z) of elements in Zp where g has large prime order q. The protocol enables the Prover to convince the Verifier that he knows the discrete log of y with respect to the base g, and the discrete log of z with respect to the base x, and furthermore that these discrete logs are equal. Note that this convinces the Verifier that (g,x,y,z) is a valid DDH-tuple, i.e., that (g,x,y,z) = (g,g r 1,g r 2,g r 1r 2 ) for some r 1,r 2 Z q (where the Prover knows r 2 ). Note that this can also serve as a proof that an ElGamal ciphertext has been decrypted correctly, since (u, v) is an ElGamal encryption of M under pubic key (g,g x ) if and only if (g,g x,u,m 1 v) is a valid DDH-tuple. The Prover chooses random s Z q, and sends (a,b) to the Verifier, where a = g s and b = y s. The Verifier chooses random c Z q and sends c to the 12

13 Prover. The Prover sends t = s + cr 2 mod q to the Verifier. The Verifier accepts if g t = ay c and x t = bz c. Note: For both the Schnorr protocol and the Chaum-Pedersen protocol, if the Prover and Verifier follow the protocol honestly, then the Verifier is convinced of the claim without revealing any additional information to the Verifier. This is called an honest verifier zero-knowledge proof of knowledge. There is a nice tutorial on this topic available at Ivan Damgard s website ( On Σ-protocols ). Here are some key ideas from the security analysis of the Schnorr protocol. From two Schnorr transcripts with the same first message (a,c,t) and (a,c,t ) it is easy to compute the secret exponent r, which suggests that a cheating Prover cannot anticipate more than one challenge successfully without knowing r. If a Schnorr transcript is computed backwards, then it can be shown to be drawn from the same distribution as real transcripts that arise from a real interaction between an honest Prover and honest Verifier: Choose random t Zq, then choose random c Z q, and then compute a = g t y c. This suggests that no information is leaked by the Schnorr protocol to an honest Verifier. 4.2 Oblivious Transfer 1-out-of-2 Oblivious Transfer (1-2-OT): At the start of a 1-2-OT protocol, the sender decides on input messages M 0,M 1 and the receiver decies on an input bit σ {0,1}. Then both parties are assumed to follow the protocol honestly. At the end of the protocol, Receiver learns M σ while learning nothing about M 1 σ, and Sender learns nothing about σ. Here is a very efficient 1-2-OT protocol (Naor-Pinkas, SODA 2001), based on the assumption that the (large prime order subgroup) Decision Diffie- Hellman Problem is hard. It also relies on the security of a pseudorandom generator. The protocol works in a group of large prime order q. Recever chooses random a,b,c Z q, and sends x,y,z 0,z 1, where x = g a, y = g b, z σ = g ab, and z 1 σ = g c. Sender verifies that z 0 z 1. Sender chooses random r 0,s 0,r 1,s 1 Zq, and sends w 0,C 0,w 1,C 1, where w 0 = x s 0 g r 0, k 0 = z s 0 0 yr 0, C 0 = G(k 0 ) M 0, w 1 = x s 1 g r 1, k 1 = z s 1 1 yr 1, and C 1 = G(k 1 ) M 1. Receiver computes M σ = G(k σ ) C σ, where k σ = (w σ ) b. 13

14 Beaver s Pre-Processing Trick: Here is a way to speed up any 1-2-OT protocol in the situation where the Receiver decides on the selection bit σ before the Sender decides on the input messages M 0,M 1. The Sender and Receiver execute the 1-2-OT protocol ahead of time, with the Sender using randomly chosen messages R 0,R 1, and the Receiver using selection bit σ to learn R σ. Later on, after the Sender has decided on the input messages M 0,M 1, the Sender simply sends M 0 R 0 and M 1 R 1. The Receiver can use R σ to recover M σ, but learns nothing about M 1 σ. Extending Oblivious Transfer Efficiently: Here is a very efficient protocol (Ishai et al., Crypto 2003) for reducing m 1-2-OT protocols on l-bit messages to k 1-2-OT protocols on m-bit messages, where m > k (and may be l k as well). The Naor-Pinkas 1-2-OT can then be called k times to achieve many more than k OT s. Sender begins with m pairs (x j,0,x j,1 ) of l-bit strings, 1 j m. Receiver begins with m selection bits r 1,...,r m. Sender chooses random s i {0,1}, 1 i k. Receiver choosses random t i,j {0,1}, 1 i m, 1 j k. Sender and Receiver perform k 1-2-0T protocols on m-bit messages, reversing roles. In the ith 1-2-OT protocol, sender acts as receiver with selection bit s i, while receiver acts as sender with messages t 1i...t mi, and t 1i...t mi r 1...r m. Let Q denote the m by k matrix of values received by sender, where the ith column of Q has the output of the ith 1-2-OT protocol. For 1 i m, sender sends y i,0,y i,1, where y i,0 = x i,0 H(i,q i1...q ik ) and y i,1 = x i,1 H(i,q i1... q ik s 1...s k ). The hash function H : {1,...,m} {0,1} k {0,1} l is modeled as a random oracle in the security analysis. For 1 i m, receiver outputs z i = y i,r H(i,t i1...t ik ). 4.3 Two-Party Secure Computation Yao s Garbled Circuit Protocol: This is a two-party protocol for privately computing a function f(x,y). At the start of the protocol, Alice decides on input x, and Bob decides on input y. Then both parties are assumed to follow the protocol honestly. At the end of the protocol, both parties know the output f(x,y). Neither party can infer anything about the other party s input, beyond what is already revealed through learning the output. See the 2009 J. Cryptology article by Lindell and Pinkas for details on security models and proofs. 14

15 The protocol will use a double-lock symmetric key encryption scheme (E 2,D 2 ), for which two keys are needed to encrypt and decrypt. Here is a simple example of such a scheme, built from a pseudorandom generator G: E 2 K 1,K 2 (M) = R G(K 1 ),M R G(K 2 ). D 2 K 1,K 2 (C 1,C 2 ) = C 1 C 2 G(K 1 ) G(K 2 ). We will assume that messages are formatted before decryption (say prepended with k zeros, where k is a security parameter) so that unsuccessful decryption will be detected with all but negligible probability. Bob begins the protocol by constructing a garbled circuit from a boolean circuit C that computes the function f. For each wire i of the circuit C, Bob randomly chooses two keys: Wi 0 (corresponding to value 0 on that wire when the circuit is evaluated) and Wi 1 (corresponding to value 1). For every gate of C with input wires i,j and output wire k computing boolean function g, Bob computes a garbled gate, consisting of four double-encryptions in randomly permuted order: E 2 Wi 0,W (W g(0,0) j 0 k ), E 2 W 0 i,w 1 j (W g(0,1) k ), E 2 Wi 1,W j 0 (W g(1,0) k ), E 2 Wi 1,W (W g(1,1) j 1 k ). Bob sends to Alice all of the garbled gates. For every output wire i, Bob sends to Alice (i,(0,wi 0),(1,W i 1 )) ( output table ). For every input wire i that corresponds to a bit of Bob s input, Bob sends to Alice (i,w y i i ), where y i is the corresponding bit of Bob s input y. For every input wire i that corresponds to a bit of Alice s input, Bob uses 1-2-OT to send W x i i to Alice, where x i is the corresponding bit of Alice s input x. That is, Bob plays the role of the sender in the 1-2-OT protocol with messages Wi 0,W i 1, and Alice plays the role of the receiver with selection bit x i. Alice now performs the following procedure repeatedly: Choose a gate such that she knows some keys Wi a and Wj b for the gate s input wires i,j. Find the corresponding garbled gate, and attempt to decrypt the four ciphertexts using the keys Wi a,w i b. From the one successful decryption, Alice learns W g(a,b) k, where k is the gate s output wire, and where the gate computes the boolean function g. This procedure maintains the following invariant: Every key learned by Alice corresponds to the value on a wire in the computation of the circuit for the inputs of Bob and Alice. At the end of the procedure, Alice knows one key corresponding to the value on each of the circuit s output wires. Alice can now find the actual output values by looking up those keys in the output 15

16 table sent by Bob. She can then send the actual output values to Bob to end the protocol. One Decryption per Gate: There is a standard method to modify the garbled circuit construction so that Alice only needs to perform one decryption per garbled gate (and message formatting is unnecessary). The idea is to associate a random bit (permutation) p i with each wire i in the circuit. Each wire key Wi a is concatenated with its masked value: Wi a p i a. These concatenated keys replace the wire keys throughout the garbled circuit construction. In particular, for a gate g with input wires i,j and output wire k, and for a,b {0,1}, W g(a,b) k g(a,b) p k is double-encrypted with Wi a a p i and Wj b p j. The entries in a garbled gate no longer need to be randomly permuted, but can rather be given in standard order according to the masked input values (e.g,. (a,b) first if a p i = 0 and b p j = 0, etc.). As soon as Alice knows a key and masked value for each input wire, she can look up the appropriate ciphertext in the garbled gate, and doubledecrypt that one ciphertext to learn a key and masked value for the output wire. The method can be generalized to garbled look-up tables that have many input bits and output bits. See the article on Fairplay [Malkhi et al., Usenix Security 2004] for details. Free-XOR Trick: The free-xor trick is a way to modify the garbled circuit construction so that no communication is needed for any of the xor gates in the circuit. That is, Bob does not need to construct garbled gates for the xor gates in the circuit. The basic idea is for Bob to carefully choose wire keys so that, for every xor gate with input wires i,j and output wire k, Wi a W j b = W k a b for all a,b {0,1}. See the paper by Koleshnikov and Schneider [ICALP 2008] for details. 4.4 Multi-Party Secure Computation BGW/CCD Protocol: This is a protocol for privately computing a function f among n 3 parties connected by a complete network of private channels. For simplicity of presentation, we assume that each party s input is a single element of Z p (where p > n), and that the output is a single element of Z p. The function f can be represented as an arithmetic circuit, with n input wires and one output wire, consisting of the following types of gates: addition gate: If the values on its two incoming wires are a,b Z p, then the value on its outgoing wire is a + b mod p. multiply-by-constant gate: If the value on its one incoming wire is a Z p, 16

17 then the value on its outgoing wire is ac mod p. Note that there are multiplyby-constant gates for every c Z p. multiply gate: If the values on its two incoming wires are a,b Z p, then the value on its outgoing wire is ab mod p. At the start of the protocol, each party i decides on input a i Z p. Then all n parties are assumed to follow the protocol honestly. At the end of the protocol, all parties know the output f(a 1,...,a n ). If n 2t + 1, then no coalition of t parties can infer anything about the other parties inputs beyond what is already revealed through learning the output. See Secure Multiparty Computation Goes Live, Bogetoft et al., Financial Crypto for more details on security models and proofs. The protocol, which exploits nice algebraic properties of Shamir s secret sharing scheme, proceeds as follows: Input Phase: All parties create shares of their inputs using Shamir s (t + 1, n) threshold secret sharing scheme (using the same p that the function f is being computed over), that is, the inputs are shared with degree t polynomials. Each party i sends its jth share to party j, for all i,j [1... n]. Addition Gate: Assume that each party holds valid shares of the values a, b on the incoming wires of an addition gate. Then each party can add its two shares (modulo p) to create a valid share of the value a + b mod p on the outgoing wire. Multiply-by-constant gate: Assume that each party holds valid shares of the value a on the incoming wire of a multiply-by-constant gate (for a fixed known constant c Z p ). Then each party can multiply its share by c (modulo p) to create a valid share of the value ac mod p on the outgoing wire. Multiply gate: Assume that each party holds valid shares of the values a,b on the incoming wires of a multiply gate. Then each party can multiply its two shares (modulo p) to create an *invalid* share of the value ab mod p on the outgoing wire. It is invalid because the n shares lie on a degree 2t polynomial passing through (0,ab mod p), instead of a degree t polynomial. There is also a randomness problem. The parties can participate in a simple oneround protocol to fix these imperfections: Each server shares its invalid share of ab mod p with the other servers. Then each server locally computes a linear combination of the shares of invalid shares that it received, using appropriate Lagrange coefficients for interpolating a degree two polynomial at zero. Output Phase: After all gates are processed, the parties hold valid shares 17

18 of the value on the arithmetic circuit s output wire. The parties perform the Reconstruction Phase of Shamir s secret sharing scheme to recover the output. 18

1 Number Theory Basics

1 Number Theory Basics ECS 289M (Franklin), Winter 2010, Crypto Review 1 Number Theory Basics This section has some basic facts about number theory, mostly taken (or adapted) from Dan Boneh s number theory fact sheets for his

More information

Chapter 11 : Private-Key Encryption

Chapter 11 : Private-Key Encryption COMP547 Claude Crépeau INTRODUCTION TO MODERN CRYPTOGRAPHY _ Second Edition _ Jonathan Katz Yehuda Lindell Chapter 11 : Private-Key Encryption 1 Chapter 11 Public-Key Encryption Apologies: all numbering

More information

ECS 189A Final Cryptography Spring 2011

ECS 189A Final Cryptography Spring 2011 ECS 127: Cryptography Handout F UC Davis Phillip Rogaway June 9, 2011 ECS 189A Final Cryptography Spring 2011 Hints for success: Good luck on the exam. I don t think it s all that hard (I do believe I

More information

Introduction to Cryptography. Lecture 8

Introduction to Cryptography. Lecture 8 Introduction to Cryptography Lecture 8 Benny Pinkas page 1 1 Groups we will use Multiplication modulo a prime number p (G, ) = ({1,2,,p-1}, ) E.g., Z 7* = ( {1,2,3,4,5,6}, ) Z p * Z N * Multiplication

More information

Katz, Lindell Introduction to Modern Cryptrography

Katz, Lindell Introduction to Modern Cryptrography Katz, Lindell Introduction to Modern Cryptrography Slides Chapter 12 Markus Bläser, Saarland University Digital signature schemes Goal: integrity of messages Signer signs a message using a private key

More information

Multiparty Computation

Multiparty Computation Multiparty Computation Principle There is a (randomized) function f : ({0, 1} l ) n ({0, 1} l ) n. There are n parties, P 1,...,P n. Some of them may be adversarial. Two forms of adversarial behaviour:

More information

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today:

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today: Today: Introduction to the class. Examples of concrete physical attacks on RSA A computational approach to cryptography Pseudorandomness 1 What are Physical Attacks Tampering/Leakage attacks Issue of how

More information

ENEE 457: Computer Systems Security 10/3/16. Lecture 9 RSA Encryption and Diffie-Helmann Key Exchange

ENEE 457: Computer Systems Security 10/3/16. Lecture 9 RSA Encryption and Diffie-Helmann Key Exchange ENEE 457: Computer Systems Security 10/3/16 Lecture 9 RSA Encryption and Diffie-Helmann Key Exchange Charalampos (Babis) Papamanthou Department of Electrical and Computer Engineering University of Maryland,

More information

Lecture 9 Julie Staub Avi Dalal Abheek Anand Gelareh Taban. 1 Introduction. 2 Background. CMSC 858K Advanced Topics in Cryptography February 24, 2004

Lecture 9 Julie Staub Avi Dalal Abheek Anand Gelareh Taban. 1 Introduction. 2 Background. CMSC 858K Advanced Topics in Cryptography February 24, 2004 CMSC 858K Advanced Topics in Cryptography February 24, 2004 Lecturer: Jonathan Katz Lecture 9 Scribe(s): Julie Staub Avi Dalal Abheek Anand Gelareh Taban 1 Introduction In previous lectures, we constructed

More information

Lecture 1: Introduction to Public key cryptography

Lecture 1: Introduction to Public key cryptography Lecture 1: Introduction to Public key cryptography Thomas Johansson T. Johansson (Lund University) 1 / 44 Key distribution Symmetric key cryptography: Alice and Bob share a common secret key. Some means

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Introduction Public Key Cryptography Unlike symmetric key, there is no need for Alice and Bob to share a common secret Alice can convey her public key to Bob in a public communication:

More information

Lecture 16 Chiu Yuen Koo Nikolai Yakovenko. 1 Digital Signature Schemes. CMSC 858K Advanced Topics in Cryptography March 18, 2004

Lecture 16 Chiu Yuen Koo Nikolai Yakovenko. 1 Digital Signature Schemes. CMSC 858K Advanced Topics in Cryptography March 18, 2004 CMSC 858K Advanced Topics in Cryptography March 18, 2004 Lecturer: Jonathan Katz Lecture 16 Scribe(s): Chiu Yuen Koo Nikolai Yakovenko Jeffrey Blank 1 Digital Signature Schemes In this lecture, we introduce

More information

Lecture 4 Chiu Yuen Koo Nikolai Yakovenko. 1 Summary. 2 Hybrid Encryption. CMSC 858K Advanced Topics in Cryptography February 5, 2004

Lecture 4 Chiu Yuen Koo Nikolai Yakovenko. 1 Summary. 2 Hybrid Encryption. CMSC 858K Advanced Topics in Cryptography February 5, 2004 CMSC 858K Advanced Topics in Cryptography February 5, 2004 Lecturer: Jonathan Katz Lecture 4 Scribe(s): Chiu Yuen Koo Nikolai Yakovenko Jeffrey Blank 1 Summary The focus of this lecture is efficient public-key

More information

Public-Key Encryption: ElGamal, RSA, Rabin

Public-Key Encryption: ElGamal, RSA, Rabin Public-Key Encryption: ElGamal, RSA, Rabin Introduction to Modern Cryptography Benny Applebaum Tel-Aviv University Fall Semester, 2011 12 Public-Key Encryption Syntax Encryption algorithm: E. Decryption

More information

An Introduction to Probabilistic Encryption

An Introduction to Probabilistic Encryption Osječki matematički list 6(2006), 37 44 37 An Introduction to Probabilistic Encryption Georg J. Fuchsbauer Abstract. An introduction to probabilistic encryption is given, presenting the first probabilistic

More information

Block Ciphers/Pseudorandom Permutations

Block Ciphers/Pseudorandom Permutations Block Ciphers/Pseudorandom Permutations Definition: Pseudorandom Permutation is exactly the same as a Pseudorandom Function, except for every key k, F k must be a permutation and it must be indistinguishable

More information

Lecture 17 - Diffie-Hellman key exchange, pairing, Identity-Based Encryption and Forward Security

Lecture 17 - Diffie-Hellman key exchange, pairing, Identity-Based Encryption and Forward Security Lecture 17 - Diffie-Hellman key exchange, pairing, Identity-Based Encryption and Forward Security Boaz Barak November 21, 2007 Cyclic groups and discrete log A group G is cyclic if there exists a generator

More information

CS 4770: Cryptography. CS 6750: Cryptography and Communication Security. Alina Oprea Associate Professor, CCIS Northeastern University

CS 4770: Cryptography. CS 6750: Cryptography and Communication Security. Alina Oprea Associate Professor, CCIS Northeastern University CS 4770: Cryptography CS 6750: Cryptography and Communication Security Alina Oprea Associate Professor, CCIS Northeastern University March 26 2017 Outline RSA encryption in practice Transform RSA trapdoor

More information

Winter 2011 Josh Benaloh Brian LaMacchia

Winter 2011 Josh Benaloh Brian LaMacchia Winter 2011 Josh Benaloh Brian LaMacchia Fun with Public-Key Tonight we ll Introduce some basic tools of public-key crypto Combine the tools to create more powerful tools Lay the ground work for substantial

More information

Lecture 11: Key Agreement

Lecture 11: Key Agreement Introduction to Cryptography 02/22/2018 Lecture 11: Key Agreement Instructor: Vipul Goyal Scribe: Francisco Maturana 1 Hardness Assumptions In order to prove the security of cryptographic primitives, we

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Ali El Kaafarani 1 Mathematical Institute 2 PQShield Ltd. 1 of 44 Outline 1 Public Key Encryption: security notions 2 RSA Encryption Scheme 2 of 44 Course main reference 3 of 44

More information

Lecture Notes, Week 6

Lecture Notes, Week 6 YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467b: Cryptography and Computer Security Week 6 (rev. 3) Professor M. J. Fischer February 15 & 17, 2005 1 RSA Security Lecture Notes, Week 6 Several

More information

Technische Universität München (I7) Winter 2013/14 Dr. M. Luttenberger / M. Schlund SOLUTION. Cryptography Endterm

Technische Universität München (I7) Winter 2013/14 Dr. M. Luttenberger / M. Schlund SOLUTION. Cryptography Endterm Technische Universität München (I7) Winter 2013/14 Dr. M. Luttenberger / M. Schlund SOLUTION Cryptography Endterm Exercise 1 One Liners 1.5P each = 12P For each of the following statements, state if it

More information

Introduction to Cybersecurity Cryptography (Part 4)

Introduction to Cybersecurity Cryptography (Part 4) Introduction to Cybersecurity Cryptography (Part 4) Review of Last Lecture Blockciphers Review of DES Attacks on Blockciphers Advanced Encryption Standard (AES) Modes of Operation MACs and Hashes Message

More information

Public-Key Cryptosystems CHAPTER 4

Public-Key Cryptosystems CHAPTER 4 Public-Key Cryptosystems CHAPTER 4 Introduction How to distribute the cryptographic keys? Naïve Solution Naïve Solution Give every user P i a separate random key K ij to communicate with every P j. Disadvantage:

More information

Lecture 19: Public-key Cryptography (Diffie-Hellman Key Exchange & ElGamal Encryption) Public-key Cryptography

Lecture 19: Public-key Cryptography (Diffie-Hellman Key Exchange & ElGamal Encryption) Public-key Cryptography Lecture 19: (Diffie-Hellman Key Exchange & ElGamal Encryption) Recall In private-key cryptography the secret-key sk is always established ahead of time The secrecy of the private-key cryptography relies

More information

Lecture 15 & 16: Trapdoor Permutations, RSA, Signatures

Lecture 15 & 16: Trapdoor Permutations, RSA, Signatures CS 7810 Graduate Cryptography October 30, 2017 Lecture 15 & 16: Trapdoor Permutations, RSA, Signatures Lecturer: Daniel Wichs Scribe: Willy Quach & Giorgos Zirdelis 1 Topic Covered. Trapdoor Permutations.

More information

Introduction to Cybersecurity Cryptography (Part 4)

Introduction to Cybersecurity Cryptography (Part 4) Introduction to Cybersecurity Cryptography (Part 4) Review of Last Lecture Blockciphers Review of DES Attacks on Blockciphers Advanced Encryption Standard (AES) Modes of Operation MACs and Hashes Message

More information

Oblivious Transfer and Secure Multi-Party Computation With Malicious Parties

Oblivious Transfer and Secure Multi-Party Computation With Malicious Parties CS 380S Oblivious Transfer and Secure Multi-Party Computation With Malicious Parties Vitaly Shmatikov slide 1 Reminder: Oblivious Transfer b 0, b 1 i = 0 or 1 A b i B A inputs two bits, B inputs the index

More information

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30 CHALMERS GÖTEBORGS UNIVERSITET CRYPTOGRAPHY TDA35 (Chalmers) - DIT50 (GU) 11 April 017, 8:30-1:30 No extra material is allowed during the exam except for pens and a simple calculator (not smartphones).

More information

Computational security & Private key encryption

Computational security & Private key encryption Computational security & Private key encryption Emma Arfelt Stud. BSc. Software Development Frederik Madsen Stud. MSc. Software Development March 2017 Recap Perfect Secrecy Perfect indistinguishability

More information

Chapter 8 Public-key Cryptography and Digital Signatures

Chapter 8 Public-key Cryptography and Digital Signatures Chapter 8 Public-key Cryptography and Digital Signatures v 1. Introduction to Public-key Cryptography 2. Example of Public-key Algorithm: Diffie- Hellman Key Exchange Scheme 3. RSA Encryption and Digital

More information

10 Concrete candidates for public key crypto

10 Concrete candidates for public key crypto 10 Concrete candidates for public key crypto In the previous lecture we talked about public key cryptography and saw the Diffie Hellman system and the DSA signature scheme. In this lecture, we will see

More information

El Gamal A DDH based encryption scheme. Table of contents

El Gamal A DDH based encryption scheme. Table of contents El Gamal A DDH based encryption scheme Foundations of Cryptography Computer Science Department Wellesley College Fall 2016 Table of contents Introduction El Gamal Practical Issues The El Gamal encryption

More information

Lecture 9 and 10: Malicious Security - GMW Compiler and Cut and Choose, OT Extension

Lecture 9 and 10: Malicious Security - GMW Compiler and Cut and Choose, OT Extension CS 294 Secure Computation February 16 and 18, 2016 Lecture 9 and 10: Malicious Security - GMW Compiler and Cut and Choose, OT Extension Instructor: Sanjam Garg Scribe: Alex Irpan 1 Overview Garbled circuits

More information

Cryptography IV: Asymmetric Ciphers

Cryptography IV: Asymmetric Ciphers Cryptography IV: Asymmetric Ciphers Computer Security Lecture 7 David Aspinall School of Informatics University of Edinburgh 31st January 2011 Outline Background RSA Diffie-Hellman ElGamal Summary Outline

More information

Block ciphers And modes of operation. Table of contents

Block ciphers And modes of operation. Table of contents Block ciphers And modes of operation Foundations of Cryptography Computer Science Department Wellesley College Table of contents Introduction Pseudorandom permutations Block Ciphers Modes of Operation

More information

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrovsky. Lecture 7

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrovsky. Lecture 7 CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrovsky Lecture 7 Lecture date: Monday, 28 February, 2005 Scribe: M.Chov, K.Leung, J.Salomone 1 Oneway Trapdoor Permutations Recall that a

More information

Lecture 18 - Secret Sharing, Visual Cryptography, Distributed Signatures

Lecture 18 - Secret Sharing, Visual Cryptography, Distributed Signatures Lecture 18 - Secret Sharing, Visual Cryptography, Distributed Signatures Boaz Barak November 27, 2007 Quick review of homework 7 Existence of a CPA-secure public key encryption scheme such that oracle

More information

Mathematics of Cryptography

Mathematics of Cryptography UNIT - III Mathematics of Cryptography Part III: Primes and Related Congruence Equations 1 Objectives To introduce prime numbers and their applications in cryptography. To discuss some primality test algorithms

More information

Question: Total Points: Score:

Question: Total Points: Score: University of California, Irvine COMPSCI 134: Elements of Cryptography and Computer and Network Security Midterm Exam (Fall 2016) Duration: 90 minutes November 2, 2016, 7pm-8:30pm Name (First, Last): Please

More information

Lecture 17: Constructions of Public-Key Encryption

Lecture 17: Constructions of Public-Key Encryption COM S 687 Introduction to Cryptography October 24, 2006 Lecture 17: Constructions of Public-Key Encryption Instructor: Rafael Pass Scribe: Muthu 1 Secure Public-Key Encryption In the previous lecture,

More information

Introduction to Cryptography Lecture 13

Introduction to Cryptography Lecture 13 Introduction to Cryptography Lecture 13 Benny Pinkas June 5, 2011 Introduction to Cryptography, Benny Pinkas page 1 Electronic cash June 5, 2011 Introduction to Cryptography, Benny Pinkas page 2 Simple

More information

14 Diffie-Hellman Key Agreement

14 Diffie-Hellman Key Agreement 14 Diffie-Hellman Key Agreement 14.1 Cyclic Groups Definition 14.1 Example Let д Z n. Define д n = {д i % n i Z}, the set of all powers of д reduced mod n. Then д is called a generator of д n, and д n

More information

Provable Security for Public-Key Schemes. Outline. I Basics. Secrecy of Communications. Outline. David Pointcheval

Provable Security for Public-Key Schemes. Outline. I Basics. Secrecy of Communications. Outline. David Pointcheval Provable Security for Public-Key Schemes I Basics David Pointcheval Ecole normale supérieure, CNRS & INRIA IACR-SEAMS School Cryptographie: Foundations and New Directions November 2016 Hanoi Vietnam Introduction

More information

RSA RSA public key cryptosystem

RSA RSA public key cryptosystem RSA 1 RSA As we have seen, the security of most cipher systems rests on the users keeping secret a special key, for anyone possessing the key can encrypt and/or decrypt the messages sent between them.

More information

II. Digital signatures

II. Digital signatures II. Digital signatures Alice m Bob Eve 1. Did Bob send message m, or was it Eve? 2. Did Eve modify the message m, that was sent by Bob? 1 Digital signatures Digital signature - are equivalent of handwritten

More information

ASYMMETRIC ENCRYPTION

ASYMMETRIC ENCRYPTION ASYMMETRIC ENCRYPTION 1 / 1 Recommended Book Steven Levy. Crypto. Penguin books. 2001. A non-technical account of the history of public-key cryptography and the colorful characters involved. 2 / 1 Recall

More information

EXAM IN. TDA352 (Chalmers) - DIT250 (GU) 12 January 2018, 08:

EXAM IN. TDA352 (Chalmers) - DIT250 (GU) 12 January 2018, 08: CHALMERS GÖTEBORGS UNIVERSITET EXAM IN CRYPTOGRAPHY TDA352 (Chalmers) - DIT250 (GU) 12 January 2018, 08:30 12.30 Tillåtna hjälpmedel: Typgodkänd räknare. Annan minnestömd räknare får användas efter godkännande

More information

Outline. The Game-based Methodology for Computational Security Proofs. Public-Key Cryptography. Outline. Introduction Provable Security

Outline. The Game-based Methodology for Computational Security Proofs. Public-Key Cryptography. Outline. Introduction Provable Security The Game-based Methodology for Computational s David Pointcheval Ecole normale supérieure, CNRS & INRIA Computational and Symbolic Proofs of Security Atagawa Heights Japan April 6th, 2009 1/39 2/39 Public-Key

More information

Digital Signatures. Saravanan Vijayakumaran Department of Electrical Engineering Indian Institute of Technology Bombay

Digital Signatures. Saravanan Vijayakumaran Department of Electrical Engineering Indian Institute of Technology Bombay Digital Signatures Saravanan Vijayakumaran sarva@ee.iitb.ac.in Department of Electrical Engineering Indian Institute of Technology Bombay July 24, 2018 1 / 29 Group Theory Recap Groups Definition A set

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 11 February 21, 2013 CPSC 467b, Lecture 11 1/27 Discrete Logarithm Diffie-Hellman Key Exchange ElGamal Key Agreement Primitive Roots

More information

EXAM IN. TDA352 (Chalmers) - DIT250 (GU) 18 January 2019, 08:

EXAM IN. TDA352 (Chalmers) - DIT250 (GU) 18 January 2019, 08: CHALMERS GÖTEBORGS UNIVERSITET EXAM IN CRYPTOGRAPHY TDA352 (Chalmers) - DIT250 (GU) 18 January 2019, 08:30 12.30 Tillåtna hjälpmedel: Typgodkänd räknare. Annan minnestömd räknare får användas efter godkännande

More information

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1). 1 Background 1.1 The group of units MAT 3343, APPLIED ALGEBRA, FALL 2003 Handout 3: The RSA Cryptosystem Peter Selinger Let (R, +, ) be a ring. Then R forms an abelian group under addition. R does not

More information

Lecture 28: Public-key Cryptography. Public-key Cryptography

Lecture 28: Public-key Cryptography. Public-key Cryptography Lecture 28: Recall In private-key cryptography the secret-key sk is always established ahead of time The secrecy of the private-key cryptography relies on the fact that the adversary does not have access

More information

Lecture 10: Zero-Knowledge Proofs

Lecture 10: Zero-Knowledge Proofs Lecture 10: Zero-Knowledge Proofs Introduction to Modern Cryptography Benny Applebaum Tel-Aviv University Fall Semester, 2011 12 Some of these slides are based on note by Boaz Barak. Quo vadis? Eo Romam

More information

10 Public Key Cryptography : RSA

10 Public Key Cryptography : RSA 10 Public Key Cryptography : RSA 10.1 Introduction The idea behind a public-key system is that it might be possible to find a cryptosystem where it is computationally infeasible to determine d K even if

More information

Short Exponent Diffie-Hellman Problems

Short Exponent Diffie-Hellman Problems Short Exponent Diffie-Hellman Problems Takeshi Koshiba 12 and Kaoru Kurosawa 3 1 Secure Computing Lab., Fujitsu Laboratories Ltd. 2 ERATO Quantum Computation and Information Project, Japan Science and

More information

Introduction to Modern Cryptography. Benny Chor

Introduction to Modern Cryptography. Benny Chor Introduction to Modern Cryptography Benny Chor RSA: Review and Properties Factoring Algorithms Trapdoor One Way Functions PKC Based on Discrete Logs (Elgamal) Signature Schemes Lecture 8 Tel-Aviv University

More information

Authentication. Chapter Message Authentication

Authentication. Chapter Message Authentication Chapter 5 Authentication 5.1 Message Authentication Suppose Bob receives a message addressed from Alice. How does Bob ensure that the message received is the same as the message sent by Alice? For example,

More information

1 Secure two-party computation

1 Secure two-party computation CSCI 5440: Cryptography Lecture 7 The Chinese University of Hong Kong, Spring 2018 26 and 27 February 2018 In the first half of the course we covered the basic cryptographic primitives that enable secure

More information

COS433/Math 473: Cryptography. Mark Zhandry Princeton University Spring 2018

COS433/Math 473: Cryptography. Mark Zhandry Princeton University Spring 2018 COS433/Math 473: Cryptography Mark Zhandry Princeton University Spring 2018 Identification Identification Non- Repudiation Consider signature- based C- R sk ch=r res = Sig(vk,ch) Bob can prove to police

More information

Introduction to Cybersecurity Cryptography (Part 5)

Introduction to Cybersecurity Cryptography (Part 5) Introduction to Cybersecurity Cryptography (Part 5) Prof. Dr. Michael Backes 13.01.2017 February 17 th Special Lecture! 45 Minutes Your Choice 1. Automotive Security 2. Smartphone Security 3. Side Channel

More information

Question 2.1. Show that. is non-negligible. 2. Since. is non-negligible so is μ n +

Question 2.1. Show that. is non-negligible. 2. Since. is non-negligible so is μ n + Homework #2 Question 2.1 Show that 1 p n + μ n is non-negligible 1. μ n + 1 p n > 1 p n 2. Since 1 p n is non-negligible so is μ n + 1 p n Question 2.1 Show that 1 p n - μ n is non-negligible 1. μ n O(

More information

COS Cryptography - Final Take Home Exam

COS Cryptography - Final Take Home Exam COS 433 - Cryptography - Final Take Home Exam Boaz Barak May 12, 2010 Read these instructions carefully before starting to work on the exam. If any of them are not clear, please email me before you start

More information

Introduction to Modern Cryptography Lecture 11

Introduction to Modern Cryptography Lecture 11 Introduction to Modern Cryptography Lecture 11 January 10, 2017 Instructor: Benny Chor Teaching Assistant: Orit Moskovich School of Computer Science Tel-Aviv University Fall Semester, 2016 17 Tuesday 12:00

More information

CPA-Security. Definition: A private-key encryption scheme

CPA-Security. Definition: A private-key encryption scheme CPA-Security The CPA Indistinguishability Experiment PrivK cpa A,Π n : 1. A key k is generated by running Gen 1 n. 2. The adversary A is given input 1 n and oracle access to Enc k, and outputs a pair of

More information

Topics in Cryptography. Lecture 5: Basic Number Theory

Topics in Cryptography. Lecture 5: Basic Number Theory Topics in Cryptography Lecture 5: Basic Number Theory Benny Pinkas page 1 1 Classical symmetric ciphers Alice and Bob share a private key k. System is secure as long as k is secret. Major problem: generating

More information

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups Great Theoretical Ideas in CS V. Adamchik CS 15-251 Upcoming Interview? Lecture 24 Carnegie Mellon University Cryptography and RSA How the World's Smartest Company Selects the Most Creative Thinkers Groups

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

Pseudo-random Number Generation. Qiuliang Tang

Pseudo-random Number Generation. Qiuliang Tang Pseudo-random Number Generation Qiuliang Tang Random Numbers in Cryptography The keystream in the one-time pad The secret key in the DES encryption The prime numbers p, q in the RSA encryption The private

More information

MATH 158 FINAL EXAM 20 DECEMBER 2016

MATH 158 FINAL EXAM 20 DECEMBER 2016 MATH 158 FINAL EXAM 20 DECEMBER 2016 Name : The exam is double-sided. Make sure to read both sides of each page. The time limit is three hours. No calculators are permitted. You are permitted one page

More information

Oblivious Evaluation of Multivariate Polynomials. and Applications

Oblivious Evaluation of Multivariate Polynomials. and Applications The Open University of Israel Department of Mathematics and Computer Science Oblivious Evaluation of Multivariate Polynomials and Applications Thesis submitted as partial fulfillment of the requirements

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 11 October 7, 2015 CPSC 467, Lecture 11 1/37 Digital Signature Algorithms Signatures from commutative cryptosystems Signatures from

More information

Basics in Cryptology. Outline. II Distributed Cryptography. Key Management. Outline. David Pointcheval. ENS Paris 2018

Basics in Cryptology. Outline. II Distributed Cryptography. Key Management. Outline. David Pointcheval. ENS Paris 2018 Basics in Cryptology II Distributed Cryptography David Pointcheval Ecole normale supérieure, CNRS & INRIA ENS Paris 2018 NS/CNRS/INRIA Cascade David Pointcheval 1/26ENS/CNRS/INRIA Cascade David Pointcheval

More information

Efficient MPC Oblivious Transfer and Oblivious Linear Evaluation aka How to Multiply

Efficient MPC Oblivious Transfer and Oblivious Linear Evaluation aka How to Multiply CIS 2018 Efficient MPC Oblivious Transfer and Oblivious Linear Evaluation aka How to Multiply Claudio Orlandi, Aarhus University Circuit Evaluation 3) Multiplication? How to compute [z]=[xy]? Alice, Bob

More information

Introduction to Modern Cryptography. Benny Chor

Introduction to Modern Cryptography. Benny Chor Introduction to Modern Cryptography Benny Chor RSA Public Key Encryption Factoring Algorithms Lecture 7 Tel-Aviv University Revised March 1st, 2008 Reminder: The Prime Number Theorem Let π(x) denote the

More information

Public Key Algorithms

Public Key Algorithms Public Key Algorithms Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 Jain@cse.wustl.edu Audio/Video recordings of this lecture are available at: http://www.cse.wustl.edu/~jain/cse571-09/

More information

Algorithmic Number Theory and Public-key Cryptography

Algorithmic Number Theory and Public-key Cryptography Algorithmic Number Theory and Public-key Cryptography Course 3 University of Luxembourg March 22, 2018 The RSA algorithm The RSA algorithm is the most widely-used public-key encryption algorithm Invented

More information

Sharing DSS by the Chinese Remainder Theorem

Sharing DSS by the Chinese Remainder Theorem Sharing DSS by the Chinese Remainder Theorem Kamer Kaya,a, Ali Aydın Selçuk b a Ohio State University, Columbus, 43210, OH, USA b Bilkent University, Ankara, 06800, Turkey Abstract In this paper, we propose

More information

ID-based Encryption Scheme Secure against Chosen Ciphertext Attacks

ID-based Encryption Scheme Secure against Chosen Ciphertext Attacks ID-based Encryption Scheme Secure against Chosen Ciphertext Attacks ongxing Lu and Zhenfu Cao Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200030, P.. China {cao-zf,

More information

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University Number Theory, Public Key Cryptography, RSA Ahmet Burak Can Hacettepe University abc@hacettepe.edu.tr The Euler Phi Function For a positive integer n, if 0

More information

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculty of Mathematics and Computer Science Exam Cryptology, Friday 25 January 2019

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculty of Mathematics and Computer Science Exam Cryptology, Friday 25 January 2019 Faculty of Mathematics and Computer Science Exam Cryptology, Friday 25 January 2019 Name : TU/e student number : Exercise 1 2 3 4 5 total points Notes: Please hand in all sheets at the end of the exam.

More information

Lecture 11: Non-Interactive Zero-Knowledge II. 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian problem

Lecture 11: Non-Interactive Zero-Knowledge II. 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian problem CS 276 Cryptography Oct 8, 2014 Lecture 11: Non-Interactive Zero-Knowledge II Instructor: Sanjam Garg Scribe: Rafael Dutra 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian

More information

Constructing secure MACs Message authentication in action. Table of contents

Constructing secure MACs Message authentication in action. Table of contents Constructing secure MACs Message authentication in action Foundations of Cryptography Computer Science Department Wellesley College Fall 2016 Table of contents From last time Recall the definition of message

More information

Practice Final Exam Winter 2017, CS 485/585 Crypto March 14, 2017

Practice Final Exam Winter 2017, CS 485/585 Crypto March 14, 2017 Practice Final Exam Name: Winter 2017, CS 485/585 Crypto March 14, 2017 Portland State University Prof. Fang Song Instructions This exam contains 7 pages (including this cover page) and 5 questions. Total

More information

Advanced Topics in Cryptography

Advanced Topics in Cryptography Advanced Topics in Cryptography Lecture 6: El Gamal. Chosen-ciphertext security, the Cramer-Shoup cryptosystem. Benny Pinkas based on slides of Moni Naor page 1 1 Related papers Lecture notes of Moni Naor,

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Spotlight on Science J. Robert Buchanan Department of Mathematics 2011 What is Cryptography? cryptography: study of methods for sending messages in a form that only be understood

More information

Cryptography CS 555. Topic 22: Number Theory/Public Key-Cryptography

Cryptography CS 555. Topic 22: Number Theory/Public Key-Cryptography Cryptography CS 555 Topic 22: Number Theory/Public Key-Cryptography 1 Exam Recap 2 Exam Recap Highest Average Score on Question Question 4: (Feistel Network with round function f(x) = 0 n ) Tougher Questions

More information

A Fair and Efficient Solution to the Socialist Millionaires Problem

A Fair and Efficient Solution to the Socialist Millionaires Problem In Discrete Applied Mathematics, 111 (2001) 23 36. (Special issue on coding and cryptology) A Fair and Efficient Solution to the Socialist Millionaires Problem Fabrice Boudot a Berry Schoenmakers b Jacques

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Ali El Kaafarani Mathematical Institute Oxford University 1 of 60 Outline 1 RSA Encryption Scheme 2 Discrete Logarithm and Diffie-Hellman Algorithm 3 ElGamal Encryption Scheme 4

More information

Public Key Cryptography

Public Key Cryptography T H E U N I V E R S I T Y O F B R I T I S H C O L U M B I A Public Key Cryptography EECE 412 1 What is it? Two keys Sender uses recipient s public key to encrypt Receiver uses his private key to decrypt

More information

An Efficient Protocol for Fair Secure Two-Party Computation

An Efficient Protocol for Fair Secure Two-Party Computation Appears in Cryptographers Track-RSA Conference (CT-RSA 2008), Lecture Notes in Computer Science 4964 (2008) 88 105. Springer-Verlag. An Efficient Protocol for Fair Secure Two-Party Computation Mehmet S.

More information

G Advanced Cryptography April 10th, Lecture 11

G Advanced Cryptography April 10th, Lecture 11 G.30-001 Advanced Cryptography April 10th, 007 Lecturer: Victor Shoup Lecture 11 Scribe: Kristiyan Haralambiev We continue the discussion of public key encryption. Last time, we studied Hash Proof Systems

More information

b = 10 a, is the logarithm of b to the base 10. Changing the base to e we obtain natural logarithms, so a = ln b means that b = e a.

b = 10 a, is the logarithm of b to the base 10. Changing the base to e we obtain natural logarithms, so a = ln b means that b = e a. INTRODUCTION TO CRYPTOGRAPHY 5. Discrete Logarithms Recall the classical logarithm for real numbers: If we write b = 10 a, then a = log 10 b is the logarithm of b to the base 10. Changing the base to e

More information

Cryptography CS 555. Topic 23: Zero-Knowledge Proof and Cryptographic Commitment. CS555 Topic 23 1

Cryptography CS 555. Topic 23: Zero-Knowledge Proof and Cryptographic Commitment. CS555 Topic 23 1 Cryptography CS 555 Topic 23: Zero-Knowledge Proof and Cryptographic Commitment CS555 Topic 23 1 Outline and Readings Outline Zero-knowledge proof Fiat-Shamir protocol Schnorr protocol Commitment schemes

More information

Notes for Lecture 17

Notes for Lecture 17 U.C. Berkeley CS276: Cryptography Handout N17 Luca Trevisan March 17, 2009 Notes for Lecture 17 Scribed by Matt Finifter, posted April 8, 2009 Summary Today we begin to talk about public-key cryptography,

More information

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467a: Cryptography and Computer Security Notes 23 (rev. 1) Professor M. J. Fischer November 29, 2005 1 Oblivious Transfer Lecture Notes 23 In the locked

More information

Asymmetric Encryption

Asymmetric Encryption -3 s s Encryption Comp Sci 3600 Outline -3 s s 1-3 2 3 4 5 s s Outline -3 s s 1-3 2 3 4 5 s s Function Using Bitwise XOR -3 s s Key Properties for -3 s s The most important property of a hash function

More information

John Hancock enters the 21th century Digital signature schemes. Table of contents

John Hancock enters the 21th century Digital signature schemes. Table of contents John Hancock enters the 21th century Digital signature schemes Foundations of Cryptography Computer Science Department Wellesley College Fall 2016 Table of contents From last time: Good news and bad There

More information