Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there any way to encryption and decryption #64

Open
chouguleds-zz opened this issue Dec 16, 2016 · 2 comments
Open

is there any way to encryption and decryption #64

chouguleds-zz opened this issue Dec 16, 2016 · 2 comments

Comments

@chouguleds-zz
Copy link

@Ivshti is there any way that I can encrypt the database and decrypt it at the time of querying and show the result?

@Ivshti
Copy link
Owner

Ivshti commented Dec 16, 2016

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

@zxfrank
Copy link

zxfrank commented Dec 10, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants