I would like to encrypt and decrypt strings with a password. I use C# and WinRT (MetroStyle). Have somebody a class for encryption/decryption?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The normal .Net System.Security.Cryptography namespace does not exist in Metro. You use the CryptographicEngine class in Windows.Security.Cryptography.Core namespace instead.
If the password is only being verified/authenticated, do not encrypt it. Instead, use the following:
When a password is supplied run through the same process using the same salt and compare derivedBytes. Store the secret as you would an encryption key.
If the password will be used, such as to connect to another service:
As with any cryptography, make sure to protect your keys appropriately and follow best practise. The linked documentation also provides examples.