1 / 29

CHAPTER 5 : P ublic - key cryptography

CHAPTER 5 : P ublic - key cryptography. Rapidly increasing needs for flexible and secure transmission of information require to use new cryptographic methods.

faraji
Télécharger la présentation

CHAPTER 5 : P ublic - key cryptography

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CHAPTER 5: Public-keycryptography Rapidly increasing needs for flexible and secure transmission ofinformation require to use new cryptographic methods. The main disadvantage of the classical cryptography is the need tosend a (long) key through a super secure channel before sending themessage itself. IV054 In secret-key (symetric key) cryptography both sender and receiver sharethe same secret key. In public-key ryptography there are two different keys: a public encryption key and a secret decryption key (at the receiver side). Public-key cryptography

  2. IV054 Basic idea - example • Basic idea:If it is infeasible from the knowledge of an encryption algorithm ek to construct the corresponding description algorithm dk, then ek can be made public. • Toy example: (Telephone directory encryption) • Start: Each user U makes public a unique telephone directory tdU to encrypt messages for U and U is the only user to have an inverse telephone directory itdU. • Encryption: Each letterX of a plaintext w is replaced, using the telephone directorytdU of the intended receiver U, by the telephone number of a person whose name starts with letter X. • Decryption: easy for Uk, with an inverse telephone directory, infeasible for others. Analogy: Secret-key cryptography1. Put the message into a box, lock it with a padlock and send the box. 2. Send the key by a secure channel. Public-key cryptography Open padlocks, for each user different one, are freely available.Only legitimate user has key from his padlocks. Transmission: Put the message into the box of the intended receiver, close the padlock and send the box. Public-key cryptography

  3. IV054 Public Establishment of Secret Keys • Main problem of the secret-key cryptography: a need to make a secure distribution (establishment) of secret keys ahead of transmissions. • Diffie+Hellman solved this problem in 1976 by designing a protocol for secure key • establishment (distribution) over public channels. • Protocol: If two parties, Alice and Bob, want to create a commonsecret key, then • they first agree, somehow, on a large prime p and a primitive root q (mod p) and then theyperform, through a public channel, the following activities. • Alice chooses, randomly, a large 1Ł x<p-1 and computes • X=qxmod p. • Bob also chooses, again randomly, a large 1Ły <p-1 and computes • Y=qymod p. • Alice and Bob exchange X and Y, through a public channel, but keep x,y secret. • Alice computes Y xmod p and Bob computesXymod pand then each of them has the keyK= qxymod p. An eavesdropper seems to need, in order to determine x from X,q,p and y fromY,q,p, to have a capability to compute discrete logarithms, or to compute qxy from qx and qy, what is believed to be infeasible. Public-key cryptography

  4. IV054 MAN-IN-THE-MIDDLE ATTACK • The following attack by a man-in-the-middle is possible against the Diffie-Hellman key establishmentprotocol. 1. Eve chooses an exponent z. 2. Eve intercepts qx and q y. 3. Eve sends q z to both Alice and Bob. (After that Alice believes she has received qx and Bob believes he has received q y.) 4. Eve computes KA=qxz (mod p) and KB=qyz (mod p) . Alice, not realizingthat Eve is in the middle, also computes KAand Bob, not realizing that Eve is in the middle, also computes KB. 5. When Alice sends a message to Bob, encrypted with KA, Eve intercepts it, decrypts it, then encrypts itwith KB and sends it to Bob. 6. Bob decrypts the message with KB and obtains the message. At this point he has no reason to think that communication was insecure. 7. Meanwhile, Eve enjoys reading Alice's message. Public-key cryptography

  5. IV054 Blom's key pre-distribution protocol • allows to atrusted authority (Trent) to distributed secret keys to n(n-1)/2 pairs ofn users. • Let a large prime p>n be publically known. The protocol has the following steps: • 1. Each user U in the network is assigned, byTrent, a unique public number rU<p. 2. Trent chooses three random numbers a, b and c, smaller than p. 3.For each user U,Trent calculates two numbers aU=(a+brU)modp,bU=(b+crU)modp and sends them via his secure channel to U. 4. Each user U creates the polynomial gU(x)=aU+bU(x). 5. If Alice (A) wants to send a message to Bob (B), then Alice computes her key KAB=gA(rB)and Bob computes his key KBA=gB(rA). 6.It is easy to see that KAB=KBA and therefore Alice and Bob can now use their (identical) keysto communicate using some secret-key cryptosystem. Public-key cryptography

  6. IV054 Secure communicationwith secret-key cryptosystems • without any need forsecret key distribution • (Shamir's no-key algorithm) • Basic assumption:Each user X has its own • secret encryption function eX • secret decryption function dX • andall these functions commute (to form a commutative cryptosystem). Communication protocol with which Alice can send a message w to Bob. 1. Alice sendseA(w) to Bob 2. Bob sends eB (eA(w)) to Alice 3. Alice sends dA (eB (eA(w))) =eB (w) to Bob 4. Bob performs the decryption to get dB (eB (w)) =w. Disadvantage: 3 communications are needed (in sucha context 3 is a much too large number) . Advantage: A perfect protocol for distribution of secret keys. Public-key cryptography

  7. IV054 Cryptography and Computational Complexity • Modern cryptography uses such encryption methods that no ``enemy'' can have enough computational power and time to do encryption (even those capable to use thousands of supercomputers for tens of years for encryption). • Modern cryptography is based on negative and positive results of complexity theory - on the fact that for some algorithm problems no efficient algorithm seem to exists, surprisingly, and for some of “small'' modifications of these problems, surprisingly, simple, fast and good enough (randomized) algorithms do exist. Integer factorization: Given n(=pq), find p,q- unfeasible. There is a list of ”most wanted to factor integers''. Top current successes, using thousands of computers for months. (*) Factorization of 22^9+1 with 155 digits (1996) (**) Factorization of a “typical'' 155-digits integer (1999) Primes recognition: Is a givenn a prime? - fast randomized algorithms exist. The existence of polynomial deterministic algorithms has been shown only in 2002 Public-key cryptography

  8. IV054 Cryptography and Computational Complexity Discrete logarithm problem: Given x,y,n, computea such that yºxa (mod n) - unfeasible. Discrete square root problem: Given y,n, compute x such that yºx2 (mod n) - infeasible in general, easy ifn is prime. Knapsack problem: Given a knapsack vector X=(x1,…,xn) and knapsack capacityc, find binary vector(b1,…,bn) such that Problem is NP-hard in general, but easy if Public-key cryptography

  9. IV054 One-way functions • Informally, a function F:N -> N is said to beone-way functionif it is easily computable - in polynomial time - but any computation of its inverse is infeasible. • A one-way permutation is a 1-1 one-way function. • easy • xf(x) • computation infeasible A more formal approach Definition A functionf:{0,1}* ®{0,1}* is calleda strongly one-way function if the following conditions are satisfied: 1. f can be computed in polynomial time; 2. there are c,e>0 such that |x|eŁ|f(x)|Ł|x|c; 3.for every randomized polynomial time algorithm A, and any constant c>0, there exists annc such that for n>nc Candidates:Modular exponentiation: f(x)=axmod n Modular squaringf(x)=x2mod n, n - a Blum integer Prime number multiplicationf(p,q)=pq. Public-key cryptography

  10. IV054 Trapdoor One-way Functions • The key concept for design of public-key cryptosystems is that of trapdoor one-way functions. • A function f:X®Y is trapdoor one-way function • iff and its inverse can be computed efficiently, • yet even the complete knowledge of the algorithm to compute f does not make it feasible to determine a polynomial time algorithm to compute inverseof f. • A candidate: modular squaring with a fixed modulus. • computation of discrete square roots is unfeasible in general, but quite easy if the decomposition of the modulus into primes is known. • One way to design a trapdoor one-way function is to transform an easy case of a hard (one-way) function to a hard-looking case of such a function, that can be, however, solved easily by those knowing how the above transformation was performed. Public-key cryptography

  11. IV054 Example - Computer passwords • A naive solution is to keep in computer a file with entries as • login CLINTON password BUSH, • that is with logins and corresponding passwords. This is not sufficiently safe. A more safe method is to keep in the computer a file with entries as login CLINTON password BUSH one-way functionfc The idea is that BUSH is a “public'' password and CLINTON is the only one that knows a “secret'' password, say MADONA, such that fc(MADONA)=BUSH Public-key cryptography

  12. LAMPORT’s ONE-TIME PASSWORDS • One-way functions can be used to create a sequence of passwords: • Alice chooses a random w and computes, using a one-way function h, a sequence of passwords • w, h(w), h(h(w)),…,hn(w) • Alice then transfers securely (??????) ``the initial secret’’ w0=hn(w) to Bob. • The i-th authentication, 0 < i < n+1, is performed as follows: • ------- Alice sends wi=hn-i(w) to Bob • ------- Bob checks whether wi-1=h(wi). • When the number of identifications reaches n, a new w has to be chosen. Public-key cryptography

  13. IV054 General knapsack problem - unfeasible • KNAPSACK PROBLEM:Given an integer-vector X=(x1,…,xn) and an integer c. • Determine a binary vector B=(b1,…,bn) (if it exists) such thatXBT=c. Knapsack problem with superincreasing vector – easy Problem Given a superincreasing integer-vectorX=(x1,…,xn) (i.e. and an integer c, determine a binary vectorB=(b1,…,bn) (if it exists) such that XBT=c. Algorithm - to solve knapsack problems with superincreasing vectors: fori¬ndownto2do ifcł 2xithen terminate {no solution} else ifc > xi thenbi ¬ 1; c ¬ c – xi ; elsebi = 0; ifc = x1then b1 ¬ 1 else ifc = 0 thenb1 ¬ 0; else terminate {no solution} ExampleX=(1,2,4,8,16,32,64,128,256,512)c=999 X=(1,3,5,10,20,41,94,199)c=242 Public-key cryptography

  14. IV054 KNAPSACK ENCODING - BASIC IDEAS • Let a (knapsack) vector • A=(a1,…,an) • be given. • Encoding of a (binary) message B=(b1,b2,…,bn) by A is doneby thevector/vector multiplication: • ABT=c • and results in the cryptotext c Decoding of c requires to solve the knapsack problem for theinstant given by the knapsack vector A and the cryptotext c. The problem is that decoding seems to be infeasible. Example IfA=(74, 82,94, 83, 39, 99, 56, 49, 73, 99)and B =(1100110101) then ABT= Public-key cryptography

  15. IV054 Another view of the knapsack problem • Eachknapsack vectorA=(a1,…,an) • defines an integer valued • knapsack-function • specified by • Example A0=(43,129,215,473,903,302,561,1165,697,1523) • fA0(364)=fA0(0101101100)=129+473+903+561+1165=3231 Unambiguity of knapsack systems For unambiguity of the decryption of the knapsack cryptosystems with knapsack vectorA, it is important that Example: IfA=(17,103,50,81,33), then 131=17+33+81=50+81 Snd therefore for cryptotexts: (131,33,100,234,33) SAUNAFAUNA two plaintexts are obtained Public-key cryptography

  16. IV054 Design of knapsack cryptosystems • 1. Choose a superincreasing vectorX=(x1,…,xn). • 2. Choosem,u such thatm>2xn,gcd(m,u)=1. • 3. Compute u -1modm,X'=(x1’,…,xn'),xi’=uximod m. • diffusion • confusion Cryptosystem:X' - public key X,u,m - trapdoor information Encryption: of a binary vector w of length n: c = X' w Decryption: compute c‘ = u-1c mod m and solve the knapsack problem with X and c'. LemmaLet X, m, u, X', c, c' be as defined above. Then the knapsack problem instances (X,c') and (X',c) have at most one solution, and if one of them has a solution, then the second one has the same solution. ProofLet X'w=c. Then c‘ºu-1cºu-1X'wºu-1uXwºXw (mod m). Since X is superincreasing and m>2xn we have (X w)mod m=X w and thereforec‘=Xw. Public-key cryptography

  17. IV054 Design of knapsack cryptosystems • ExampleX=(1,2,4,9,18,35,75,151,302,606) • m=1250, u=41 • X‘=(41,82,164,369,738,185,575,1191,1132,1096) • In order to encrypt an English plaintext, we first encode its letters by 5-bit numbers _ - 00000, A - 00001, B - 00010,… and then divide the resulting binary strings into blocks of length 10. • Plaintext: Encoding of AFRICA results in vectors • w1=(0000100110)w2=(1001001001)w3=(0001100001) • Encryption: c1’=X'w1=3061 c2’=X'w2=2081 c3’=X‘w3=2203 • Cryptotext:(3061,2081,2203) Decryption of cryptotexts:(2163,2116,1870,3599) By multiplying with u–1=61 (mod 1250) we get new cryptotexts (several new c’) (693,326,320,789) and in the binary form solutions B of equations XBT=c’ have the form (1101001001,0110100010,0000100010,1011100101) that is the resulting plaintext is: ZIMBABWE Public-key cryptography

  18. IV054 Story of the Knapsack • Invented: 1978 - Ralp C. Merkle, Martin Hellman • Patented: in 10 countries • Broken: 1982: Adi Shamir • New idea: iterated knapsack cryptosystem using hyper-reachable vectors. • DefinitionA knapsack vector X'=(x1',…,xn') is obtained from a knapsack vector X=(x1,…,xn) by strong modular multiplication if • X’i=uximod m, i = 1,…,n, • where • andgcd(u,m)=1. A knapsack vector X' is called hyper-reachable, if there is a sequence of knapsack vectorsX=x0,x1,…,xk=X‘, • where x0 is a super-increasing vector and for i=1,…,k} andxiis obtained from xi-1 by a strong modular multiplication. • Iterated knapsack cryptosystem was broken in 1985 - E. Brickell • New ideas: dense knapsack cryptosystems.Density of a knapsack vector: X=(x1,…,xn) is defined by • Remark. Density of super-increasing vectors is Public-key cryptography

  19. IV054 Breaking knapsack • Basic ideas of Shamir's polynomial time algorithm (in the length of the knapsack vector) to break knapsack cryptosystems. • Assumption: there is a d>1 such that modulus m has [dn] bits and elementsai,1ŁiŁn, of a superincreasing vector, have [dn] –1–n+i bits. • (This implies that A is a superincreasing vector and • (Original suggestion: d=2,n=100.) Key observation: Given a knapsack vector B, which was obtained from a super-increasing vector A through a strong modular multiplication using m and u, it is not important for successful cryptoanalysis to find original A,m,u. It is enough to find a pair (m‘,u') such that(1) the vector A' obtained is superincreasing (2) Such a pair is called a trapdoor pair. To find a trapdoor pair one can proceed as follows: One consider functionsbix mod m,1ŁiŁn Minimums are in points (discontinuation points) sawtooth curves Public-key cryptography

  20. IV054 Breaking knapsack • We need to find out t and m such that: • a i = bitmod m • and (a1,…,an) is a superincreasing vector. • Since a1 has to be very small comparing to m, t has to be close to some of the minima of the b1-graph! • Similarly t has to be close to some minimum of the b2-graph. • This implies that two minima of the b1 and b2-graphs must be close to one another. • Similarly we can consider more bi-graphs. • The fact that the trapdoor pair value of t is close to a minimum on each bi-graph implies that all these minima are close to one another. • Thus, instead of trying to find t itself, we try to find out “accumulation points'' of the minima of bi-graphs. • This amounts to constructing a small interval containing a minimum of each bi-graph, and from this to find a trapdoor value of t. • Experiments show that it suffices to analyze only four bi-graphs to get a desirable small interval containing t. • The task is now to express the above ideas in terms of inequalities. Public-key cryptography

  21. IV054 Breaking knapsack • The first problem is that also m is unknown. This is easy to deal with. • We reduce the size of figures for bi-graphs so m becomes 1. This does not change which of the minima are close to another. • The algorithm for finding a trapdoor pair consists of two parts: • 1.Candidates are found for an integer p such that the p-th minimum of the b1-curve is an accumulation point we are looking for. 2.Candidates are tests one by one. One of the candidates has to succeed. One problem is that the first stage may produce too many candidates. To deal with this problem an integer r is fixed in advance and if the first stage produces more than r candidates the algorithm terminates and reports failure. Public-key cryptography

  22. IV054 KNAPSACK CRYPTOSYSTEM - COMMENTS • The term “knapsack'' in the name of the cryptosystem is quitemisleading. • By theKnapsack problem it is mostly understood the followingproblem: • Given n items with weights w1,w2,…, wn and valuesv1,v2,…, vn and a knapsack limit c, the task is to find a bitvector (b1,b2,…,bn) such that • andis as large as possible. The term subset problem is usually used for the problem used inour construction of the knapsack cryptosystem. It is well-known thatthe decision version of this problem isNP-complete. Sometimes, for our main version of theknapsack problem the termMerkle-Hellmman (Knapsack) Cryptosystem is used. Public-key cryptography

  23. IV054 McEliece Cryptosystem • McEliece cryptosystem is based on a similar design principle as theKnapsack cryptosystem. McEliece cryptosystem is formed bytransforming an easy to break cryptosystem into a cryptosystem that is hard tobreak because it seems to be based on a problem that is, in general,NP-hard. • The underlying fact is that the decision version of the decryptionproblem for linear codes is in general NP-complete. However, for special types of linear codes polynomial-time decryptionalgorithms exist. One such a class of linear codes, the so-called Goppa codes, are used to design McEliece cryptosystem. • Goppa codes are [2m,n-mt, 2t+1]-codes, where n=2m. • (McEliece suggested to usem=10, t=50.) Public-key cryptography

  24. IV054 McEliece Cryptosystem - DESIGN • Goppa codes are [2m,n-mt, 2t+1]-codes, where n=2m. • Design of McEliece cryptosystems. Let • G be a generating matrixfor an [n,k,d] Goppa code C; • S be a k × k binary matrix invertible over Z2; • P be an n × n permutation matrix; • G‘ =SGP. • Let P=(Z2)k, C=(Z2)n, K=(G,S,P,G‘). • G' is made public, G,S,P are kept secret. Encryption:eK(w,e)=wG‘ +e,where e is a binary vector of length n and weight t. • Decryption of a cryptotextc = wG’+eÎ (Z2)n. • Compute c1=cP–1 =wSGPP–1 + eP–1 = wSG+eP-1 • Decode c1 to get w1=wS, • Compute w=w1S-1 Public-key cryptography

  25. IV054 COMMENTS on McELIECE CRYPTOSYSTEM • Each irreducible polynomial over Z2m of degree t generates a Goppa code with distance at least 2t+1. • In the design of McEliece cryptosystem the goal of matrices S and C is to modifya generator matrix G for an easy-to-decode Goppa code to get a matrix that looks as a generalrandom matrix for a linear code for which decoding problem is NP-complete. • An important novel and unique trick is an introduction, in the encoding process, ofa random vector e that represents an introduction of up to t errors - such a numberof errors that are correctable using the given Goppa code and this is the basic trick of the decoding process. • Since P is a permutation matrix eP-1 has the same weight as e. • As already mentioned, McEliece suggested to use a Goppa code with m=10 and t=50. Thisprovides a [1024,524,101]-code. Each plaintext is then a 524-bit string, each cryptotextis a 1024-bit string. The public key is an 524 × 1024 matrix. • Observe that the number of potential matrices S and P is so large that probabilityof guessing these matrices is smaller that probability of guessing correct plaintext!!! • It can be shown that it is not safe to encrypt twice the same plaintext with the samepublic key (and different error vectors). Public-key cryptography

  26. IV054 FINAL COMMENTS • Public-key cryptosystems can never provide unconditional security. This is because an eavesdropper, on observing a cryptotextc can encrypt each posible plaintext bythe encryption algorithm eA until he finds an c such thateA(w)=c. • One-way functions exists if and only if P = UP, whereUP is the class of languages accepted by unambiguouspolynomial time bounded nondeterministic Turing machine. • There are actually two types of keys in practical use: A session key is used forsending a particular message (or few of them). A master key is usually used togenerate several session keys. • Session keys are usually generated when actually required and discarded after their use.Session keys are usually keys of a secret-key cryptosystem. • Master keys are usually used for longer time and need therefore be carefully stored.Master keys are usually keys of a public-key cryptosystem. Public-key cryptography

  27. IV054 SATELLITE VERSION of ONE-TIME PAD • Suppose a satellite produces and broadcasts several random sequences of bits at a rate fast enough that no computer can store more than a small fraction of theoutput. • If Alice wants to send a message to Bob they first agree, using a public key cryptography, on a method of sampling bits from the satellite outputs. • Alice and Bob use this method to generate a random key and they use it withONE-TIME PAD for encryption. • By the time Eve decrypted their public key communications, random streams produced by the satellite and used by Alice and Bob to get the secret key have disappeared, and therefore there is no way for Eveto make decryption. • The point is that satellites produce so large amount of date that Eve cannot • store all of them Public-key cryptography

  28. IV054 Digital signatures • Digital signatures are one of the most important inventions of modern cryptography. • The problem is how can a user sign a message such that everybody (or the intended addressee only) can verify the digital signature and the signature is good enough also for legal purposes. Assume that a public-key cryptosystem is used by users. Signing a message w by a user A so that any user can verify the signature; dA(w) Signing a message w by a user A so that only user B can verify the signature; eB(dA(w)) Sending a message w and a signed message digest of w obtained by using a hash function standardh: (w,dA(h(w))) Example Alice succeeds after 20 years to factor the integer. bob used, as modulus, to sign documents, using RSA, 20 years ago. Even if the key is already expired, she can write Bob's will, leaving fortune to Alice, and date it 20 years ago. Moral: It may pay of to factor a single integers using many years of many computer power. Public-key cryptography

  29. IV054 Digital signatures • If only signature (but not the encryption of the message) are of importance, then it suffices that Alice sends to Bob • (w,dA(w)) • Caution: Signing a messagew by A for B by • eB(dA(w)) • is O.K., bat the symmetric solution with encoding was • c=dA(eB(w)) • is not good. An active enemy, the tamperer, can intercept the message, then compute dT(eB(c))=dT(eA(w)) and send it to Alice, pretending it is from him (without being able to decrypt the message). Any public-key cryptosystem in which the plaintext and cryptotext are the same can be used for digital signature. Digital signatures The main difference from a handwritten signature is that digital signature of a message is intimately connected with the message whereas the handwritten signature is adjoined to the message and always look the same. Public-key cryptography

More Related