APCGC_CBS.Common/DESEncrypt.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace APCGC_CBS.Common
{
    /// <summary>
    /// DES加密/解密类。
    /// </summary>
    public class DEncrypt
    {

        public static string BASE_Key = "c0f4a97b-20e8-4787-b09b-91eb9eba9981"; //此密钥不可更改
        public static System.Text.Encoding encoding = System.Text.Encoding.UTF8;//编码类型不可更改
        public static byte[] Decrypt(byte[] encrypted)
        {
            byte[] buffer1 = encoding.GetBytes(BASE_Key);
            return DEncrypt.Decrypt(encrypted, buffer1);
        }

        /// <summary>
        /// 解密
        /// </summary>
        /// <param name="original"></param>
        /// <returns></returns>
        public static string Decrypt(string original)
        {
            return DEncrypt.Decrypt(original, BASE_Key, encoding);
        }

        public static byte[] Decrypt(byte[] encrypted, byte[] key)
        {
            TripleDESCryptoServiceProvider provider1 = new TripleDESCryptoServiceProvider();
            provider1.Key = DEncrypt.MakeMD5(key);
            provider1.Mode = CipherMode.ECB;
            return provider1.CreateDecryptor().TransformFinalBlock(encrypted, 0, encrypted.Length);
        }

        public static string Decrypt(string original, string key)
        {
            return DEncrypt.Decrypt(original, key, encoding);
        }

        public static string Decrypt(string encrypted, string key, Encoding encoding)
        {
            byte[] buffer1 = Convert.FromBase64String(encrypted);
            byte[] buffer2 = encoding.GetBytes(key);
            return encoding.GetString(DEncrypt.Decrypt(buffer1, buffer2));
        }

        /// <summary>
        /// 加密
        /// </summary>
        /// <param name="original"></param>
        /// <returns></returns>
        public static string Encrypt(string original)
后面还有 103 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。