Пример #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 { throw; }
            return value;
        }
Пример #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 { throw; }
            return encryptedValue;
        }