JSPM

simple-aes

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 251
  • Score
    100M100P100Q54521F
  • License MIT

Simple abstraction of AES to ensure no silly mistakes

Package Exports

  • simple-aes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-aes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

simple-aes

NPM Version Build Status

import SimpleAES from 'simple-aes';

// the key length can be 128, 192 or 256 bits
// the key can be a Buffer or a hex string, but MUST match the key length
const aes = new SimpleAES(192, '6dd860658d0b72475c5408830671b9d9750e7251b9cd68bd');

// plaintext input must be a string
const enc = aes.encrypt('foobar');

console.log(enc.iv); // => JpC10OoCLYs5u+lS7APMaA==
console.log(enc.ciphertext); // => Ffu10taggKPtriYzoZT/rg==

// iv and ciphertext inputs must be strings
const plaintext = aes.decrypt('JpC10OoCLYs5u+lS7APMaA==', 'Ffu10taggKPtriYzoZT/rg==');

console.log(plaintext); // => foobar

Installation

$ npm install simple-aes

Support

Please open an issue on this repository.

Authors

License

MIT licensed - see LICENSE file