kevast-encrypt
v0.1.1
Published
Encryption middleware for kevast.js.
Downloads
18
Maintainers
Readme
kevast-file.js
Encryption middleware for kevast.js.
Kevast-gist encrypts data with AES-128-CBC.
For encryption detail, refer to node-forge.
Installation
Node.js
Using yarn
yarn add kevast-encrypt
Using npm
npm install kevast-encrypt
Browser
<script src="https://cdn.jsdelivr.net/npm/kevast-encrypt/dist/kevast-encrypt.min.js"></script>
Usage
const { Kevast } = require('kevast');
const { KevastMemory } = require('kevast-memory');
const { KevastEncrypt } = require('kevast-encrypt');
const assert = require('assert');
(async () => {
const map = new Map();
const kevast = new Kevast(new KevastMemory(map));
kevast.use(new KevastEncrypt(KevastEncrypt.randomString()));
await kevast.set('key', 'value');
console.log(map);
assert(await kevast.get('key') === 'value');
})();