Xk6-crypto-x509 - A k6 extension to encrypt data with a PEM Public Key

xk6-crypto-x509

A k6 extension to encrypt data with a PEM Public Key

This is a k6 extension using the xk6 system.

This is a proof of concept, isn't supported by the k6 team, and may break in the future. USE AT YOUR OWN RISK!

Hash Supported:

  • sha256
  • sha512

Usage

Import an entire module's contents:

import * as cryptoX509 from "k6/x/crypto_x509";

API

Functions:

Example

// example.js
import crypto from "k6/x/crypto-x509";

export default function () {
  console.log(
    crypto.encryptRsa(
      `-----BEGIN RSA PUBLIC KEY-----
      MIIBigKCAYEA0lavluO97KNSzvWMmVKjov0tFNLSEXZB5icjMY9zR1XXWS6F2mG0
      zmCSrsS0hGWIpq7O49UkjBY5IMLpOKFyKcIggftzjI6dq+Eql/ToOUPGoTLvu4Bx
      dL4afRPXpFX9QUnPN2gaNg31SUwf/ruKoDBJWKR/bymoreC34BLvk7J6wAbTaNxz
      Y59P4Doc4MV7bO9aDotw5LWHCFgfuWNypjsa4gVDQGbt7jCLDCIvksowYEcfpE7s
      nTuz8ojvJnLWg49jQbUk+4YntlQ/X8iSC9n5CsMnLTJu950PRpaq609TNuGv7pgr
      +VRFr69bdhfAppxvMok+EzFBl4KxedeauN5qe10Vbsr7ioMb5A3+gNy+Cdo1TUvf
      nWJOqZbos02DbmHL+UwSANBLgx1NX2pMYfQ9+h8FxedCOsuIvv5HEaa3vP/gE0iY
      eHJ6JSJNp6nQtW6llrt2ZYvGl/K/KuyvCzN0DatMpuXHn8/XEHqlEk2bzT6uTq6j
      VDUwqgzepMFtAgMBAAE=
      -----END RSA PUBLIC KEY-----`,
      "STRING TO BE ENCRYPTED"
    )
  );
}

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then:

  1. Install xk6:
$ go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
$ xk6 build --with github.com/dgzlopes/xk6-exec@latest
Owner
Rogério Kino
Backend Developer
Rogério Kino
Similar Resources

Real time crypto VWAP calculator

Real time crypto VWAP calculator

VWAP calculator A realtime VWAP calculator of crypto currencies. It uses coinbase as its default provider for real time data over websocket. Design Th

Oct 31, 2022

ECIES implementation forked of the `crypto/ecies` package from Ethereum

# NOTE This implementation is direct fork of Kylom's implementation. I claim no authorship over this code apart from some minor modifications. Please

Dec 7, 2021

A tiny Crypto Project with REST API

Goal ⚽ Golang으로 아무 쓸모 없는 블록체인을 한땀 한땀 만들어보면서 BTC나 ETH에 적용된 블록체인 기법 이해해보기! Special Thanks to Nico! Current... 🏗️ Work 🏃 자세한 내용은 issue와 PR을 확인하세요. Now

Dec 30, 2021

InductiveDifferentiation - A Trading Experiment With The Crypto Market

A Trading Experiment With The Crypto Market The program was proposed and owned b

Apr 10, 2022

Easy to use crypto library with multiple algorithms

crypka Crypka is library, which abstracts away crypto, so one can easily do: Swap cryptosystems by swapping algorithm object in one place Easily and s

Mar 6, 2022

Coinbase - You can use this to retrieve the current price for an crypto currency

whats-this You can use this to retrieve the current price for an crypto currency

Sep 29, 2022

Crypto-project - Personal project for learning TLS

crypto-project My personal attempt to implement this cipher suite using the Go l

Feb 14, 2022

Blockcain - Trust Wallet token repository - A comprehensive, up-to-date collection of information about several thousands (!) of crypto tokens

Blockcain - Trust Wallet token repository - A comprehensive, up-to-date collection of information about several thousands (!) of crypto tokens

Trust Wallet Assets Info Overview Trust Wallet token repository is a comprehensi

Feb 14, 2022
generate a chia address by public key, chia公钥生成地址

chia-address-generator This repo is a hack way to generate an address from publicKey. So it's not a good enough way to use it in prod, use it just for

Mar 9, 2022
Easily encrypt data for the Adyen payment platform

adyen Encrypt secrets for the Adyen payment platform. This library uses crypto/rand to generate cryptographically secure AES keys and nonces, and re-u

Jan 2, 2023
Sign, verify, encrypt and decrypt data with GPG in your browser.
Sign, verify, encrypt and decrypt data with GPG in your browser.

keygaen Sign, verify, encrypt and decrypt data with GPG in your browser. ⚠️ keygaen has not yet been audited! While we try to make keygaen as secure a

Nov 22, 2022
A public facing version of the Chicago data microservices repo.

chicago-data | full stack reporting solution Project Overview This repo houses microservices dedicated to ingesting and preparing open Chicago dataset

Jun 22, 2022
Simple Crypto API for Go

cryptogo Simple cryptography API in Go Hashes: hash.MD5Bytes, hash.MD5Base64, hash.MD5Hex calculates an MD5 chechsum of the input byte array as a byte

Nov 10, 2021
A command line Crypto-currency ticker made using golang and WazirX Api
A command line Crypto-currency ticker made using golang and WazirX Api

░█████╗░██████╗░██╗░░░██╗██████╗░████████╗███████╗██╗░░██╗ ██╔══██╗██╔══██╗╚██╗░██╔╝██╔══██╗╚══██╔══╝██╔════╝╚██╗██╔╝ ██║░░╚═╝██████╔╝░╚████╔╝░██████╔

Feb 6, 2022
a modern crypto messaging format

saltpack a modern crypto messaging format https://saltpack.org/ saltpack is a streamlined, modern solution, designed with simplicity in mind. It is ea

Dec 22, 2022
An easy to setup local crypto wallet based on Geth

CryptoWallet An easy to setup local crypto wallet based on Geth To run. go run CrytoWallet This will expose a set a api's. To Create new Wallet curl

Oct 15, 2021
A terminal application to watch crypto prices!
A terminal application to watch crypto prices!

cryptgo Latest Stable Version: Crytpgo is a TUI based application written purely in Go to monitor and observe cryptocurrency prices in real time! Inst

Dec 21, 2022