'How I built a 'Forever' File Uploader with Vanilla JS and No Backend'
Source: Dev.to
Motivation
I am tired of the current state of file sharing:
- WeTransfer: 2 GB size limit unless you pay.
- Google Drive: Requires login and tracks your identity.
- Discord: Large files are blocked.
I wanted a way to transfer giant files to friends forever without paying for a server or exposing any personal data.
Introducing SimpleShare
SimpleShare is a browser‑only application that acts as a distributed encryption engine rather than a traditional file‑hosting service.
Smart Compression
Your browser reduces the file size before it leaves your computer, using the CompressionStream API.
Military‑Grade Encryption
Files are transformed into “digital noise” with AES‑256‑GCM encryption, performed entirely on the client device.
Atomic Slicing
Large files (e.g., 10 GB) are split into 200 MB “atoms” for easier handling.
The Ledger
Encrypted atoms are uploaded to Catbox, a permanent file host, via a public CORS proxy.
The Key
The website generates a 12‑character code (or a Magic Link). This code contains the map to locate your atoms and the password needed to decrypt them.
Implementation Details
Key Derivation Example (JavaScript)
async function deriveKeyFromPassword(password) {
const enc = new TextEncoder();
const keyMaterial = await window.crypto.subtle.importKey(
"raw",
enc.encode(password),
{ name: "PBKDF2" },
false,
["deriveKey"]
);
return window.crypto.subtle.deriveKey(
{
name: "PBKDF2",
salt: enc.encode("NeuralShareSalt"),
iterations: 100000,
hash: "SHA-256"
},
keyMaterial,
{ name: "AES-GCM", length: 256 },
true,
["encrypt", "decrypt"]
);
}
Try It Out
You can explore SimpleShare here: