I am working on a C# program that will be installed on multiple machines. In the registry I would like to store the username/password used by the program to login to MsSQL. Obviously I need to protect/encrypt this value somehow but not sure how.

Can someone provide an example or insight on how to do this? Also, is there someway of adding the encrypted value to the registry during installation of the program?

I am using VC# 2008 (.NET 3.5).

Thanks,
Brian Enderle