Classic McEliece
Classic McEliece is a code-based key-encapsulation mechanism built on binary Goppa codes. A NIST Round-4 candidate not selected by NIST; it is on the ISO/IEC standardization track, not the NIST FIPS track. It is prized for its extreme conservatism — the underlying problem has resisted attack since 1978 — and for tiny ciphertexts, at the price of enormous public keys.
How it works
Classic McEliece is a KEM whose security rests on the hardness of decoding a random-looking linear code. The public key is a scrambled generator/parity-check matrix for a binary Goppa code; the private key is the structured description that allows efficient decoding. Encapsulation encodes a random error vector and derives a shared secret; decapsulation uses the secret Goppa structure to decode the error and recover the secret.
The original McEliece scheme dates to 1978 and has survived more than forty-five years of cryptanalysis essentially intact — an unusually strong track record. "Classic McEliece" is the modern, IND-CCA2-secure KEM packaging of that idea.
Parameter sets
Sizes vary widely across parameter sets. Note the contrast: ciphertexts are tiny, but public keys are hundreds of kilobytes to over a megabyte. Approximate values in bytes. Classic McEliece has many parameter sets, and different document versions keep different recommended sets; overall the public keys range from about 255 KB to 1.3 MB and the ciphertexts from about 96 to 208 bytes.
| Parameter set | Security level | Public key (approx.) | Ciphertext (approx.) |
|---|---|---|---|
| mceliece348864 | Category 1 | 261120 (~255 KB) | 96 |
| mceliece460896 | Category 3 | 524160 (~512 KB) | 156 |
| mceliece6960119 | Category 5 | ~1047319 (~1 MB) | 194 |
| mceliece8192128 | Category 5 | ~1357824 (~1.3 MB) | 208 |
Strengths & tradeoffs
- Extremely conservative. Unbroken since 1978; the security assumption is among the most trusted in all of cryptography.
- Tiny ciphertexts. Only ~96-208 bytes — smaller than ML-KEM ciphertexts — which is great for high-volume encapsulation traffic.
- Tradeoff — huge public keys. 255 KB to over 1 MB. This makes it unsuitable for protocols that transmit a fresh public key per handshake (like ephemeral TLS), but acceptable when keys are long-lived and distributed infrequently.
When to use it
Classic McEliece shines when the public key can be installed once and reused for a long time — pinned keys, pre-provisioned devices, or static infrastructure endpoints — and you want the strongest possible confidence in long-term confidentiality (defending against Harvest Now, Decrypt Later). For general ephemeral key exchange where keys are sent per connection, prefer ML-KEM or the code-based HQC.
Code example
import oqs
kem = "Classic-McEliece-348864"
with oqs.KeyEncapsulation(kem) as server:
public_key = server.generate_keypair()
print("public key bytes:", len(public_key)) # ~261120 (~255 KB!)
with oqs.KeyEncapsulation(kem) as client:
ciphertext, ss_c = client.encap_secret(public_key)
print("ciphertext bytes:", len(ciphertext)) # ~96
ss_s = server.decap_secret(ciphertext)
assert ss_c == ss_s
Related
Code-based cryptography →
Goppa codes and the decoding problem.
HQC →
The code-based KEM NIST standardized.
Key Encapsulation →
How a KEM works.
Round 4 →
Status of the remaining candidates.
Standards & references
- Classic McEliece project — official specification, reference implementation, and parameter sets.
- NIST PQC project — Round-4 KEM evaluation and status.
- Resources — full standards register
Classic McEliece
Classic McEliece 是一种基于编码的密钥封装机制,建立在二元 Goppa 码之上。作为 NIST 第四轮候选,NIST 未推进;它走 ISO/IEC 标准化路线,不在 NIST FIPS 轨道上。它以极致的保守性著称——底层问题自 1978 年起从未被攻破——并拥有极小的密文,代价是巨大的公钥。
工作原理
Classic McEliece 是一种 KEM,其安全性建立在解码一个看似随机的线性码之困难性上。公钥是一个被扰乱的二元 Goppa 码生成/校验矩阵;私钥则是能高效解码的结构化描述。封装时编码一个随机错误向量并导出共享密钥;解封装时利用秘密的 Goppa 结构解码该错误并还原密钥。
原始 McEliece 方案可追溯至 1978 年,历经四十五年以上密码分析基本毫发无损——这是极为罕见的优异记录。“Classic McEliece”正是这一思想的现代化、满足 IND-CCA2 的 KEM 封装。
参数集
各参数集尺寸差异巨大。请注意反差:密文极小,公钥却达数百 KB 乃至超过 1 MB。下表为近似字节值。Classic McEliece 参数集较多,不同文档版本会保留不同推荐集;总体范围是公钥约 255 KB 到 1.3 MB,密文约 96 到 208 字节。
| 参数集 | 安全等级 | 公钥(约) | 密文(约) |
|---|---|---|---|
| mceliece348864 | 等级 1 | 261120(约 255 KB) | 96 |
| mceliece460896 | 等级 3 | 524160(约 512 KB) | 156 |
| mceliece6960119 | 等级 5 | 约 1047319(约 1 MB) | 194 |
| mceliece8192128 | 等级 5 | 约 1357824(约 1.3 MB) | 208 |
优势与取舍
- 极致保守。自 1978 年从未被攻破;其安全假设跻身整个密码学中最受信赖之列。
- 密文极小。仅约 96-208 字节——小于 ML-KEM 密文——非常适合高频封装流量。
- 取舍——巨大公钥。255 KB 至 1 MB 以上。这使其不适合每次握手都传输新公钥的协议(如临时 TLS),但在公钥长寿命、低频分发时可接受。
适用场景
当公钥可一次安装、长期复用时,Classic McEliece 表现出色——固定(pinned)密钥、预置设备、或静态基础设施端点——且你希望获得对长期机密性的最强信心(抵御“先收集后解密”)。对于每次连接都发送公钥的通用临时密钥交换,请优先选用 ML-KEM 或基于编码的 HQC。
代码示例
import oqs
kem = "Classic-McEliece-348864"
with oqs.KeyEncapsulation(kem) as server:
public_key = server.generate_keypair()
print("公钥字节:", len(public_key)) # 约 261120(约 255 KB!)
with oqs.KeyEncapsulation(kem) as client:
ciphertext, ss_c = client.encap_secret(public_key)
print("密文字节:", len(ciphertext)) # 约 96
ss_s = server.decap_secret(ciphertext)
assert ss_c == ss_s
相关页面
标准与参考
- Classic McEliece 项目 — 官方规范 参考实现与参数集。
- NIST PQC 项目 — 第四轮 KEM 评估与状态。
- 资源链接 — 完整标准登记册