lecture12

# lecture12 - Number theory and Cryptography Lecture...

This preview shows pages 1–5. Sign up to view the full content.

1 Lecture 12 (October 6, 2011) Number theory and Cryptography p-1 p 1 m m e mod (pq) m ( g r , m * h r ) How do you compute… 5 8 First idea: 5 5 2 5 3 5 4 5 5 5 6 5 7 5 8 = 5*5 = 5 2 *5 using few multiplications? How do you compute… 5 8 Better idea: 5 5 2 5 4 5 8 = 5*5 = 5 2 *5 2 = 5 4 *5 4 Used only 3 mults instead of 7 !!! Repeated squaring calculates a 2 k in k multiply operations compare with (2 k 1) multiply operations used by the naïve method How do you compute… 5 13 5 16 too high! what now? assume no divisions allowed… Use repeated squaring again? 5 5 2 5 4 5 8 How do you compute… 5 13 Use repeated squaring again? 5 5 2 5 4 5 8 Note that 13 = 8+4+1 So a 13 = a 8 * a 4 * a 1 Two more multiplies! 13 10 = (1101) 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 To compute a m Suppose 2 k m < 2 k+1 a a 2 a 4 a 8 This takes k multiplies Now write m as a sum of distinct powers of 2 a m = a 2 k * a 2 i1 * … * a 2 it a 2 k . . . say, m = 2 k + 2 i 1 + 2 i 2 … + 2 i t at most k more multiplies Hence, we can compute a m while performing at most 2 log 2 m multiplies How do you compute… 5 13 (mod 11) First idea: Compute 5 13 using 5 multiplies 5 5 2 5 4 5 8 5 12 5 13 = 5 8 *5 4 = 5 12 *5 then take the answer mod 11 = 1 220 703 125 1220703125 (mod 11) = 4 How do you compute… 5 13 (mod 11) Better idea: keep reducing the answer mod 11 5 5 2 5 4 5 8 5 12 5 13 ´ 11 3 ´ 11 9 ´ 11 81 ´ 11 36 ´ 11 15 ´ 11 4 ´ 11 3 ´ 11 4 25 Hence, we can compute a m (mod n ) while performing at most 2 log 2 m multiplies where each time we multiply together numbers with log 2 n + 1 bits How do you compute… 5 121242653 (mod 11) The current best idea would still need about 54 calculations answer = 4 Can we exponentiate any faster?
3 OK, need a little more number theory for this one… Z n = {0, 1, 2, …, n -1} Z n * = {x Z n | GCD(x,n) =1} First, recall… Fundamental lemmas mod n : If (x n y) and (a n b). Then 1) x + a n y + b 2) x * a n y * b 3) x - a n y b 4) cx n cy a n b i.e., if c in Z n * Euler Totient Function Φ (n) Φ (n) = size of Z n * p prime Φ (p) = p-1 p, q distinct primes Φ (pq) = (p-1)(q-1) Fundamental lemma of powers? If (x n y) Then a x n a y ? NO! (2 3 5) , but it is not the case that: 2 2 3 2 5 (Correct) Fundamental lemma of powers. Equivalently, for a Z n * , a x n a x mod Φ (n) If a Z n * and x Φ (n) y then a x n a y

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 How do you compute… 5 121242653 (mod 11) 121242653 (mod 10) = 3 5 3 (mod 11) = 125 mod 11 = 4 Why did we take mod 10? Hence, we can compute a m (mod n ) while performing at most 2 log 2 Φ (n) multiplies where each time we multiply together numbers with log 2 n + 1 bits for a Z n * , a x n a x mod Φ (n) 343281 327847324 mod 39 Step 1: reduce the base mod 39 Step 2: reduce the exponent mod Φ (39) = 24 Step 3: use repeated squaring to compute 3 4 , taking mods at each step NB: you should check that gcd(343281,39)=1 to use lemma of powers
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/03/2011 for the course CS 251 taught by Professor Gupta during the Spring '11 term at Carnegie Mellon.

### Page1 / 11

lecture12 - Number theory and Cryptography Lecture...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online