# bumo-encryption

> bumo-encryption

Latest version **1.0.2** (published 2018-05-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install bumo-encryption
pnpm add bumo-encryption
yarn add bumo-encryption
bun add bumo-encryption
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-05-23 |
| First published | 2018-05-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 155.5 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | BUMO |
| Maintainers | bumo.io |
| Keywords | bumo, bumo-encryption |

## Links

- npm: https://www.npmjs.com/package/bumo-encryption
- npm.io page: https://npm.io/package/bumo-encryption

## Dependencies (3)

- [sjcl](https://npm.io/package/sjcl.md) ^1.0.7
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1
- [is-type-of](https://npm.io/package/is-type-of.md) ^1.2.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-05-23
- 1.0.1 — 2018-05-23
- 1.0.0 — 2018-05-22

## README

bumo-encryption
=======

bumo-encryption Sub module of [bumo-sdk-js]().

## bumo-encryption  Installation
```
npm install bumo-encryption --save
```

## bumo-encryption  Test
```
npm test
```

## bumo-encryption  Usage

```js
'use strict';

const encryption = require('bumo-encryption');

const KeyPair = encryption.keypair;
const signature = encryption.signature;
const keystore = encryption.keystore;

let kp = new KeyPair();
// Get encPrivateKey, encPublicKey, address
let encPrivateKey = kp.getEncPrivateKey();
let encPublicKey = kp.getEncPublicKey();
let address = kp.getAddress();


console.log('============= bof: ==============');
console.log(`EncPrivateKey is : ${encPrivateKey}`);
console.log(`EncPublicKey is : ${encPublicKey}`);
console.log(`Address hash is : ${address}`);
console.log('============= eof: ==============');

// Get keypair
let keypair = KeyPair.getKeyPair();

// Get encPublicKey
let encPublicKey = KeyPair.getEncPublicKey(encPrivateKey);

// Get address
let address = KeyPair.getAddress(encPublicKey);

// check encPrivateKey
KeyPair.checkEncPrivateKey(encPrivateKey);

// check encPublicKey
KeyPair.checkEncPublicKey(encPublicKey);

// check address
KeyPair.checkAddress(address);

// signature sign and verify
let sign = signature.sign('test', encPrivateKey);
let verify = signature.verify('test', sign, encPublicKey);

// keystore
keystore.encrypt(encPrivateKey, 'test', function(encData) {
  keystore.decrypt(encData, 'test', function(descData) {
    console.log(descData);
  });
});

```

## License

[MIT](LICENSE)

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