Skip to content

Commit 6ec42f6

Browse files
author
André Ribas
committed
up
1 parent c3ec636 commit 6ec42f6

3 files changed

Lines changed: 55 additions & 36 deletions

File tree

‎README.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 🔐 cipherlink
2+
3+
`cipherlink` is a lightweight, secure URL redirection service built on **Cloudflare Workers**. It uses end-to-end encryption to protect destination URLs until they are decrypted by the worker at runtime.
4+
5+
## 🚀 How it works
6+
7+
The service listens for requests with an encrypted `ref` parameter. It then:
8+
1. Performs an **X25519** Diffie-Hellman key exchange using a private key stored in its environment.
9+
2. Derives a shared secret.
10+
3. Decrypts the destination URL using **AES-256-GCM**.
11+
4. Redirects the user to the decrypted URL.
12+
13+
This ensures that the final destination of a link is hidden from intermediate layers (like logs or analytics) until the moment of redirection.
14+
15+
## ✨ Features
16+
17+
- **X25519 Key Exchange**: Robust asymmetric encryption for shared secret derivation.
18+
- **AES-GCM**: High-performance symmetric encryption for the payload.
19+
- **Cloudflare Workers**: Global distribution and low latency.
20+
- **Privacy Oriented**: Destination URLs are never stored or transmitted in plain text.
21+
22+
## 🛠️ Setup
23+
24+
### Environment Variables
25+
26+
You need to configure the following environment variables in your Cloudflare dashboard or `wrangler.jsonc`:
27+
28+
- `PRIVATE_KEY_RAW`: Your X25519 private key in Base64Url format.
29+
- `URL_BASE`: The default URL to redirect to if no `ref` parameter is provided.
30+
31+
### Deployment
32+
33+
```bash
34+
npm install
35+
npm run deploy
36+
```
37+
38+
## 💻 Development
39+
40+
### Key Scripts
41+
42+
- `npm run dev`: Start a local development server using `wrangler`.
43+
- `npm run test`: Run the test suite using `vitest`.
44+
- `npm run cf-typegen`: Generate TypeScript types for your environment bindings.
45+
46+
## 📄 License
47+
48+
MIT.

‎package-lock.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎wrangler.jsonc‎

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,12 @@
1-
/**
2-
* For more details on how to configure Wrangler, refer to:
3-
* https://developers.cloudflare.com/workers/wrangler/configuration/
4-
*/
51
{
62
"$schema": "node_modules/wrangler/config-schema.json",
7-
"name": "h4f-me-url",
3+
"name": "cipherlink",
84
"main": "src/index.ts",
95
"compatibility_date": "2025-09-27",
106
"observability": {
117
"enabled": true
8+
},
9+
"vars": {
10+
"URL_BASE": "https://hackerfofo.com/"
1211
}
13-
/**
14-
* Smart Placement
15-
* https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
16-
*/
17-
// "placement": { "mode": "smart" }
18-
/**
19-
* Bindings
20-
* Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
21-
* databases, object storage, AI inference, real-time communication and more.
22-
* https://developers.cloudflare.com/workers/runtime-apis/bindings/
23-
*/
24-
/**
25-
* Environment Variables
26-
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
27-
* Note: Use secrets to store sensitive data.
28-
* https://developers.cloudflare.com/workers/configuration/secrets/
29-
*/
30-
// "vars": { "MY_VARIABLE": "production_value" }
31-
/**
32-
* Static Assets
33-
* https://developers.cloudflare.com/workers/static-assets/binding/
34-
*/
35-
// "assets": { "directory": "./public/", "binding": "ASSETS" }
36-
/**
37-
* Service Bindings (communicate between multiple Workers)
38-
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
39-
*/
40-
// "services": [ { "binding": "MY_SERVICE", "service": "my-service" } ]
4112
}

0 commit comments

Comments
 (0)