pqfile 0.1.0__tar.gz
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.
- pqfile-0.1.0/Cargo.toml +27 -0
- pqfile-0.1.0/PKG-INFO +97 -0
- pqfile-0.1.0/README.md +82 -0
- pqfile-0.1.0/pqfile/Cargo.toml +160 -0
- pqfile-0.1.0/pqfile/README.md +1319 -0
- pqfile-0.1.0/pqfile/benches/crypto.rs +104 -0
- pqfile-0.1.0/pqfile/benches/iai.rs +107 -0
- pqfile-0.1.0/pqfile/examples/ct_decrypt.rs +96 -0
- pqfile-0.1.0/pqfile/examples/ct_passphrase.rs +104 -0
- pqfile-0.1.0/pqfile/examples/ct_shamir.rs +138 -0
- pqfile-0.1.0/pqfile/examples/gen_compat_vectors.rs +271 -0
- pqfile-0.1.0/pqfile/examples/gen_vectors.rs +113 -0
- pqfile-0.1.0/pqfile/src/add_recipient.rs +376 -0
- pqfile-0.1.0/pqfile/src/archive.rs +700 -0
- pqfile-0.1.0/pqfile/src/async_io.rs +674 -0
- pqfile-0.1.0/pqfile/src/audit.rs +621 -0
- pqfile-0.1.0/pqfile/src/cert.rs +1072 -0
- pqfile-0.1.0/pqfile/src/decrypt.rs +2830 -0
- pqfile-0.1.0/pqfile/src/distrust.rs +234 -0
- pqfile-0.1.0/pqfile/src/encrypt.rs +2234 -0
- pqfile-0.1.0/pqfile/src/error.rs +393 -0
- pqfile-0.1.0/pqfile/src/fec.rs +307 -0
- pqfile-0.1.0/pqfile/src/format.rs +1027 -0
- pqfile-0.1.0/pqfile/src/fsutil.rs +95 -0
- pqfile-0.1.0/pqfile/src/hardware/credential_store.rs +170 -0
- pqfile-0.1.0/pqfile/src/hardware/mod.rs +164 -0
- pqfile-0.1.0/pqfile/src/hardware/stub.rs +120 -0
- pqfile-0.1.0/pqfile/src/inspect.rs +213 -0
- pqfile-0.1.0/pqfile/src/io_util.rs +17 -0
- pqfile-0.1.0/pqfile/src/kem_backend.rs +407 -0
- pqfile-0.1.0/pqfile/src/keygen.rs +816 -0
- pqfile-0.1.0/pqfile/src/keys.rs +604 -0
- pqfile-0.1.0/pqfile/src/lib.rs +204 -0
- pqfile-0.1.0/pqfile/src/padding.rs +360 -0
- pqfile-0.1.0/pqfile/src/passphrase.rs +779 -0
- pqfile-0.1.0/pqfile/src/progress.rs +68 -0
- pqfile-0.1.0/pqfile/src/reader.rs +392 -0
- pqfile-0.1.0/pqfile/src/recipient_string.rs +226 -0
- pqfile-0.1.0/pqfile/src/rekey.rs +206 -0
- pqfile-0.1.0/pqfile/src/repassphrase.rs +386 -0
- pqfile-0.1.0/pqfile/src/resume.rs +573 -0
- pqfile-0.1.0/pqfile/src/revoke.rs +182 -0
- pqfile-0.1.0/pqfile/src/sealed_sender.rs +588 -0
- pqfile-0.1.0/pqfile/src/secret.rs +156 -0
- pqfile-0.1.0/pqfile/src/seek_decrypt.rs +418 -0
- pqfile-0.1.0/pqfile/src/shamir.rs +782 -0
- pqfile-0.1.0/pqfile/src/shred.rs +80 -0
- pqfile-0.1.0/pqfile/src/sign.rs +938 -0
- pqfile-0.1.0/pqfile/src/signcrypt.rs +363 -0
- pqfile-0.1.0/pqfile/src/stego.rs +510 -0
- pqfile-0.1.0/pqfile/src/tlock.rs +497 -0
- pqfile-0.1.0/pqfile/src/writer.rs +373 -0
- pqfile-0.1.0/pqfile/tests/auth_header.rs +238 -0
- pqfile-0.1.0/pqfile/tests/compat/padme_768.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/padme_768.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/padme_plaintext.bin +1 -0
- pqfile-0.1.0/pqfile/tests/compat/plaintext.bin +1 -0
- pqfile-0.1.0/pqfile/tests/compat/stealth_768.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/stealth_768.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v10_keyfile.bin +1 -0
- pqfile-0.1.0/pqfile/tests/compat/v10_keyfile.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v10_passphrase.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v2_768.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v2_768.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v3_1024.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v3_1024.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v3_512.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v3_512.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v3_hybrid.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v3_hybrid.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v4_multi.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v4_multi.priv1.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v4_multi.priv2.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v5_8k.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v5_8k.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v6_zstd.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v6_zstd.priv.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v8_anon.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v8_anon.priv1.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v8_anon.priv2.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v8_anon.priv3.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v9_padded.pqf +0 -0
- pqfile-0.1.0/pqfile/tests/compat/v9_padded.priv1.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v9_padded.priv2.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat/v9_padded.priv3.pem +4 -0
- pqfile-0.1.0/pqfile/tests/compat.rs +198 -0
- pqfile-0.1.0/pqfile/tests/kat_vectors.rs +83 -0
- pqfile-0.1.0/pqfile/tests/kem_oracle.rs +180 -0
- pqfile-0.1.0/pqfile/tests/property.rs +180 -0
- pqfile-0.1.0/pqfile/tests/static_vectors.rs +236 -0
- pqfile-0.1.0/pqfile/tests/stealth.rs +225 -0
- pqfile-0.1.0/pqfile/tests/vectors.rs +653 -0
- pqfile-0.1.0/pqfile/tests/wasm_smoke.rs +45 -0
- pqfile-0.1.0/pqfile-python/Cargo.lock +1456 -0
- pqfile-0.1.0/pqfile-python/Cargo.toml +23 -0
- pqfile-0.1.0/pqfile-python/README.md +82 -0
- pqfile-0.1.0/pqfile-python/src/lib.rs +149 -0
- pqfile-0.1.0/pqfile-python/tests/test_roundtrip.py +68 -0
- pqfile-0.1.0/pyproject.toml +30 -0
- pqfile-0.1.0/python/pqfile/__init__.py +64 -0
- pqfile-0.1.0/python/pqfile/_pqfile.pyi +17 -0
- pqfile-0.1.0/python/pqfile/py.typed +0 -0
pqfile-0.1.0/Cargo.toml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
members = ["pqfile", "pqfile-cli", "pqfile-gui", "pqfile-desktop"]
|
|
3
|
+
exclude = [
|
|
4
|
+
"fuzz", # managed by cargo-fuzz, not the main workspace
|
|
5
|
+
"pqfile-python", # managed by maturin; keeps Python dev headers out of `cargo build --workspace`
|
|
6
|
+
"pqfile-node", # managed by `napi build`; keeps Node.js headers out of `cargo build --workspace`
|
|
7
|
+
"pqfile-mobile", # managed by uniffi-bindgen/cargo-ndk/Xcode; keeps Android/iOS cross-compiles out of `cargo build --workspace`
|
|
8
|
+
]
|
|
9
|
+
resolver = "2"
|
|
10
|
+
|
|
11
|
+
[workspace.dependencies]
|
|
12
|
+
# Internal crates
|
|
13
|
+
pqfile = { path = "pqfile", version = "4.3.3" }
|
|
14
|
+
pqfile-gui = { path = "pqfile-gui", version = "4.3.3" }
|
|
15
|
+
|
|
16
|
+
# Shared external dependencies
|
|
17
|
+
eframe = { version = "0.35", features = ["default_fonts"] }
|
|
18
|
+
getrandom = { version = "0.4" }
|
|
19
|
+
tempfile = { version = "3" }
|
|
20
|
+
|
|
21
|
+
# Release binaries and the WASM bundle. Thin LTO + a single codegen unit speed
|
|
22
|
+
# up the crypto hot paths and shrink both native binaries and the WASM download
|
|
23
|
+
# (on top of Trunk's wasm-opt pass); strip drops symbols from shipped binaries.
|
|
24
|
+
[profile.release]
|
|
25
|
+
lto = "thin"
|
|
26
|
+
codegen-units = 1
|
|
27
|
+
strip = true
|
pqfile-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pqfile
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Topic :: Security :: Cryptography
|
|
8
|
+
Summary: Quantum-resistant file encryption (ML-KEM, hybrid X25519+ML-KEM-768) - Python bindings
|
|
9
|
+
License: MIT
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
12
|
+
Project-URL: Documentation, https://github.com/dangel34/PQ-File-Encryption/blob/main/pqfile-python/README.md
|
|
13
|
+
Project-URL: Repository, https://github.com/dangel34/PQ-File-Encryption
|
|
14
|
+
|
|
15
|
+
# pqfile (Python bindings)
|
|
16
|
+
|
|
17
|
+
Python bindings for [`pqfile`](https://github.com/dangel34/PQ-File-Encryption), a
|
|
18
|
+
quantum-resistant file encryption library: ML-KEM (512/768/1024) and hybrid
|
|
19
|
+
X25519+ML-KEM-768 key encapsulation with ChaCha20-Poly1305 authenticated
|
|
20
|
+
encryption. Built with [PyO3](https://pyo3.rs) and packaged with
|
|
21
|
+
[maturin](https://www.maturin.rs); the crypto itself lives entirely in the
|
|
22
|
+
`pqfile` Rust crate, not in this binding layer.
|
|
23
|
+
|
|
24
|
+
## Install (from source, until wheels are published)
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pip install maturin
|
|
28
|
+
cd pqfile-python
|
|
29
|
+
maturin develop --release
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
import pqfile
|
|
36
|
+
|
|
37
|
+
# Generate a key pair
|
|
38
|
+
pub_pem, priv_pem = pqfile.keygen() # level=768 by default; also 512, 1024
|
|
39
|
+
|
|
40
|
+
# Encrypt / decrypt in memory
|
|
41
|
+
ciphertext = pqfile.encrypt_bytes(pub_pem, b"hello, post-quantum world")
|
|
42
|
+
plaintext = pqfile.decrypt_bytes(priv_pem, ciphertext)
|
|
43
|
+
assert plaintext == b"hello, post-quantum world"
|
|
44
|
+
|
|
45
|
+
# Encrypt / decrypt files directly (streams; flat memory use regardless of size)
|
|
46
|
+
pqfile.encrypt_file(pub_pem, "report.pdf", "report.pdf.pqf")
|
|
47
|
+
pqfile.decrypt_file(priv_pem, "report.pdf.pqf", "report.pdf")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
A passphrase-protected private key:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
pub_pem, priv_pem = pqfile.keygen(passphrase="correct horse battery staple")
|
|
54
|
+
plaintext = pqfile.decrypt_bytes(priv_pem, ciphertext, passphrase="correct horse battery staple")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Hybrid X25519 + ML-KEM-768 (defense in depth against a future ML-KEM break):
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
pub_pem, priv_pem = pqfile.keygen_hybrid()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Errors
|
|
64
|
+
|
|
65
|
+
All failures raise `pqfile.PqfileError`, a subclass of `Exception`, with a
|
|
66
|
+
human-readable message and the stable numeric error code from
|
|
67
|
+
[`docs/ERROR_CODES.md`](../docs/ERROR_CODES.md) appended, e.g.
|
|
68
|
+
`decryption failure: authentication tag mismatch (code 7)`.
|
|
69
|
+
|
|
70
|
+
## Scope
|
|
71
|
+
|
|
72
|
+
This wraps `pqfile::encrypt`/`pqfile::decrypt`'s single-recipient streaming
|
|
73
|
+
path only (`keygen`/`encrypt_bytes`/`decrypt_bytes`/`encrypt_file`/`decrypt_file`).
|
|
74
|
+
Multi-recipient encryption, signing/`signcrypt`, Shamir sharing, certificates,
|
|
75
|
+
and the other CLI features are not yet exposed here - see
|
|
76
|
+
`docs/ROADMAP.md`, "Python, Node.js, and mobile bindings", for status.
|
|
77
|
+
|
|
78
|
+
## Compatibility
|
|
79
|
+
|
|
80
|
+
Produces and reads the same `.pqf` v3/v5 wire format as the `pqfile` CLI and
|
|
81
|
+
GUI (see `docs/FORMAT.md`), so files are interchangeable in both directions.
|
|
82
|
+
|
|
83
|
+
## CI and publishing
|
|
84
|
+
|
|
85
|
+
`ci.yml`'s `bindings-python` job builds this crate and runs the pytest suite
|
|
86
|
+
on every push/PR. `publish-python.yml` is scaffolding for the actual PyPI
|
|
87
|
+
release - it builds wheels for Linux (manylinux, via `PyO3/maturin-action`'s
|
|
88
|
+
bundled Docker image)/Windows/macOS (x86_64 and aarch64) plus an sdist, and
|
|
89
|
+
would publish them to PyPI on a GitHub Release being published. It has never
|
|
90
|
+
actually run: publishing uses PyPI Trusted Publishing (OIDC) rather than a
|
|
91
|
+
stored token, which needs a one-time "pending publisher" registered on PyPI
|
|
92
|
+
first (pypi.org -> your account -> Publishing -> Add a new pending
|
|
93
|
+
publisher) - project name `pqfile`, owner `dangel34`, repository
|
|
94
|
+
`PQ-File-Encryption`, workflow `publish-python.yml`, environment `release`.
|
|
95
|
+
Until that's registered, the publish job's `id-token: write` permission has
|
|
96
|
+
nothing to authenticate against and the upload step fails.
|
|
97
|
+
|
pqfile-0.1.0/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# pqfile (Python bindings)
|
|
2
|
+
|
|
3
|
+
Python bindings for [`pqfile`](https://github.com/dangel34/PQ-File-Encryption), a
|
|
4
|
+
quantum-resistant file encryption library: ML-KEM (512/768/1024) and hybrid
|
|
5
|
+
X25519+ML-KEM-768 key encapsulation with ChaCha20-Poly1305 authenticated
|
|
6
|
+
encryption. Built with [PyO3](https://pyo3.rs) and packaged with
|
|
7
|
+
[maturin](https://www.maturin.rs); the crypto itself lives entirely in the
|
|
8
|
+
`pqfile` Rust crate, not in this binding layer.
|
|
9
|
+
|
|
10
|
+
## Install (from source, until wheels are published)
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
pip install maturin
|
|
14
|
+
cd pqfile-python
|
|
15
|
+
maturin develop --release
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
import pqfile
|
|
22
|
+
|
|
23
|
+
# Generate a key pair
|
|
24
|
+
pub_pem, priv_pem = pqfile.keygen() # level=768 by default; also 512, 1024
|
|
25
|
+
|
|
26
|
+
# Encrypt / decrypt in memory
|
|
27
|
+
ciphertext = pqfile.encrypt_bytes(pub_pem, b"hello, post-quantum world")
|
|
28
|
+
plaintext = pqfile.decrypt_bytes(priv_pem, ciphertext)
|
|
29
|
+
assert plaintext == b"hello, post-quantum world"
|
|
30
|
+
|
|
31
|
+
# Encrypt / decrypt files directly (streams; flat memory use regardless of size)
|
|
32
|
+
pqfile.encrypt_file(pub_pem, "report.pdf", "report.pdf.pqf")
|
|
33
|
+
pqfile.decrypt_file(priv_pem, "report.pdf.pqf", "report.pdf")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
A passphrase-protected private key:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
pub_pem, priv_pem = pqfile.keygen(passphrase="correct horse battery staple")
|
|
40
|
+
plaintext = pqfile.decrypt_bytes(priv_pem, ciphertext, passphrase="correct horse battery staple")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Hybrid X25519 + ML-KEM-768 (defense in depth against a future ML-KEM break):
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
pub_pem, priv_pem = pqfile.keygen_hybrid()
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Errors
|
|
50
|
+
|
|
51
|
+
All failures raise `pqfile.PqfileError`, a subclass of `Exception`, with a
|
|
52
|
+
human-readable message and the stable numeric error code from
|
|
53
|
+
[`docs/ERROR_CODES.md`](../docs/ERROR_CODES.md) appended, e.g.
|
|
54
|
+
`decryption failure: authentication tag mismatch (code 7)`.
|
|
55
|
+
|
|
56
|
+
## Scope
|
|
57
|
+
|
|
58
|
+
This wraps `pqfile::encrypt`/`pqfile::decrypt`'s single-recipient streaming
|
|
59
|
+
path only (`keygen`/`encrypt_bytes`/`decrypt_bytes`/`encrypt_file`/`decrypt_file`).
|
|
60
|
+
Multi-recipient encryption, signing/`signcrypt`, Shamir sharing, certificates,
|
|
61
|
+
and the other CLI features are not yet exposed here - see
|
|
62
|
+
`docs/ROADMAP.md`, "Python, Node.js, and mobile bindings", for status.
|
|
63
|
+
|
|
64
|
+
## Compatibility
|
|
65
|
+
|
|
66
|
+
Produces and reads the same `.pqf` v3/v5 wire format as the `pqfile` CLI and
|
|
67
|
+
GUI (see `docs/FORMAT.md`), so files are interchangeable in both directions.
|
|
68
|
+
|
|
69
|
+
## CI and publishing
|
|
70
|
+
|
|
71
|
+
`ci.yml`'s `bindings-python` job builds this crate and runs the pytest suite
|
|
72
|
+
on every push/PR. `publish-python.yml` is scaffolding for the actual PyPI
|
|
73
|
+
release - it builds wheels for Linux (manylinux, via `PyO3/maturin-action`'s
|
|
74
|
+
bundled Docker image)/Windows/macOS (x86_64 and aarch64) plus an sdist, and
|
|
75
|
+
would publish them to PyPI on a GitHub Release being published. It has never
|
|
76
|
+
actually run: publishing uses PyPI Trusted Publishing (OIDC) rather than a
|
|
77
|
+
stored token, which needs a one-time "pending publisher" registered on PyPI
|
|
78
|
+
first (pypi.org -> your account -> Publishing -> Add a new pending
|
|
79
|
+
publisher) - project name `pqfile`, owner `dangel34`, repository
|
|
80
|
+
`PQ-File-Encryption`, workflow `publish-python.yml`, environment `release`.
|
|
81
|
+
Until that's registered, the publish job's `id-token: write` permission has
|
|
82
|
+
nothing to authenticate against and the upload step fails.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "pqfile"
|
|
3
|
+
version = "4.3.3"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "Quantum-resistant file encryption: ML-KEM (512/768/1024), hybrid X25519+ML-KEM-768, ML-DSA-65 and SLH-DSA signing, multi-recipient, Shamir sharing"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
repository = "https://github.com/dangel34/PQ-File-Encryption"
|
|
8
|
+
homepage = "https://github.com/dangel34/PQ-File-Encryption"
|
|
9
|
+
documentation = "https://docs.rs/pqfile"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
keywords = ["encryption", "post-quantum", "ml-kem", "chacha20", "cryptography"]
|
|
12
|
+
categories = ["cryptography", "filesystem"]
|
|
13
|
+
|
|
14
|
+
[lints.rust]
|
|
15
|
+
# `--cfg fuzzing` is injected by cargo-fuzz; stego.rs gates its
|
|
16
|
+
# Argon2-skipping fuzz entry points on it so they never ship in the API.
|
|
17
|
+
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(fuzzing)"] }
|
|
18
|
+
|
|
19
|
+
[dependencies]
|
|
20
|
+
ml-kem = { version = "0.3", features = ["getrandom", "zeroize"] }
|
|
21
|
+
chacha20poly1305 = "0.11"
|
|
22
|
+
getrandom = { workspace = true }
|
|
23
|
+
zeroize = { version = "1", features = ["derive"] }
|
|
24
|
+
pem = "3"
|
|
25
|
+
thiserror = "2"
|
|
26
|
+
sha3 = "0.12"
|
|
27
|
+
argon2 = { version = "0.5", features = ["zeroize"] }
|
|
28
|
+
aes-gcm = "0.11"
|
|
29
|
+
# >=0.1.1 required: 0.1.0-rc.3 and earlier carry a Decompose timing side-channel
|
|
30
|
+
# (RUSTSEC-2025-0144) and a signature-malleability regression (GHSA-5x2r-hc65-25f9),
|
|
31
|
+
# both fixed by 0.1.0-rc.4. Do not loosen this floor.
|
|
32
|
+
ml-dsa = { version = "0.1.1", features = ["getrandom", "zeroize"] }
|
|
33
|
+
# RustCrypto has not cut a stable 0.2.0 as of 2026-07-14; re-check on each dependency
|
|
34
|
+
# bump whether a stable release exists yet, since this is the only SLH-DSA backend.
|
|
35
|
+
slh-dsa = { version = "0.2.0-rc.5", features = ["zeroize"] }
|
|
36
|
+
x25519-dalek = { version = "3", features = ["static_secrets", "zeroize"] }
|
|
37
|
+
hkdf = "0.13"
|
|
38
|
+
sha2 = "0.11"
|
|
39
|
+
rayon = "1"
|
|
40
|
+
bech32 = "0.12"
|
|
41
|
+
# Constant-time MAC comparison in sealed_sender.rs.
|
|
42
|
+
subtle = "2"
|
|
43
|
+
# Cover-image decode/encode for stego.rs (`stego` feature). PNG (lossless,
|
|
44
|
+
# required for LSB embedding to survive) plus JPEG so a JPEG cover photo can
|
|
45
|
+
# be used as input; output is always re-encoded as PNG regardless of input
|
|
46
|
+
# format, per the standing BLAKE3-for-non-format-hashing guideline this also
|
|
47
|
+
# uses blake3 rather than SHA3 since the payload checksum never touches the
|
|
48
|
+
# wire format.
|
|
49
|
+
image = { version = "0.25", default-features = false, features = ["png", "jpeg"], optional = true }
|
|
50
|
+
# Also used by resume.rs's checkpoint prefix-hash convention (never touches
|
|
51
|
+
# the wire format), so unlike `image` this is not gated behind `stego`.
|
|
52
|
+
blake3 = "1"
|
|
53
|
+
# Classical Reed-Solomon BCH error correction for fec.rs (`fec` feature).
|
|
54
|
+
# Pure Rust, no_std-compatible, no system dependencies - gated behind an
|
|
55
|
+
# opt-in feature anyway since bit-rot protection is a niche need most builds
|
|
56
|
+
# don't want the extra dependency for. See docs/ROADMAP.md,
|
|
57
|
+
# "Forward-error-correction for cold-storage resilience".
|
|
58
|
+
reed-solomon = { version = "0.2", optional = true }
|
|
59
|
+
|
|
60
|
+
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
61
|
+
# getrandom 0.4 needs the wasm_js feature to use globalThis.crypto in a browser/Node.js context.
|
|
62
|
+
getrandom = { workspace = true, features = ["wasm_js"] }
|
|
63
|
+
# getrandom 0.3 needs both the wasm_js feature AND the getrandom_backend cfg flag
|
|
64
|
+
# (set in .cargo/config.toml) to select the wasm_js backend.
|
|
65
|
+
getrandom_03 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }
|
|
66
|
+
# chacha20poly1305 -> rand_core -> getrandom 0.2; needs the js feature for WASM.
|
|
67
|
+
getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] }
|
|
68
|
+
|
|
69
|
+
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
|
70
|
+
wasm-bindgen-test = "0.3"
|
|
71
|
+
|
|
72
|
+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
73
|
+
zstd = { version = "0.13.3", features = ["zstdmt"] }
|
|
74
|
+
# Core types for hardware-backed key credential storage.
|
|
75
|
+
keyring-core = "1"
|
|
76
|
+
# Memory-mapped I/O for zero-copy file encryption.
|
|
77
|
+
memmap2 = "0.9"
|
|
78
|
+
# mlock/VirtualLock for in-flight secrets (secret.rs); no allocator features.
|
|
79
|
+
memsec = { version = "0.7", default-features = false, features = ["use_os"] }
|
|
80
|
+
# Optional F*-verified ML-KEM backend (`kem-libcrux` feature). Also listed
|
|
81
|
+
# unconditionally below as a dev-dependency so tests/kem_oracle.rs runs on
|
|
82
|
+
# every `cargo test` regardless of feature flags; Cargo unions the two.
|
|
83
|
+
libcrux-ml-kem = { version = "0.0.10", optional = true }
|
|
84
|
+
# Time-lock encryption (`tlock` feature): IBE over the drand beacon (tlock) and
|
|
85
|
+
# a synchronous (ureq-based, no tokio) drand HTTP client (drand_core). This is
|
|
86
|
+
# the only network-capable dependency in the workspace; both are optional so a
|
|
87
|
+
# default build never pulls in an HTTP stack, and native-only since ureq does
|
|
88
|
+
# not target wasm32. See pqfile/src/tlock.rs.
|
|
89
|
+
tlock = { version = "0.0.10", optional = true }
|
|
90
|
+
drand_core = { version = "0.0.19", optional = true }
|
|
91
|
+
|
|
92
|
+
# Platform-specific credential store backends (no sqlite/tantivy bloat).
|
|
93
|
+
[target.'cfg(target_os = "windows")'.dependencies]
|
|
94
|
+
windows-native-keyring-store = "1"
|
|
95
|
+
|
|
96
|
+
[target.'cfg(target_os = "macos")'.dependencies]
|
|
97
|
+
apple-native-keyring-store = { version = "1", features = ["keychain"] }
|
|
98
|
+
|
|
99
|
+
[target.'cfg(target_os = "linux")'.dependencies]
|
|
100
|
+
linux-keyutils-keyring-store = "1"
|
|
101
|
+
|
|
102
|
+
[features]
|
|
103
|
+
# Enable async encrypt/decrypt API backed by Tokio.
|
|
104
|
+
async = ["tokio"]
|
|
105
|
+
# Enable statistical constant-time tests (requires a quiet machine; not for CI).
|
|
106
|
+
timing-tests = []
|
|
107
|
+
# Opt into Cryspen's F*-verified libcrux-ml-kem as the ML-KEM backend instead
|
|
108
|
+
# of the default RustCrypto ml-kem. No wire-format change: pqfile/tests/kem_oracle.rs
|
|
109
|
+
# proves the two agree byte-for-byte on FIPS 203. See docs/ROADMAP.md, "Optional
|
|
110
|
+
# formally verified ML-KEM backend".
|
|
111
|
+
kem-libcrux = ["dep:libcrux-ml-kem"]
|
|
112
|
+
# Time-locked encryption (V11 format): encrypt --tlock-round is fully offline;
|
|
113
|
+
# decrypt fetches a drand beacon signature over the network. See docs/ROADMAP.md,
|
|
114
|
+
# "Time-locked encryption".
|
|
115
|
+
tlock = ["dep:tlock", "dep:drand_core"]
|
|
116
|
+
# Steganographic key backup (`bury`/`exhume`): LSB-embeds a file inside a
|
|
117
|
+
# cover image's pixel data. Off by default so a normal build never pays for
|
|
118
|
+
# the image-codec dependency tree. See docs/ROADMAP.md, "Steganographic key
|
|
119
|
+
# backup".
|
|
120
|
+
stego = ["dep:image"]
|
|
121
|
+
# Reed-Solomon forward-error-correction sidecar for cold-storage resilience
|
|
122
|
+
# (`encrypt --fec` / `decrypt --fec` / `check --fec`). Off by default; no
|
|
123
|
+
# wire-format change, no impact on builds that don't opt in. See
|
|
124
|
+
# docs/ROADMAP.md, "Forward-error-correction for cold-storage resilience".
|
|
125
|
+
fec = ["dep:reed-solomon"]
|
|
126
|
+
# Encrypted, signed, hash-chained audit log for encrypt/decrypt events
|
|
127
|
+
# (`pqfile audit-verify`). No extra dependency - built entirely from
|
|
128
|
+
# existing sign/encrypt/decrypt/blake3 primitives - but off by default like
|
|
129
|
+
# every other niche, opt-in capability. See docs/ROADMAP.md, "Encrypted
|
|
130
|
+
# audit log".
|
|
131
|
+
audit = []
|
|
132
|
+
|
|
133
|
+
[dependencies.tokio]
|
|
134
|
+
version = "1"
|
|
135
|
+
features = ["io-util"]
|
|
136
|
+
optional = true
|
|
137
|
+
|
|
138
|
+
[dev-dependencies]
|
|
139
|
+
tempfile = { workspace = true }
|
|
140
|
+
serde_json = "1"
|
|
141
|
+
tokio = { version = "1", features = ["rt", "macros"] }
|
|
142
|
+
|
|
143
|
+
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
|
144
|
+
criterion = { version = "0.8", features = ["html_reports"] }
|
|
145
|
+
proptest = "1"
|
|
146
|
+
# Unconditional dev-dependency so the cross-implementation oracle test
|
|
147
|
+
# (tests/kem_oracle.rs) runs on every `cargo test`, independent of whether the
|
|
148
|
+
# `kem-libcrux` feature (which also depends on this crate, see [dependencies]
|
|
149
|
+
# above) is enabled.
|
|
150
|
+
libcrux-ml-kem = "0.0.10"
|
|
151
|
+
iai-callgrind = "0.16.1"
|
|
152
|
+
|
|
153
|
+
[[bench]]
|
|
154
|
+
name = "crypto"
|
|
155
|
+
harness = false
|
|
156
|
+
|
|
157
|
+
[[bench]]
|
|
158
|
+
name = "iai"
|
|
159
|
+
harness = false
|
|
160
|
+
|