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

[QUESTION] please need example for https://www.litedb.org/docs/encryption/ #2520

Open
qart2003 opened this issue Jul 19, 2024 · 1 comment
Open
Labels

Comments

@qart2003
Copy link

Hey anybody,

I have read about Encryption - https://www.litedb.org/docs/encryption/
How can I use it?

In the project I should store patients data and it's sensitive data should be encrypted/decrypted

@marss72
Copy link

marss72 commented Sep 8, 2024

If you can derive an encryption key for each patient, you might want to individually encrypt each document by for example making each document contain an ID and an encrypted byte array, that when decrypted can be a JSON string, that then can be deserialized and will contain the secret patient data.

If you want to encrypt the whole database using one key, you can provide a password when opening the database in the connection string. You will need to rebuild the database if it's not encrypted already.

Connection string to introduce encryption: https://www.litedb.org/docs/connection-string/. Make sure to follow the latest encryption standards to make the encryption effective. Never hard-code the password or store it as plain text.

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

No branches or pull requests

2 participants