The Radius SKDE is a cryptographic library built in Rust for advanced encryption and key aggregation processes. This design represents a step forward from Multiparty Delay Encryption (MDE)[KAJ+23]. It provides features like delayed encryption mechanisms and key aggregation circuits, which can be used in secure and privacy-preserving applications.
Delay encryption is a cryptographic tool that employs time-lock puzzles to enforce a predetermined delay on the availability of a decryption key. This method ensures that encrypted data cannot be decrypted until a specified amount of computational work, often measured in time, has been completed.
As its core, delay encryption involves two main phases: encryption and timed decryption. During the encryption phase, data is encrypted using a standard cryptographic algorithm, and a time-lock puzzle is generated. This puzzle is constructed in such a way that solving it requires a predictable amount of computational effort, effectively creating a “delay” before the information can be accessed.
To improve efficiency for large messages, the SKDE protocol supports an optional hybrid encryption mode. In this mode, the message is encrypted using AES-GCM (a symmetric cipher), and only the AES key and IV are encrypted using the delay encryption mechanism. This approach significantly reduces ciphertext size and encryption time while preserving the delayed-decryption guarantee.
Radius SKDE includes several tests to verify the correctness and measure the performance of the delay encryption protocol.
cargo test benchmark_standard_vs_hybrid_various_lengths -- --nocapture
This test compares Standard vs Hybrid encryption across various message sizes.
For each input size (64, 128, 256, 512, 1024, 2048 bytes), it performs the following steps:
-
Setup Parameters: Generates two large prime numbers
$p$ and$q$ to create an RSA modulus$n = p * q$ . Sets all the parameters including a generator$g$ that will be used for base of exponentiation operation and the delay time parameter and maximun number of sequencers to set. - Generate Partial Keys and Proofs: Creates partial keys and validity proofs for each sequencer. (TODO) In a complete implementation, range proofs would be used to ensure that the aggregated keys represent a unique combination of partial keys.
- Verify All Generated Partial Keys: Confirms the validity of all generated keys.
- Aggregate Partial Keys: Combines partial keys into a single aggregated key.
- Encrypt a Message: Encrypts a test message using the aggregated key.
- Solve Time-lock Puzzle: Solves a time-lock puzzle to retrieve the secret key.
- Decrypt the Cipher Text: Decrypts the encrypted message and checks it matches the original.
It measures:
-
Encryption time
-
Puzzle-solving time
-
Decryption time
-
Ciphertext size
Note that, in a standard implementation, large prime numbers
Step 2 must include a range proof to ensure that the aggregated keys uniquely represent the combination of partial keys. This can be achieved using zero-knowledge proof circuit. (This will be implemented soon.)
This test ensures the delay encryption feature is functioning correctly and verifies key generation, encryption, decryption, and time-lock puzzle-solving processes.
cargo test test_secure_setup
This test ensures that setup() correctly generates valid SKDE parameters.
cargo test test_secret_key_validation
This test guarantees that the derived secret key is functionally valid for use in delay encryption.
This SKDE includes parameters for cryptographic configurations, such as bit length, prime values, and a generator. You can find these constants in the lib.rs
file:
-
MAX_SEQUENCER_NUMBER:
$2$ (default for this project) -
BIT_LEN:
$2048$ (bit length of$n$ ) - GENERATOR: A constant value used in cryptographic functions
-
TIME_PARAM_T:
$2$ (defines delay time as$2$ ^TIME_PARAM_T
)
These constants define the environment and security parameters for delay encryption and key aggregation circuit.
We appreciate your contributions to our project. Visit issues page to start with or refer to the Contributing guide.
If you cannot find answers from our Guides(WIP) and Documentation(WIP), refer to Getting Help.