What is the easiest way to encrypt a password when I save it to the registry?

后端 未结 12 1903
小鲜肉
小鲜肉 2020-11-30 18:13

Currently I\'m writing it in clear text oops!, it\'s an in house program so it\'s not that bad but I\'d like to do it right. How should I go about encrypting this w

12条回答
  •  伪装坚强ぢ
    2020-11-30 18:15

    If it's a password used for authentication by your application, then hash the password as others suggest.

    If you're storing passwords for an external resource, you'll often want to be able to prompt the user for these credentials and give him the opportunity to save them securely. Windows provides the Credentials UI (CredUI) for this purpose - there are a number of samples showing how to use this in .NET, including this one on MSDN.

提交回复
热议问题