public Decrypt ( string cipher ) : string | ||
cipher | string | A base64 encoded string that was created
/// through the |
return | string |
public string Decrypt(string cipher)
{
if (cipher == null) throw new ArgumentNullException("cipher");
//parse base64 string
byte[] data = Convert.FromBase64String(cipher);
//decrypt data
byte[] decrypted = ProtectedData.Unprotect(data, null, DataProtectionScope.LocalMachine);
return Encoding.Unicode.GetString(decrypted);
}