MATH 470 Lecture 16
« previous | Thursday, March 7, 2013 | next »
Pohlig-Hellman
Recall:
- The security of RSA is based on the (apparent) hardness of integer factoring.
- The security of El Gamal is based on the (apparent) hardness of discrete logarithms.
For El Gamal, you should really only use Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle p} with having at least 1 large factor. Otherwise, you can easily break El Gamal easily via the Pohlig-Hellman method:
input: prime , such that
output:
- factor as
- find an with for all
- Recover from via the Chinese Remainder Theorem.
Main trick to (2) is to expand in base :
Example
Last time, we used a prime with having many small primes and no power greater than 1.
This time, we'll use a prime with having only one prime and a large power:
p = 65537
R = Integers(p)
alpha = R(3)
beta = R(2)
factor(p-1) # => 2^16
- FIND d0 ##
- beta^((p-1)/2) == (alpha^a)^((p-1)/2)
beta^((p-1)/2) # => 1
- (alpha^a)^((p-1)/2) == (3^d0)^((p-1)/2) * (3^(2*d1))^((p-1)/2) * ...
- == (3^((p-1)/2))^d0 * (3^(p-1))^d1 * ...
- == 3^(d0*(p-1)/2) * 1 * 1 * ...
3^((p-1)/2) # => -1
- d0 == 0 since (-1)^d0 == 1
d0 = 0
- FIND d1 ##
- beta = (alpha^d0) * (alpha^d1)^2 * ... * (alpha^d15)^(2^15)
- therefore beta/alpha^d0 == (alpha^d1)^2 * ... * (alpha^d15)^(2^15)
beta/alpha^d0 # => 2
- raise both sides to the (p-1)/2^2 th power
- 2^((p-1)/2^2) == alpha^(2*d1*(p-1)/2^2) * alpha^(2^2*d1*(p-1)/2^2) * ... * alpha^(2^15*d15*(p-1)/2^2)
- == (alpha^((p-1)/2))^d1 * 1 * 1 * ... * 1
R(2)^((p-1)/2^2) # => 1
alpha^((p-1)/2) # => -1
- d1 == 0 since (-1)^d0 == 1
d1 = 0
- FIND d2 ##
- beta/alpha^(d0+2*d1) == alpha^(d2*2^2) * alpha^(d15*2^15)
beta/alpha^(d0+2*d1) # => 2
- raise to (p-1)/2^3 power
- 2^((p-1)/2^3) == alpha^(4*d2*(p-1)/2^3) * 1 * ... * 1
R(2)^((p-1)/2^3) # => 1
alpha^(4*(p-1)/2^3) #=> -1
- d2 == 0 since (-1)^d2 == 1
d2 = 0
- CONTINUE IN SAME WAY ##
- . . .
- a = 55296
Proof Example
Prove Fermat's Little Theorem.
Proposition. Given any and prime , then .
Proof. Consider the numbers , , …, . They are distinct mod since
We can divide by in step 3 since .
So then
If we multiply all elements of these sets, we get
Non-Computational Example
Find such that computing the exact power of 3 dividing is doable in time
Hint: You may assume that multiplying or dividing two numbers no bigger than takes time
Solution: Use binary search
Check if is divisible by 3, 32, 34, etc.
At a certain point, we get , but . Note , so
So checks take .
Suppose . , but is not the highest power dividing .
Replace by
Example: Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n' = \frac{n}{3^{2^4}} = 15}
Note Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n' \le \frac{n}{3}} since Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 3^{2^{j+1}} \nmid n} . Now proceed recursively:
This takes at most Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \log_3{n}} binary searches, and since each binary search takes Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O((\log{\log{n}})\,(\log^2{n}))} time, the total work is:
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O((\log{\log{n}})\,(\log^3{n}))}
Now Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle k = 3 + \epsilon} for any Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \epsilon > 0} since we have that Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \log{\log{n}}} factor.
Moral
Factoring Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n} may take exponential time (in Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \log{n}} ), but computing the unique Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle j} with Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n = p^j \, m} for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle p \nmid m} is doable in polynomial time (in Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \log{n}} ).