Prevention of Exponential Equivalence in Simple Password Exponential Key Exchange (SPEKE)

: Simple Password Exponential Key Exchange (SPEKE) and Dragonﬂy are simple password-based authenticated key exchange protocols that use a value derived from a shared password as a generator for modular exponentiation, as opposed to Difﬁe–Hellman key exchange, which uses a ﬁxed value. However, it has been shown that in SPEKE, an active attacker, can examine multiple passwords in a single attempt because the passwords have an exponential correlation. We show that Dragonﬂy can also suffer from the same problem, and we propose a simple countermeasure to prevent the exponential equivalence in SPEKE


Introduction
Password-Authenticated Key Exchange (PAKE) is an authenticated key exchange protocol between two or more parties that share only a human-memorable password without depending on any third party and communicating only via an insecure network.Because the password dictionary is sufficiently small, PAKE protocols are designed with the assumption that an attacker can enumerate all the possible passwords off-line within a reasonable time.The intention of PAKE protocols is to prevent off-line guessing attack.They are considered to be safe when an exhaustive search is the only available means of attack.
Simple Password Exponential Key Exchange (SPEKE), proposed by Jablon [1], and Dragonfly, proposed by Harkins [2], are well-known PAKE protocols.These protocols are similar to Diffie-Hellman key exchange except that they use a value derived from a shared password as a generator for exponentiation, instead of a fixed value.Such a characteristic makes these protocols seem simpler yet more efficient than other PAKE protocols.However, in 2004, Zhang showed that an active attacker can try multiple passwords in a single attempt by exploiting the exponential equivalence of the passwords in SPEKE [3].Furthermore, in 2005, Tang and Mitchell identified other security vulnerabilities such as unknown key-share attack and generic attack as well as the exponential equivalence problem [4].Subsequently, in 2014, Hao and Shahandashti showed that SPEKE can suffer from impersonation attack and key-malleability attack [5] and Clark and Hao showed that Dragonfly can suffer from a small subgroup attack [6].
The above-mentioned vulnerabilities except the exponential equivalence problem can be addressed in SPEKE by modifying the key confirmation process [4,5] and in Dragonfly by checking that the received element is a member of the supergroup [6].A possible solution to the exponential equivalence problem is hashing passwords, as in the case of the revised version of SPEKE, which makes it difficult for an attacker to guess the password [7].However, this approach does not overcome the essential problem, because the exponential equivalence of passwords persists even after the passwords are hashed.Hao and Ryan claimed that there is no guarantee that an attacker is unable to formulate exponential relationships among hashed passwords; no existing hash function is designed for that purpose [8].
In this paper, we show that Dragonfly can also suffer from the exponential equivalence problem, and we propose a simple solution that can prevent password-guessing attacks based on the exponential equivalence of passwords in the SPEKE protocol.

The SPEKE Protocol
Let p be a safe prime, p = 2q + 1, where q is also a prime.SPEKE is defined over a subgroup of Z * p of prime order q.Assume that two parties, Alice and Bob, share a common password π and want to exchange a password-authenticated key.SPEKE defines a function f to map the password π to a generator, i.e., f (π) = π 2 mod p in the original SPEKE [1] or f (π) = (h(π)) 2 mod p in the revised version of SPEKE [7], where h is a cryptographic hash function (e.g., SHA-256).Let g denote the generator corresponding to π, i.e., g = f (π).The squaring of π or h(π) ensures that the generator g does not fall into the small subgroup of order two, which contains {1, p − 1}.
SPEKE is exactly the same as Diffie-Hellman key exchange except that it uses a value derived from π as a generator for exponentiation.The details of fully constrained SPEKE are as follows: 1. Alice → Bob: Send A = g a mod p, where a is randomly selected in Z * q .2. Alice ← Bob: Send B = g b mod p, where b is randomly selected in Z * q .3. Alice & Bob: Compute K = B a mod p and K = A b mod p, respectively.Now, Alice and Bob share the secret K = g ab mod p.
Alice and Bob confirm that they are sharing the same secret K.For this purpose, Alice and Bob exchange validation values V A , V B , and validate them.A hash function is used to generate the values.The details are as follows:

The Dragonfly Protocol
Although Dragonfly, based on discrete logarithm cryptography, can be implemented either on a finite field or on an elliptic curve, in this paper we deal with the protocol operated on a finite field.
Let p be a large prime of the form p = rq + 1, where r and q relatively prime.Dragonfly is defined over a finite cyclic group Q, which is a subgroup of Z * p of prime order q.Assume that two parties, Alice and Bob, share a common password π and want to exchange a password-authenticated key.Dragonfly defines two functions f and h 1 to map the identities of the two participants and the shared password π to a generator, i.e., f (Alice, Bob, π) = (h 1 (Alice, Bob, π)) r mod p.The functions can be briefly represented as f : {0, 1} * → Q and h 1 : {0, 1} * → Z * p , respectively.(For more details, see [2].)Let g denote the generator, i.e., g = f (Alice, Bob, π).
The Dragonfly protocol works as follows: 1. Alice→Bob: Send A = g −a 1 mod p and a = (a 1 + a 2 ) mod q, where a 1 and a 2 are randomly selected in Z * q .Alice←Bob: Send B = g −b 1 mod p and b = (b 1 + b 2 ) mod q, where b 1 and b 2 are randomly selected in Z * q .2. Alice & Bob: Compute K = (g b • B) a 2 mod p and K = (g a • A) b 2 mod p, respectively.Now, Alice and Bob share the secret K = g a 2 b 2 mod p.

Alice → Bob: Send
4. Alice & Bob: Verify V A and V B , respectively.

Exponential Equivalence in SPEKE
In this subsection, we review the problem identified by Zhang, i.e., a single on-line attempt can scan through all the exponentially equivalent passwords [3].First, if p is a large safe prime, then for arbitrary given b, it is extremely difficult to find an integer x that satisfies the following equation: However, if mod p is not present, this equation can be converted into a simple equation that yields log a b.As such, we can say that two elements, b 1 = a x 1 and b 2 = a x 2 , where a, b 1 , b 2 ∈ Z * p , are exponentially equivalent, and the set of exponentially equivalent elements is identified as the exponential equivalence class.For example, among the numbers less than 100, the exponential equivalence classes are as follows: Now, let us consider how every element can be examined at once in the SPEKE protocol.Assume that the outputs of the mapping function f for j passwords from π 1 to π j are exponentially equivalent with a base m.The actual class in SPEKE is where the exponent e i for each i ∈ {1, 2, ..., j}, is an integer greater than or equal to 1.An active attacker, Eve, masquerading as Alice, generates a random a and sends A to Bob when A = m a mod p is calculated.Bob generates a random b and sends B and V B to Eve when B = (f (π)) b mod p, K = (A ) b mod p, and V B = h(h(h(K ))) are calculated.On receiving B and V B from Bob, Eve terminates the protocol and for each i, 1 ≤ i ≤ j, computes If V i is the same as V B received from Bob, then the guessed password π i is the same as π, which means that it is correctly guessed: To prevent an exponential equivalence attack in SPEKE, Tang and Mitchell suggested that the function f be modified as f (π) = h(π||ID A ||ID B ||i) mod p, where i (i ≥ 0) is the smallest integer that makes g a generator of a multiplicative subgroup of order q in Z * p .However, there is no difference between the function proposed by Tang and Mitchell and the function f (π) = (h(π)) 2 mod p in the revised version of SPEKE [7] from the viewpoint of preventing an exponential equivalence attack.
Furthermore, exponential equivalence among hash outputs has no effect on the security of hash-based protocols other than SPEKE or Dragonfly, which use a generator derived from hashing a shared password.

Exponential Equivalence in Dragonfly
In this subsection, we show the exponential equivalence problem in the Dragonfly protocol.A single on-line attempt can scan through all the exponentially equivalent passwords.
Assume that the outputs of the mapping function f for j passwords from π 1 to π j are exponentially equivalent with a base m.The actual class in Dragonfly is where the exponent e i for each i ∈ {1, 2, ..., j}, is an integer greater than or equal to 1.An active attacker, Eve, masquerading as Alice, generates two random a 1 and a 2 , and sends A and a to Bob when A = m −a 1 mod p and a = (a 1 + a 2 ) mod q are calculated.Bob also generates two random b 1 and b 2 , and sends B and b to Eve when B = (f (Alice, Bob, π)) −b 1 mod p and b = (b 1 + b 2 ) mod q are calculated.On receiving A and a from Eve, Bob computes K = ((f (Alice, Bob, π)) a • A ) b 2 mod p and send V B = h(K ||B||b||A ||a ) to Eve.
On receiving B and V B from Bob, Eve terminates the protocol and for each i, 1 ≤ i ≤ j, computes If V i is the same as V B received from Bob, then the guessed password π i is the same as π, which means that it is correctly guessed:

Prevention of Exponential Equivalence in SPEKE
In this section, we present a simple solution for preventing an attacker from guessing multiple passwords in a single on-line attempt based on exponential equivalence of the passwords in the SPEKE protocol.
Our approach is based on the property that there is no exponentially equivalent element when twice the minimum element is greater than the maximum element within a given set.Similarly, this approach can be applied to SPEKE by modifying the password-mapping function f by prefixing fixed bits to the output of the hash function h.Theorem 1.Let h : {0, 1} * → {0, 1} be a function that maps an input of arbitrary length to an output of fixed length .Let p be a safe prime, p = 2q + 1 where q is also a prime.There is no exponentially equivalent element among all the outputs of f (x) over a subgroup of Z * p of prime order q satisfying where k is any integer satisfying 3 ≤ k ≤ p 2 − 1 and k = q − 1 2 .
Proof.From the given condition 0 ≤ h(x) < 2 , we can derive the following equations.
For a base c, two successive elements of an exponential equivalence class should be c i and c i+1 .To ensure that no exponentially equivalent element can be found, the maximum value of f (x) must be less than c times the minimum value for all c.
Since c ≥ 2, if c = 2 is satisfied, it is satisfied for all c: The modular square is symmetric with respect to half of modulus p.Therefore, to prevent output duplication, the domain of definition of the modular square, or the range of h Because ( 2) and ( 4) are the codomain and range of h(x) + k • 2 , respectively, the following equation is established: From ( 3) and ( 5), when (1) is satisfied, no exponentially equivalent element is found in f (x).
For the 112-bit security level, the sizes of p, q and 2 should be greater than or equal to 2048, 2047 and 224 bits, respectively [9].

Discussion
Our solution for preventing exponential equivalence cannot be applied directly over a subgroup in which modulus p is not a safe prime, such as in Dragonfly.To make a generator of a subgroup, exponentiation with exponent r, i.e., f (x) = (h(x) + k • 2 ) r , is needed.Because r is very large, e.g., an 896-bit integer corresponding to a 1024-bit modulus, subsequently most of outputs of f (x) will exceed p.We reserve this problem for future research.

Conclusions
In this paper, we showed that an active attacker can try multiple passwords in a single attempt by exploiting the exponential equivalence of the passwords in Dragonfly as well as in SPEKE.Furthermore, we proposed and proved a simple solution for preventing this problem in the SPEKE protocol.Our solution can be easily applied to variants of the Diffie-Hellman protocol (e.g., the B-SPEKE protocol) that use a safe prime modulus and do not use a fixed generator.