CTCClassSchedule.Common.Encryption64.Decrypt C# (CSharp) Метод

Decrypt() публичный Метод

public Decrypt ( string stringToDecrypt, string sEncryptionKey ) : string
stringToDecrypt string
sEncryptionKey string
Результат string
        public string Decrypt(string stringToDecrypt, string sEncryptionKey)
        {
            byte[] inputByteArray = new byte[stringToDecrypt.Length];

            try {
                key = Encoding.UTF8.GetBytes(sEncryptionKey.Substring(0, 8));
                DESCryptoServiceProvider des = new DESCryptoServiceProvider();
                inputByteArray = Convert.FromBase64String(stringToDecrypt);
                MemoryStream ms = new MemoryStream();
                CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(key, IV), CryptoStreamMode.Write);
                cs.Write(inputByteArray, 0, inputByteArray.Length);
                cs.FlushFinalBlock();
                return System.Text.Encoding.UTF8.GetString(ms.ToArray());
            }
            catch (Exception e) {
                return e.Message;
            }
        }
Encryption64