4.0.1 • Published 5 years ago

@pubkeeper/crypto-cjs-aes-cbc v4.0.1

Weekly downloads
1
License
UNLICENSED
Repository
github
Last release
5 years ago

Pubkeeper AES-CBC Crypto Plugin

This package provides AES-CBC encryption for the JavaScript pubkeeper client, via cryptojs

Installation

In a browser:

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

Using npm:

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

Then, load using ES5 require() syntax…

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

…or with ES2015+ import syntax:

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

Basic Syntax

Registering as a supported cipher in a PubkeeperClient…

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

Registering as the default cipher in a PubkeeperClient…

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

Using the cipher function directly.

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"
4.1.0

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

4.0.0-rc.2

5 years ago

4.0.0-rc.1

5 years ago

4.0.0-rc.0

5 years ago

3.1.1

6 years ago

3.1.0

7 years ago

3.0.0

7 years ago

3.0.0-rc.0

7 years ago

3.0.0-beta.3

7 years ago

3.0.0-beta.2

7 years ago

3.0.0-beta.1

7 years ago

3.0.0-alpha.4

7 years ago

3.0.0-alpha.3

7 years ago

3.0.0-alpha.2

7 years ago

3.0.0-alpha.1

7 years ago