private string Encrypt(string text) { var sym = new Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael); var key = new Encryption.Data("lnfn@n0f@b"); var encryptedData = sym.Encrypt(new Encryption.Data(text), key); var encrypted = encryptedData.ToBase64(); return(encrypted); }
public static string Decrypt(string encrypted) { var sym = new Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael); var key = new Encryption.Data("lnfn@n0f@b"); var encryptedData = new Encryption.Data { Base64 = encrypted }; var decryptedData = sym.Decrypt(encryptedData, key); var result = decryptedData.ToString(); return(result); }