DGSP
Overview
DGSP is an efficient scalable post-quantum fully-dynamic group signature scheme implemented purely in Rust. It leverages the SPHINCS+ signature scheme to provide a secure, scalable, and efficient group signature mechanism that is future-proof against quantum adversaries.
DGSP supports:
- A vast user base of up to 264 users.
- Compact keypair and signature sizes.
- Efficient signing and verification processes.
- Proven security guarantees for correctness, unforgeability, anonymity, and traceability.
- Manager behavior can be judged.
This implementation is optimized for performance and modularity, making it a powerful choice for cryptographic research and real-world applications requiring long-term security.
DGSP paper
To obtain more info about DGSP group signature scheme, please refer to the paper at: https://eprint.iacr.org/2025/760
API Documentation
The full API documentation is hosted at: https://seyyedarashazimi.github.io/dgsp/
It is automatically built from the source code.
To build and open the documentation locally from source:
Features
Core Functionalities
- Key Generation: Manager and user key generation.
- Joining: Secure user onboarding via cryptographically generated identifiers.
- Signing: Message signing using efficient hash-based cryptographic primitives and pre-computed certificates.
- Verification: Signature verification for authenticity and validity.
- Opening: Ability to trace signatures to specific users by the manager without compromising anonymity for other parties.
- Revocation: Efficient revocation mechanism, including revoking a user, their corresponding signatures, and previously-generated certificates.
- Judge Manager: Evaluate manager behavior and make sure manager opens a given signature to an ID correctly.
Cryptographic Primitives
- Efficient Hash-Based Cryptographic Operations:
- Takes benefit from SHA-2 and SHAKE-based variants as per SPHINCS+ parameters.
- SPHINCS+ Wrapper:
- Simplifies the use of SPHINCS+ by providing utilities for key generation, signing, and verification.
- WOTS+ (Winternitz One-Time Signature Plus):
- Serves as a base signing primitive for DGSP.
- Supports unique address derivation to ensure resistance against multi-target attacks.
- AES:
- Plays the role of a strong pseudorandom permutation for traceability.
Security
- Is built on SPHINCS+, a stateless hash-based signature scheme.
- Is resistant to quantum adversaries.
- Provides user anonymity, unforgeability, traceability, and correctness.
- Ensures sensitive cryptographic material is securely wiped from memory when no longer needed by zeroizing them.
- Manager's behavior can be audited and judged.
Scalability and Efficiency
- Handles up to 264 users.
- Addition and revocation of new users are seamless and efficient.
- Provides in-memory and in-disk storage backends.
- Parallelized operations using rayon crate for improved performance.
- No setup and initialization time needed.
Storage Interfaces
-
PLMInterface (Private List Manager Interface):
- Stores user-related data such as usernames, activity status, and certificate counters.
- Provides functionality for adding new users, deactivating users, managing counters for issued certificates, and retrieving user information by ID or username.
- Supports in-memory and in-disk storage backends for flexibility.
- Decouples the DGSP from the storage implementation, enabling integration with other database systems.
-
RevokedListInterface:
- Manages the list of revoked certificates and ensures that revoked signatures are invalidated.
- Supports efficient insertion and checking of revoked certificates using optimized data structures.
- Designed to work seamlessly with both in-memory and in-disk storage systems.
- Allows the DGSP to operate independently of the storage implementation, supporting integration with various database systems.
The library itself provides in-memory and in-disk implementations for the above interfaces. However, one can implement these 2 interfaces, corresponding to their own database and needs.
Benchmarks
DGSP Timing Benchmarks
We ran our tests on a computer with Ubuntu 24.04 using Rust 1.84.0 (stable) in release mode. The tests were done on an Intel® Core™ i7-4702MQ CPU at 2.20 GHz with 16 GiB of memory. To keep the results steady, we used just one processor core and turned off hyper-threading and turbo-boost. The results are the average of 100 test runs. Note that in reality, the most time-consuming operations like Gen Cert will be run in parallel as the code supports multi-threading.
All benchmark times are in milliseconds (ms).
DGSP Timing Benchmarks for sphincs_shake_256f feature
DGSP Timing Benchmarks for sphincs_shake_256s feature
DGSP Size of Manager Keys and Signature
All sizes are in Bytes.
Installation
Prerequisites
DGSP is fully implemented in Rust. Install Rust via rustup.
- Minimum Supported Rust Version (MSRV): 1.63.0
- Rust version used for the benchmarks in this README: 1.84.0 (stable)
- Platform used for benchmarks: Ubuntu 24.04, Intel® Core™ i7-4702MQ @ 2.20 GHz, 16 GiB RAM
Dependencies
The following table lists all direct dependencies and the versions used:
| Dependency | Version | Notes |
|---|---|---|
aes |
0.8.4 | AES block cipher for traceability |
pqcrypto-sphincsplus |
0.7.0 | SPHINCS+ signature scheme |
pqcrypto-traits |
0.3.5 | Traits for pqcrypto crates |
rand |
0.8.5 | Random number generation |
rayon |
1.10.0 | Data parallelism |
thiserror |
2.0.11 | Error type derivation |
zeroize |
1.8.1 | Secure memory wiping |
bincode |
1.3.3 | Binary serialization (optional, in-disk) |
serde |
1.0 | Serialization framework (optional, serialization) |
serde_json |
1.0 | JSON serialization (optional, in-disk) |
serde-big-array |
0.5.1 | Serde support for large arrays (optional, serialization) |
sha2 |
0.10.8 | SHA-2 hash functions (optional, sphincs_sha2_*) |
sha3 |
0.10.8 | SHA-3/SHAKE hash functions (optional, sphincs_shake_*) |
sled |
0.34.7 | Embedded database (optional, in-disk) |
Dev dependencies: criterion 0.5 (benchmarking), tempfile 3.15 (tests), tracing-test 0.2.5 (tests).
Docker (alternative to a local Rust installation)
A pre-built Docker image is available on Docker Hub and provides a fully self-contained environment with Rust 1.84.0 and all dependencies already compiled:
Run the end-to-end example:
Run the full test suite:
Run a benchmark (e.g. in-memory, sphincs_shake_256f):
Reproduce all paper benchmark configurations:
To build the image locally from source:
Add DGSP to Your Project
To use DGSP as a library, add it to your Cargo.toml:
[]
= "0.1.0"
To enable specific features during installation, use as an example:
[]
= { = "0.1.0", = false, = ["in-disk", "sphincs_shake_256f"] }
Basic Usage
Manager Setup
Generate manager keys, and open private list of the manager and public revoked list databases:
use *;
// generate manager keypairs:
let = DGSPkeygen_manager.unwrap;
// generate plm and revoked_list using in-memory feature
let plm = open.unwrap;
let revoked_list = open.unwrap;
// or generate plm and revoked_list using in-disk feature
use PathBuf;
let path = new;
let plm = open.unwrap;
let revoked_list = open.unwrap;
User Setup
A user joins the system and obtains their unique ID and cryptographic identifier:
let username = "alice";
let = DGSPjoin.unwrap;
The user also generate a private seed:
let seed_u = DGSPkeygen_user;
CSR, Certificate, and Signing
Create a batch of certificate signing request:
let batch_size = 8;
let = DGSPcsr;
Manager generates the corresponding certificates:
let mut certs = DGSPgen_cert.unwrap;
User signs a message:
let message = b"Hello, DGSP!";
let signature = DGSPsign;
Verifying
Verify the signature:
DGSPverify.unwrap;
Opening
Manager can open a signature to find out who has signed it:
let = DGSPopen.unwrap;
Judging
Judge manager to make sure the given signature and message are correctly opened to the user id:
DGSPjudge.unwrap;
Revocation
Revoke a user and their associated certificates:
DGSPrevoke.unwrap;
To learn more, refer to the examples/simple.rs for additional information. One can run the simple.rs example for a specific sphincs feature via:
Testing
Run tests using:
To test specific configurations, enable the required feature flags:
To test all combination of configurations in Unix-like operating systems, run the provided script:
Note that the full test will take some time to complete.
Benchmarks
Run benchmarks using:
Note that the above will run the benchmarks for the default features selected in Cargo.toml. To choose a specific SPHINCS+ feature, run:
Reproducing the Paper's Benchmark Tables
To reproduce the full set of timing benchmarks reported in the paper, use the provided script that iterates over all configurations (two selected SPHINCS+ variants × both storage backends × group sizes 210 and 225 × batch sizes 1 and 8):
The script modifies the benchmark constants, runs Criterion for each configuration, and saves raw logs under
benches/log_<timestamp>/in_memory/ and benches/log_<timestamp>/in_disk/.
Note: The 2^25 configurations require significant RAM (in-memory) and disk space (in-disk). Remove
25fromGROUP_SIZES_LOGinall_benchmarks.shif resources are limited.
Reading the output: Each Criterion block looks like:
DGSP_in_memory_using_sphincs_shake_256f_with_1024_users_and_1_batch/keygen_manager
time: [3.0519 ms 3.0521 ms 3.0524 ms]
The three values are the lower confidence bound, mean, and upper confidence bound over 100 samples.
The paper reports the mean (middle value).
To populate the paper's table, collect the mean for each operation (keygen_manager, join, csr, gen_cert, sign, verify, open, judge, revoke) from the corresponding log file and convert to milliseconds if needed (Criterion prints in s, ms, µs, or ns depending on magnitude).
Note: The benchmarks were obtained on a specific machine (Ubuntu 24.04, Intel® Core™ i7-4702MQ @ 2.20 GHz, single core, hyper-threading and turbo-boost disabled). Results on other hardware will differ in absolute values, but the relative ordering and scaling behavior should support the main claims of the paper.
Feature Flags
The library supports several feature flags for customization:
in-disk: Enables in-disk storage usingsledcrate.in-memory: Enables in-memory storage.serialization: Enables serialization of cryptographic keys and structures.- SPHINCS+ Variants: Choose from SHA-2-based or SHAKE-based configurations with varying security levels and performance/size goals:
sphincs_sha2_128fsphincs_sha2_128ssphincs_sha2_192fsphincs_sha2_192ssphincs_sha2_256fsphincs_sha2_256ssphincs_shake_128fsphincs_shake_128ssphincs_shake_192fsphincs_shake_192ssphincs_shake_256fsphincs_shake_256s
benchmarking: Used for benchmarking purposes.
Source Code Organization
src/
├── lib.rs # Crate root; re-exports the public API
├── scheme.rs # Core protocol: all DGSP algorithms (keygen_manager, keygen_user,
│ # join, csr, gen_cert, sign, verify, open, judge, revoke) and all
│ # key / signature / certificate type definitions
├── params.rs # Compile-time constants derived from the chosen SPHINCS+ variant
│ # (security level λ, byte sizes for keys, signatures, etc.)
├── db.rs # PLMInterface and RevokedListInterface trait definitions
├── db/
│ ├── in_memory.rs # In-memory PLM and RevokedList (feature: in-memory)
│ └── in_disk.rs # Persistent sled-backed PLM and RevokedList (feature: in-disk)
├── cipher.rs # AES wrapper used for user-ID encryption in traceability
├── hash.rs # Hash function dispatcher (SHA-2 or SHAKE, selected at compile time)
├── hash/ # Per-parameter-set SHA-2 and SHAKE implementations
├── sphincs_plus.rs # SPHINCS+ wrapper: key generation, signing, verification
├── sphincs_plus/ # Per-parameter-set SPHINCS+ constants and ADRS byte-offset tables
├── wots_plus.rs # WOTS+ (Winternitz One-Time Signature Plus) core implementation
├── wots_plus/ # ADRS (address) type used by WOTS+ operations
├── error.rs # Error and Result types (Error, VerificationError)
└── utils.rs # Internal byte-conversion helpers (u32/u64 ↔ big-endian bytes)
benches/
├── dgsp_full_in_memory.rs # Criterion benchmark suite for the in-memory backend
├── dgsp_full_in_disk.rs # Criterion benchmark suite for the in-disk backend
├── bench_utils.rs # Shared helpers (SPHINCS+ feature detection, duration formatting)
└── all_benchmarks.sh # Runs all benchmark configurations and collects log files
examples/
└── simple.rs # End-to-end example covering all DGSP operations
tests/
└── all_features_full_test.sh # Iterates over all SPHINCS+ × storage feature combinations
# and runs the full test suite for each
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
License
This repository is licensed under the MIT License.