I'm using the solution presented in this QA: https://stackoverflow.com/a/2791259/2713516
However, I see some people storing the key (random 'password') in the code as a field, but I'm wondering if this is actually a good idea. The salt used in that solution is also a field in the class.
Some suggest to use the users password, but since that can change I dont think that's a good idea.
So my questions are. Is storing the salt in the class as a field like presented in the mentioned solution ok? What should I use for a encryption/decryption key? (some random key for all users)? Where should I store this key? In the class as a field? in the database?
Thanks!