We are using bcrypt for hashing passwords and data that never needs to be decrypted. What should we do to protect other user information that does need to be decrypted?
For example, let’s say that we didn’t want a user’s real name to be in plain text in case someone was to obtain access to the database. This is somewhat sensitive data but also needs to be called from time to time and displayed in plain text. Is there a simple way to do this?
You can use the crypto module:
Edit
Now createCipher and createDecipher is deprecated instead use createCipheriv and createDecipheriv