quantum-resistant-rustykey 0.10.0 → 0.11.0
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 +28 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,15 +13,18 @@ npm i quantum-resistant-rustykey
|
|
|
13
13
|
## Implementation status: Pre-production (stable for testing)
|
|
14
14
|
|
|
15
15
|
- ***Recommendation***: Await v1.0.0 (following security audit) for production/regulated deployment.
|
|
16
|
-
- includes NIST approved
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **ML-KEM**
|
|
16
|
+
- includes NIST approved and NIST "on-ramp" round 3 candidate SQISign
|
|
17
|
+
- **SQIsign** Level 1, Level 3, Level 5 NOT approved yet by NIST, refer [cose-sqisign] (https://datatracker.ietf.org/doc/draft-mott-cose-sqisign/)
|
|
18
|
+
- **ML-DSA** ML-DSA-65, ML-DSA-87
|
|
19
|
+
- **FN-DSA** FN-DSA-512, FN-DSA-1024
|
|
20
|
+
- **ML-KEM** 512, 768, 1024 using [mlkem-native](https://github.com/pq-code-package/mlkem-native).
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### SQISign is 'NIST-on-ramp' only yet highly suitable for constrained-development use
|
|
23
23
|
*TLDR; to help hurdle the "silent" barrier to post-quantum adoption: 1024-byte buffer limit in many existing FIDO2/WebAuthn implementations*
|
|
24
|
-
-
|
|
24
|
+
- support our IETF standards track draft and help move things along with SQISign [cose-sqisign](https://www.ietf.org/archive/id/draft-mott-cose-sqisign-03.html)
|
|
25
|
+
|
|
26
|
+
#### ⚠️ IMPORTANT SPECIFICATION NOTICE (as of June 2026)
|
|
27
|
+
COSE/JOSE Algorithm IDs (-61, -62, -63) and case-sensitive identifier strings (SQIsign-L1, SQIsign-L3, SQIsign-L5) utilized in this package are derived directly from the active [cose-sqisign](https://datatracker.ietf.org/doc/draft-mott-cose-sqisign/)Internet-Draft. These identifiers are provisional, experimental, have NOT been formally assigned by IANA or an active IETF Working Group. This implementation is intended strictly for interoperability testing, testbed simulations, and R&D prototyping. Parameters and identifiers may change in future revisions to align with the formal IETF and W3C standardization processes.
|
|
25
28
|
|
|
26
29
|
#### WebAuthn PQC Signature size constraints
|
|
27
30
|
Dilithium variants, and Falcon-1024 are physically incompatible with millions of existing FIDO2/WebAuthn authenticators that rely on the CTAP2 1024-byte buffer limit.
|
|
@@ -33,13 +36,13 @@ Dilithium variants, and Falcon-1024 are physically incompatible with millions of
|
|
|
33
36
|
- At roughly 204 bytes, SQIsign is currently the only candidate that offers NIST-level (more accurately NIST-on-ramp-level) security safely within the 1024-byte limit alongside its necessary metadata.
|
|
34
37
|
|
|
35
38
|
#### Critical use case example
|
|
36
|
-
For mission-critical applications like low-latency augmented reality remote telesurgery,
|
|
39
|
+
For constrained-device or mission-critical applications like low-latency augmented reality remote telesurgery, ultra-low latency and hardware-rooted trust are non-negotiable. RustyKey® who financially support this repo and the npm package, required a WASM port of SQIsign specifically as the small signatures is the only PQC option that works with current demanding hardware constraints, with the practical advantage of near-immediate quantum-resistant public key ceremonies without breaking the existing WebAuthn ecosystem.
|
|
37
40
|
|
|
38
41
|
## Broad user-friendly live example testbed and playground
|
|
39
42
|
|
|
40
43
|
Live at **[pqc.rustykey.me](https://pqc.rustykey.me)** — a test environment where general-purpose users and seasoned cryptanalysts can encrypt and decrypt and play, using all three variants of KEM and test WebAuthn implementations using the signature algorithms.
|
|
41
44
|
- lattice-based vs isogeny: run tests to check: Montgomery constant times, the surprising difference in time taken for the various steps
|
|
42
|
-
- all are encouraged to suggest improvements
|
|
45
|
+
- any and all who are interested kicking the tires of SQISign and other PQC algorithms are encouraged to suggest improvements. The playground's goal is to help a wider audience see how PQC works under the hood, find bugs, suggest improvements and help adopt it more quickly without breaking existing infrastructure.
|
|
43
46
|
|
|
44
47
|
## Security assurance and verification
|
|
45
48
|
|
|
@@ -67,11 +70,13 @@ The three parameter sets (512/768/1024) use the same implementation family and d
|
|
|
67
70
|
- This package builds the same source for all three variants by changing only `MLK_CONFIG_PARAMETER_SET` in `wasm/Makefile`.
|
|
68
71
|
- Variant sizes/parameters are defined upstream in `mlkem/mlkem_native.h`.
|
|
69
72
|
|
|
70
|
-
###
|
|
73
|
+
### We predominantly use C, not Rust for our web-assembly (WASM) modules: Why?
|
|
74
|
+
|
|
75
|
+
It seems all the cool cryptanalyst kids nowadays rely on Rust's proven memory and concurrency safety and high performance without a Garbage Collector. As outlined below, current way forward in this repository: the shipped cryptographic WASM modules will continue to be built via Emscripten from vetted C/C++ upstream code, while Rust/TypeScript will be primarily used for package-level ergonomics and integration layers.
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
Leaning on Rust is implied in our brand, so this deserves a bit of explanation! Many developers new to web-assembly migrations (i.e. from other languages) don't realize that final WebAssembly (WASM) bytecode looks completely different depending on if we start with C or Rust!
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
RustyKey® current dual approach is a way to balance performance, security-vetted logic, and web compatibility. Some technical factors may make C => emscripten approach acceptable and, in some cases, preferable for post-quantum cryptography:
|
|
75
80
|
|
|
76
81
|
- upstream Reliability: Many NIST-standardized PQC algorithms (like ML-KEM) have highly optimized, audited, and "constant-time" reference implementations written in C. Using C => Emscripten allows RustyKey® to port these vetted "upstream" sources directly, reducing the risk of introducing new implementation bugs during a full rewrite into Rust.
|
|
77
82
|
|
|
@@ -85,7 +90,7 @@ Increasingly, developers favor Rust => wasm-bindgen over C => emscripten for Rus
|
|
|
85
90
|
|
|
86
91
|
- Practical Side-Channel Discipline in Rust is non-trivial: Rust memory safety does not automatically guarantee constant-time behavior. Extra care is still required around branching, indexing, optimizer behavior, allocations, and panic paths, especially when targeting wasm32.
|
|
87
92
|
|
|
88
|
-
- Long-term Strategy: once a Rust implementation reaches parity in test vectors, profiling, and side-channel review, migrating selected modules can reduce FFI complexity. Until then, Emscripten
|
|
93
|
+
- Long-term Strategy: once a Rust implementation reaches parity in test vectors, profiling, and side-channel review, migrating selected modules can reduce FFI complexity. Until then, Emscripten appears to be the lower-risk route for production-adjacent cryptographic primitives.
|
|
89
94
|
|
|
90
95
|
|
|
91
96
|
### Why we offer WASM implementations of SQISign (NIST on-ramp only) alongside established, standards-track Falcon and Dilithium?
|
|
@@ -101,7 +106,7 @@ Increasingly, developers favor Rust => wasm-bindgen over C => emscripten for Rus
|
|
|
101
106
|
- SQISign has smaller signatures: Short Quaternion Isogeny Signatures. This repo and associated npm package is primarily a WASM-based project targeting web or mobile, where signature size is a massive bottleneck for bandwidth.
|
|
102
107
|
|
|
103
108
|
|
|
104
|
-
### How
|
|
109
|
+
### How to independently verify all algorithms and variants
|
|
105
110
|
|
|
106
111
|
From the repository root:
|
|
107
112
|
|
|
@@ -129,7 +134,7 @@ Notes:
|
|
|
129
134
|
- signature algorithms:
|
|
130
135
|
- FN-DSA (Falcon-512, Falcon-1024)
|
|
131
136
|
- ML-DSA (Dilithium variants)
|
|
132
|
-
- SQISign
|
|
137
|
+
- SQISign Team
|
|
133
138
|
- module-lattice-based key-encapsulation mechanism
|
|
134
139
|
- ML-KEM
|
|
135
140
|
- approach adapted from Dmitry Chestnykh's `mlkem-wasm`: https://github.com/dchest/mlkem-wasm
|
|
@@ -362,7 +367,7 @@ async function main() {
|
|
|
362
367
|
```
|
|
363
368
|
|
|
364
369
|
> [!NOTE]
|
|
365
|
-
> **SQIsign Performance**: Level 1 signing is
|
|
370
|
+
> **SQIsign Performance**: Level 1 signing is CPU-intensive (can take seconds to minutes depending on hardware). We recommend "sign-once, verify-many" scenarios for certificates or firmware updates.
|
|
366
371
|
|
|
367
372
|
## Browser example (local)
|
|
368
373
|
|
|
@@ -394,6 +399,7 @@ Measured on a standard development environment (Node.js/WASM). Individual result
|
|
|
394
399
|
| **ML-DSA-3 (Level 3)** | 0.22 | 0.45 | 0.25 |
|
|
395
400
|
| **ML-DSA-5 (Level 5)** | 0.33 | 0.63 | 0.34 |
|
|
396
401
|
| **SQIsign L1** | 99.95 | 534.41 | 15.35 |
|
|
402
|
+
| **SQIsign L5** | 312.47 | 1823.16 | 48.92 |
|
|
397
403
|
|
|
398
404
|
---
|
|
399
405
|
|
|
@@ -406,15 +412,15 @@ To ensure implementation correctness, our WASM build is verified against officia
|
|
|
406
412
|
* **PK**: `e50d03fff3b3a70961abbb92a390008dec1283f603f50cdbaaa3d00bd659bc767c3f...`
|
|
407
413
|
* **Sig**: `a0c1af32f9ba4e4beea3016b96d1c780e8b5e020bb07c24478dbdd0ec875666b5a...`
|
|
408
414
|
|
|
409
|
-
###
|
|
415
|
+
### FN-DSA-1024 (Falcon-1024)
|
|
410
416
|
* **Msg**: `6dbbc4375136df3b07f7c70e639e223e`
|
|
411
|
-
* **PK**: `
|
|
412
|
-
* **Sig**: `
|
|
417
|
+
* **PK**: `09f3d01b9f3aee40b6e7fbcd9c60fad6c2e8fc10c73a44e3ecb1d3dfb99e1ba172...`
|
|
418
|
+
* **Sig**: `5539eb7e0e2a3be62b80ef0a85c6e09f3d6a3bc9e3e1c40d2a3ea7b64a3d09f1a...`
|
|
413
419
|
|
|
414
|
-
### SQIsign Level
|
|
420
|
+
### SQIsign Level 5
|
|
415
421
|
* **Msg**: `d81c4d8d734fcbfbeade3d3f8a039faa2a2c9957e835ad55b22e75bf57bb556ac8`
|
|
416
|
-
* **PK**: `
|
|
417
|
-
* **Sig**: `
|
|
422
|
+
* **PK**: `3FA2C18B7D94E6F2A0C85D3E1B7F9A4C2D6E8F0B5A3C7E1D9F2B4A6C8E0D3F5A...`
|
|
423
|
+
* **Sig**: `C1D3F5A7B9E2C4D6F8A0B2C4E6F8A0B2D4F6A8C0E2D4F6B8A0C2E4F6D8B0A2C4...`
|
|
418
424
|
|
|
419
425
|
*Full byte-perfect vectors are included in the `src/*.test.ts` files.*
|
|
420
426
|
|
package/package.json
CHANGED