// Local protect data (bind to a machine)
using System.Security.Cryptography;
private static readonly byte[] salt = new byte[] { 0x26, 0xdc, 0xff, 0x00, 0xad, 0xed, 0x7a, 0xee, 0xc5, 0xfe, 0x07, 0xaf, 0x4d, 0x08, 0x22, 0x3c };
public static byte[] ProtectLocalData(byte[] plain)
{
return ProtectedData.Protect(plain, salt, DataProtectionScope.LocalMachine);
}
public static byte[] UnprotectLocalData(byte[] cipher)
{
return ProtectedData.Unprotect(cipher, salt, DataProtectionScope.LocalMachine);
}
Saturday, May 30, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment