ja-encryptor
v0.0.3
Published
Jast another aes256 encryptor/decryptor
Downloads
4
Maintainers
Readme
Install
npm install --save ja-encryptor
or
yarn install ja-encryptor
Import module
const Encryptor = require('ja-encryptor');
or
import Encryptor from 'ja-encryptor';
Usage
const encryptor = new Encryptor({ key: "1234567890ABCDEF" });
const encryptedString = encryptor.encrypt("test");
console.log(encryptor.decrypt(encryptedString));
// currently only string allowed, so you can just stringify object
const encryptedObject = encryptor.encrypt(JSON.stringify({ key: "value" }));
console.log(JSON.parse(encryptor.decrypt(encryptedObject)));
Build
npm run build // for single build
npm run watch // to watch changes
or
yarn build // for single build
yarn watch // to watch changes
Author
License
ISC License
Copyright (c) 2020 Sergey Frangulov
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.