Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thibmeu/tlock-worker

Demonstration worker supporting timelock encryption.
https://github.com/thibmeu/tlock-worker

cryptography encryption rust tlock workers

Last synced: about 11 hours ago
JSON representation

Demonstration worker supporting timelock encryption.

Awesome Lists containing this project

README

        

# tlock-worker

Demonstration worker supporting timelock encryption.

## Usage

If you'd like to perform local encryption and decryption, you can install `dee`. Pre-build binaries are available on [GitHub](https://github.com/thibmeu/drand-rs/releases).

The worker is configured to use quicknet `https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971`.

### Encryption

**Only supported for a fixed round number when using the worker.**

* local: `dee crypt -r 1000 original.png > encrypted.pem`
* remote: `curl -X POST --data-binary @original.png https://tlock-worker.crypto-team.workers.dev/encrypt/1000 > encrypted.pem`

### Decryption

* local: `dee crypt --decrypt encrypted.pem > decrypted.png`
* remote: `curl -X POST --data-binary @encrypted.pem https://tlock-worker.crypto-team.workers.dev/decrypt > decrypted.png`

## Development

This template starts you off with a `src/lib.rs` file, acting as an entrypoint for requests hitting your Worker. Feel free to add more code in this file, or create Rust modules anywhere else for this project to use.

With `wrangler`, you can build, test, and deploy your Worker with the following commands:

```sh
# run your Worker in an ideal development workflow (with a local server, file watcher & more)
$ npm run dev

# deploy your Worker globally to the Cloudflare network (update your wrangler.toml file for configuration)
$ npm run deploy
```

Read the latest `worker` crate documentation here: https://docs.rs/worker