之前在Navicat建立了数据库连接,设置了自动保存密码。现在忘记密码了,可以这样查看密码:

一、导出数据库连接 connections.ncx 文件

二、打开 connections.ncx 文件,找到 password 字段

这里看到的密码是加密的,需要进行解密

三、密码解密

将password字段的值替换代码倒数第二行的“加密密码”,运行后则得到该数据库连接的真实密码了。

$decode = $navicatPassword->decrypt('加密密码');

注意:Navicat版本选择12,选择11有的会出现乱码

代码在线运行工具:代码在线运行 - 在线工具

PHP解码代码:(来源:破解Navicat已保存连接的数据库账号密码 - it610.com)

<?phpnamespace FatSmallTools;class NavicatPassword
{protected $version = 0;protected $aesKey = 'libcckeylibcckey';protected $aesIv = 'libcciv libcciv ';protected $blowString = '3DC5CA39';protected $blowKey = null;protected $blowIv = null;public function __construct($version = 12){$this->version = $version;$this->blowKey = sha1('3DC5CA39', true);$this->blowIv = hex2bin('d9c7c3c8870d64bd');}public function encrypt($string){$result = FALSE;switch ($this->version) {case 11:$result = $this->encryptEleven($string);break;case 12:$result = $this->encryptTwelve($string);break;default:break;}return $result;}protected function encryptEleven($string){$round = intval(floor(strlen($string) / 8));$leftLength = strlen($string) % 8;$result = '';$currentVector = $this->blowIv;for ($i = 0; $i < $round; $i++) {$temp = $this->encryptBlock($this->xorBytes(substr($string, 8 * $i, 8), $currentVector));$currentVector = $this->xorBytes($currentVector, $temp);$result .= $temp;}if ($leftLength) {$currentVector = $this->encryptBlock($currentVector);$result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);}return strtoupper(bin2hex($result));}protected function encryptBlock($block){return openssl_encrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING); }protected function decryptBlock($block){return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING); }protected function xorBytes($str1, $str2){$result = '';for ($i = 0; $i < strlen($str1); $i++) {$result .= chr(ord($str1[$i]) ^ ord($str2[$i]));}return $result;}protected function encryptTwelve($string){$result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);return strtoupper(bin2hex($result));}public function decrypt($string){$result = FALSE;switch ($this->version) {case 11:$result = $this->decryptEleven($string);break;case 12:$result = $this->decryptTwelve($string);break;default:break;}return $result;}protected function decryptEleven($upperString){$string = hex2bin(strtolower($upperString));$round = intval(floor(strlen($string) / 8));$leftLength = strlen($string) % 8;$result = '';$currentVector = $this->blowIv;for ($i = 0; $i < $round; $i++) {$encryptedBlock = substr($string, 8 * $i, 8);$temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);$currentVector = $this->xorBytes($currentVector, $encryptedBlock);$result .= $temp;}if ($leftLength) {$currentVector = $this->encryptBlock($currentVector);$result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);}return $result;}protected function decryptTwelve($upperString){$string = hex2bin(strtolower($upperString));return openssl_decrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);}
}use FatSmallTools\NavicatPassword;//需要指定版本,11或12
$navicatPassword = new NavicatPassword(12);
//$navicatPassword = new NavicatPassword(11);//解密
//$decode = $navicatPassword->decrypt('15057D7BA390');
$decode = $navicatPassword->decrypt('加密密码');
echo $decode."\n";

如何查看Navicat已保存数据库连接的密码相关推荐

  1. 如何查看wi-fi的密码_如何在Windows 10上查看所有已保存的Wi-Fi密码

    如何查看wi-fi的密码 Mayuree Moonhirun/Shutterstock.comMayuree Moonhirun / Shutterstock.com Windows remember ...

  2. Linux怎么查看保存的密码,在Linux中查看已保存的WiFi密码

    在安装流行操作系统时,如 Windows 10.Ubuntu.macOS 等,都会要求用户提前输入 WiFi 密码.特别是 Ubuntu 系统,在配置安装向导时就可以连接 WiFi,以方便在系统安装过 ...

  3. 华为畅玩5X无Root查看已保存WiFi热点密码教程

     很多时候因为各种原因我们虽然把自己的手机连上了WiFi但却不记得密码了.虽然自己的手机使用不会受到影响,但是每当有朋友或者同事问起的时候我们就不得不想方设法把密码告诉他们.当然,方法是有的.只是 ...

  4. windows 11远程桌面连接无法使用已保存的凭据密码,每次连接都要求输入的解决方案

    记录windows 11远程桌面连接无法使用已保存的凭据密码每次都要求输入的问题 主要表现为:每次连接都提示:Windows Defender Credential Guard不允许使用已保存的凭据. ...

  5. Windows如何清除已保存的FTP密码

    Windows如何清除已保存的FTP密码 Windows如何清除已保存的FTP密码 打开CMD命令窗口输入regedit回车进入注册表 找到HKEY_CURRENT_USER\Software\Mic ...

  6. android删除所有已保存wifi密码,安卓移除/忘记已保存的wifi密码

    先说答案 高版本用wifiManager.forget,低版本用wifiManager.removeNetwork+wifiManager.saveConfiguration 网络跟集体失忆了似的. ...

  7. 安卓移除/忘记已保存的WiFi密码

    先说答案 高版本用wifiManager.forget,低版本用wifiManager.removeNetwork+wifiManager.saveConfiguration 网络跟集体失忆了似的. ...

  8. 输入你的密码来连接到_查看电脑已连接的WIFI密码

     一起来探索宇宙的奥秘 To explore universe WIFI密码连接一段时间之后会经常忘记,这时候想要在另外的设备上进行连接就比较麻烦,如果是手机设备可以简单查看所连WIFI密码,但是电脑 ...

  9. 查看已保存的wifi密码

    查看方法:安装 ES文件浏览器 (需要注意:打开后点击 切换到根目录)data/misc/wifi----wpa_supplicant.conf(点一下后,选择用ES文本浏览器打开)SSID:就是路由 ...

最新文章

  1. 20181029NOIP模拟赛T2
  2. Centos7安装Python3并更改默认版本为python3(编译安装)
  3. intellij从git上拉取maven项目详细步骤
  4. 面试官:Redis 内存数据满了,会宕机吗?
  5. springboot项目实例_Springboot项目的接口防刷的实例
  6. 在一个字符串中找到第一个只出现一次的字符, 并返回它的位置
  7. JAVA酒店管理系统
  8. 我是明晃晃的开端(2017/4/17)
  9. 怎样关闭计算机445端口,445端口怎么关闭 445端口关闭方法介绍
  10. 第9章 Linux的磁盘管理
  11. Sql Server数据库的备份和恢复措施
  12. 协同办公考勤管理系统php,协同办公考勤管理系统完整源码 超级给力UI 适用于中小型企业的办公考勤管理系统...
  13. 阅读文档时遇到的英文单词 -Words in Documents
  14. 太酷了,手把手教你用 Python 绘制桑基图
  15. 数据结构之不带头结点单链表和带头结点单链表相关操作实现(C语言)
  16. thingsboard 编译失败,报错 Failed to execute goal com.mycila:license-maven-plugin:3.0
  17. [源码和文档分享]基于WIN32 API界面编程实现的华容道小游戏
  18. 目前国外流行的几个JS库.
  19. javaweb项目设计思路
  20. canvas--如何实现H5移动端电子签名

热门文章

  1. 2022最新200道软件测试面试题
  2. 张宇考研数学闭关修炼【解析分册】
  3. HTML无序列表布局
  4. IP101GR/IP101GA原理图和代码
  5. 中国苹果树苗市场产量需求与投资收益预测报告2022-2028年
  6. javascript预加载图片、css、js的方法研究
  7. Rust:并发编程(concurrent programming)
  8. 科学计算机解三角函数方程,如何让计算器计算方程如何让fx-82ES的卡西欧计算器解一次,二次,或更高次数方程?是支持三角函数的!...
  9. Java人力资源管理系统源码 HR源码
  10. 基于FPGA的图像平滑处理