当前位置: 首页 > news >正文

使用php对navicat查看数据库密码?

navicat如何查看数据库密码?

navicat 用久了有些数据库连接密码忘记了,怎么办?

软件提供了导出链接功能:

文件----导出链接----记得勾选导出密码

打开文件,查看密码字段

需要解密使用

解密 - 使用PHP程序进行解密

<?php// Navicat 11及以前的版本
//$navicatPassword = new NavicatPassword(11);// Navicat 12及以后的版本
$navicatPassword = new NavicatPassword(12);$decode = $navicatPassword->decrypt('9F6B3EE5AE4F53AD8EA70079846F73EDE5B83C29B148BF77DFA988BCCDC3A918');
echo $decode . "\n";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);}
}

解密 - 使用PHP 在线工具进行解密

php在线运行,在线工具,在线编译IDE_w3cschool

选择你自己的Navicat版本,把代码中的密码替换为你自己connections.ncx文件中的密码,然后执行即可输出

相关文章:

  • 开机不用输入密码,修改注册表
  • nvue全攻略:从入门到性能优化
  • 短视频矩阵系统开发实战:PHP实现SaaS独立部署
  • Vue-生命周期
  • Jmeter压测手册:脚本配置、服务器环境搭建与运行
  • 将后端数据转换为docx文件
  • 13.18 Ollama+LLaMA3企业级部署实战:6步打造私有化大模型高效引擎
  • <8>-MySQL复合查询
  • 前端三剑客基础案例001
  • 下载指定版本的matplotlib
  • 图片去水印,图片变清晰,完成免费
  • Java并发编程实战 Day 21:分布式并发控制
  • ONLYOFFICE 的AI技巧-1.集成OCR、文本转图像、电子表格集成等新功能
  • aflplusplus:开源的模糊测试工具!全参数详细教程!Kali Linux教程!(一)
  • 激光雷达 + 视觉相机:高精度位姿测量方案详解
  • Altera系列FPGA基于ADV7180解码PAL视频,纯verilog去隔行,提供2套Quartus工程源码和技术支持
  • 多个机器人同时加载在rviz及gazebo同一个场景中
  • Blender 简介 ~ 总结,如何下载Blend格式模型
  • UDS协议中0x31服务(Routine Control)详解及应用
  • 网络安全防护:点击劫持
  • 网站建设所需材料/关键词排名方法
  • h5网站开发培训哪里好/网站运营推广方案
  • 专为网站做点击量/百度推广业务员
  • 网站建设目标个人博客dw/腾讯竞价广告
  • 湖南营销型网站建设报价/全球疫情最新数据消息
  • 做网站赚广告费多么/百度免费推广登录入口