Encryption middleware for kevast.js.
Kevast-gist encrypts data with AES-128-CBC.
For encryption detail, refer to node-forge.
Using yarn
yarn add kevast-encrypt
Using npm
npm install kevast-encrypt
<script src="https://cdn.jsdelivr.net/npm/kevast-encrypt/dist/kevast-encrypt.min.js"></script>
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');
})();