1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DecryptPwd.Utils
- {
- public 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;
- }
- }
- }
|