While we intend to keep this module as simple and stable as possible, we may need to add features or introduce breaking changes. This could happen at any time until we release this module as stable.Experimental module, use at your own risk
Feel free to provide user feedback, and open an issue or pull request if you have any suggestions.
With this experimental module, you can use the WebCrypto API in your k6 scripts. However, note that this API is not yet fully implemented and some algorithms and features might still be missing.
The Web Crypto API is a JavaScript API for performing cryptographic operations such as encryption, decryption, digital signature generation and verification, and key generation and management. It provides a standard interface to access cryptographic functionality, which can help ensure that cryptographic operations are performed correctly and securely.
API
The module exports a top-level crypto object with the following properties and methods:
Interface/Function | Description |
---|---|
getRandomValues | Fills the passed TypedArray with cryptographically sound random values. |
randomUUID | Returns a randomly generated, 36 character long v4 UUID. |
subtle | The SubtleCrypto interface provides access to common cryptographic primitives, such as hashing, signing, encryption, or decryption. |
Example
example-webcrypto-module.js