Expand description
Time-lock encryption for scheduled content release.
This module provides time-lock encryption that allows encrypting content that can only be decrypted after a certain time period. This is useful for:
- Scheduled content release in P2P networks
- Fair exchange protocols
- Delayed disclosure mechanisms
§Example
use chie_crypto::timelock::{timelock_encrypt, timelock_decrypt, TimeParams};
// Encrypt data that requires 100,000 sequential hash operations to decrypt
let data = b"Secret content to be released in the future";
let params = TimeParams::new(100_000);
let locked = timelock_encrypt(data, ¶ms).unwrap();
// Decrypt (requires performing the time-lock computation)
let decrypted = timelock_decrypt(&locked).unwrap();
assert_eq!(data, &decrypted[..]);Structs§
- Time
Lock Ciphertext - A time-locked ciphertext that can only be decrypted after performing the required number of hash iterations.
- Time
Lock Puzzle - A time-lock puzzle that can be used for timed release of secrets.
- Time
Params - Parameters for time-lock encryption.
Enums§
- Time
Lock Error - Error types for time-lock encryption operations.
Functions§
- timelock_
decrypt - Decrypt time-locked data.
- timelock_
encrypt - Encrypt data with time-lock encryption.
- timelock_
encrypt_ with_ puzzle - Encrypt data using a pre-created time-lock puzzle.