Alex Rivera | Logout

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

Asked 2008-10-17T14:55:48.093
67

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 when writing to the registry and how do I decrypt it?

OurKey.SetValue("Password", textBoxPassword.Text);
Edit
Report

1 Answer

-1

Rather than encrypt/decrypt, you should be passing the password through a hashing algorithm, md5/sha512, or similar. What you would ideally do is hash the password and store the hash, then when the password is needed, you hash the entry and compare the entries. A password will then never be "decrypted", simply hashed and then compared.

answered 2008-10-17T15:01:09.690

Your Answer