linvodb3
linvodb3 copied to clipboard
is there any way to encryption and decryption
@Ivshti is there any way that I can encrypt the database and decrypt it at the time of querying and show the result?
It was never envisioned that way, but since linvodb3 is only a middleware, so you can use an encrypted back-end store (key-value store) and you would achieve the goal
look for encrypted leveldown stores, as linvodb works with levelup
Hello,
has someone acheived any form of encryption? I think the most viable option is with encryptdown (there's not many)
what I came up with looks like this:
const db = new LinvoDB('my_datastore_name', {}, {
store : {
db : function () { //must be a function otherwise an error "db is not a funtion" is thrown
return encryptdown(LevelDown('path_to_ds_custom_folder'), { jwk });
}
}
});
But when I insert data, I get an error (after having a "success" inserted:1)
cause: undefined
message: "IO error: lock path_to_ds_custom_folder/LOCK: already held by process"
name: "OpenError"
stack: "OpenError: IO error: lock path_to_ds_custom_folder/LOCK: already held by process
at node_modules/levelup/lib/levelup.js:87:23
at node_modules/deferred-leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:41:14
at node_modules/deferred-leveldown/deferred-leveldown.js:20:21
at node_modules/encoding-down/node_modules/abstract-leveldown/abstract-leveldown.js:41:14
at node_modules/abstract-leveldown/abstract-leveldown.js:38:14
at node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:38:14"
type: "OpenError"
__proto__: Error
cause: undefined
message: undefined
name: "LevelUPError"
stack: "LevelUPError
at createError (node_modules/errno/custom.js:44:29)
at ce (node_modules/errno/custom.js:50:12)
at Object.<anonymous> (node_modules/level-errors/errors.js:11:14)
[...]
at Object.<anonymous> (node_modules/@adorsys/encrypt-down/src/index.js:12:23)"
type: "LevelUPError"
anyone have an idea?