From f63d8ead25bdb3c32dacca817a059bd30390e9bc Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期三, 15 六月 2022 22:20:07 +0800
Subject: [PATCH] 1.系统账户数据库优化:   修改“账户类型”的数据类型为VARCHAR2(1024),多个角色时以半角“,”分隔。   加密盐。 密码加密优化;账户登录优化;角色权限管理(作废用户权限); 2.字典类型管理(定义:用户角色) 3.字典数据管理(初始化用户角色数据) 3.角色权限管理 4.系统账户管理,账户类型对应用户角色(可多选)。

---
 web/Common/DESEncrypt.cs |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/web/Common/DESEncrypt.cs b/web/Common/DESEncrypt.cs
index 4f8109c..a1842d9 100644
--- a/web/Common/DESEncrypt.cs
+++ b/web/Common/DESEncrypt.cs
@@ -6,18 +6,24 @@
 
 namespace Common
 {
+
   public class DESEncrypt
   {
-    public static string Encrypt(string Text)
+        //鍔犲瘑涓�
+        //public static string encryptStr = "litianping";
+        public static string encryptStr = "abcDEF123@$@";
+
+        public static string Encrypt(string Text)
     {
-      return DESEncrypt.Encrypt(Text, "litianping");
+      return DESEncrypt.Encrypt(Text, encryptStr );
     }
 
     public static string Encrypt(string Text, string sKey)
     {
       DESCryptoServiceProvider cryptoServiceProvider = new DESCryptoServiceProvider();
       byte[] bytes = Encoding.Default.GetBytes(Text);
-      cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
+            //c#鐨凞ES鍔犲瘑鏄痥ey涓�8浣�
+            cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
       cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
       MemoryStream memoryStream = new MemoryStream();
       CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, cryptoServiceProvider.CreateEncryptor(), CryptoStreamMode.Write);
@@ -31,7 +37,7 @@
 
     public static string Decrypt(string Text)
     {
-      return DESEncrypt.Decrypt(Text, "litianping");
+      return DESEncrypt.Decrypt(Text, encryptStr);
     }
 
     public static string Decrypt(string Text, string sKey)
@@ -43,10 +49,11 @@
       {
         int num = Convert.ToInt32(Text.Substring(index * 2, 2), 16);
         buffer[index] = (byte) num;
-      }
-      cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
-      cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
-      MemoryStream memoryStream = new MemoryStream();
+        }
+            //c#鐨凞ES鍔犲瘑鏄痥ey涓�8浣�
+            cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
+        cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
+        MemoryStream memoryStream = new MemoryStream();
       CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, cryptoServiceProvider.CreateDecryptor(), CryptoStreamMode.Write);
       cryptoStream.Write(buffer, 0, buffer.Length);
       cryptoStream.FlushFinalBlock();

--
Gitblit v1.9.1