Ring learning with errors key exchange: Difference between revisions

Content deleted Content added
Yobot (talk | contribs)
m Removed invisible unicode characters + other fixes, replaced: →, added orphan tag using AWB (11125)
Rewrote the Lead according to the information provided by the reviewer. Shortened the name of the key exchange to RLWE-KEX.
Line 5:
}}
 
In [[Cryptography]] a [[key exchange|public key exchange]] is a [[cryptographic algorithm]] which allows two parties to create and share a secret key which they use to encrypt messages between themselves. The Ring Learning with Errors Key Exchange (RLWE-KEX) is one of a new class of public key exchange algorithms that are designed to be secure against an adversary that possesses a [[quantum computer]]. This is important because all of the [[public key algorithm|public key algorithms]] in use today are easily broken by a quantum computer and scientists are making steady progress toward creating such a computer. The RLWE-KEX is one of a set of [[Post-quantum cryptography|Post Quantum cryptographic]] algorithms being which are based on the difficulty of solving mathematical certain mathematical problems involving [[Lattice-based cryptography|lattices]]. Unlike older lattice based cryptographic algorithms, the RLWE-KEX is provably reducible to a known hard problem in lattices.
[[Cryptography]] is the art and science of secret writing; the task of transmitting secret messages through insecure channels in a manner such that no one but the intended recipient can read the transmitted message. In the 20th century, [[cryptography]] has become the subject of intense interest by governments, companies, and individuals eager to send and receive secret messages over vast communications networks spanning the globe. It involves the mathematics of taking computer generated bit streams which encode information and transforming them using a computer algorithm and a [[secret key]] into encrypted information. The encrypted information is sent over a communications channel to an intended recipient. If the intended recipient has the same secret key and the same computer algorithm, they can transform the encrypted information back into it's original state (plaintext). This article is about one way a sender of information and its intended recipient can produce a shared secret, that is, a secret that only they know.
 
This article focuses on a particular set of cryptographic [[computer algorithms]] called public [[key exchange]] algorithms. In these algorithms a sender ("Initiator" of the key exchange) and the intended recipient ("Responder in the key exchange) each generate random information and combine this information with fixed and known information to form a public key. The sender and intended recipient then exchange public keys. Each party then uses the received public key and their random information in an algorithm to produce what is generally called a shared secret. The classic example of a key exchange is something known as the [[Diffie–Hellman key exchange|Diffie-Hellman key exchange]]. This article discusses a different key exchange that has many of the same properties as the [[Diffie–Hellman key exchange|Diffie-Hellman key exchange]].
 
The motivation for this different key exchange and for this article is the ability of a quantum computer to break the key exchange algorithms used today to secure the internet. Whether its logging on to a social media site or remotely connecting to an office over the internet some form of public key exchange is used. A [[Quantum computing|quantum computer]], if it can be built, will render the currently used algorithms insecure. This article is about one approach to remedy this problem and protect internet security from potential advances in quantum computers.
 
== Background ==
Since the 1980s the security of cryptographic [[key exchange]]<nowiki/>s and [[digital signature]]<nowiki/>s over the internet has been primarily based on a small number of [[public key]] algorithms. The security of these algorithms is based on a similarly small number of computationally hard problems in classical computing. These problems are the difficulty of [[Integer factorization|factoring the product of two carefully chosen prime numbers]], the difficulty to compute [[discrete logarithms]] in a carefully chosen finite field, and the difficulty of computing discrete logarithms in a carefully chosen [[elliptic curve]] group. These problems are very difficult to solve on a classical computer (the type of computer the world has known since the 1940's through today) but are rather easily solved by a relatively small [[Quantum computing|quantum computer]] using only 5 to 10 thousand of bits of memory. As of 2015 no one has built a quantum computer with even 50-bits of memory but there is optimism in the computer industry that larger scale quantum computers will be available in the next 15 years. If a [[quantum computer]] of sufficient size were built, all of the public key algorithms based on these three classically hard problems would become extremely insecure. This public key cryptography is used today to secure internet websites, protect computer login information, and prevent our computers from accepting malicious software. A quantum computer would undermine the security of these functions and of electronic commerce and data exchange in general.
 
Cryptography that is not susceptible to attack by a quantum computer is referred to as [[Post-quantum cryptography|Quantum Safe]], or [[Post-quantum cryptography|Post-Quantum cryptography]]. One class of quantum resistant cryptographic algorithms is based on a concept called "[[Learning with errors]]" introduced by Oded Regev in 2005.<ref>{{Cite journal|title = On Lattices, Learning with Errors, Random Linear Codes, and Cryptography|url = http://doi.acm.org/10.1145/1060590.1060603|publisher = ACM|journal = Proceedings of the Thirty-seventh Annual ACM Symposium on Theory of Computing|date = 2005|___location = New York, NY, USA|isbn = 1-58113-960-8|pages = 84–93|series = STOC '05|doi = 10.1145/1060590.1060603|first = Oded|last = Regev}}</ref> A specialized form of Learning with errors operates within the [[Polynomial ring|Ring of Polynomials]] over a [[Finite field|Finite Field]]. This specialized form is called Ring Learning with Errors or [[Ideal lattice cryptography|Ring-LWERLWE]].
 
There are a variety of cryptographic algorithms which work using the Ring-LWERLWE paradigm. There are [[Public-key cryptography|public key encryption]] algorithms, [[homomorphic encryption]] algorithms, and [[Digital Signature Algorithm|digital signature]] algorithms in addition to the public key, key exchange algorithm presented in this article
 
A [[key exchange algorithm]] is a type of public key algorithm which establishes a shared secret key between to communicants on a communications link. The classic example of a key exchange is the [[Diffie–Hellman key exchange|Diffie-Hellman]] key exchange. The exchange consists of one transmission from one end of the line and one transmission from the other end of the link. [[Diffie–Hellman key exchange|Diffie-Hellman]] and [[Elliptic curve Diffie–Hellman|Elliptic Curve Diffie-Hellman]] are the two most popular key exchange algorithms.
 
The Ring-LWERLWE Key Exchange is designed to be a "[[Quantum Safe Cryptography|quantum safe]]" replacement for the widely used [[Diffie-Hellman]] and [[Elliptic Curve Diffie-Hellman]] key exchanges that are used to secure the establishment of secret keys over untrusted communications channels. Like Diffie-Hellman and Elliptic Curve Diffie-Hellman, the Ring-LWE key exchange presented in this article provides a cryptographic property called "[[forward secrecy]]"; the aim of which is to reduce the effectiveness of [[mass surveillance]] programs and ensure that there are no long term secret keys that can be compromised that would enable bulk decryption.
 
== Introduction ==
Starting with a [[Prime number|prime]] integer q, the Ring-LWE key exchange works in the [[ring of polynomials]] modulo a polynomial Φ(x) with coefficients in the field of integers mod q (i.e. the ring F<sub>q</sub>[x]/Φ(x) ). Multiplication and addition of polynomials will work in the usual fashion with results of a multiplication reduced mod g(x). This article will closely follow the Ring-LWERLWE work of Peikert in "Lattice Cryptography for the Internet" as further explained by Singh.<ref name=":0">{{Cite book|title = Lattice Cryptography for the Internet|url = http://link.springer.com/chapter/10.1007/978-3-319-11659-4_12|publisher = Springer International Publishing|date = 2014|isbn = 978-3-319-11658-7|pages = 197–219|series = Lecture Notes in Computer Science|first = Chris|last = Peikert|editor-first = Michele|editor-last = Mosca}}</ref><ref name=":1">{{Cite journal|title = A Practical Key Exchange for the Internet using Lattice Cryptography|url = http://eprint.iacr.org/2015/138|date = 2015|first = Vikram|last = Singh}}</ref> For this presentation a typical polynomial is expressed as:
 
a(x) = a<sub>0</sub> + a<sub>1</sub>x + a<sub>2</sub>x<sup>2</sup> + ... + a<sub>n-3</sub>x<sup>n-3</sup> + a<sub>n-2</sub>x<sup>n-2</sup> + a<sub>n-1</sub>x<sup>n-1</sup>
Line 29 ⟶ 25:
The coefficients of this polynomial, the a<sub>i</sub>'s, are integers mod q. The polynomial Φ(x) will be Φ(x) = x<sup>n</sup> +1 where n is a power of 2 (values for n = 256, 512, or 1024 are usually referenced in the academic literature).
 
The RingRLWE-LWE key exchangeKEX uses polynomials which are considered "small" with respect to a measure called the "[[infinity norm]]." The infinity norm for a polynomial is simply the value of the largest coefficient of the polynomial when the coefficients are considered as integerselements inof (Zthe viceset Z{-(q-1)/qZ2,..., 0, ... (q-1)/2}. The algorithm's security will depend on an ability to generate random polynomials which are small with respect to the infinity norm. This is done simply by randomly generating the coefficients for a polynomial (s<sub>n-1</sub>, ..., s<sub>0</sub>) which are guaranteed or very likely to be small. There are two common ways to do this:
# Using [[Uniform distribution (discrete)|Uniform Sampling]] - The coefficients of the small polynomial are uniformly sampled from a set of small coefficients. Let b be an integer that is much less than q. If we randomly choose coefficients from the set: { -b, -b+1, -b+2. ... -2, -1, 0, 1, 2, ... , b-2, b-1, b} the polynomial will be small with respect to the bound (b). Singh suggest using b = 5.<ref name=":1" /> Thus coefficients would be chosen from the set { q-5, q-4, q-3, q-2, q-1, 0 , 1, 2, 3, 4, 5 }.
# Using [[Gaussian distribution|Discrete Gaussian]] Sampling - For an odd value for q, the coefficients are randomly chosen by sampling from the set { -(q-1)/2 to (q-1)/2 } according to a discrete gaussianGaussian distribution with mean 0 and distribution parameter σ. The references describe in full detail how this can be accomplished. It is more complicated than uniform sampling but it allows for a proof of security of the algorithm. An overview of gaussianGaussian sampling is found in a presentation by Peikert.<ref>{{Cite web|title = http://www.cc.gatech.edu/~cpeikert/pubs/slides-pargauss.pdf|url = http://www.cc.gatech.edu/~cpeikert/pubs/slides-pargauss.pdf|website = www.cc.gatech.edu|accessdate = 2015-05-29}}</ref>
For the rest of this article, the random small polynomials will be sampled according do a distribution which is simply be specified as '''D'''. Further q will be an odd prime such that q is congruent to 1 mod 4 and 1 mod 2n. The maximum degree of the polynomials (n) will be a power of 2. This follows the work of Singh.<ref name=":1" /> Other cases for q and n are thoroughly discussed in "A Toolkit for Ring-LWE Cryptography."<ref name=":2" /> A fixed public polynomial, a(x), shared by all users of the network. It is deterministically generated from a cryptographically secure source.
 
== The Key Exchange ==
The key exchange will take place between two devices. There will be an initiator for the key exchange designated as (I) and a responderrespondent designated as (R). Both I and R know, q, n, a(x), and have the ability to generate small polynomials according to the distribution '''D'''. The description which follows does not contain any explanation of why the key exchange results in the same key at both ends of a link. Rather, it succinctly specifies the steps to be taken. For a thorough understanding of why the key exchange results in the initiator and responder having the same key, the reader should look at the referenced works by Peikert and Singh.<ref name=":0" /><ref name=":1" />
 
The key exchange begins with the initiator (I) doing the following:
Line 43 ⟶ 39:
# Compute t<sub>I</sub>(x) = a(x)·s<sub>I</sub>(x) + e<sub>I</sub>(x).
# The initiator sends the polynomial t<sub>I</sub>(x) to the Responder.
'''ResponderRespondent's Steps:'''
# Generate two small polynomials s<sub>R</sub>(x) and e<sub>R</sub>(x) by sampling from the distribution D.
# Compute '''v(x) =''' '''t<sub>I</sub>(x)·s<sub>R</sub>(x) + e<sub>R</sub>(x)''' ''Note that v(x) = a(x)s<sub>I</sub>(x)s<sub>R</sub>(x) + e<sub>I</sub>(x)s<sub>R</sub>(x) + e<sub>R</sub>(x) and that e<sub>R</sub>(x) + e<sub>I</sub>(x)s<sub>R</sub>(x) will be small because e<sub>R</sub>(x) was chosen to be small and the coefficients of e<sub>I</sub>(x)s<sub>R</sub>(x) will be bounded in their growth and still relatively small.''
Line 55 ⟶ 51:
# Form an n-long "reconciliation" bit string (c) as the concatenation of c<sub>n-1</sub>, ..., c<sub>0</sub>.
# Compute t<sub>R</sub>(x) = a(x)·s<sub>R</sub>(x) + e<sub>R</sub>(x).
# The ResponderRespondent sends t<sub>R</sub>(x) and c to the Initiator.
'''Initiators Final Steps:'''
# Receive t<sub>R</sub>(x) and c from the Responder
Line 63 ⟶ 59:
## If c<sub>j</sub> = 1 and -3q/8 ≤ w<sub>j</sub> < q/8 then u<sub>j</sub> = 0 otherwise u<sub>j</sub> = 1
# Form the key (k) as the concatenation of u<sub>n-1</sub>, ..., u<sub>0</sub>
If the key exchange worked properly, the initiator's string: u<sub>n-1</sub>, ..., u<sub>0</sub> and the responderrespondent's string: u<sub>n-1</sub>, ..., u<sub>0</sub> will be the same.
 
Depending on the specifics of the parameters chosen n, q, σ, or b, there is an extremely small probability that this key exchange will fail to produce the same key. Implementors of the scheme might want to introduce a key validation step before ciphertext is produced. However, parametersParameters for the key exchange can be chosen to make the probability of failure in the key exchange very small; much less than the probability of undetectable garbles or device failures.
 
== Parameter Choices ==
The RingRWLE-LWE KeyKEX exchange presented above worked in the Ring of Polynomials of degree n-1 or less mod a polynomial Φ(x). The presentation assumed that n was a power of 2 and that q was a prime which was congruent to 1 (mod 4). Following the guidance given in Peikert's paper, Singh suggested two sets of paramtersparameters for the RingRWLE-LWE Key ExchangeKEX.
 
For 128 bits of security, n = 512, q = 25601, and F(x) = x<sup>512</sup> + 1
Line 74 ⟶ 70:
For 256 bits of security, n = 1024, q = 40961, and F(x) = x<sup>1024</sup> + 1
 
Because the key exchange uses random sampling and fixed bounds there is a small probability that the key exchange will fail to produce the same key for the initiator and responder. If we assume that the gaussianGaussian parameter σ is 8/sqrt(2π) and the uniform sampling bound (b) = 5 (see Singh),<ref name=":1" /> then the probability of key agreement failure is <u>less than</u> 2<sup>−71</sup> for the 128-bit secure parameters and <u>less than</u> 2<sup>−91</sup> for the 256-bit secure parameters.
 
== Key Exchange Security ==
Line 80 ⟶ 76:
 
== Other approaches ==
A variant of the approach described above but with very different reconciliation function and parameter choices is the work of Zhang, Zhang, Ding, Snook and Dagdelen in their paper, "Post Quantum Authenticated Key Exchange from Ideal Lattices."<ref>{{Cite web|title = Workshop on Cybersecurity in a Post-Quantum World|url = http://www.nist.gov/itl/csd/ct/post-quantum-crypto-workshop-2015.cfm|website = www.nist.gov|accessdate = 2015-06-06}}</ref> The concept of creating what has been called a DiffieDuffie-Hellman-like Key Exchange using lattices with a reconciliation function appears to have first been presented by French researchers Aguilar, Gaborit, Lacharme, Schrek, and Zemor at PQCrypto 2010 in their talk, "Noisy Diffie-Hellman Protocols."<ref>{{Cite web|title = https://pqc2010.cased.de/rr/03.pdf|url = https://pqc2010.cased.de/rr/03.pdf|website = pqc2010.cased.de|accessdate = 2015-06-06}}</ref> This work was then extended and put on a much more rigorous foundation by Peikert in his writings.<ref name=":0" /><ref name=":2">{{Cite journal|title = A Toolkit for Ring-LWE Cryptography|url = http://eprint.iacr.org/2013/293|date = 2013|first = Vadim|last = Lyubashevsky|first2 = Chris|last2 = Peikert|first3 = Oded|last3 = Regev}}</ref>
 
== References ==