C#反编译找到解密方法,可是怎么传参运行这个方法解密呢?

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

public void DesDecrypt()
{
byte[] rgbIV = new byte[]
{
18,
52,
86,
120,
144,
171,
205,
239
};
try
{
byte[] bytes = Encoding.UTF8.GetBytes(this._decryptKey.Substring(0, 8));
DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
byte[] array = Convert.FromBase64String(this._inputString);
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateDecryptor(bytes, rgbIV), CryptoStreamMode.Write);
cryptoStream.Write(array, 0, array.Length);
cryptoStream.FlushFinalBlock();
Encoding encoding = new UTF8Encoding();
this._outString = encoding.GetString(memoryStream.ToArray());
}
catch (Exception ex)
{
this._noteMessage = ex.Message;
}
}

密文64Cic1ERUP9n2OzxuKl9Tw== 盐LIywB/zHFDTuEA1LU53Opg==

这个是类的方法,需要自己建立属性_inputString【密文】_outString【明文】,_noteMessage【出错时的错误信息】,_decryptKey【密钥】,解密得到明文admin5566,示例如下

img

using System;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace Demo
{
    public class Des
    {
        /// <summary>
        /// 密文
        /// </summary>
        public string _inputString { get; set; }

        /// <summary>
        /// 明文
        /// </summary>
        public string _outString { get; set; }
        /// <summary>
        /// 出错时的错误信息
        /// </summary>
        public string _noteMessage { get; set; }
        /// <summary>
        /// 密钥
        /// </summary>
        public string _decryptKey { get; set; }
        public void DesDecrypt()
        {
            byte[] rgbIV = new byte[]
            {
                18,
                52,
                86,
                120,
                144,
                171,
                205,
                239
            };
            try
            {
                byte[] bytes = Encoding.UTF8.GetBytes(this._decryptKey.Substring(0, 8));
                DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
                byte[] array = Convert.FromBase64String(this._inputString);
                MemoryStream memoryStream = new MemoryStream();
                CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateDecryptor(bytes, rgbIV), CryptoStreamMode.Write);
                cryptoStream.Write(array, 0, array.Length);
                cryptoStream.FlushFinalBlock();
                Encoding encoding = new UTF8Encoding();
                this._outString = encoding.GetString(memoryStream.ToArray());
            }
            catch (Exception ex)
            {
                this._noteMessage = ex.Message;
            }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            var d = new Des { _inputString= "64Cic1ERUP9n2OzxuKl9Tw==", _decryptKey= "LIywB/zHFDTuEA1LU53Opg==" };
            d.DesDecrypt();
            Console.WriteLine(d._outString);

            Console.ReadKey();
        }
    }
}


DesDecrypt这个方法没有参数。

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632