pqbox 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -12
- package/dist/generated/wasm-bytes.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,10 @@ wire format.
|
|
|
14
14
|
- **Python:** package `pqbox` on PyPI, built with PyO3 (abi3, Python ≥ 3.10).
|
|
15
15
|
- **JavaScript / TypeScript:** package `pqbox` on npm, built with WebAssembly (Node ≥ 20 and browsers, ESM, synchronous API).
|
|
16
16
|
|
|
17
|
+
Website: <https://maxgfr.github.io/pqbox/>. Applications that use pqbox follow one integration
|
|
18
|
+
guide, [`docs/INTEGRATION.md`](docs/INTEGRATION.md): which function for which job, labels and
|
|
19
|
+
format versions, key storage, and an audit checklist.
|
|
20
|
+
|
|
17
21
|
## Suites
|
|
18
22
|
|
|
19
23
|
Every key, ciphertext, sealed box and signature records its suite in its header, so objects from
|
|
@@ -22,7 +26,7 @@ different suites can never be mixed.
|
|
|
22
26
|
| Id | Name | KEM | Signature | Use it for |
|
|
23
27
|
|---|---|---|---|---|
|
|
24
28
|
| `0x02` | **`pqbox-max`** (default) | ML-KEM-1024 + ECDH P-384 | ML-DSA-87 + ECDSA P-384 (SHA-384) | Everything, unless you have a reason below |
|
|
25
|
-
| `0x03` | `pqbox-paranoid` (experimental) | ML-KEM-1024 + Classic McEliece 8192128 + ECDH P-384 | ML-DSA-87 + SLH-DSA-SHAKE-256s + ECDSA P-384 |
|
|
29
|
+
| `0x03` | `pqbox-paranoid` (experimental, not recommended for new keys) | ML-KEM-1024 + Classic McEliece 8192128 + ECDH P-384 | ML-DSA-87 + SLH-DSA-SHAKE-256s + ECDSA P-384 | Reading and using existing paranoid keys and archives. Not for new keys: see [Classic McEliece](#classic-mceliece-not-recommended-for-new-keys) |
|
|
26
30
|
| `0x01` | `xwing` (compat only) | X-Wing (ML-KEM-768 + X25519) | ML-DSA-65 + Ed25519 | Interop with X-Wing tooling such as hush. Never the default |
|
|
27
31
|
|
|
28
32
|
**Suite policy.** The functions that read keys, ciphertexts, signatures and sealed boxes accept
|
|
@@ -41,11 +45,28 @@ Key generation takes the suite by name and needs no policy.
|
|
|
41
45
|
**The `paranoid` feature.** `pqbox-paranoid` is **experimental**: its SLH-DSA half comes from
|
|
42
46
|
`slh-dsa` 0.2.0-rc.5, a release candidate. The Rust crates compile it only with the `paranoid`
|
|
43
47
|
cargo feature, off by default (`cargo add pqbox --features paranoid`,
|
|
44
|
-
`cargo install pqbox-cli --features paranoid`); without it, paranoid objects are refused with
|
|
48
|
+
`cargo install --locked pqbox-cli --features paranoid`); without it, paranoid objects are refused with
|
|
45
49
|
`SuiteNotEnabled`. The Python wheels and the npm package include it: it adds about 66 KB to a
|
|
46
50
|
wheel (542 KB to 608 KB, macOS arm64) and about 67 KB to the WebAssembly module (801 KB to 868 KB
|
|
47
51
|
before wasm-bindgen).
|
|
48
52
|
|
|
53
|
+
#### Classic McEliece: not recommended for new keys
|
|
54
|
+
|
|
55
|
+
BSI's [Notes on recent developments concerning Classic McEliece](https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Crypto/Notes_Classic_McEliece.html)
|
|
56
|
+
(1 October 2026) say Classic McEliece should no longer be used in new developments. Structural
|
|
57
|
+
attacks have improved fast in 2026, among them a quasipolynomial distinguisher with a heuristic key
|
|
58
|
+
recovery ([ePrint 2026/1630](https://eprint.iacr.org/2026/1630)) and an improved heuristic key
|
|
59
|
+
recovery ([ePrint 2026/1984](https://eprint.iacr.org/2026/1984)). None is practical against the
|
|
60
|
+
recommended parameter sets, and BSI expects further progress. For pqbox:
|
|
61
|
+
|
|
62
|
+
- `pqbox-paranoid` objects stay readable and usable, and the format does not change.
|
|
63
|
+
- Do not create new `pqbox-paranoid` KEM keys: use `pqbox-max`.
|
|
64
|
+
- The paranoid KEM is still a hybrid: its shared secret holds as long as ML-KEM-1024 or P-384
|
|
65
|
+
holds. What Classic McEliece no longer reliably adds is protection against a break of lattices.
|
|
66
|
+
The paranoid signatures (SLH-DSA) are not affected.
|
|
67
|
+
- Replacing Classic McEliece with HQC or FrodoKEM, which BSI recommends instead, would change the
|
|
68
|
+
bytes, so it would need a new suite id. The `0x03` suite stays as it is.
|
|
69
|
+
|
|
49
70
|
**Hybrid rationale.** A hybrid stays secure as long as one of its components holds. KEM shared
|
|
50
71
|
secrets go through a combiner, so recovering the session key means breaking every component.
|
|
51
72
|
A composite signature verifies only if every component signature verifies.
|
|
@@ -57,8 +78,10 @@ A composite signature verifies only if every component signature verifies.
|
|
|
57
78
|
keeps as an interim choice. That advisory lists elliptic curves other than P-384/P-521, and
|
|
58
79
|
EdDSA, among the algorithms to inventory and replace. Some cryptographers read it as a sign that
|
|
59
80
|
256-bit curves may be weaker than believed. The advisory itself does not say they are broken.
|
|
60
|
-
- `pqbox-paranoid` also
|
|
61
|
-
SLH-DSA (hash-based) do not rely on lattices.
|
|
81
|
+
- `pqbox-paranoid` was meant to also survive a break of lattice cryptography: Classic McEliece
|
|
82
|
+
(code-based) and SLH-DSA (hash-based) do not rely on lattices. Recent attacks on Classic McEliece
|
|
83
|
+
weaken that for its KEM (see [above](#classic-mceliece-not-recommended-for-new-keys)); its
|
|
84
|
+
signatures are not affected.
|
|
62
85
|
- `xwing` exists only for compatibility. Its classical half is a 256-bit curve, so treat its
|
|
63
86
|
security as resting entirely on ML-KEM-768 and ML-DSA-65.
|
|
64
87
|
|
|
@@ -88,14 +111,14 @@ order (signing normalizes it; the malleable `n - s` twin is refused).
|
|
|
88
111
|
|
|
89
112
|
| Purpose | Algorithm | Crate |
|
|
90
113
|
|---|---|---|
|
|
91
|
-
| KEM | ML-KEM-1024 (FIPS 203), in `pqbox-max` and `pqbox-paranoid` | `libcrux-ml-kem` 0.0.12 (portable build) |
|
|
114
|
+
| KEM | ML-KEM-1024 (FIPS 203), in `pqbox-max` and `pqbox-paranoid` | `libcrux-ml-kem` 0.0.12 (portable build, SIMD code not compiled) |
|
|
92
115
|
| KEM | ML-KEM-768 (FIPS 203), inside X-Wing | `ml-kem` 0.3.4 |
|
|
93
116
|
| KEM | X-Wing (draft-connolly-cfrg-xwing-kem) | `x-wing` 0.1.1 |
|
|
94
117
|
| KEM | Classic McEliece 8192128 | `classic-mceliece-rust` 3.1.0 |
|
|
95
|
-
| KEM (classical half) | ECDH P-384, X25519 | `p384` 0.14.0, `x25519-dalek` 3.0.0 |
|
|
118
|
+
| KEM (classical half) | ECDH P-384, X25519 | `p384` 0.14.0, `x25519-dalek` 3.0.0 (both with fiat-crypto field arithmetic) |
|
|
96
119
|
| Signature | ML-DSA-65 / ML-DSA-87 (FIPS 204) | `ml-dsa` 0.1.2 |
|
|
97
120
|
| Signature | SLH-DSA-SHAKE-256s (FIPS 205), `paranoid` feature only, experimental | `slh-dsa` 0.2.0-rc.5 (release candidate) |
|
|
98
|
-
| Signature (classical half) | ECDSA P-384 with SHA-384, Ed25519 | `p384` 0.14.0, `ed25519-dalek` 3.0.0 |
|
|
121
|
+
| Signature (classical half) | ECDSA P-384 with SHA-384, Ed25519 | `p384` 0.14.0, `ed25519-dalek` 3.0.0 (both with fiat-crypto field arithmetic) |
|
|
99
122
|
| Sealed box | suite KEM + HKDF-SHA-256 + XChaCha20-Poly1305 | |
|
|
100
123
|
| AEAD | XChaCha20-Poly1305 (default), AES-256-GCM | `chacha20poly1305` 0.11.0, `aes-gcm` 0.11.1 |
|
|
101
124
|
| KDF / MAC | HKDF-SHA-256, HMAC-SHA-256 | `hkdf` 0.13.0, `hmac` 0.13.0 |
|
|
@@ -130,16 +153,37 @@ XChaCha20-Poly1305 62 µs, AES-256-GCM 14 µs, SHA-256 20 µs, SHA3-256 59 µs,
|
|
|
130
153
|
## Install
|
|
131
154
|
|
|
132
155
|
```sh
|
|
133
|
-
cargo add pqbox
|
|
134
|
-
cargo install pqbox-cli
|
|
135
|
-
pip install pqbox
|
|
136
|
-
npm install pqbox
|
|
156
|
+
cargo add pqbox # Rust library (add `--features paranoid` for pqbox-paranoid)
|
|
157
|
+
cargo install --locked pqbox-cli # `pqbox` command (same feature)
|
|
158
|
+
pip install pqbox # Python ≥ 3.10
|
|
159
|
+
npm install pqbox # Node ≥ 20, browsers
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Build options.** The CLI binaries, the wheels and the npm package are built with the
|
|
163
|
+
repository's [`.cargo/config.toml`](.cargo/config.toml): P-384 and Curve25519 use the formally
|
|
164
|
+
verified field arithmetic synthesized by [fiat-crypto](https://github.com/mit-plv/fiat-crypto)
|
|
165
|
+
(the same bytes as the default backends, checked by the frozen KATs), and only the portable code
|
|
166
|
+
of libcrux is compiled (see [docs/BACKENDS.md](docs/BACKENDS.md)). `cargo install`, `cargo add`
|
|
167
|
+
and a build from the Python sdist do not read that file; to build the same way, set:
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
RUSTFLAGS='--cfg p384_backend="fiat" --cfg curve25519_dalek_backend="fiat"' \
|
|
171
|
+
LIBCRUX_DISABLE_SIMD128=1 LIBCRUX_DISABLE_SIMD256=1 \
|
|
172
|
+
cargo install --locked pqbox-cli
|
|
137
173
|
```
|
|
138
174
|
|
|
139
175
|
Each GitHub release also carries prebuilt `pqbox` binaries, `pqbox-<target>` for macOS (arm64,
|
|
140
176
|
x86_64) and Linux (arm64, x86_64), with a `SHA256SUMS` file. `pqbox --version` reports the release,
|
|
141
177
|
and `pqbox selftest` checks the installed binary offline.
|
|
142
178
|
|
|
179
|
+
Every release asset made after v1.1.0 (binaries, wheels, sdist, npm tarball and `SHA256SUMS`) also
|
|
180
|
+
has a signed build provenance attestation. Check a download with the GitHub CLI (see
|
|
181
|
+
[RELEASING.md](RELEASING.md#verify-a-release)):
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
gh attestation verify pqbox-aarch64-apple-darwin -R maxgfr/pqbox
|
|
185
|
+
```
|
|
186
|
+
|
|
143
187
|
## Examples
|
|
144
188
|
|
|
145
189
|
### Rust
|
|
@@ -344,7 +388,7 @@ is refused. The body layouts are documented in [`format.rs`](crates/pqbox-core/s
|
|
|
344
388
|
## Upstream
|
|
345
389
|
|
|
346
390
|
pqbox stands on these projects. The versions are pinned in the `Cargo.toml` files (exactly, with
|
|
347
|
-
`=`, for every cryptographic crate); Dependabot proposes updates, and a
|
|
391
|
+
`=`, for every cryptographic crate); Dependabot proposes updates, and a daily
|
|
348
392
|
[upstream watch](.github/workflows/upstream-watch.yml) reports advisories, new releases and
|
|
349
393
|
alternatives ([`scripts/watch/`](scripts/watch)). [`docs/BACKENDS.md`](docs/BACKENDS.md) compares
|
|
350
394
|
the backends with the alternatives (RustCrypto, libcrux and AWS-LC), and explains the move of
|