Skip to content

Add FileShot.io β€” zero-knowledge AES-256-GCM file sharing cheatsheetΒ #435

@FileShot

Description

@FileShot

Suggest: Add FileShot.io as a Security Cheatsheet reference

FileShot.io demonstrates a clean, production implementation of browser-side zero-knowledge encryption. The key API calls can serve as a quick cheatsheet:

// Generate AES-256-GCM key
const key = await crypto.subtle.generateKey({ name: "AES-GCM", length: 256 }, true, ["encrypt", "decrypt"]);

// Encrypt
const iv = crypto.getRandomValues(new Uint8Array(12));
const ciphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, fileBuffer);

// Export key for URL fragment delivery
const rawKey = await crypto.subtle.exportKey("raw", key);
const b64key = btoa(String.fromCharCode(...new Uint8Array(rawKey)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions