There are many instance where we need to encrypt and decrypt data. Here is a class which does the job. public class CryptographyHelper { static byte [] entropy = Encoding .Unicode.GetBytes( "Salt Is Not A Password" ); public static string EncryptString(System.Security. SecureString input) { byte [] encryptedData = System.Security.Cryptography. ProtectedData .Protect( System.Text. Encoding .Unicode.GetBytes(ToInsecureString(input)), entropy, System.Security.Cr...
(Helping you out with C#, ASP.NET, SQL, Microsoft Azure, MVC & Javascript)