Skip to content

TheGreatAzizi/Secure-Pastebin-Cloudflare-Worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Secure Pastebin Logo

πŸ” Secure Pastebin

End-to-End Encrypted Message Sharing on Cloudflare Workers
Zero-Knowledge β€’ Password Protected β€’ Self-Destructing

πŸš€ Live Demo ✨ Self-Hosted Ver

AES-256 Zero-Knowledge Cloudflare MIT License


✨ Features

Feature Description
πŸ”’ AES-256-GCM Encryption Military-grade encryption in your browser
πŸ›‘οΈ Zero-Knowledge Architecture Server cannot read your data. Ever.
πŸ”‘ Optional Password Protection Extra layer with PBKDF2 key derivation
πŸ”₯ Burn After Reading Self-destruct after first view
⏱️ Expiration Control 1 hour to 30 days
🌍 Auto RTL Support Persian, Arabic, Hebrew auto-detection
πŸ“± Fully Responsive Works on all devices
🚫 No Registration No emails, no accounts, no tracking

πŸ” How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     AES-256-GCM      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Browser   β”‚ ───────────────────→ β”‚  Cloudflare β”‚
β”‚  (Encrypt)  β”‚                      β”‚     KV      β”‚
β”‚  Key in URL β”‚ ←─────────────────── β”‚  (Storage)  β”‚
β”‚   Fragment  β”‚                      β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Client-Side Encryption: Message encrypted in browser before sending
  2. Key in URL Fragment: Decryption key never reaches server (after #)
  3. Zero Storage: Server only sees ciphertext, never plaintext
  4. Optional Password: PBKDF2 with 100,000 iterations for extra security

πŸš€ Deployment Guide

This guide uses Cloudflare Dashboard (no CLI required) - the exact method used for sp.theazizi.ir

Prerequisites

  • Cloudflare account (free tier works)
  • 5 minutes of your time

Step 1: Create KV Namespace

  1. Go to dash.cloudflare.com
  2. From left sidebar: Storage & Databases β†’ KV
  3. Click "Create a namespace"
  4. Name: PASTEBIN_KV
  5. Click "Create"

⚠️ Important: Remember this exact name - PASTEBIN_KV


Step 2: Create Worker

  1. Go to Workers & Pages β†’ Create application
  2. Click "Create Worker"
  3. Name your worker (e.g., secure-pastebin)
  4. Click "Deploy" (we'll replace the code next)

Step 3: Bind KV to Worker

This step is critical - connects your KV to the worker:

  1. In your Worker dashboard, click "Settings" tab
  2. Go to Bindings section
  3. Click "Add"
  4. Select "KV Namespace"
  5. Configure:
    • Variable name: PASTEBIN_KV (must match exactly)
    • KV namespace: Select the one you created in Step 1
  6. Click "Deploy"

Step 4: Add the Code

  1. In your Worker, go to "Edit code" (or Quick Edit)
  2. Delete all existing code
  3. Copy the entire worker.js from this repo
  4. Paste into the editor
  5. Click "Save and Deploy"

Step 5: Add Custom Domain (Optional)

To use your own domain like sp.theazizi.ir:

  1. In Worker dashboard, go to "Triggers" tab
  2. Click "Add Custom Domain"
  3. Enter your subdomain (e.g., sp.yourdomain.com)
  4. Add CNAME record in your DNS pointing to your worker
  5. Wait for SSL certificate (automatic)

πŸ› οΈ Local Development (Optional)

If you prefer Wrangler CLI:

# Install Wrangler
npm install -g wrangler

# Login to Cloudflare
wrangler login

# Create KV namespace
wrangler kv:namespace create "PASTEBIN_KV"

# Update wrangler.toml with your KV ID
# Deploy
wrangler deploy

πŸ” Security Details

Encryption

  • Algorithm: AES-256-GCM
  • Key Derivation: PBKDF2 (100,000 iterations)
  • IV: Random 12-byte per message
  • Key Location: URL fragment (never sent to server)

Privacy

  • No server-side logs
  • No analytics or tracking
  • No registration required
  • Messages auto-expire
  • Burn-after-read option

πŸ“ Project Structure

secure-pastebin/
β”œβ”€β”€ worker.js          # Main Cloudflare Worker code
β”œβ”€β”€ README.md          # This file
└── LICENSE            # MIT License

🌐 Internet Freedom

#InternetForAll

Internet access is a fundamental human right.
Restricting internet access violates human rights and limits freedom of expression, access to information, and the ability to communicate securely. We believe in free, open, and secure internet for everyone β€” regardless of borders, politics, or censorship.

This tool is built to ensure private, secure communication remains accessible to all.


🀝 Contributing

Contributions welcome! Areas to improve:

  • File attachments (encrypted)
  • QR code generation for sharing
  • Custom themes
  • Browser extension

πŸ“œ License

MIT License - see LICENSE file


πŸ‘€ Author

TheGreatAzizi


Built with ❀️ for a free and open internet

About

πŸ” Secure Pastebin β€” End-to-End Encrypted Message Sharing. Zero-knowledge, password protected, self-destructing. Live demo: https://sp.theazizi.ir #InternetForAll

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors