# eosio-key-encryption

> EOSIO private key en/decryption library

Latest version **1.2.0** (published 2022-05-04) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install eosio-key-encryption
pnpm add eosio-key-encryption
yarn add eosio-key-encryption
bun add eosio-key-encryption
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-05-04 |
| First published | 2021-02-17 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 46.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jnordberg |

## Links

- npm: https://www.npmjs.com/package/eosio-key-encryption
- Homepage: https://github.com/greymass/eosio-key-encryption
- npm.io page: https://npm.io/package/eosio-key-encryption

## Dependencies (5)

- [tslib](https://npm.io/package/tslib.md) ^2.1.0
- [scrypt-js](https://npm.io/package/scrypt-js.md) ^3.0.1
- [asmcrypto.js](https://npm.io/package/asmcrypto.js.md) ^2.3.2
- [@greymass/eosio](https://npm.io/package/@greymass/eosio.md) ^0.6.0
- [@greymass/miniaes](https://npm.io/package/@greymass/miniaes.md) ^1.0.0

## Recent versions

- 1.2.0 (latest) — 2022-05-04
- 1.1.2 — 2021-09-25
- 1.1.1 — 2021-09-25
- 1.1.0 — 2021-07-03
- 1.0.2 — 2021-02-18
- 1.0.1 — 2021-02-18
- 1.0.0 — 2021-02-17

## README

EOSIO Key Encryption / EEP-8
============================

Specification and reference implementation of EOSIO Key Encryption (EEP-8).

## Installation

The `eosio-key-encryption` package is distributed as a module on [npm](https://www.npmjs.com/package/eosio-key-encryption).

```
yarn add eosio-key-encryption
# or
npm install --save eosio-key-encryption
```

## Usage

```ts
import {decrypt, encrypt} from 'eosio-key-encryption'

const wif = '5JiAW9u8f2bwV2KcQRRt7WYMQnEdXwSxSDX2hnM2EccuX8eAXcP'
const password = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100] // utf-8 "hello world"

encrypt(wif, password).then((encrypted) => {
    console.log(JSON.stringify(encrypted)) // "SEC_K1_8xacaDNEJyzqu1RG4dG7sBwo9QCA24EePExWLPPTBWVDiMo6BpAw7DHq"
})

decrypt('SEC_K1_8xacaDNEJyzqu1RG4dG7sBwo9QCA24EePExWLPPTBWVDiMo6BpAw7DHq', password).then((key) => {
    console.log(key.toWif()) // 5JiAW9u8f2bwV2KcQRRt7WYMQnEdXwSxSDX2hnM2EccuX8eAXcP
})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).

---
_Source: https://npm.io/package/eosio-key-encryption · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
