3 ms·
Neither scrypt nor lzma are encryption. If you use scrypt, you won't be able to get the file back out ever again. If you use lzma, it's compressed, not encryp
by TheDong 6y ago
Neither scrypt nor lzma are encryption.
If you use scrypt, you won't be able to get the file back out ever again.
If you use lzma, it's compressed, not encrypted, and anyone who gets the compressed data can trivially decompress it.
Consider using an nacl secretbox if you need to encrypt it.
Consider very carefully where you'll store the password.
Does the user input it each time they access the file (in which case use a key-derivation-function on their password)? Do you encrypt it with an application key? Per-user key stored in vault? Do you have a hardware encryption tool available (an HSM) or something like aws KMS?
Your encryption is only as secure as you keep the encryption keys.
See also [0] for some suggestions.
[0]: https://latacora.micro.blog/2018/04/03/cryptographic-right-answers.html https://latacora.micro.blog/2018/04/03/cryptographic-right-a...
- agustif 6y agoThanks for all the tips and the link, will research further and see what better suits my needs. For now I'm most worried about db being leaked so would look into db encryption and prob I will go with application-key