Skip to main content

Passkeys Are for Login: Keep Auth and Encryption Separate

· 8 min read
Victor Jimenez
Senior Product Engineer

Passkey credentials should not double as data-encryption keys. The design looks elegant in review, and then a user switches phones and their data stays behind with the old device. The passkeys critique made this failure mode hard to ignore, so these are the guardrails I would enforce in any architecture review before that design reaches production.

TL;DR
  • Authentication and encryption get separate key lifecycles.
  • Passkeys gate access and authorize key operations. They are never the sole raw key material.
  • Default to KMS-backed envelope encryption for user data.
  • Reject any design that cannot show tested recovery, tested rotation and versioned crypto metadata.

Authentication and encryption have different jobs​

Authentication proves who the user is. Encryption keeps data confidential. The two controls can interact, but they must not share one key lifecycle, because then a login problem becomes a data problem.

A key lifecycle here means everything that happens to a key over time: creation, use, rotation, recovery and revocation. Login credentials and data keys change for different reasons, so each needs its own.

Reality check

If encryption keys are derived directly from passkey credentials, losing the passkey means losing the data. That is the default outcome of normal user behavior: switching devices, resetting an account or changing authentication providers. Reject any design that cannot survive these events without irreversible data loss.

Under that design, the account reset flow also deletes the user's data, and it does so reliably. None of the three events in the diagram is an attack. They are the ordinary week of a user with a new phone.

Approved patterns for user-data encryption​

Three patterns pass review. All three keep the passkey on the access side of the line.

A few terms first. A Data Encryption Key (DEK) encrypts the data itself. A Key Encryption Key (KEK) encrypts, or "wraps", the DEK. A KMS (key management service) or HSM (hardware security module) holds the KEK. AEAD (authenticated encryption with associated data) hides the content and also detects tampering.

Use per-record or per-tenant Data Encryption Keys (DEKs), wrapped by a Key Encryption Key (KEK) in KMS/HSM.

The data path has four steps. Generate a DEK scoped to the object or tenant. Encrypt the plaintext with AEAD (AES-256-GCM or XChaCha20-Poly1305), wrap the DEK with a KEK in managed KMS/HSM, then store the ciphertext with the wrapped DEK and its metadata (algorithm, version, AAD context).

BenefitWhy
Clean key rotationRewrap DEKs without re-encrypting the data
Scoped revocationRevoke one tenant's keys without touching the others
Auditable key usageKMS/HSM keeps the audit trail

Pattern A is the one most products need. This is the request path it describes:

My call: start with Pattern A. Add Pattern B only when a business requirement asks for user-side secrecy, and accept that it brings a recovery path you have to build and test.

Architecture review decision flow​

The review asks four questions in order. Any "no" ends it with a rejection and a pointer to the approved patterns.

The word that matters in each box is "tested". A recovery path described in a design doc and never run does not count.

Anti-patterns to block on sight​

This table does more work in a review than the rest of the post. Each row is a rejection reason on its own.

Anti-patternWhy it fails
Auth == Encryption keyLosing the passkey or credential means permanent data loss
No recovery story"Data gone forever if credential lost" in a mainstream product
Client-only key custody by accidentNo backup, no escrow, no explicit warning to the user
Nonce misuseAEAD nonce reuse, or a deterministic nonce without a proven construction. A nonce is a value that must never repeat under the same key.
Homegrown cryptoCustom primitives, unaudited constructions
Single global DEKOne compromise decrypts the entire user population
Soft-delete onlyKeys stay active after a deletion request
Opaque key metadataNo key IDs, algorithm IDs or version tags
Silent downgradeFalls back to weaker crypto without explicit control and alerting

A single global DEK has one clear efficiency: a single compromise exposes every user at once. Per-tenant DEKs under Pattern A fix it, and revocation then touches one tenant instead of all of them.

Control mapping for review boards​

Sort controls into what must exist, what should exist and what stops a launch.

CategoryControls
Must-haveEnvelope encryption, documented key hierarchy, recovery and rotation runbooks, cryptographic logging and alerting
Should-havePer-tenant key segmentation, periodic key health attestations, break-glass with dual authorization
BlockersIrreversible user-data loss from the normal auth lifecycle, no incident response for key compromise, no test evidence for restore, rotation or deletion flows
No board required

A small team does not need a review board to use this table. I would paste the Blockers row into the pull request template and require test evidence for each item before merge.

Practical default baseline for most SaaS products
  • WebAuthn/passkeys for phishing-resistant authentication
  • KMS-backed envelope encryption for user data
  • Argon2id-derived user secret only where business requirements need user-side secrecy
  • Documented recovery with explicit user communication

This gives strong authentication and durable encryption, and the product's data does not depend on a single credential.

Plugins, modules and hosted user data​

Drupal and WordPress sites store user data, PII and sometimes regulated content, so the same rules apply to contrib modules and plugins that add auth or encryption.

Module or plugin addsRule
Auth: SSO, passkeys, 2FAPasskeys or OAuth tokens gate access. They are never the only key for stored data.
Encryption: field-level, backupPrefer envelope encryption with a KEK in managed KMS where possible
EitherReject designs where losing the auth credential means irreversible data loss. Require a documented recovery path.

Hosting and platform teams that offer encryption at rest or key management, such as Pantheon, Acquia and WP Engine, should follow these patterns too. Otherwise site builders inherit the anti-patterns with the hosting plan.

Review checklist​

Use this list to verify a design before approval. Each checked box needs a test run or a document behind it.

  • No auth credential is used directly as an encryption key
  • Recovery path exists and has test evidence
  • Rotation path exists and has test evidence
  • Ciphertext carries key ID, algorithm ID and version tag
  • DEKs are scoped per record or per tenant, never global
  • AEAD nonces are never reused
  • No custom primitives or unaudited constructions
  • Deletion requests revoke keys, not only rows
  • Any crypto fallback is explicit and alerts
  • Incident response exists for key compromise

I would add the anti-pattern table to the review template as a gate, next to this checklist.