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

Encryption #26

Closed
phuze opened this issue Oct 23, 2017 · 4 comments
Closed

Encryption #26

phuze opened this issue Oct 23, 2017 · 4 comments

Comments

@phuze
Copy link

phuze commented Oct 23, 2017

I've supplied an encryption key when creating a new store, but nothing happens. Could you please elaborate on whats required / how this works?

@sindresorhus
Copy link
Owner

What did you expect to happen and what didn't?

@phuze
Copy link
Author

phuze commented Oct 24, 2017

That's a great question. The documentation doesn't really specify what, if anything, should happen and so I didn't expect anything to happen. Never-the-less, based on the documentation, I had guessed that I would open the .json store file and find the contents encrypted -- this was not the case.

var store = new Store({ name: "myExample", encryptionKey: "oiV32mVp5lOwYneFESjrWq2xFByNOvNj" })

Edit:

By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so. When specified, the store will be encrypted using the aes-256-cbc encryption algorithm.

@sindresorhus
Copy link
Owner

I'm not sure why you expected an empty store to produce an encrypted file. Just follow the usage example in the readme and you'll get your encrypted file.

@phuze
Copy link
Author

phuze commented Nov 7, 2017

I'm not sure why you assume my store file is empty. Following the usage example does not result in an encrypted file, contrary to your assumption and to your documentation.

Let me quote the extent of your documentation, in case you've forgotten:

By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so. When specified, the store will be encrypted using the aes-256-cbc encryption algorithm.

Here, let me help you visualize a non-empty store file, configured using a valid 256-bit encryption key:

var store = new Store({
    name: "myExample",
    encryptionKey: "oiV32mVp5lOwYneFESjrWq2xFByNOvNj"
})

store.set("this_is_a_key", "this_is_a_value")

And the result, a non-encrypted store file:

{
    "this_is_a_key": "this_is_a_value"
}

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

2 participants