coderef

Web CryptographyBaseline · Widely available

The Web Cryptography API performs low-level cryptographic operations, such as encryption, decryption, and signature verification. Also known as the Web Crypto API.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 19, 2017. Widely available since Mar 19, 2020.

Browser support

DesktopChrome
1–36Not supported
37+Supportedsince Aug 26, 2014
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–33Not supported
34+Supportedsince Dec 1, 2014
Current: 157
Safari
1–10.1Not supported
11+Supportedsince Sep 19, 2017
Current: 27
MobileChrome Android
18–36Not supported
37+Supportedsince Sep 3, 2014
Current: 155
Firefox Android
4–33Not supported
34+Supportedsince Dec 1, 2014
Current: 157
Safari iOS
1–10.3Not supported
11+Supportedsince Sep 19, 2017
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Crypto.

Feature detection

JS · check before using
if ("Crypto" in globalThis) {
  // Crypto is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (41). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Crypto111221518215
Crypto.getRandomValues111221518215
Crypto.randomUUID92929515.4929515.4
Crypto.subtle37123411373411
Crypto.subtle.secure_context_required60797515607915
CryptoKey3712341037349
CryptoKey.algorithm3712341037349
CryptoKey.extractable3712341037349
CryptoKey.type3712341037349
CryptoKey.usages3712341037349
SubtleCrypto37123411373411
SubtleCrypto.decrypt37793411373411
SubtleCrypto.deriveBits41793411413411
SubtleCrypto.deriveBits.x255191331331301713313017
SubtleCrypto.deriveKey41793411413411
SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_aes41793411413411
SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_hkdf4179119114111911
SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_hmac41793411413411
SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_pbkdf24179119114111911
SubtleCrypto.deriveKey.x255191331331301713313017
Show 21 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
SubtleCrypto.digest41793411413411
SubtleCrypto.encrypt37793411373411
SubtleCrypto.exportKey37793411373411
SubtleCrypto.exportKey.ed255191371371291713712917
SubtleCrypto.exportKey.x255191331331301713313017
SubtleCrypto.generateKey37793411373411
SubtleCrypto.generateKey.ed255191371371291713712917
SubtleCrypto.generateKey.x255191331331301713313017
SubtleCrypto.importKey37793411373411
SubtleCrypto.importKey.ed255191371371291713712917
SubtleCrypto.importKey.x255191331331301713313017
SubtleCrypto.secure_context_required60797515607915
SubtleCrypto.sign37793411373411
SubtleCrypto.sign.ed255191371371291713712917
SubtleCrypto.unwrapKey37793411373411
SubtleCrypto.verify37793411373411
SubtleCrypto.verify.ed255191371371291713712917
SubtleCrypto.worker_support37794811374811
SubtleCrypto.wrapKey37793411373411
crypto3712153745
crypto.worker_support37794810.1374810.3