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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support37 Yes3411246.1
getRandomValues11 Yes2611153.1
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support3737 ? ?24 No Yes
subtle3737 ? ?24 No Yes
getRandomValues No23 Yes26 No6 ?

See Also

Document Tags and Contributors

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