Garlic.js icon indicating copy to clipboard operation
Garlic.js copied to clipboard

encrypt data

Open turgs opened this issue 6 years ago • 3 comments

Hello

Is there a way I can encrypt data before it's stored?

I'd like to pass a string per element, and that be used to encrypt and decrypt. That way, it someone's using a public computer, data isn't as exposed once they logout and leave.

Thanks Tim

turgs avatar Jan 19 '18 04:01 turgs

Hi there, this could be a nice feature, but unfortunately this is not built-in yet.

It should be possible by creating a module that ships a bijective encryption method (aes ?) in javascript and give the private key to Garlic on booting.

Feel free to implement that and submit a PR if you have time to do so (not my case unfortunately)

Best

guillaumepotier avatar Jan 19 '18 08:01 guillaumepotier

I think encryption is a bit overkill. Simply having an option to use SessionStorage (as suggested in #115) would solve the problem of exposing data from different users.

BrunoRB avatar Sep 28 '18 18:09 BrunoRB

Oh hey there, five months ago I developed this package that does decryption and encryption natively in Nodejs. Kind of a wrapper package that makes RSA Keypair encryption and encryption easier in terms of coding syntax:

https://github.com/joshuaquek/QuickEncrypt https://www.npmjs.com/package/quick-encrypt

Not sure if it might be of help to you guys here haha!

It takes around 2-4 seconds to do the encryption and decryption, depending on your machine's speed

joshuaquek avatar Oct 24 '18 13:10 joshuaquek