Lably
Skip to content

McEliece cryptosystem

Asymmetric encryption algorithm developed by Robert McEliece

  • 6 min read
  • 5 chapters

Related on Lably

Through Digital signature and Invertible matrix

The algorithm is based on the hardness of decoding a general linear code (which is known to be NP-hard) and of the hardness of using the public key to recover an efficient decoding algorithm . For a description of the private key, an error-correcting code is selected for which an efficient decoding algorithm is known, and that is able to correct t 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. 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 G is perturbated by two randomly selected invertible matrices S and P (see below).

Variants of this cryptosystem exist, using different types of codes. Most of them were proven less secure; they were broken by attacks that took advantage of the hidden structure of the public key . A version using moderate-density parity check codes is still believed to be secure .

McEliece with Goppa codes resisted cryptanalysis until 2026, when a series of key-recovery attacks were found . The cost of these attacks is high, but for the original Classic McEliece parameters it is significantly less than information-set decoding, the previously most effective algorithm . The attack can be mitigated by adjusting parameters, but this requires larger keys and ciphertexts to compensate . In particular, ciphertext sizes now scale quadratically with the security required in bits .

Prior to 2026, the most effective attacks known used information-set decoding algorithms. A 2008 paper described both an attack and a fix. Another paper shows that for quantum computing, key sizes must be increased by a factor of four due to improvements in information set decoding.

The McEliece cryptosystem has some advantages over, for example, RSA. The encryption and decryption are faster. 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 that 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: n,k,t.

Key generation

The principle is that Alice chooses a linear code C from some family of codes for which she knows an efficient decoding algorithm, and to make C public knowledge but keep the decoding algorithm secret. Such a decoding algorithm requires not just knowing C, in the sense of knowing an arbitrary generator matrix, but requires one to know the parameters used when specifying C 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 C.

More specifically, the steps are as follows:

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

Message encryption

Suppose Bob wishes to send a message m to Alice whose public key is (G^,t):

  1. Bob encodes the message m as a binary string of length k.
  2. Bob computes the vector c′=mG^.
  3. Bob generates a random n-bit vector z containing exactly t ones (a vector of length n and weight t)
  4. Bob sends Alice the ciphertext computed as c=c′+z.

Message decryption

Upon receipt of c, Alice performs the following steps to decrypt the message:

  1. Alice computes the inverse of P (i.e. P−1).
  2. Alice computes c^=cP−1.
  3. Alice uses the decoding algorithm A to decode c^ to m^.
  4. Alice computes m=m^S−1.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Computing and communication