Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szkiba/xk6-crypto
A k6 extension for using extended crypto functions
https://github.com/szkiba/xk6-crypto
k6 k6-extension xk6
Last synced: 11 days ago
JSON representation
A k6 extension for using extended crypto functions
- Host: GitHub
- URL: https://github.com/szkiba/xk6-crypto
- Owner: szkiba
- License: mit
- Archived: true
- Created: 2021-05-07T18:03:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-07T08:30:48.000Z (5 months ago)
- Last Synced: 2024-07-30T21:05:35.358Z (3 months ago)
- Topics: k6, k6-extension, xk6
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xk6-crypto
> [!WARNING]
> This extension is deprecated. In the meantime, [k6 supports webcrypto](https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/webcrypto/), it is advisable to use it in new tests.
> If you need this extension because of your old tests or if you want to continue development, feel free to fork it.A k6 extension for using extended crypto functions, mostly from [golang.org/x/crypto](https://pkg.go.dev/golang.org/x/crypto).
Built for [k6](https://go.k6.io/k6) using [xk6](https://github.com/grafana/xk6).
## Usage
Import an entire module's contents:
```JavaScript
import * as xcrypto from "k6/x/crypto";
```Import a single export from a module:
```JavaScript
import { hkdf } from "k6/x/crypto";
```## API
Functions:
- [ecdh](docs/README.md#ecdh)
- [generateKeyPair](docs/README.md#generatekeypair)
- [hkdf](docs/README.md#hkdf)
- [pbkdf2](docs/README.md#pbkdf2)For complete API documentation click [here](docs/README.md)!
## Build
To build a `k6` binary with this extension, first ensure you have the prerequisites:
- [Go toolchain](https://go101.org/article/go-toolchain.html)
- GitThen:
1. Install `xk6`:
```bash
$ go install go.k6.io/xk6/cmd/xk6@latest
```2. Build the binary:
```bash
$ xk6 build --with github.com/szkiba/xk6-crypto@latest
```