session3-zhang-paper
session3-zhang-paper
Abstract. We propose a method for integrating NTRUEncrypt into the ntor key exchange protocol
as a means of achieving a quantum-safe variant of forward secrecy. The proposal is a minimal change
to ntor, essentially consisting of an NTRUEncrypt-based key exchange performed in parallel with the
ntor handshake. Performance figures are provided demonstrating that the client bears most of the
additional overhead, and that the added load on the router side is acceptable.
We make this proposal for two reasons. First, we believe it to be an interesting case study into the
practicality of quantum-safe cryptography and into the difficulties one might encounter when transi
tioning to quantum-safe primitives within real-world protocols and code-bases. Second, we believe that
Tor is a strong candidate for an early transition to quantum-safe primitives; users of Tor may be jus
tifiably concerned about adversaries who record traffic in the present and store it for decryption when
technology or cryptanalytic techniques improve in the future.
• DHGen(1λ ) : Let x ←R [1, q − 1], and X = g x . definition captures the idea that the output of a
Outputs the Diffie-Hellman keypair (x, X), where KDF should be indistinguishable from a uniform £
x is the private key and X is the public key. bit string so long as that the conditional min-entropy
• NTRUGen(1λ ) : Outputs an NTRUEncrypt key- of the keying material, given the naturally leaked in
pair (sk, pk) where sk is the secret key and pk is formation, is at least m bits.
the public key. The KDF appearing in our protocol is assumed to
• NTRUEnc(m, pk) : Takes as input a message m ∈ be λ-entropy secure.
M, and an NTRUEncrypt public key pk. Outputs
a ciphertext c.
• NTRUDec(c, sk) : Takes as input a ciphertext c, 2.3 Related work
and an NTRUEncryptsecret key sk. Outputs a
message m ∈ M. From Diffie-Hellman to ntor. Two parties, Alice
and Bob, who have publicly agreed on parameters –
namely a generator g of a group G of prime order q –
Key derivation functions A Key Derivation Func may derive a shared secret in the presence of passive
tion (KDF) [22,1] is a function that takes three inputs eavesdroppers using the Diffie-Hellman protocol [5].
and outputs a string of £ bits. The three inputs are: Alice selects x in [1, q − 1] and sends X = g x to
a sample from a source of keying material, K ∈ K; Bob. Similarly, Bob selects y in [1, q − 1] and sends
a sample from a set of possible salt values, S ∈ S; Y = g y to Alice. They arrive at the common value
and a bitstring specifying additional, or contextual, g xy by computing Y x and X y respectively.
information, I. It is understood that the source from
The security of this protocol requires that the
which the keying material is derived leaks some in
decisional Diffie-Hellman assumption holds for the
formation to the environment1 , so the role of a key
group G. That is, given g, g x , g y ∈ G, the element
derivation function is to ensure that, despite this in
g xy is indistinguishable from an element chosen
evitable leakage, the £ output bits are uniformly ran
uniformly at random from G. This is one of the core
dom.
assumptions of modern cryptography; its apparent
Krawczyk presented an instantiation of a KDF
validity with respect to non-quantum distinguishers
based on a Hash-based Message Authentication Code
for some cyclic groups has enabled many crypto
(HMAC) in [11] and provided a formal definition of
graphic schemes.
security for KDFs called m-entropy security. This
1
For instance, a Diffie-Hellman handshake might use g xy The authenticated version of the Diffie-Hellman
as keying material and leak g x , g y and the group pa protocol presented in Figure 2 was formally analyzed
rameters to the environment. by Shoup in [21], although it was likely known prior
reveal a long-term secret, is not authenticated, and
 : (a, A) B̂ : (b, B) is allowed to remain anonymous. As detailed in Fig
(x, X) ← DHGen(1λ ) (y, Y ) ← DHGen(1λ ) ure 4, the parties derive two shared secrets, the first
σA = Signa (X|B̂) σB = Signb (Y |Â) g xy combines the parties’ short-term key material,
X, σA and the second g bx mixes Alice’s short-term key with
−−−−−−−−→
Y, σB Bob’s long-term key. The latter value ensures that
←−−−−−−−− Alice maintains the ability to authenticate Bob, and
K =Yx K = Xy
the former provides forward secrecy against leakage
of Bob’s long-term key.
Fig. 2. The signed Diffie-Hellman key exchange pro
tocol.
 : B̂ : (b, B)
to that analysis. It is sometimes referred to as the (x, X) ← DHGen(1λ ) (y, Y ) ← DHGen(1λ )
X
signed Diffie-Hellman protocol. −−−−−→
In this protocol each party must produce a signa s1 = X y |X b
ture on their public group element and their peer’s (vk, K) = H1 (s1 |B̂|X|Y )
identity. By verifying Alice’s signature, Bob is con auth = H2 (vk|B̂|Y |X)
vinced that the group element he received has come Y, auth
←−−−−−−−−−
from Alice, and vice versa. s1 = Y x |B x
Signed Diffie-Hellman suffers from several short (vk, K) = H1 (s1 |B̂|X|Y )
comings, the most troubling being that leakage of an ensure auth = Hash1 (vk|B̂|Y |X)
ephemeral key allows an adversary to impersonate
the leaked key’s owner in subsequent sessions.
Fig. 4. The ntor protocol
 : (a, A) B̂ : (b, B)
(x, X) ← DHGen(1λ ) (y, Y ) ← DHGen(1λ ) Key encapsulation mechanisms. Diffie-Hellman
X protocols are far from the only method by which two
−−−−−→
Y
←−−−−−
parties may derive a common key over a public chan
K = Hash(Y a |B x |Â|B̂) K = Hash(Ay |X b |Â|B̂) nel. Among the many alternatives are Key Encapsu
lation Mechanisms (KEMs).