McEliece cryptosystem

From HandWiki
Short description: Asymmetric encryption algorithm developed by Robert McEliece

In cryptography, the McEliece cryptosystem is an asymmetric encryption algorithm developed in 1978 by Robert McEliece.[1] It was the first such scheme to use randomization in the encryption process. The algorithm has never gained much acceptance in the cryptographic community, but is a candidate for "post-quantum cryptography", as it is immune to attacks using Shor's algorithm and – more generally – measuring coset states using Fourier sampling.[2]

The algorithm is based on the hardness of decoding a general linear code (which is known to be NP-hard[3]). For a description of the private key, an error-correcting code is selected for which an efficient decoding algorithm is known, and which is able to correct [math]\displaystyle{ t }[/math] errors. The original algorithm uses binary Goppa codes (subfield codes of algebraic geometry codes of a genus-0 curve over finite fields of characteristic 2); these codes can be efficiently decoded, thanks to an algorithm due to Patterson.[4] The public key is derived from the private key by disguising the selected code as a general linear code. For this, the code's generator matrix [math]\displaystyle{ G }[/math] is perturbated by two randomly selected invertible matrices [math]\displaystyle{ S }[/math] and [math]\displaystyle{ P }[/math] (see below).

Variants of this cryptosystem exist, using different types of codes. Most of them were proven less secure; they were broken by structural decoding.

McEliece with Goppa codes has resisted cryptanalysis so far. The most effective attacks known use information-set decoding algorithms. A 2008 paper describes both an attack and a fix.[5] Another paper shows that for quantum computing, key sizes must be increased by a factor of four due to improvements in information set decoding.[6]

The McEliece cryptosystem has some advantages over, for example, RSA. The encryption and decryption are faster.[7] For a long time, it was thought that McEliece could not be used to produce signatures. However, a signature scheme can be constructed based on the Niederreiter scheme, the dual variant of the McEliece scheme. One of the main disadvantages of McEliece is that the private and public keys are large matrices. For a standard selection of parameters, the public key is 512 kilobits long.

Scheme definition

McEliece consists of three algorithms: a probabilistic key generation algorithm which produces a public and a private key, a probabilistic encryption algorithm, and a deterministic decryption algorithm.

All users in a McEliece deployment share a set of common security parameters: [math]\displaystyle{ n, k, t }[/math].

Key generation

The principle is that Alice chooses a linear code [math]\displaystyle{ C }[/math] from some family of codes for which she knows an efficient decoding algorithm, and to make [math]\displaystyle{ C }[/math] public knowledge but keep the decoding algorithm secret. Such a decoding algorithm requires not just knowing [math]\displaystyle{ C }[/math], in the sense of knowing an arbitrary generator matrix, but requires one to know the parameters used when specifying [math]\displaystyle{ C }[/math] in the chosen family of codes. For instance, for binary Goppa codes, this information would be the Goppa polynomial and the code locators. Therefore, Alice may publish a suitably obfuscated generator matrix of [math]\displaystyle{ C }[/math].

More specifically, the steps are as follows:

  1. Alice selects a binary [math]\displaystyle{ (n, k) }[/math]-linear code [math]\displaystyle{ C }[/math] capable of (efficiently) correcting [math]\displaystyle{ t }[/math] errors from some large family of codes, e.g. binary Goppa codes. This choice should give rise to an efficient decoding algorithm [math]\displaystyle{ A }[/math]. Let also [math]\displaystyle{ G }[/math] be any generator matrix for [math]\displaystyle{ C }[/math]. Any linear code has many generator matrices, but often there is a natural choice for this family of codes. Knowing this would reveal [math]\displaystyle{ A }[/math] so it should be kept secret.
  2. Alice selects a random [math]\displaystyle{ k \times k }[/math] binary non-singular matrix [math]\displaystyle{ S }[/math].
  3. Alice selects a random [math]\displaystyle{ n \times n }[/math] permutation matrix [math]\displaystyle{ P }[/math].
  4. Alice computes the [math]\displaystyle{ k \times n }[/math] matrix [math]\displaystyle{ {\hat G} = SGP }[/math].
  5. Alice's public key is [math]\displaystyle{ ({\hat G}, t) }[/math]; her private key is [math]\displaystyle{ (S, P, A) }[/math]. Note that [math]\displaystyle{ A }[/math] could be encoded and stored as the parameters used for selecting [math]\displaystyle{ C }[/math].

Message encryption

Suppose Bob wishes to send a message m to Alice whose public key is [math]\displaystyle{ ({\hat G}, t) }[/math]:

  1. Bob encodes the message [math]\displaystyle{ m }[/math] as a binary string of length [math]\displaystyle{ k }[/math].
  2. Bob computes the vector [math]\displaystyle{ c^{\prime} = m{\hat G} }[/math].
  3. Bob generates a random [math]\displaystyle{ n }[/math]-bit vector [math]\displaystyle{ z }[/math] containing exactly [math]\displaystyle{ t }[/math] ones (a vector of length [math]\displaystyle{ n }[/math] and weight [math]\displaystyle{ t }[/math])[1]
  4. Bob computes the ciphertext as [math]\displaystyle{ c = c^{\prime} + z }[/math].

Message decryption

Upon receipt of [math]\displaystyle{ c }[/math], Alice performs the following steps to decrypt the message:

  1. Alice computes the inverse of [math]\displaystyle{ P }[/math] (i.e. [math]\displaystyle{ P^{-1} }[/math]).
  2. Alice computes [math]\displaystyle{ {\hat c} = cP^{-1} }[/math].
  3. Alice uses the decoding algorithm [math]\displaystyle{ A }[/math] to decode [math]\displaystyle{ {\hat c} }[/math] to [math]\displaystyle{ {\hat m} }[/math].
  4. Alice computes [math]\displaystyle{ m = {\hat m}S^{-1} }[/math].

Proof of message decryption

Note that [math]\displaystyle{ {\hat c} = cP^{-1} = m{\hat G}P^{-1} + zP^{-1} = mSG + zP^{-1} }[/math], and that [math]\displaystyle{ P }[/math] is a permutation matrix, thus [math]\displaystyle{ zP^{-1} }[/math] has weight [math]\displaystyle{ t }[/math].

The Goppa code [math]\displaystyle{ G }[/math] can correct up to [math]\displaystyle{ t }[/math] errors, and the word [math]\displaystyle{ mSG }[/math] is at distance at most [math]\displaystyle{ t }[/math] from [math]\displaystyle{ cP^{-1} }[/math]. Therefore, the correct code word [math]\displaystyle{ {\hat m} = mS }[/math] is obtained.

Multiplying with the inverse of [math]\displaystyle{ S }[/math] gives [math]\displaystyle{ m = {\hat m}S^{-1}= mSS^{-1} }[/math], which is the plain text message.

Key sizes

Because there is a free choice in the matrix [math]\displaystyle{ S }[/math], it is common to express [math]\displaystyle{ {\hat G} }[/math] in "systematic form" so that the last [math]\displaystyle{ k }[/math] columns correspond to the identity matrix [math]\displaystyle{ {\hat G} = ({\tilde G}|I) }[/math]. This reduces the key size to [math]\displaystyle{ (n-k) \times k }[/math].[8][9] McEliece originally suggested security parameter sizes of [math]\displaystyle{ n=1024, k=524, t=50 }[/math],[1] resulting in a public key size of 524*(1024−524) = 262,000 bits. Recent analysis suggests parameter sizes of [math]\displaystyle{ n=2048, k=1751, t=27 }[/math] for 80 bits of security when using standard algebraic decoding, or [math]\displaystyle{ n=1632, k=1269, t=34 }[/math] when using list decoding for the Goppa code, giving rise to public key sizes of 520,047 and 460,647 bits respectively.[5] For resiliency against quantum computers, sizes of [math]\displaystyle{ n=6960, k=5413, t=119 }[/math] with Goppa code were proposed, giving the size of public key of 8,373,911 bits.[10] In its round 3 submission to the NIST post quantum standardization the highest level of security, level 5 is given for parameter sets 6688128, 6960119, and 8192128. The parameters are [math]\displaystyle{ n=6688, k=128, t= 13 }[/math], [math]\displaystyle{ n= 6960, k = 119, t = 13 }[/math], [math]\displaystyle{ n=8192, k =128, t = 13 }[/math] respectively.

Attacks

An attack consists of an adversary, who knows the public key [math]\displaystyle{ ({\hat G}, t) }[/math] but not the private key, deducing the plaintext from some intercepted ciphertext [math]\displaystyle{ y \in \mathbb{F}_2^n }[/math]. Such attempts should be infeasible.

There are two main branches of attacks for McEliece:

Brute-force / unstructured attacks

The attacker knows [math]\displaystyle{ \hat G }[/math] which is the generator matrix of an [math]\displaystyle{ (n,k) }[/math] code [math]\displaystyle{ \hat C }[/math] which is combinatorially able to correct [math]\displaystyle{ t }[/math] errors. The attacker may ignore the fact that [math]\displaystyle{ \hat C }[/math] is really the obfuscation of a structured code chosen from a specific family, and instead just use an algorithm for decoding with any linear code. Several such algorithms exist, such as going through each codeword of the code, syndrome decoding, or information set decoding.

Decoding a general linear code, however, is known to be NP-hard,[3] however, and all of the above-mentioned methods have exponential running time.

In 2008, Bernstein, Lange, and Peters[5] described a practical attack on the original McEliece cryptosystem, using the information set decoding method by Stern.[11] Using the parameters originally suggested by McEliece, the attack could be carried out in 260.55 bit operations. Since the attack is embarrassingly parallel (no communication between nodes is necessary), it can be carried out in days on modest computer clusters.

Structural attacks

The attacker may instead attempt to recover the "structure" of [math]\displaystyle{ C }[/math], thereby recovering the efficient decoding algorithm [math]\displaystyle{ A }[/math] or another sufficiently strong, efficient decoding algorithm.

The family of codes from which [math]\displaystyle{ C }[/math] is chosen completely determines whether this is possible for the attacker. Many code families have been proposed for McEliece, and most of them have been completely "broken" in the sense that attacks which recover an efficient decoding algorithm has been found, such as Reed-Solomon codes.

The originally proposed binary Goppa codes remain one of the few suggested families of codes which have largely resisted attempts at devising structural attacks.

Post-quantum encryption candidate

A variant of this algorithm combined with NTS-KEM[12] was entered into and selected during the third round of the NIST post-quantum encryption competition.[13]

References

  1. 1.0 1.1 1.2 McEliece, Robert J. (1978). "A Public-Key Cryptosystem Based on Algebraic Coding Theory". DSN Progress Report 44: 114–116. Bibcode1978DSNPR..44..114M. https://ipnpr.jpl.nasa.gov/progress_report2/42-44/44N.PDF. 
  2. Dinh, Hang; Moore, Cristopher; Russell, Alexander (2011). "McEliece and Niederreiter cryptosystems that resist quantum Fourier sampling attacks". in Rogaway, Philip. Advances in cryptology—CRYPTO 2011. 6841. Heidelberg: Springer. pp. 761–779. doi:10.1007/978-3-642-22792-9_43. ISBN 978-3-642-22791-2. 
  3. 3.0 3.1 Berlekamp, Elwyn R.; McEliece, Robert J.; Van Tilborg, Henk C.A. (1978). "On the Inherent Intractability of Certain Coding Problems". IEEE Transactions on Information Theory IT-24 (3): 384–386. doi:10.1109/TIT.1978.1055873. https://authors.library.caltech.edu/5607/. 
  4. N. J. Patterson (1975). "The algebraic decoding of Goppa codes". IEEE Transactions on Information Theory IT-21 (2): 203–207. doi:10.1109/TIT.1975.1055350. 
  5. 5.0 5.1 5.2 Bernstein, Daniel J. (8 August 2008). "Attacking and Defending the McEliece Cryptosystem". Post-Quantum Cryptography. Lecture Notes in Computer Science. 5299. pp. 31–46. doi:10.1007/978-3-540-88403-3_3. ISBN 978-3-540-88402-6. https://eprint.iacr.org/2008/318. 
  6. Bernstein, Daniel J. (2010). "Grover vs. McEliece". in Sendrier, Nicolas. Post-quantum cryptography 2010. 6061. Berlin: Springer. pp. 73–80. doi:10.1007/978-3-642-12929-2_6. ISBN 978-3-642-12928-5. https://cr.yp.to/codes/grovercode-20091123.pdf. 
  7. "eBATS: ECRYPT Benchmarking of Asymmetric Systems". 2018-08-25. https://bench.cr.yp.to/ebats.html. 
  8. Classic McEliece Team (2022-10-23). "Classic McEliece: conservative code-based cryptography: cryptosystem specification". Round 4 NIST Submission Overview. https://classic.mceliece.org/mceliece-spec-20221023.pdf. 
  9. Tanja Lange (2021-02-23). "Code-based cryptography III - Goppa codes: definition and usage". https://www.youtube.com/watch?v=qisORKNShvo. 
  10. Daniel Augot (2015-09-07). "Initial recommendations of long-term secure post-quantum systems". PQCRYPTO: Post-Quantum Cryptography for Long-Term Security. https://pqcrypto.eu.org/docs/initial-recommendations.pdf. 
  11. Jacques Stern (1989). "A method for finding codewords of small weight". Coding Theory and Applications. Lecture Notes in Computer Science. 388. Springer Verlag. pp. 106–113. doi:10.1007/BFb0019850. ISBN 978-3-540-51643-9. 
  12. "NTS-KEM". 2017-12-29. https://nts-kem.io/. 
  13. "Status Report on the Third Round of the NIST Post-Quantum Cryptography Standardization Process". NISTIR: 31. https://nvlpubs.nist.gov/nistpubs/ir/2022/NIST.IR.8413.pdf. 

External links