Skip to content

Commit bb3cc26

Browse files
authored
Update README.md
Signed-off-by: David Osipov <[email protected]>
1 parent cf30328 commit bb3cc26

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

README.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Post-Quantum Secure Feldman's Verifiable Secret Sharing
22

3-
[![Version](https://img.shields.io/badge/version-0.7.0--Alpha-blue)](https://github.com/davidosipov/feldman-vss-pq)
3+
[![Version](https://img.shields.io/badge/version-0.7.4a0-blue)](https://github.com/davidosipov/feldman-vss-pq)
44
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
55
![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)
66
[![Tests](https://github.com/davidosipov/feldman-vss-pq/actions/workflows/tests.yml/badge.svg)](https://github.com/davidosipov/feldman-vss-pq/actions/workflows/tests.yml)
@@ -9,43 +9,44 @@
99

1010
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.
1111

12-
1312
## ATTENTION:
1413

1514
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.
1615

17-
1816
**Key Features:**
1917

2018
* **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.
2220
* **Fault Injection Countermeasures:** Includes redundant computation and checksum verification to mitigate fault injection attacks.
2321
* **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.
2523
* **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`).
2624
* **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.
2927
* **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.
3129
* **Comprehensive Error Handling:** Includes custom exceptions for security, parameter, verification, and serialization errors.
3230
* **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.
3332

3433
**Dependencies:**
3534

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`)
3736
* **blake3:** (Highly Recommended) For fast and secure cryptographic hashing. (`pip install blake3`)
3837
* **xxhash:** (Recommended) For high-performance checksums. (`pip install xxhash`)
3938
* **msgpack:** For efficient and secure serialization. (`pip install msgpack`)
4039

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.
4241

4342
**Installation:**
4443

4544
```bash
4645
pip install feldman-vss-pq
4746
```
47+
4848
The source code is also available on Github:
49+
4950
```bash
5051
git clone https://github.com/davidosipov/feldman-vss-pq.git
5152
cd feldman-vss-pq
@@ -54,8 +55,8 @@ cd feldman-vss-pq
5455
**Basic Usage:**
5556

5657
```python
57-
from feldman_vss_pq import FeldmanVSS, get_feldman_vss, VSSConfig, CyclicGroup
58-
from shamir_secret_sharing import ShamirSecretSharing # Assuming you have a Shamir implementation
58+
from feldman_vss_pq import FeldmanVSS, get_feldman_vss, VSSConfig, CyclicGroup, create_vss_from_shamir
59+
from shamir_secret_sharing import ShamirSecretSharing # Assuming you have a Shamir implementation
5960

6061
# Example using a Shamir instance (replace with your actual Shamir implementation)
6162
shamir = ShamirSecretSharing(5, 3) # 5 shares, threshold of 3
@@ -74,9 +75,9 @@ is_valid = vss.verify_commitments_with_proof(commitments, proof)
7475
print(f"Proof Verification: {is_valid}") # Expected: True
7576

7677
# Verify a share
77-
share_x, share_y = shares[1] # Example share
78+
share_x, share_y = list(shares.items())[0] # Example share, get first item
7879
is_share_valid = vss.verify_share(share_x, share_y, commitments)
79-
print(f"Share Verification: {is_share_valid}") # Expected: True
80+
print(f"Share Verification: {is_share_valid}") # Expected: True
8081

8182
# Serialize and deserialize commitments
8283
serialized = vss.serialize_commitments(commitments)
@@ -88,27 +89,28 @@ new_shares, new_commitments, verification_data = vss.refresh_shares(shares, 3, 5
8889
# ... further checks with verification_data ...
8990

9091
# --- Example without Shamir ---
91-
# Example of direct usage (without Shamir)
92-
from your_module import MersennePrimeField # Replace with your field implementation
92+
# Example of direct usage (without Shamir, you need a field implementation)
93+
94+
# from your_module import MersennePrimeField # Replace with your field implementation
9395

94-
field = MersennePrimeField(4096) # Using a 4096-bit prime
95-
vss = get_feldman_vss(field)
96-
coefficients = [field.random_element() for _ in range(3)]
97-
commitments = vss.create_commitments(coefficients)
96+
# field = MersennePrimeField(4096) # Using a 4096-bit prime
97+
# vss = get_feldman_vss(field)
98+
# coefficients = [field.random_element() for _ in range(3)]
99+
# commitments = vss.create_commitments(coefficients)
98100
# ... (rest of the example similar to above)
99101
```
100102

101103
**Security Considerations:**
102104

103-
* **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.
105107
* **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.
108110

109111
**Contributing:**
110112

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).
112114

113115
**License:**
114116

@@ -117,4 +119,3 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
117119
**Author:**
118120

119121
David Osipov ([email protected])
120-

0 commit comments

Comments
 (0)