Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nulltea/tlock-rs
Rust library for practical time-lock encryption using `drand` threshold network
https://github.com/nulltea/tlock-rs
cryptography drand encryption timelock tlock
Last synced: 6 days ago
JSON representation
Rust library for practical time-lock encryption using `drand` threshold network
- Host: GitHub
- URL: https://github.com/nulltea/tlock-rs
- Owner: nulltea
- License: mit
- Created: 2022-10-01T12:15:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-24T12:17:59.000Z (almost 2 years ago)
- Last Synced: 2024-05-22T04:27:43.397Z (6 months ago)
- Topics: cryptography, drand, encryption, timelock, tlock
- Language: Rust
- Homepage:
- Size: 20.5 KB
- Stars: 34
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tlock-rs: Practical Timelock Encryption/Decryption in Rust
This repo contains pure Rust implementation of [`drand/tlock`](https://github.com/drand/tlock) scheme. It provides time-based encryption and decryption capabilities by relying on a [drand](https://drand.love/) threshold network and identity-based encryption (IBE). The IBE scheme implemented here is [`Boneh-Franklin`](https://crypto.stanford.edu/~dabo/papers/bfibe.pdf).
## Usage
The tlock system relies on an unchained drand network. Working endpoints to access it are, for now:
- https://pl-us.testnet.drand.sh/
- https://testnet0-api.drand.cloudflare.com/### Lock file for given duration
```bash
cargo run -- lock -o test_lock.pem -d 30s test.txt
```### Lock file for drand round
```bash
cargo run -- lock -o test_lock.pem -r 1000 test.txt
```### Attempt unlocking file
```bash
cargo run -- unlock -o test_unlock.txt test_lock.pem
```Error `Too early` will appear, if one tries to unlock a file before the specified round is reached.
## Known issues
- API currently supports 32 bytes of plaintext
- Cross-library decryption hasn't been verified