If you want to protect your data from other users. Take a look at the ProtectedData class.
(Disclaimer: data protection to create a copy protection scheme is not covered in this answer).
This class uses DPAPI from Windows to encrypt and decrypt data at the user or computer level.
Using ProtectedData / DPAPI frees you from key processing and data security. And you can protect the data for the current user. Data can be read from different computers by the same domain users.
If you want to create your own key. You can create a key for each user / machine and save this key in the registry. Since the registry can be protected, only the current user can read the key back. I know that registry karma is bad, but it actually stores data like this very well.
PS: Do not put IV in your code. Create a new IV every time and put it in front of the data.
GvS Feb 11 '11 at 9:30 2011-02-11 09:30
source share