You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides a Python implementation of Feldman's Verifiable Secret Sharing (VSS) scheme, designed with **post-quantum security** in mind. It builds upon Shamir's Secret Sharing, adding mathematical verification to ensure the integrity of distributed shares, and uses hash-based commitments to resist quantum attacks.
11
11
12
-
13
12
## ATTENTION:
14
13
15
14
This code was developed with the assistance of AI language models and has been supervised by a product manager (non-cryptographer and non-developer). **The code has not undergone a formal security audit.** While every effort has been made to implement best practices for security and performance, it is **strongly recommended not to use this code in a production environment** without a thorough independent security review by qualified cryptography experts. Use at your own risk.
16
15
17
-
18
16
**Key Features:**
19
17
20
18
***Post-Quantum Security:** Employs hash-based commitments (using BLAKE3 or SHA3-256) and large prime fields (minimum 4096 bits) to provide resistance against quantum computers. No reliance on discrete logarithm problems.
21
-
***Verifiable Secret Sharing:**Allows participants to verify the correctness of their shares, ensuring that the dealer has distributed shares of a valid secret.
19
+
***Verifiable Secret Sharing:** Allows participants to verify the correctness of their shares, ensuring that the dealer has distributed shares of a valid secret.
22
20
***Fault Injection Countermeasures:** Includes redundant computation and checksum verification to mitigate fault injection attacks.
23
21
***Efficient Batch Verification:** Optimized for verifying multiple shares simultaneously.
24
-
***Serialization and Deserialization:**Provides secure serialization and deserialization of commitment data, including checksums for integrity checks.
22
+
***Serialization and Deserialization:** Provides secure serialization and deserialization of commitment data, including checksums for integrity checks and handling of extra entropy for low-entropy secrets.
25
23
***Integration with Shamir's Secret Sharing:** Designed for seamless integration with a standard Shamir Secret Sharing implementation (specifically, it provides a helper function `create_vss_from_shamir`).
26
24
***Zero-Knowledge Proofs:** Includes methods to generate and verify zero-knowledge proofs of polynomial knowledge and dual-commitment proofs (for integration with Pedersen VSS).
27
-
***Byzantine Fault Tolerance:** Robust handling of malicious participants, including detection of equivocation and inconsistent shares.
28
-
***Share Refreshing:** Implements an optimized version of Chen & Lindell's Protocol 5 for securely refreshing shares without changing the underlying secret, with enhancements for asynchronous environments.
25
+
***Byzantine Fault Tolerance:** Robust handling of malicious participants, including detection of equivocation, inconsistent shares, and adaptive quorum-based detection during share refreshing.
26
+
***Share Refreshing:** Implements an optimized version of Chen & Lindell's Protocol 5 for securely refreshing shares without changing the underlying secret, with enhancements for asynchronous environments and improved Byzantine fault tolerance.
29
27
***Constant-Time Operations:** Utilizes constant-time comparison and exponentiation where appropriate to mitigate timing side-channel attacks.
30
-
***Optimized Cyclic Group Operations:** Features an enhanced cyclic group implementation with caching and precomputation for improved performance.
28
+
***Optimized Cyclic Group Operations:** Features an enhanced cyclic group implementation with a thread-safe LRU caching and precomputation for improved performance.
31
29
***Comprehensive Error Handling:** Includes custom exceptions for security, parameter, verification, and serialization errors.
32
30
***gmpy2-based Arithmetic:** Leverages the `gmpy2` library for high-performance, arbitrary-precision arithmetic, critical for cryptographic operations.
31
+
***Deterministic Hashing:** Uses fixed-size integer representation for commitment generation, to be platform independent.
33
32
34
33
**Dependencies:**
35
34
36
-
***gmpy2:**Required for efficient and secure large-number arithmetic. (`pip install gmpy2`)
35
+
***gmpy2:** Required for efficient and secure large-number arithmetic. (`pip install gmpy2`)
37
36
***blake3:** (Highly Recommended) For fast and secure cryptographic hashing. (`pip install blake3`)
38
37
***xxhash:** (Recommended) For high-performance checksums. (`pip install xxhash`)
39
38
***msgpack:** For efficient and secure serialization. (`pip install msgpack`)
40
39
41
-
If `blake3` is not available, the library will fall back to SHA3-256, but `blake3` is strongly recommended for performance and security. If `xxhash` is not available, a cryptographic fallback (BLAKE3 or SHA3-256) will be used for checksums.
40
+
If `blake3` is not available, the library will fall back to SHA3-256, but `blake3` is strongly recommended for performance and security. If `xxhash` is not available, a cryptographic fallback (BLAKE3 or SHA3-256) will be used for checksums.
***Prime Size:** This library defaults to 4096-bit primes for post-quantum security. It enforces a minimum of 4096 bits. Using smaller primes is *strongly discouraged* and will trigger warnings.
104
-
***Safe Primes:** The library defaults to using safe primes (where `p` and `(p-1)/2` are both prime) to enhance security.
105
+
***Prime Size:** This library defaults to 4096-bit primes for post-quantum security. It enforces a minimum of 4096 bits. Using smaller primes is *strongly discouraged* and will trigger warnings.
106
+
***Safe Primes:** The library defaults to using safe primes (where `p` and `(p-1)/2` are both prime) to enhance security. This can be configured.
105
107
***Hash Algorithm:** BLAKE3 is the preferred hash algorithm for its speed and security.
106
-
***Entropy:**The library uses `secrets` for cryptographically secure random number generation.
107
-
***Side-Channel Attacks:**Constant-time operations are used where appropriate to mitigate timing attacks.
108
+
***Entropy:** The library uses `secrets` for cryptographically secure random number generation.
109
+
***Side-Channel Attacks:** Constant-time operations are used where appropriate to mitigate timing attacks.
108
110
109
111
**Contributing:**
110
112
111
-
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
113
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines (you'll likely want to create this file).
112
114
113
115
**License:**
114
116
@@ -117,4 +119,3 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
0 commit comments