1.0.9 • Published 8 months ago

aes256cbc-enc v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

view on npm npm module downloads per month

AES 256 CBC

Simple aes-256-cbc encryption tools

How to Install

npm install aes256cbc-enc
# or
yarn add aes256cbc-enc

How to Use

// in common JS
const { Aes256Cbc, generateKey } = require("aes256cbc-enc");

// in typescript
import { Aes256Cbc, generateKey } from "aes256cbc-enc";

// generate random key
const key = generateKey();

// create new instance
const aes = new Aes256Cbc({
  key: "", // 64 character string hex
});

// or if you want generate from string
const aes = new Aes256Cbc({
  rawKey: "", // any string
});

// print current key
const currKey = aes.getCurrentKey();

// encrypt and decrypt

const plainText = "test123";
const encryptedText = aes.encrypt(plainText);
const decryptedText = aes.decrypt(encryptedText);

console.log({ encryptedText, decryptedText });
1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3-alpha.1

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago