8000 GitHub - osbytes/crypt.fyi: Ephemeral, zero-knowledge, end-to-end post-quantum encrypted sensitive data sharing Β· GitHub
[go: up one dir, main page]

Skip to content
7FFF
osbytesPublic

Latest commit

Β 

History

457 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

logo

crypt.fyi - A zero-knowledge, end-to-end encrypted secret sharing platform that enables secure and private transmission of sensitive data.

osbytes β€” open source bytes CI Security Headers Mozilla HTTP Observatory Grade CII Best Practices i18n

Features

  • πŸ” End-to-end encryption using ML-KEM post-quantum cryptography
  • πŸ›‘οΈ Strict Content Security Policy (CSP) to prevent XSS attacks and unauthorized resource loading
  • πŸ›‘οΈ Strict rate limits to mitigate brute-force attacks
  • 🀫 Zero-knowledge architecture - server never sees unencrypted data or decryption keys
  • πŸ”₯ Burn after reading w/ provisions to prevent erroneous burns from bots or url introspection
  • πŸ”₯ Burn after n read failures
  • ⏰ Automatic expiration (Time-To-Live)
  • πŸ—οΈ Password protection
  • πŸ“ File sharing support w/ drag and drop
  • πŸͺ Webhook notifications for read success, read failure, and burn events
  • 🌐 IP/CIDR allow-listing
  • πŸ”’ Read count limits
  • πŸ“± QR code generation
  • ⌨️ CLI for interacting with the API
  • 🧩 Chrome Extension
  • 🐳 Docker images for the api server and web client
  • 🌐 Internationalization support for multiple languages

How It Works

  1. Encryption key is generated on the client
  2. Password is optionally provided
  3. Encryption key and password are used to encrypt the secret
  4. Encryption key and password are hashed and stored along with the encrypted secret for verification on retrieval - the raw key and password are never stored or transmitted on/to the server
  5. The unique URL containing the decryption key is generated on the client
  6. Share the URL with your recipient and separately the password if specified
  7. When accessed, only when the decryption key and password match via server-side verification of the hashes, the encrypted secret is shared and decrypted in the recipient's browser
  8. Optionally, the secret is automatically destroyed after being read in an atomic read & delete operation guaranteeing only one person can access the secret
  9. If retrieval doesn't happen within the TTL, the secret is automatically destroyed

RFC

API Usage

OpenAPI Specification

Deployment

Docker

API_URL=https://{your-domain-here} ENCRYPTION_KEY=$(openssl rand -base64 32) docker compose up --build

ENCRYPTION_KEY encrypts IP restrictions and webhook URLs at rest in Redis. Keep it stable across restarts (e.g. in a .env file next to docker-compose.yaml); changing it makes existing secrets with those options unreadable.

API_URL is read when the web container starts, so changing it only needs a restart (docker compose up -d), not a rebuild. It must be a plain http(s)://host[:port][/path] URL; the container refuses to start otherwise.

A prebuilt API server image (linux/amd64, linux/arm64) is published to GHCR on every release:

docker pull ghcr.io/osbytes/crypt.fyi-server:latest

It runs with NODE_ENV=production and requires REDIS_URL and ENCRYPTION_KEY.

The web client image is not published to GHCR yet; build it with docker compose as above.

Railway

Deploy on Railway

Development

  1. Clone the repository
  2. Enable Corepack (uses the packageManager field β†’ pnpm):
    npm install -g corepack   # Node 25+ no longer bundles it
    corepack enable
  3. Install dependencies:
    pnpm install
  4. Set up environment variables (see .env.example)
  5. Start the development server:
    pnpm dev

Releasing packages

Publishable packages: @crypt.fyi/core and @crypt.fyi/cli (npm), plus the Chrome extension.

  1. Record changes: pnpm changeset
  2. Merge to main β€” the Release workflow opens a Version Packages PR (or publishes when that PR is merged)
  3. Required GitHub secrets for publishing:
    • NPM_TOKEN
    • CHROME_EXTENSION_ID, CHROME_CLIENT_ID, CHROME_CLIENT_SECRET, CHROME_REFRESH_TOKEN, CHROME_PUBLISHER_ID

Technical Stack

Known Issues & Development Considerations

Content Security Policy

  • Production CSP (including style-src hashes for sonner/Radix inline styles) lives in nginx/nginx.conf
  • vite preview applies that same policy via packages/web/csp.ts so local/CI match production
  • pnpm test:e2e runs Playwright against vite preview under that CSP (default createβ†’readβ†’burn, password unlock). It fails on style-src / connect-src violations; other console warnings/errors and non-style CSP noise (e.g. script-src eval fallback notes) are reported as non-blocking annotations
  • The e2e API uses an in-memory rate limiter and dedicated ports (:4322 API / :4173 preview by default) so local pnpm dev and shared Redis rate-limit keys cannot poison the suite. Playwright rebuilds the web client with that API URL before preview so CSP connect-src matches the baked client config.
  • When a test fails on style-src, add the reported hash to nginx/nginx.conf (do not weaken to 'unsafe-inline')
  • Reference: sonner#449

Development Environment

  • Ensure Redis is running locally when developing the server
  • The web client expects the API to be available at http://localhost:4321 by default
  • CSP headers in development may differ from production configuration

Security Considerations

  • Always test encryption/decryption flows thoroughly when making changes
  • Ensure no sensitive data is logged or exposed in error messages
  • Maintain strict CSP headers to prevent XSS vulnerabilities
  • Keep dependencies updated for security patches

Contributing

Contributions are welcome! Please feel free to submit an Issue or Pull Request on GitHub.

Packages

Used by

Contributors

Languages

0