VOOZH about

URL: https://www.geeksforgeeks.org/javascript/html-dom-window-crypto-property/

⇱ HTML DOM window crypto property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM window crypto property

Last Updated : 24 Aug, 2022

The Window.crypto property returns the crypto object associated with the global object. This is a read-only property. This object allows web pages to access certain cryptographic related services. This crypto object offers some methods to access, exp getRandomValues() method.

Syntax:

var cryp = window.crypto or window.msCrypto;

Value: This property returns an instance of the crypto object.

Example: This example uses the crypto property with its getRandomValues() method to generate a random array of size 5.

Output:

Before Clicking Button:

👁 Image

After Clicking Button:

👁 Image

Also, the crypto object in the console is:

👁 Image

Supported Browsers:

  • Google Chrome 37
  • Edge 12
  • Firefox 1
  • Safari 5
  • Opera 24
Comment
Article Tags:
Article Tags: