The usual way to do this is to use a symmetric encryption key, which is obtained from the user's password. The standard way to do this is to use the algorithm specified in RFC2898 , which generates a set of cryptographically protected bytes, which you can use as a key and intravenously. This is probably supported by the library for your .NET language, for example, this is what I use, this is the class Rfc2898DeriveBytes .
Of course, when your user changes his password, you will have to decrypt any existing encrypted text, and then output a new key and re-encrypt.
source share