GiantDB middleware for object encryption
npm i giantdb-crypto
const GiantDB = ;const GiantDBCrypto = ;const db = ;// register the middlewaredb;
That's all there is to it!
Note that this middleware cannot be added in retrospect. Items not previously encrypted will cause errors when it is suddenly introduced.
You will need to provide an encryption key with every action that reads or writes items. Examples:
const options =encryption:key: /* your encryption key (any 24-byte Buffer) */;db;db;db;
giantdb-crypto uses 192-bit AES with a per-item random initialization vector
by default. The cipher is provided by Node's native
crypto module, which in
turn uses OpenSSL.