Navicat 查看密码方案 解决问题: 我们经常使用 navicat 连接数据库,有时候时间久了之后,会忘记之前的密码,那么现在我们有办法获得只要正常连接的数据库的密码
步骤: 导出连接 connections.ncx,拿到保存到本地的 connections.ncx 文件中的 Password,粘贴到下面的代码中 登陆https://tool.lu/coderunner/,使用 PHP 在线运行工具,粘贴下面添加密码后的代码
备用工具网址(https://zixuephp.net/tool-runcode.html) 1<?php 2class 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 .