Email-Based Key Recovery
Email-Based User Secret for Deterministic Key Recovery
This document describes a secure mechanism for generating a private key without storing it on the backend, while allowing the user to recover it later using only a token delivered by email. The backend must not be able to reconstruct the private key without the user’s email token.
Overview
The system uses a high-entropy email token as the user’s true secret.
The backend stores only a verifier of this token, never the token itself, and never the private key.
This achieves:
- Non-custodial key ownership (backend cannot regenerate the key).
- Simple UX: the user only needs to keep an email.
- Deterministic regeneration of the same private key from the email token.
- Zero storage of private keys server‑side.
Core Idea
- Backend generates a random 256-bit token
T. - Backend sends
Tto the user via email. - Backend stores only a hash of
T(e.g., Argon2id output). - The client uses
Tto derive: - Backend cannot regenerate the private key because it does not know
T.
User recovery is possible simply by finding the email again.
Enrollment Flow
1. Backend generates token
Tis never stored.- Only
tokenHash+saltServerare kept.
2. Client receives token and derives key
Client extracts T (directly or from a URL fragment):
Client registers publicKey with backend.
3. Backend links signer
Backend stores:
Backend still cannot regenerate privateKey.
Authentication Flow (Using Email Token)
- Client asks backend for login.
- Backend sends a challenge.
- Client re-derives:
- Backend verifies signature using stored
publicKey.
Recovery Flow
To recover the signer on a new device:
- User finds the email containing token
T. - Client derives the same private key:
- Client proves ownership by signing a challenge.
- Backend validates and grants access.
Backend cannot recover the key without the user; only the user has T.
Threat Model
Backend DB compromised
Attacker obtains:
tokenHashsaltServerpublicKey
Cannot:
- Derive
T(Argon2id is slow + unknown entropy source) - Derive
privateKey - Authenticate as user
Email compromise
Attacker gains access to email → attacker can read T.
This is the intended trade-off:
security is anchored in email ownership, not backend trust.
User forgets token
If the user deletes or loses the email, the key becomes unrecoverable unless an external recovery method is implemented (e.g., Safe guardians).
Optional: Backup Encryption Variant
If the private key should be randomly generated, not derived from T:
- Client generates
privateKeyrandomly. - Backend sends
Tby email. - Client derives:
- Backend stores only
C+backupSalt.
To recover:
Backend never learns the key.
Summary
Using a high-entropy email token allows:
- Deterministic private key derivation
- No backend access to the private key
- Simple user recovery (keep the email)
- Strong security as long as the email account is trusted
This method is ideal for systems where users should own cryptographic keys without managing complex secrets or seed phrases.