ut-function.cbc

1.1.6 • Public • Published

ut-function.cbc

Cipher block chaining encrypt/decrypt factory function

Usage

ut-function.cbc is a factory function that has a single argument keywhich must be a buffer or hex representing the raw key used by the built-in aes-256-cbc algorithm.

e.g.:

const cbc = require('ut-function.cbc');
// use 32 bytes hex as a key in this case
const {encrypt, decrypt} = cbc('757435736f66747761726567726f7570757435736f66747761726567726f7570');

// different each time as it is being encrypted with random seed
const encrypted = encrypt('test');

// equals to 'test' no matter the seed was random
const decrypted = decrypt(encrypted);

Readme

Keywords

none

Package Sidebar

Install

npm i ut-function.cbc

Weekly Downloads

8

Version

1.1.6

License

Apache-2.0

Unpacked Size

4.89 kB

Total Files

5

Last publish

Collaborators

  • kalin.krustev