explainer
How a signing link can carry its own decryption key
End-to-end encrypted e-signatures, explained: why the part of a URL after the # never reaches the server, how one secret becomes a token and a key, and the trade-offs.
To collect a signature from someone else, a document has to travel. The usual design sends it to the signing service, which stores it, shows it to each signer and assembles the result. It works, but it means the service, and anyone who compromises it, can read every contract that passes through.
There is another way: encrypt the document before it leaves the sender's browser and give each signer the key inside their link. The server stores data it cannot read. This article explains how that works on signer.tools, why it relies on a small, old detail of how URLs work, and what it costs.
The detail that makes it possible: the URL fragment
A URL such as https://signer.tools/sign#Ab3d…x9.Qm7…Lk has two parts that matter here:
https://signer.tools/signis what the browser asks the server for.#Ab3d…x9.Qm7…Lkis the fragment. It is defined in RFC 3986 as a reference to something inside the page, and browsers keep it to themselves: it is not part of the HTTP request, it does not appear in server logs, and it is removed from theRefererheader sent to other sites.
The page's own JavaScript can read the fragment, which is exactly what we need. The server delivers the signing page; the page reads the key from the fragment and does the decryption locally.
From one secret to a token and a key
When a sender creates a signature request, their browser does the following before uploading anything:
- Generates a content key, a random 256-bit AES key, and encrypts the PDF, its title, the sender's message, every signer's name and email, and the field layout with AES-256-GCM.
- Generates one link secret per person: one for the sender and one for each signer, each 256 random bits.
- Derives two values from each secret with HKDF-SHA-256, salted with the envelope's identifier:
- an access token, which the browser presents to the server to prove it holds a valid link;
- a wrapping key, which encrypts a copy of the content key for that person.
- Uploads the ciphertext, each person's wrapped content key and the access tokens. The server stores the tokens only as SHA-256 hashes.
- Builds the links, putting each person's envelope identifier and secret in the fragment.
The key-derivation step is what keeps the server out. It sees the access token, but HKDF is a one-way function: knowing the token does not reveal the secret, and without the secret the wrapping key cannot be computed.
What happens when a signer opens their link
The signer's browser loads the page, reads the secret from the fragment, and derives the same two values. It sends the access token to fetch the encrypted document and its wrapped key, unwraps the content key, and decrypts the PDF in memory.
When they sign, their field values and signature image are encrypted with the same content key before upload. Every ciphertext is bound to its envelope and slot using AES-GCM's authenticated data, so the server cannot swap one signer's submission for another's, or move a document between envelopes, without decryption failing.
Before a signer can sign, their browser also recomputes the document's SHA-256 hash from the file it actually decrypted and compares it with the hash the sender's browser recorded at the start. If they differ, it refuses to continue. That fingerprint is part of the audit trail, which the server can record because it is metadata, not content.
What the server can and cannot see
| The server can see | The server cannot see |
|---|---|
| That an envelope exists, its size and its number of signers | The document, its title or file name |
| Whether signing is in order | Signer names and email addresses |
| When each action happened, from which IP address and browser | The sender's message |
| A SHA-256 fingerprint of the original document | Signatures, typed values and decline reasons |
The trade-offs
This design is not free. These are its costs, stated plainly:
- The service cannot send emails for you. To email a signing link, a server would need the link, and the link contains the key. Instead, the sender's browser opens their own email app with the message ready, or copies the link. One extra step is the price of the server staying blind.
- A link is a key. Anyone who obtains a signing link can open the document and sign as that person. Treat links like passwords, and the sender's own link, which can read and cancel the whole request, even more so.
- Links live in browser history. Fragments are stored in history like the rest of the URL. On a shared computer, use a private window or clear history after signing.
- You trust the code that is served. As with every web application that encrypts in the browser, the encryption code comes from the server. A compromised server could serve altered code to new visitors. A strict Content Security Policy on the signing pages, which allows only the site's own scripts, narrows that risk but cannot remove it.
- Signers are identified by possession of the link, not by an ID check. That is a simple electronic signature, and the certificate page says so. For the difference this makes, see electronic vs digital signatures.
Sending links safely
- Send each link only to its signer, through a channel you trust, such as email to an address you have used before or a messaging app you already use with them.
- Do not paste signing links into shared channels or tickets.
- Chat apps that show link previews fetch the page without the fragment, so a preview does not expose the key. The message itself still contains the full link, so the usual care applies.
- If a link may have reached the wrong person, cancel the request from your sender page and send a new one. Cancelling deletes the ciphertext immediately.
The full model, including the digital seal and the limits listed here, is on the security page. If you only need your own signature, sign the PDF yourself: then the file never leaves your device at all.
Written by
Abdessamad Bettal
Abdessamad designs and builds signer.tools, including its in-browser encryption, PDF sealing and verification. These guides explain how electronic signatures work underneath, in plain language, with the same care for accuracy that goes into the product.