当前位置:网站首页>Navicat premium view password scheme
Navicat premium view password scheme
2022-06-25 12:29:00 【Yu Qin】
Regular use Navicat Premium Connect to database , Sometimes I forget my password , You can obtain the password through the following two steps :
One . Export connection
1: Select the database where you want to get the password

Two : Get the saved to local connections.ncx In the document Password
Three decryption password
<?php
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);
}
};
// Two versions need to be specified ,11 or 12
//$navicatPassword = new NavicatPassword(11);
$navicatPassword = new NavicatPassword(11);
// Decrypt
//$decode = $navicatPassword->decrypt('15057D7BA390');
$decode = $navicatPassword->decrypt('E75BF077AB8BAA3AC2D5');
echo $decode."\n";
?> Use the password, Replace... In the above code $decode = $navicatPassword->decrypt('E75BF077AB8BAA3AC2D5');
After running , Will get the real password
边栏推荐
- Explain factor analysis in simple terms, with case teaching (full)
- Dark horse shopping mall ---6 Brand, specification statistics, condition filtering, paging sorting, highlighting
- How do super rookies get started with data analysis?
- How can we make an annual income of onemillion yuan by making our own media video?
- ARM V7 连续加载/存储
- 一套自动化无纸办公系统(OA+审批流)源码:带数据字典
- Arm V7 LDR STR memory access
- 实现领域驱动设计 - 使用ABP框架 - 系列文章汇总
- Architects reveal the difference between working in Alibaba, Tencent and meituan
- What is Flink? What can Flink do?
猜你喜欢

19、wpf之事件转命令实现MVVM架构

揭秘GaussDB(for Redis):全面對比Codis

刷入Magisk通用方法

MySQL common interview questions

Explain AHP in human language (very detailed principle + simple tool implementation)

How to use ARIMA model for prediction?

The source code of the hottest online disk money making system in 2022 imitates Lanzou online disk / Chengtong online disk / sharing money making cloud disk system / online disk VIP Download System

揭秘GaussDB(for Redis):全面对比Codis

Architects reveal the difference between working in Alibaba, Tencent and meituan

Dark horse shopping mall ---6 Brand, specification statistics, condition filtering, paging sorting, highlighting
随机推荐
Time series analysis - how to use unit root test (ADF) correctly?
R语言dplyr包summarise_at函数计算dataframe数据中多个数据列(通过向量指定)的计数个数、均值和中位数、在每个函数内部指定na.rm参数、通过list指定函数列表
Kotlin study notes
Today, I will explain to you what is DFI and its development prospects
Qiantang Pingou source code -- Qiantang Pingou app system development source code sharing
New and old cluster migration of Minio data
Ten commandments of self-learning in machine learning
Why should Apple change objc_ Type declaration for msgsend
Lighten the source code -- lighten the app system development function introduction to the beautiful world lighten the app system development source code in China
Uncover gaussdb (for redis): comprehensive comparison of CODIS
做自媒体视频需要怎么做才能年收入一百万?
Update of complex JSON in MySQL
Does sklearex make your sklearn machine learning model training fly fast?
2022 meisai topic C idea sharing + translation
2022年首期Techo Day腾讯技术开放日将于6月28日线上举办
如果你也想做自媒体,不妨听大周给您点建议
R language dplyr package filter function filters the data rows in the specified list whose contents in the dataframe data are not (not equal to one of the specified vectors)
Black Horse Chang Shopping Mall - - - 3. Gestion des produits de base
R language uses GLM function to build Poisson logarithmic linear regression model, processes three-dimensional contingency table data to build saturation model, and poisgof function of epidisplay pack
Explain factor analysis in simple terms, with case teaching (full)