# @pubkeeper/crypto-cjs-aes-cbc

> AES-CBC Crypto for Pubkeeper (using cryptojs)

Latest version **4.0.1** (published 2019-01-25) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @pubkeeper/crypto-cjs-aes-cbc
pnpm add @pubkeeper/crypto-cjs-aes-cbc
yarn add @pubkeeper/crypto-cjs-aes-cbc
bun add @pubkeeper/crypto-cjs-aes-cbc
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2019-01-25 |
| First published | 2017-09-19 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 302.3 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | niolabs |
| Maintainers | 32bitkid, mattdodge |

## Links

- npm: https://www.npmjs.com/package/@pubkeeper/crypto-cjs-aes-cbc
- Repository: https://github.com/pubkeeper/javascript-crypto-cjs-aes-cbc
- Homepage: https://github.com/pubkeeper/javascript-crypto-cjs-aes-cbc#readme
- Issues: https://github.com/pubkeeper/javascript-crypto-cjs-aes-cbc/issues
- npm.io page: https://npm.io/package/@pubkeeper/crypto-cjs-aes-cbc

## Dependencies (2)

- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1
- [@pubkeeper/types](https://npm.io/package/@pubkeeper/types.md) ^1.0.2

## Recent versions

- 4.0.1 (latest) — 2019-01-25
- 4.1.0 (next) — 2019-03-15
- 4.0.0 — 2019-01-15
- 4.0.0-rc.2 — 2019-01-14
- 4.0.0-rc.1 — 2019-01-14
- 4.0.0-rc.0 — 2019-01-02
- 3.1.1 — 2018-09-18
- 3.1.0 — 2017-11-14
- 3.0.0 — 2017-11-01
- 3.0.0-rc.0 — 2017-10-26
- 3.0.0-beta.3 — 2017-10-10
- 3.0.0-beta.1 — 2017-10-10
- 3.0.0-alpha.4 — 2017-10-02
- 3.0.0-alpha.3 — 2017-10-02
- 3.0.0-alpha.2 — 2017-10-02
- … 1 more at https://npm.io/package/@pubkeeper/crypto-cjs-aes-cbc/versions

## README

# Pubkeeper AES-CBC Crypto Plugin

This package provides AES-CBC encryption for the JavaScript pubkeeper client, via [crypto&#x2011;js](https://www.npmjs.com/package/crypto-js)

## Installation

In a browser:

```html
<script src="pubkeeper-crypto-aes-cbc.js"></script>
```

Using npm:

```bash
$ npm install --save @pubkeeper/crypto-cjs-aes-cbc
```

Then, load using ES5 `require()` syntax…

```js
var PubkeeperAesCbcCrypto =
  require('@pubkeeper/crypto-cjs-aes-cbc').PubkeeperAesCbcCrypto;
```


…or with ES2015+ `import` syntax:

```js
import { PubkeeperAesCbcCrypto } from '@pubkeeper/crypto-cjs-aes-cbc';
```

## Basic Syntax

Registering as a supported cipher in a PubkeeperClient…

```js
const client = new PubkeeperClient({
  crypto: new Map([
    PubkeeperAesCbcCrypto,
  ]),
})
```

Registering as the _default_ cipher in a PubkeeperClient…

```js
const client = new PubkeeperClient({
  crypto: new Map([
    PubkeeperClient.setDefaultCrypto(PubkeeperAesCbcCrypto),
    PubkeeperAesCbcCrypto,
  ]),
})
```

Using the cipher function directly.

```js
const [,cipher] = PubkeeperAesCbcCrypto;
const key = new TextEncoder().encode('averyinsecurekey');
const c = cipher(key)
const ptext = new TextEncoder().encode('my message');
const ctext = c.encrypt(ptext)
const result = c.decrypt(ctext);
console.log(new TextDecoder().decode(result)); // "my message"
```

---
_Source: https://npm.io/package/@pubkeeper/crypto-cjs-aes-cbc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
