Exemple #1
0
        public static string Decrypt(string key, string encryptedValue)
        {
            string value = string.Empty;

            try
            {
                RijndaelEnhanced rijndaelKey = new RijndaelEnhanced(key);
                value = rijndaelKey.Decrypt(encryptedValue);
            }
            catch { Trace.TraceError("Decrypter failed"); }
            return(value);
        }
Exemple #2
0
        public static string Encrypt(string key, string value)
        {
            string encryptedValue = string.Empty;

            try
            {
                RijndaelEnhanced rijndaelKey = new RijndaelEnhanced(key);
                // string hashValue = HashEncryption.SHA256Hash(value);
                encryptedValue = rijndaelKey.Encrypt(value);
            }
            catch { Trace.TraceError("Encrypter failed"); }
            return(encryptedValue);
        }