Skip to main content

Client-side form encryption that encrypts submissions before they leave the browser and works with any POST endpoint.

Project description

formseal-embed

formseal-embed

A server-blind, browser-native encrypted form poster.


Form submissions are encrypted in the browser using X25519 sealed boxes before reaching your endpoint. The backend stores ciphertext prefixed with formseal.. Decryption is operator-controlled.

formseal-embed is not a hosted service, dashboard, or SaaS. It is a drop-in client-side utility.


Installation

Via pipx (recommended)

pipx install formseal-embed

Via pip

pip install formseal-embed

Quick start

fse init
fse set endpoint
fse set key
fse set origin
fse --status

See Getting started for key generation.


How it works

Browser (formseal-embed)
       │
       ▼ (encrypted submissions)
  Your server / endpoint
       │
       ▼ (fsf fetch — optional)
  Your local machine

On submit, formseal:

  1. Collects field values by name attribute
  2. Validates against fields.jsonl
  3. Seals the payload with crypto_box_seal
  4. POSTs ciphertext (prefixed formseal.) to your endpoint

Your endpoint stores the ciphertext. Only the holder of the private key can decrypt.


Security guarantee

If the endpoint is fully compromised, seized, or maliciously operated, previously submitted form data remains confidential.

Encryption happens in the browser. The backend stores ciphertext only. Decryption keys never exist in the backend environment. A backend compromise yields no recoverable plaintext.


Wire up your HTML

After fse init, files live in ./formseal-embed/. Reference them via your server's static path (e.g. /formseal-embed/globals.js).

<form id="contact-form">

  <!-- honeypot — hide off-screen with CSS -->
  <input type="text" name="_hp" tabindex="-1" autocomplete="off"
    style="position:absolute;left:-9999px;opacity:0;height:0;">

  <input type="text"  name="name">
  <span data-fse-error="name"></span>

  <input type="email" name="email">
  <span data-fse-error="email"></span>

  <textarea name="message"></textarea>
  <span data-fse-error="message"></span>

  <button type="submit" id="contact-submit">Send message</button>
</form>

<div id="contact-status"></div>

<script>
  window.fseCallbacks = {
    onSuccess: () => document.getElementById('contact-status').textContent = 'Sent securely.',
    onError:   (err) => console.error('formseal error:', err),
  };
</script>

<script src="/formseal-embed/globals.js"></script>

Payload format

{
  "version": "fse.v1.0",
  "origin": "contact-form",
  "id": "<uuid>",
  "submitted_at": "<iso8601>",
  "data": {
    "name": "...",
    "email": "...",
    "message": "..."
  }
}

The entire object is sealed with crypto_box_seal. Your endpoint receives ciphertext prefixed with formseal. as the request body.

No IP, no timezone, no fingerprints — just the data you explicitly collect.


Field configuration

Fields are defined in fields.jsonl (one JSON object per line):

{"name": {"required": true, "maxLength": 100}}
{"email": {"required": true, "type": "email"}}
{"message": {"required": true, "maxLength": 1000}}

Manage fields with the CLI:

fse field add phone type:tel required:false
fse field remove company

CSS hooks

Selector When
[data-fse-error="field"] Populated with a validation error
[aria-invalid="true"] Set on invalid inputs
[data-fse-status="success"] Set on status element on success
[data-fse-status="error"] Set on status element on error

What formseal-embed does not do

  • No admin dashboard or inbox UI
  • No hosted service
  • No bundled decryption tools (yet)
  • No npm dependencies at runtime

These are intentional.


Documentation


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

formseal_embed-3.8.0.tar.gz (313.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

formseal_embed-3.8.0-py3-none-any.whl (321.7 kB view details)

Uploaded Python 3

File details

Details for the file formseal_embed-3.8.0.tar.gz.

File metadata

  • Download URL: formseal_embed-3.8.0.tar.gz
  • Upload date:
  • Size: 313.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for formseal_embed-3.8.0.tar.gz
Algorithm Hash digest
SHA256 756a8c0d1a2508e47bd0254fdc4bc0904315a371308b9d1fb35b0fca1f4d2dec
MD5 68bdea8d5fc4357c34f2f82493e67744
BLAKE2b-256 e13bdbf1662177bafec56ab0d0f4c3e3e89fd7441a7ec3ab77fcf88760705f26

See more details on using hashes here.

Provenance

The following attestation bundles were made for formseal_embed-3.8.0.tar.gz:

Publisher: publish.yml on useFormseal/embed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file formseal_embed-3.8.0-py3-none-any.whl.

File metadata

  • Download URL: formseal_embed-3.8.0-py3-none-any.whl
  • Upload date:
  • Size: 321.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for formseal_embed-3.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 946240f9c5971208ced8c9c1514acea8a83e86cd2f69b51b5cda7a2ed08f9dfa
MD5 2f0bc20fc50175c259a2253fbdafd269
BLAKE2b-256 1d884652271eca339261a27ba80c8e8dd3eaec0bc377babeef1daafcecf72ca1

See more details on using hashes here.

Provenance

The following attestation bundles were made for formseal_embed-3.8.0-py3-none-any.whl:

Publisher: publish.yml on useFormseal/embed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page