tlock

Crates.iotlock
lib.rstlock
version0.0.5
sourcesrc
created_at2023-03-22 20:46:54.497661
updated_at2024-02-29 09:41:22.323262
descriptionRust encryption library for practical time-lock encryption.
homepagehttps://github.com/thibmeu/tlock-rs
repositoryhttps://github.com/thibmeu/tlock-rs
max_upload_size
id817468
size85,096
Thibault (thibmeu)

documentation

README

tlock: Practical Timelock Encryption/Decryption in Rust

Documentation License crates.io

tlock is a library to encrypt and decrypt 16-byte binaries using tlock scheme. It provides encrypt and decrypt methods consuming Threshold BLS signatures provided by drand beacons.

The reference interroperable Go implementation is available at drand/tlock.

Tables of Content

Features

  • Timelock encryption and decryption of 16-byte u8 array
  • Encryption with public key on G1 and G2
  • Interroperability with Go and JS implementation
  • wasm32 compatible library

Installation

Environment CLI Command
Cargo (Rust 1.74+) cargo install tlock

The library is tested against the following targets: x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu, wasm32-wasi.

Usage

Code examples are provided in tlock/examples.

The tlock system relies on unchained drand networks.

This crate does not provide a drand client. You can use drand_core.

Security Considerations

This software has not been audited. Please use at your sole discretion. With this in mind, dee security relies on the following:

FAQ

I want to encrypt more than 16 bytes

You should consider using tlock_age. It relies on this library to encrypt an age filekey, allowing for file of arbitrary size to use timelock-encryption.

How does practical timelock encryption work

For the simple explanation, you can use Handwaving Cryptography.

For a more detailed one, you should take time to read tlock: Practical Timelock Encryption from Threshold BLS by Nicolas Gailly, Kelsey Melissaris, and Yolan Romailler.

RFC 9380 Hashing to Elliptic Curve

RFC 9380 standardises a lot of interactions with elliptic curves. tlock did not use it first, and has been upgraded to support it. The feature rfc9380 is enabled by default starting 0.0.4. This is not a backward compatible change.

License

This project is under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be MIT licensed as above, without any additional terms or conditions.

Commit count: 57

cargo fmt