liuyuqi-dellpc 7 months ago
parent
commit
2921f43338

+ 1 - 1
C#/DecryptPwd/Program.cs

@@ -50,7 +50,7 @@ namespace DecryptPwd
             }
             else if (args[0] == "-Foxmail")
             {
-                String res = FoxmailUtils.decodePW(19, "fff");
+                String res = FoxmailUtils.Decrypt(19, "fff");
                 System.Console.WriteLine(res);
             }
         }

+ 18 - 0
C#/DecryptPwd/Utils/FileZilla.cs

@@ -8,5 +8,23 @@ namespace DecryptPwd.Utils
 {
     class FileZilla
     {
+        /// <summary>
+        /// Decrypt password
+        /// </summary>
+        public static string Decrypt(string password)
+        {
+            string result = string.Empty;
+            try
+            {
+                byte[] data = Convert.FromBase64String(password);
+                result = Encoding.UTF8.GetString(data);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            return result;
+        }
+
     }
 }

+ 1 - 1
C#/DecryptPwd/Utils/FoxmailUtils.cs

@@ -8,7 +8,7 @@ namespace DecryptPwd.Utils
 {
     class FoxmailUtils
     {
-        public static String decodePW(int ver, String strHash)
+        public static String Decrypt(int ver, String strHash)
         {
             String decodedPW = "";
             // 第一步:定义不同版本的秘钥

+ 23 - 0
C#/DecryptPwd/Utils/Navicat.cs

@@ -8,5 +8,28 @@ namespace DecryptPwd.Utils
 {
     class Navicat
     {
+        /// <summary>
+        /// Decrypt Navicat password
+        /// </summary>
+        /// <param name="pwd">Encrypted password</param>
+        /// <returns>Decrypted password</returns>
+        public static string Decrypt(string pwd)
+        {
+            string result = string.Empty;
+            try
+            {
+                byte[] bytes = Convert.FromBase64String(pwd);
+                for (int i = 0; i < bytes.Length; i++)
+                {
+                    bytes[i] = (byte)(bytes[i] ^ 0xA3);
+                }
+                result = Encoding.UTF8.GetString(bytes);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            return result;
+        }
     }
 }

+ 17 - 0
C#/DecryptPwd/Utils/TeamViewer.cs

@@ -8,5 +8,22 @@ namespace DecryptPwd.Utils
 {
     class TeamViewer
     {
+        /// <summary>
+        /// Decrypt password
+        /// </summary>
+        public static string Decrypt(string password)
+        {
+            string result = string.Empty;
+            try
+            {
+                byte[] data = Convert.FromBase64String(password);
+                result = Encoding.UTF8.GetString(data);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            return result;
+        }
     }
 }

+ 17 - 0
C#/DecryptPwd/Utils/WinSCP.cs

@@ -8,5 +8,22 @@ namespace DecryptPwd.Utils
 {
     class WinSCP
     {
+        /// <summary>
+        /// Decrypt password
+        /// </summary>
+        public static string Decrypt(string password)
+        {
+            string result = string.Empty;
+            try
+            {
+                byte[] data = Convert.FromBase64String(password);
+                result = Encoding.UTF8.GetString(data);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            return result;
+        }
     }
 }

+ 17 - 0
C#/DecryptPwd/Utils/Xmangager.cs

@@ -8,5 +8,22 @@ namespace DecryptPwd.Utils
 {
     class Xmangager
     {
+        /// <summary>
+        /// Decrypt password
+        /// </summary>
+        public static string Decrypt(string password)
+        {
+            string result = string.Empty;
+            try
+            {
+                byte[] data = Convert.FromBase64String(password);
+                result = Encoding.UTF8.GetString(data);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            return result;
+        }
     }
 }