1:从注册表中查看加密后的密码。

  1.1:windows键+r,输入 regedit

  1.2:在注册表中找到 \HKEY_CURRENT_USER\SOFTWARE\PremiumSoft\navicat\servers 并找到 UserName 即 账号

   1.3:从上面步骤中,打开注册表、并找到如下图片中的密码栏:Pwd(加密的密码)

2:解密密码,打开在线工具运行一下代码,并修改倒数第二行代码,将上面的密码写入decrypt(’’);中,点击运行。即可

  2.1:在线编码网址,https://tool.lu/coderunner/

2.2:解密代码:

  1 <?php
2 class NavicatPassword
3 {
4 protected $version = 0;
5 protected $aesKey = 'libcckeylibcckey';
6 protected $aesIv = 'libcciv libcciv ';
7 protected $blowString = '3DC5CA39';
8 protected $blowKey = null;
9 protected $blowIv = null;
10
11 public function __construct($version = 12)
12 {
13 $this->version = $version;
14 $this->blowKey = sha1('3DC5CA39', true);
15 $this->blowIv = hex2bin('d9c7c3c8870d64bd');
16 }
17
18 public function encrypt($string)
19 {
20 $result = FALSE;
21 switch ($this->version) {
22 case 11:
23 $result = $this->encryptEleven($string);
24 break;
25 case 12:
26 $result = $this->encryptTwelve($string);
27 break;
28 default:
29 break;
30 }
31
32 return $result;
33 }
34
35 protected function encryptEleven($string)
36 {
37 $round = intval(floor(strlen($string) / 8));
38 $leftLength = strlen($string) % 8;
39 $result = '';
40 $currentVector = $this->blowIv;
41
42 for ($i = 0; $i < $round; $i++) {
43 $temp = $this->encryptBlock($this->xorBytes(substr($string, 8 * $i, 8), $currentVector));
44 $currentVector = $this->xorBytes($currentVector, $temp);
45 $result .= $temp;
46 }
47
48 if ($leftLength) {
49 $currentVector = $this->encryptBlock($currentVector);
50 $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
51 }
52
53 return strtoupper(bin2hex($result));
54 }
55
56 protected function encryptBlock($block)
57 {
58 return openssl_encrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
59 }
60
61 protected function decryptBlock($block)
62 {
63 return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
64 }
65
66 protected function xorBytes($str1, $str2)
67 {
68 $result = '';
69 for ($i = 0; $i < strlen($str1); $i++) {
70 $result .= chr(ord($str1[$i]) ^ ord($str2[$i]));
71 }
72
73 return $result;
74 }
75
76 protected function encryptTwelve($string)
77 {
78 $result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
79 return strtoupper(bin2hex($result));
80 }
81
82 public function decrypt($string)
83 {
84 $result = FALSE;
85 switch ($this->version) {
86 case 11:
87 $result = $this->decryptEleven($string);
88 break;
89 case 12:
90 $result = $this->decryptTwelve($string);
91 break;
92 default:
93 break;
94 }
95
96 return $result;
97 }
98
99 protected function decryptEleven($upperString)
100 {
101 $string = hex2bin(strtolower($upperString));
102
103 $round = intval(floor(strlen($string) / 8));
104 $leftLength = strlen($string) % 8;
105 $result = '';
106 $currentVector = $this->blowIv;
107
108 for ($i = 0; $i < $round; $i++) {
109 $encryptedBlock = substr($string, 8 * $i, 8);
110 $temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);
111 $currentVector = $this->xorBytes($currentVector, $encryptedBlock);
112 $result .= $temp;
113 }
114
115 if ($leftLength) {
116 $currentVector = $this->encryptBlock($currentVector);
117 $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
118 }
119
120 return $result;
121 }
122
123 protected function decryptTwelve($upperString)
124 {
125 $string = hex2bin(strtolower($upperString));
126 return openssl_decrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
127 }
128 };
129
130
131 //需要指定版本两种,11或12
132 //$navicatPassword = new NavicatPassword(12);
133 $navicatPassword = new NavicatPassword(11);
134
135 //解密
136 $decode = $navicatPassword->decrypt('5658213B');
137 echo $decode."\n";
138 ?>

最新文章

  1. 简析.NET Core 以及与 .NET Framework的关系
  2. [转]struts2处理.do后缀的请求
  3. OC-02 如何设计类
  4. Windows Server 2008 R2 服务器安装(重装)流程备忘
  5. yum clean all 是什么意思
  6. android访问网络--okhttp
  7. iwebshop 订单存库修改为下单件库存
  8. C# ADO.NET SqlDataAdapter中传递参数
  9. Homebrew OS X 不可或缺的套件管理器
  10. 阅读&lt;构建之法&gt;第三10、11、12章
  11. Android NDK OpenCV C++
  12. struts.xml配置文件标签详解
  13. Jenkins使用教程
  14. C# 神奇的Web services 请求超时问题 排查分析
  15. 获取上一行记录lag
  16. SQLite 知识摘要 --- 事务
  17. 获取windows鼠标的当前坐标
  18. Python Django框架笔记(四):数据分页和CSRF跨站点请求伪造
  19. C# IEqualityComparer类型参数写法
  20. DBeaver利用方式简介

热门文章

  1. java学习日记20230228-变量
  2. javaSE学习二
  3. Redis系列目录
  4. LinuxGPU服务器搭建
  5. P2016题解
  6. 别再写一堆的 for 循环了!Java 8 中的 Stream 轻松遍历树形结构,是真的牛逼
  7. 带有FIFO硬件缓存的串口
  8. 【c#】csharp_learn
  9. Nginx日志切割工具logrorate
  10. @Column和@Select使用测试