A simple app which let you share file securely :)
See the codeSeveral reasons:
What RelaySecret aims for:
Visit https://www.relaysecret.com/ to try it out.
The architecture is Cloudflare Workers + R2 + Pages. Three regional R2 buckets (US, EU, APAC) store ciphertext. The Worker has two jobs:
A KV namespace stores encrypted clipboard blobs.
https://{server}/{object-key}#{key-material}#key-material never leaves the browser (not sent in Referer, not logged server-side).{expiry-days}/{hex-id}. R2 lifecycle rules auto-expire objects by prefix (1-day, 2-day, ..., 10-day).deleteOnDownload are deleted automatically after the first download.Visit https://www.relaysecret.com/tunnel.
Create a "room" by entering a room name (min 8 characters). Others who enter the same room name see the same file list and can share/decrypt files. All files in a room expire after 1 day.
The room name is hashed with SHA-256 to derive the key material. The room name itself is never sent to the server — only the first 16 hex chars of its hash are used as the tunnel ID. Users can add an optional password for extra protection.
Files under 500 MB use the RSv1 format: the entire file is encrypted in one shot with AES-GCM-256, uploaded via a single presigned PUT URL.
Files over 500 MB use the RSv2 chunked format:
All cryptography uses the Web Crypto API. No external libraries.
| Primitive | Usage |
|---|---|
| AES-GCM-256 | File/message encryption. Per-chunk auth tags in RSv2. |
| PBKDF2-HMAC-SHA256 | Key derivation from password + temp key. 600,000 iterations, 16-byte random salt. |
| HMAC-SHA256 | AWS SigV4 presigning, optional upload gate. |
| SHA-256 | Object key generation, room name derivation, VirusTotal lookups. |
The encryption key is derived as: PBKDF2-HMAC-SHA256(password + tempKey, salt, 600000) -> 256 bits. The temp key (128-bit random for single-recipient, SHA-256 of room name for tunnels) is the primary entropy source; the optional password is layered on top.
The application uses symmetric cryptography only — no RSA, ECDH, ECDSA, or any asymmetric primitives. AES-256 and HMAC-SHA256 are considered quantum-resistant: Grover's algorithm halves the effective key space, but AES-256 retains 128-bit post-quantum security which is well beyond practical attacks.
The transport layer (HTTPS) relies on Cloudflare's TLS termination. Cloudflare has been deploying hybrid post-quantum key agreement (X25519 + ML-KEM/Kyber) across their network. This is the only point where asymmetric cryptography enters the threat model, and it is outside the application's control.
See deploy/README.md for the full one-shot deploy script. It provisions R2 buckets, KV namespace, the Worker, Pages, and DNS — all against your own Cloudflare account.
Quick start:
cp deploy/config.example.env deploy/config.env
# fill in your Cloudflare API token + domain
./deploy/deploy.sh --yes
Requirements: wrangler, curl, jq, openssl.
This project is licensed under the GPL-3.0 open source license.
56 commits
7 commits
JavaScript
68.1%
Shell
15.1%
CSS
10.3%
HTML
6.5%
A simple app which let you share file securely :)
See the codeSeveral reasons:
What RelaySecret aims for:
Visit https://www.relaysecret.com/ to try it out.
The architecture is Cloudflare Workers + R2 + Pages. Three regional R2 buckets (US, EU, APAC) store ciphertext. The Worker has two jobs:
A KV namespace stores encrypted clipboard blobs.
https://{server}/{object-key}#{key-material}#key-material never leaves the browser (not sent in Referer, not logged server-side).{expiry-days}/{hex-id}. R2 lifecycle rules auto-expire objects by prefix (1-day, 2-day, ..., 10-day).deleteOnDownload are deleted automatically after the first download.Visit https://www.relaysecret.com/tunnel.
Create a "room" by entering a room name (min 8 characters). Others who enter the same room name see the same file list and can share/decrypt files. All files in a room expire after 1 day.
The room name is hashed with SHA-256 to derive the key material. The room name itself is never sent to the server — only the first 16 hex chars of its hash are used as the tunnel ID. Users can add an optional password for extra protection.
Files under 500 MB use the RSv1 format: the entire file is encrypted in one shot with AES-GCM-256, uploaded via a single presigned PUT URL.
Files over 500 MB use the RSv2 chunked format:
All cryptography uses the Web Crypto API. No external libraries.
| Primitive | Usage |
|---|---|
| AES-GCM-256 | File/message encryption. Per-chunk auth tags in RSv2. |
| PBKDF2-HMAC-SHA256 | Key derivation from password + temp key. 600,000 iterations, 16-byte random salt. |
| HMAC-SHA256 | AWS SigV4 presigning, optional upload gate. |
| SHA-256 | Object key generation, room name derivation, VirusTotal lookups. |
The encryption key is derived as: PBKDF2-HMAC-SHA256(password + tempKey, salt, 600000) -> 256 bits. The temp key (128-bit random for single-recipient, SHA-256 of room name for tunnels) is the primary entropy source; the optional password is layered on top.
The application uses symmetric cryptography only — no RSA, ECDH, ECDSA, or any asymmetric primitives. AES-256 and HMAC-SHA256 are considered quantum-resistant: Grover's algorithm halves the effective key space, but AES-256 retains 128-bit post-quantum security which is well beyond practical attacks.
The transport layer (HTTPS) relies on Cloudflare's TLS termination. Cloudflare has been deploying hybrid post-quantum key agreement (X25519 + ML-KEM/Kyber) across their network. This is the only point where asymmetric cryptography enters the threat model, and it is outside the application's control.
See deploy/README.md for the full one-shot deploy script. It provisions R2 buckets, KV namespace, the Worker, Pages, and DNS — all against your own Cloudflare account.
Quick start:
cp deploy/config.example.env deploy/config.env
# fill in your Cloudflare API token + domain
./deploy/deploy.sh --yes
Requirements: wrangler, curl, jq, openssl.
This project is licensed under the GPL-3.0 open source license.
56 commits
7 commits
JavaScript
68.1%
Shell
15.1%
CSS
10.3%
HTML
6.5%