SLIDE 1
Playing “Hide-and-Seek” in Finite Fields: Hidden Number Problem and Its Applications
Igor E. Shparlinski
Centre for Advanced Computing: Algorithms and Cryptography Macquarie University igor@comp.mq.edu.au
SLIDE 2 Introduction
We describe a rather surprising, yet powerful, combination of
- exponential sums
- lattice reduction algorithms.
This combination has led to a number of cryp- tographic applications, helping to make rigorous several heuristic approaches. It provides a two edge sword to:
- prove important security results;
- create powerful attacks
SLIDE 3 Examples:
– Diffie–Hellman key exchange system, – Shamir message passing scheme, – XTR cryptosystem, – Rivest–Shamir–Wagner timed-release crypto.
– Digital Signature Scheme (DSA), – Nyberg–Rueppel Signature Scheme.
SLIDE 4
Notation
p = prime number I Fp = finite field of p elements. ⌊s⌋m = the remainder of s on division by m. For ℓ > 0, MSBℓ,p(x) denotes any integer u such that |⌊x⌋p − u| ≤ p/2ℓ+1. MSBℓ,p(x) ≈ ℓ most significant bits of x. However this definition is more flexible. In particular, ℓ need not be an integer.
SLIDE 5 Hidden Number Problem (HNP)
Boneh and Venkatesan, 1996 HNP: Recover α ∈ I Fp such that for many known random t ∈ I Fp we are given MSBℓ,p(αt) for some ℓ > 0. B&V, 1996: a polynomial time algorithm to solve HNP with ℓ ≈ log1/2 p. The algorithm is based on lattice reduction.
Lattices
Let {b1, . . . , bs} be a set of linearly independent vectors in I
L = {z | z =
s
cibi, c1, . . . , cs ∈ Z
Z}
is called an s-dimensional full rank lattice. The set {b1, . . . , bs} is called a basis of L.
SLIDE 6 The closest vector problem
CVP: Given a vector r ∈ I Rs find a lattice vec- tor v ∈ L with r − v = min
z∈L r − z.
CVP is NP-complete. Approximate solution? Lenstra, Lenstra and Lov´ asz, 1982 Kannan, 1987 Schnorr, 1987 Lemma 1 There exists a deterministic polyno- mial time algorithm which, for a given lattice L and a vector r ∈ I Rs, finds a lattice vector v ∈ L satisfying the inequality r − v ≤ exp
log s
z∈L r − z.
for some absolute constant C > 0. LLL: stretch factor 2s/2 (can be used as well) Working with 2o(s) is technically easier
SLIDE 7 HNP and CVP — B&V, 1996
Let d ≥ 1 be integer. Given ti, ui = MSBℓ,p(αti), i = 1, . . . , d, we build the lattice L(p, ℓ, t1, . . . , td) spanned by the rows of the matrix:
p . . . p ... . . . . . . . . . ... ... . . . . . . p t1 t2 . . . td 1/2ℓ+1
. The unknown vector v = (⌊αt1⌋p, . . . , ⌊αtd⌋p, α/2ℓ+1)
- belongs to L(p, ℓ, t1, . . . , td)
- is close to the known vector u = (u1, . . . , ud, 0):
v − u = O
. Idea: Apply a CVP algorithm and hope that it will output v.
SLIDE 8 How to make it rigorous? We show that for almost all t1, . . . , td, v is the
- nly lattice vector which can be so close to u.
In fact, even within the approximation factor of Lemma 1, that is within the distance of order p2−ℓ+o(d), this is still the only lattice vector. Assume that w ≡ (βt1, . . . , βtd, β/2ℓ+1) (mod p), with β ≡ α (mod p) is another lattice vector with w − u ≤ p2−ℓ+o(d). Then w − v ≤ p2−ℓ+o(d). (1) Therefore for each i = 1, . . . , d (α − β)ti ∈ [−p2−ℓ+o(d), p2−ℓ+o(d)] (mod p) For every fixed γ ≡ 0 (mod p) Pr
t∈I Fp (γt ∈ [−h, h]
(mod p)) ≤ 2h + 1 p (2)
SLIDE 9 Thus Pr
t1,...,td∈I Fp (γti ∈ [−h, h]
(mod p), i = 1, . . . , d) ≤
p
d
. In our settings γ = α − β and h = p2−ℓ+o(d). Because β (and thus γ = α − β) may belong to p−1 distinct residue classes we conclude that (1) holds with probability at most P ≤ p
Choose ℓ = d = 2
P ≤ 1 p. CVP algorithm returns v with prob. ≥ 1 − 1/p
SLIDE 10 Extended HNP
HNP: Recover α ∈ I Fp such that for many known random t ∈ I Fp we are given MSBℓ,p(αt) for some ℓ > 0. The condition that t is selected uniformly at ran- dom from I Fp is too restrictive for applications. Typically t is selected from a certain finite se- quence T of elements of I Fp which
- may have a nice and well-studied number the-
- retic structure (bit security of Diffie–Hellman
key),
- may be rather “ugly” looking (attacks on
DSA and Nyberg–Rueppel). EHNP: Recover α ∈ I Fp such that for many known random t ∈ T we are given MSBℓ,p(αt) for some ℓ > 0. The same arguments as above apply to the EHNP . . . but one needs an analogue of (2). ⇓ T must have some uniformity of distribution properties.
SLIDE 11 Distribution of Sequences
Discrepancy D(Γ) of an N-element sequence Γ = {γ1, . . . , γN} of elements of the interval [0, 1] is defined as sup
J⊆[0,1]
N − |J|
where |J| is the length of the interval J and A(J, N) = # {γn ∈ J, 1 ≤ n ≤ N}. A finite sequence T of integers is ∆-homogeneously distributed modulo p (∆-HDp) if for any a ∈ [1, p − 1], {⌊at⌋p/p}, t ∈ T , has the discrepancy at most ∆.
SLIDE 12 Putting Together
For a ∆-HDp sequence T instead of (2) we get Pr
t∈T (γt ∈ [−h, h]
(mod p)) ≤ 2h + 1 p + ∆. Nguyen&Shparlinski, 2000: Theorem 2 Let ℓ = ⌈log1/2 p⌉ + ⌈log log p⌉ and d = 2
- log1/2 p
- . Let T be 2− log1/2 p-HDp. There
exists a deterministic polynomial time algorithm A such that for any fixed integer α ∈ [0, p − 1], given 2d integers ti and ui = MSBℓ,p (αti) , i = 1, . . . , d, its output satisfies Pr
t1,...,td∈T [A (t1, . . . , td; u1, . . . , ud) = α]
≥ 1 − 2−(log p)1/2 log log p if t1, . . . , td are chosen uniformly and indepen- dently at random from the elements of T .
SLIDE 13 Discrepancy and Exponential Sums
Polya–Vinogradov, 1918: T is ∆-HDp with ∆ = O
log p
#T max
1≤c≤p−1
exp (2πict/p)
.
To use it we need an improvement up on the trivial bound
exp (2πict/p)
In many situatuions we have such resuslt which are quite enough . . . but what if only a very weak bound of the above esponential sums is know?
SLIDE 14 Using Very Weak Bounds
Shparlinski&Winterhof, 2003: We can amplify it but considering k-sums {t1 + . . . + tk | t1, . . . , tk ∈ T }. The discrepancy of this sequence: ∆k = O
log p
#T max
1≤c≤p−1
exp (2πict/p)
.
Any nontrvial saving γ against the trivial bound
exp (2πict/p)
will be risen to the kth power!
SLIDE 15 Important Example Konyagin, 1992: For any 1 > ε > 0 there exists a constant c(ε) > 0 such that for any subgroup G ⊆ I F∗
p of order
T ≥ log p (log log p)1−ε the bound max
gcd(λ,p)=1
ep (λr)
c(ε) (log p)1+ε
Konyagin&Shparlinski, 1999: For larger subgroups stronger bounds are known.
SLIDE 16 Modifications to the Algorithm
Chose t11, . . . , t1k, . . . , td1, . . . , tdk ∈ G and get integers uij with
i = 1, . . . , d, j = 1, . . . , k. For i = 1, 2, . . . , d we put vi =
k
ti =
k
tij
p
, ui =
k
uij The rest of the algorithm remains the same.
SLIDE 17
Good News: Bit Security of the Diffie–Hellman Key
Diffie–Hellman (DH) problem: Given an element g of order τ modulo p, recover K = ⌊gxy⌋p from ⌊gx⌋p and ⌊gy⌋p. Typically, either τ = p−1 or τ = q – a large prime divisor of p − 1 The size of p and τ is determined by the present state of art in the discrete logarithm problem. Typically, p is about 500 bits, τ is at least 160 bits. However after the common DH key K = gxy is established, only a small portion of bits of K will be used as a common key for some private key cryptosystem.
SLIDE 18 Assume that finding K is infeasible. Is it still infeasible to find certain bits of K? Private Key | Public Key Boneh&Venkatesan, 1996: for τ = p − 1 (- small gap in the proof) Gonz´ alez Vasco&Shparlinski, 2000: for “any” τ (+ fixing the gap in BV) YES!!! Assume we know how to recover ℓ most signif- icant bits of ⌊gxy⌋p from from X = ⌊gx⌋p and Y = ⌊gy⌋p. Select a random u ∈ [0, τ − 1] and apply this al- gorithm to X = ⌊gx⌋p and U = ⌊Y gu⌋p =
p:
MSBℓ,p
= MSBℓ,p (gxygxu) = MSBℓ,p (αt) EHNP with α = gxy and t = gxu, u ∈ [0, τ − 1]!!!
SLIDE 19
When γu is 2− log1/2 p-HDp? (γ = gx) Shparlinski& Winterhof, 1999: Theorem 3 For any ε > 0 there exists c > 0 such that for k = c log2 p any γ ∈ I Fp of order τ ≥ (log p)1+ε the sequence Tk = {γu1 + . . . + γuk, u1, . . . , uk = 0, . . . , τ − 1} is p−δ-HDp. If p is an n-bit prime and τ ≥ (log p)1+ε then ≈ n1/2 most significant bits of the DH key are as secure as the whole key.
SLIDE 20
What Else?
Similar results for the Shamir message passing scheme (has not been worked out in details). Shparlinski, 2000: Li, N¨ aslund, Shparlinski, 2002: Similar results for the XTR cryptosystem of Lenstra&Verheul Galbraith&Hopkins&Shparlinski, 2003: Similar results for the bilinear Diffie-Hellman bits In both case but for much large ordes. Open Question: Extend the range.
SLIDE 21 Bad News: Attack on DSA
DSA: Proposed NIST, August 1991; US Federal Information Processing Standard 186, May 1994 Public Data: q and p = primes with q|p − 1 g ∈ I Fp = a fixed element of order q. M = set of messages to be signed h : M → I Fq = a hash-function. The secret key is α ∈ I F∗
q which is known only
to the signer (and publishes A = ⌊gα⌋p – to be used for signature verification). To sign a message µ ∈ M, the signer chooses a random integer k ∈ I F∗
q usually called the nonce,
and which must be kept secret and computes: r(k) =
p
, s(k, µ) =
(r(k), s(k, µ)) is the DSA signature of the mes- sage µ with a nonce k.
SLIDE 22 Assume that some bits of k are “leaked”. Howgrave-Graham&Smart, 1998: Heuristic lattice based attack. Nguyen, 1999: Simpler and more powerful but still heuristic lat- tice based attack. Nguyen&Shparlinski, 1999: Rigorous lattice based attack. Idea (Nguyen, 1999): s(k, µ) ≡ k−1 (h(µ) + αr(k)) (mod q) ⇓ α r(k)s(k, µ)−1 ≡ k − h(µ)s(k, µ)−1 (mod q). If ℓ most significant bits of k are known then we know MSBℓ,q
. EHNP with t(k, µ) =
q,
(k, µ) ∈ [1, q −1]×M.
SLIDE 23 Nguyen&Shparlinski, 1999: W = # {h(µ1) = h(µ2), µ1, µ2 ∈ M}. W/#M2 = probability of collision. Typically W/|M|2 ≈ q−1 . Theorem 4 Let Q be a sufficiently large inte-
- ger. The following statement holds with ϑ = 1/3
for all primes p ∈ [Q, 2Q], and with ϑ = 0 for all primes p ∈ [Q, 2Q] except at most Q5/6+ε of
- them. For any ε > 0 there exists δ > 0 such that
for any g ∈ I Fp of order q ≥ pϑ+ε the sequence t(k, µ) =
q,
(k, µ) ∈ [1, q −1]×M. is q−δ-HDq, provided W ≤ #M2 q1−δ .
SLIDE 24 Theoretically: If q is an n-bit prime and ≈ n1/2 most significant bits of k are known for ≈ n1/2 signatures then α can be recovered in polynomial time. The proof uses:
- bounds of exponential sums with exponential
functions (Konyagin&Shparlinski, 1999);
- Weil’s bound;
- Vinogradov’s method of estimates of double
sums. Main difficulty: The double reduction errases any number theoretric structure among the val- ues of r(k). Practically: 4 bits of k are always enough, 3 bits are often enough, 2 bits are possibly enough as well.
SLIDE 25 Moral:
- 1. Do not use small k (to cut the cost of expo-
nentiation in r(k)).
- 2. Protect your software/hardware against tim-
ing/power attacks when the attacker mea- sures the time/power consumption and se- lects the signatures for which this value is smaller than “on average” – these signatures are likely to correspond to small k (∼ faster exponentiation in r(k)).
- 3. Use quality PRNG’s to generate k, biased
generators are dangerous.
- 4. Do not use Arazi’s cryptosystem which com-
bines DSA and Diffie-Hellman protocol – it leakes some bits of k (Brown & Menezes).
- 5. Do not buy CryptoLib from AT&T, it always
uses odd values of k thus one bit is leaked immediately, one more and . . . .
SLIDE 26 Generalizations and Open Prob- lems
Complete analogue of the bit security results for the DH key are also known ElGamal cryptosys- tem, Shamir message passing scheme and several
For XTR some non-trivial results are know as well (Li, N¨ aslund, Shparlinski, 2002). Attacks on other DSA-like schemes, including the elliptic curve DSA, of the same strength as on the original DSA (ElMahassni, Nguyen, Shparlin- ski, 2000–2001). For the Nyberg–Rueppel scheme the range of p and q in which the results are nontrivial are nar- rower than in practical applications. Improve??? . . . Better bounds of exponential sums are re- quired.