The Crypto interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.

An object with this interface is available on Web context via the Window.crypto property.


This interface implements properties defined on RandomSource.

Crypto.subtle Read only
Returns a SubtleCrypto object providing access to common cryptographic primitives, like hashing, signing, encryption or decryption.


This interface implements methods defined on RandomSource.

Fills the passed TypedArray with cryptographically sound random values.


Specification Status Comment
Web Cryptography API
The definition of 'Crypto' in that specification.
Recommendation Initial definition

Browser Compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 37 34 (34) 11 (Yes) 6.1
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) ? ? ? (Yes) ?

See Also

Document Tags and Contributors

 Contributors to this page: soanvig, jpmedley, Sebastianz, teoli, Noitidart, njoyce
 Last updated by: soanvig,