public static void csSetLayout(this GridView gv, string s64) { if (string.IsNullOrEmpty(s64)) { return; } byte[] b = TCipher.Base64toBytes(s64); MemoryStream ms = new MemoryStream(b); gv.RestoreLayoutFromStream(ms); }
public static string DecryptString(string Value64, string Password) { if (string.IsNullOrEmpty(Value64) || string.IsNullOrEmpty(Password)) { return(string.Empty); } try { byte[] key = Parameter(Password); byte[] cypher = TCipher.Base64toBytes(Value64); return(decryptStringFromBytes_AES(cypher, key)); } catch { #if (DEBUG) { throw new Exception("Invalid Operation"); } #else { return(string.Empty); } #endif } }
public static string RSADecrypt(string Base64CipherText, string Key) { byte[] bEncryptedText = TCipher.Base64toBytes(Base64CipherText); byte[] bPlainText = TCipher.RSADecrypt(bEncryptedText, Key); return(BytesToRegularString(bPlainText)); }