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
SubtleCrypto
object providing access to common cryptographic primitives, like hashing, signing, encryption or decryption.This interface implements methods defined on RandomSource
.
Crypto.getRandomValues()
TypedArray
with cryptographically sound random values.Specification | Status | Comment |
---|---|---|
Web Cryptography API The definition of 'Crypto' in that specification. | Recommendation | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 11 | 12 | 26 | 11 | 15 | 6.1 |
subtle
|
37 | 12 | 34
|
11 | 24 | 10.1
|
getRandomValues |
11 | 12 | 26 | 11 | 15 | 4 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | 18 | 12 | 26 | 14 | 6.1 | Yes |
subtle
|
37 | 37 | 12 | 34
|
24 | 10.1
|
Yes |
getRandomValues |
Yes | 18 | 12 | 26 | 14 | 4 | Yes |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Crypto