1 / 9

Cryptography

Cryptography. Inverses and GCD Piotr Faliszewski. gcd(a, 0) = a gcd(a, b) = gcd(b, a mod b) a = b*q + r Here: q =  a / b  r = a mod b (a – b*q). Key idea express the first argument in terms of the second. GCD(a,b). Let a, n – two integers A number a -1 s.t.

willa
Télécharger la présentation

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. Cryptography Inverses and GCD Piotr Faliszewski

  2. gcd(a, 0) = a gcd(a, b) = gcd(b, a mod b) a = b*q + r Here: q = a / b r = a mod b (a – b*q) Key idea express the first argument in terms of the second GCD(a,b)

  3. Let a, n – two integers A number a-1 s.t. a*a-1= 1 (mod n) is called a multiplicative inverse of a Theorem if gcd(a,b) = d then there are integers x and y s.t.,ax + by = d Multiplicative Inverse

  4. Let a, n – two integers If gcd( a, n ) = 1 then there are integers x,y: ax + ny = 1 then, x is a-1 Note ax + ny = 1 (mod n) ax = 1 (mod n) Theorem if gcd(a,b) = d then there are integers x and y s.t.,ax + by = d Multiplicative Inverse

  5. gcd(a ,b), r0=a, r1 = b gcd( r0, r1 ) r0 = q1r1 + r2 r1 = q2r2 + r3 r2 = q3r3 + r4 ... rk-1 = qkrk + rk+1 rk = qk+1rk+1 +0 Idea: sequences (xi) and (yi) ri = axi + byi build as you go Computing x,y via GCD

  6. gcd(a ,b), r0=a, r1 = b gcd( r0, r1 ) r0 = q1r1 + r2 r1 = q2r2 + r3 r2 = q3r3 + r4 ... rk-1 = qkrk + rk+1 rk = qk+1rk+1 +0 x0 = 1, y0 = 0 x1 = 0, y1 = 1 x2 = x0 - q1x1, y2 = y0 - q1y1 x3 = x1 - q2x2, y3 = y1 - q2y2 x4 = x2 - q3x3, y4 = y2 - q3y3 ... rk+1 = axk+1 + byk+1 xj+1 = xj-1 – qjxj yj+1 = yj-1 – qjyj Computing x,y via GCD

  7. gcd(a ,b), r0=45, r1 = 20 gcd( 45, 20 ) r0 = q1 r1 + r2 45 = 2  20 + 5 r1 = q2  r2 + r3 20 = 4  5 + 0 x0 = 1, y0 = 0 x1 = 0, y1 = 1 x2 = x0 - q1x1, y2 = y0 - q1y1 x2 = 1 – 2  0, y2 = 0 – 2  1 x2 = 1, y2 = -2 r3 = 0  computation ended gcd(45, 20) = 5 = 451 – 220 Example: GCD(45, 20)

  8. gcd(a ,b), r0=19, r1 = 7 gcd( 19, 7 ) 19 = 2  7 + 5 7 = 1  5 + 2 5 = 2  2 + 1 2 = 2  1 + 0 x0 = 1, y0 = 0 x1 = 0, y1 = 1 x2 = 1 – 2  0 = 1 y2 = 0 – 2  1 = -2 x3 = 0 – 1  1 = -1 y3 = 1 – 1  (-2) = 3 x4 = 1 – 2  (-1) = 3 y4 = -2 – 2  (3) = -8 19  3 + 7 (-8) = 57 - 56 = 1 Example: GCD(19, 7)

  9. Problem: Solve 7x = 10 (mod 19) 11  7 = 1 (mod 19) Thus (11  7)x = 11  10 (mod 19) x = 110 (mod 19) x = 15 (mod 19) Getting the inverse via GCD we know that gcd(19, 7) = 1 7*(-8) + 19*3 = 1 -8 is the multiplicative inverse of 7 (mod 19) -8 = 19 - 8 = 11 (mod 19) Solving Linear Congruences

More Related