Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/thibmeu/tlock-worker
- Owner: thibmeu
- Created: 2024-02-27T15:52:57.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-29T15:32:38.000Z (9 months ago)
- Last Synced: 2024-03-01T15:53:54.970Z (9 months ago)
- Topics: cryptography, encryption, rust, tlock, workers
- Language: Rust
- Homepage: https://tlock-worker.crypto-team.workers.dev
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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