The app key
After sign-in your app receives productKey: a 256-bit AES-GCM key, different for every user and every app. Your app uses it to encrypt the user's data before sending it to your server. Your server stores ciphertext it can't read.
Where it comes from
- Every Novren ID account has a root key, born from the user's password on their device and never sent anywhere in clear.
- The first time a user authorizes your app, their device creates 32 random bytes, your app key, seals them under the root key and stores the sealed copy on Novren ID. Novren ID can't open it.
- At every sign-in, the account page opens that copy on the user's device and seals it for your app's ephemeral key (see How sign-in works).
So the same user gets the same key at every sign-in, on every device and every client of your app.
What your app gets
In the browser SDK productKey is a non-extractable CryptoKey for AES-GCM with encrypt and decrypt: your code can use it but cannot read its bytes, so a script injected later can't copy it out. In the Rust crate it is product_key: Zeroizing<[u8; 32]>, wiped from memory when dropped.
How to use it: Encrypt user data.
The identity
From the app key the SDK also derives identity, a key pair for encryption (X-Wing) and one for signatures (Ed25519). They let users of your app exchange data with each other end to end: the public halves are published in a directory, signed by the account, and anyone can check them with verifyDirectoryEntry. See the reference.
The private seeds in identity are plain bytes: keep them only in memory and only as long as needed.
What can't happen
- Your server can't get the key. It reaches your app only through the fragment and is opened in the browser.
- Another app can't get your key, and you can't get theirs: the envelope is bound to app, client and request.
- Novren ID can't get the key: it stores only a copy sealed under a root key it never sees.
What you must plan for
Email recovery creates new keys
If a user forgets the password and loses their 24-word recovery phrase, they can recover the account by email. That creates a new root key, and the old app keys can no longer be opened: data encrypted with the old productKey becomes unreadable. The next time they authorize your app, a new key is created. The recovery can be cancelled for a short time, which brings the old keys back.
Recovery with the 24 words keeps the same keys.
What this means for your app:
- detect that decryption fails (
OperationErrorfromcrypto.subtle.decrypt) and tell the user their old encrypted data can't be opened; - don't keep anything only encrypted if losing it would be unacceptable and the user would expect you to recover it.
More cases in Limits and edge cases.