public string Encrypt(string text) { Encryption.Data skey = new Encryption.Data("!41i0@7_EW>F"); Encryption.Symmetric sym = new Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael); Encryption.Data encryptedData = default(Encryption.Data); encryptedData = sym.Encrypt(new Encryption.Data(text), skey); return(encryptedData.ToHex()); }
public string Decrypt(string hexstream) { try { Encryption.Data skey = new Encryption.Data("!41i0@7_EW>F"); Encryption.Symmetric sym = new Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael); Encryption.Data encryptedData = new Encryption.Data(); encryptedData.Hex = hexstream; Encryption.Data decryptedData = default(Encryption.Data); decryptedData = sym.Decrypt(encryptedData, skey); return(decryptedData.ToString()); } catch { } return(""); }