Web Crypto (non-extractable keys)
Provides built-in cryptography; keys can be stored in the browser and marked non-exportable.
In one line
Can lock and unlock data inside the page, with keys it can't hand out
Provides built-in cryptography; keys can be stored in the browser and marked non-exportable.
A site can encrypt data, sign with keys it cannot export, and store them in IndexedDB. Non-extractable keys stop theft by script but do not stop a malicious page using them.
What it can and can't do
What the user does: Nothing. It happens when the page signs in, saves data or checks a file.
It can
- Create secure keys and random numbers
- Scramble and unscramble data
- Check that a file has not been changed
It cannot
- Hand out a key that was made non exportable
- Reach keys saved by other sites
- Work on a page that is not on a secure connection (HTTPS)
- Keep its saved keys after you clear that site's data
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 37 | 2014-08-26 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 34 | 2014-12-01 | None |
| Safari | Supported | 11 | 2017-09-19 | None |
| Safari on iPhone | Supported | 11 | 2017-09-19 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 37 | 2014-09-03 | None |
| Samsung Internet | Supported | 3.0 | 2015-04-10 | None |
How a site asks for it
| API | crypto.subtle.generateKey/importKey/sign/encrypt; extractable:false; crypto.randomUUID() |
| Browser compat keys | api.SubtleCryptoapi.Crypto.getRandomValuesapi.CryptoKey |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| Activation | none |
| How long it lasts | CryptoKey objects can be stored in IndexedDB as opaque handles |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | HTTPS only (crypto.subtle undefined on HTTP except localhost) |
Typical flow
- Generate key with extractable false
- Store CryptoKey in IndexedDB
- Use sign() and decrypt() later
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- crypto.subtle only in secure contexts
- Non-extractable keys cannot be exported via exportKey(), but any script on the origin can use them
- getRandomValues fills at most 65536 bytes per call
- Algorithms: AES-GCM and CBC and CTR, RSA-OAEP and PSS, ECDSA (P-256, P-384, P-521), ECDH, HMAC, HKDF, PBKDF2, SHA-1/256/384/512; Ed25519 (Chrome 137, Safari 17, Firefox 129), X25519
- No hardware-backed keys (use WebAuthn for that)
The story
What it is
The browser has built in locks and keys that a page can use and store safely.
For you
You never see it. It quietly protects logins, chats and payments, and keeps your keys in a form that scripts cannot read out.
For makers
Makers use it to secure logins, sign messages and encrypt data in your browser before it leaves. Non exportable keys help stop theft even if the page is attacked.
Where you see it
| Type | Example | Apps |
|---|---|---|
| messaging | A secure chat tool encrypts messages in your browser before sending. | WhatsApp Web, Signal Desktop |
| banking | A bank page signs a login challenge with a key that never leaves the browser. | None named |
| security | A password manager web app encrypts your vault locally. | 1Password, Bitwarden |
| productivity | A notes app does end to end encryption of your documents. | Proton Docs |
| games | A browser game signs scores so cheaters cannot send fake ones. | None named |
| ads | Ad scripts use random numbers from the same tool to create ids. | None named |
Risks
- Misused by bad scripts
- Ransomware style misuse
What the platform says
- Mozilla: Web Crypto API. MDN says the API gives pages tools for hashing, signing, encryption and key handling.
Good uses and abuse
Legitimate uses
- Client-side encryption
- Signing
- Key derivation
Known abuse
- Ransom-style encryption in page
- Hidden persistent keys
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2015-04, Chrome 37: Web Crypto unprefixed
- 2024-07, Firefox 129: Ed25519 support
- 2025-05, Chrome 137: Ed25519 and X25519 support
Sources
How well checked: Based on official documentation.