当前位置:网站首页>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
边栏推荐
- Update of complex JSON in MySQL
- 做自媒体视频需要怎么做才能年收入一百万?
- sklearnex 让你的 sklearn 机器学习模型训练快得飞起?
- An article clearly explains MySQL's clustering / Federation / coverage index, back to table, and index push down
- [data midrange] what is the oneid of the data midrange? Isn't the master data fragrant?
- Full nanny tutorial of Market Research Competition (experience sharing)
- 图片打标签之获取图片在ImageView中的坐标
- ECSHOP commodity page multi-attribute batch purchase plug-ins ECSHOP wholesale plug-ins multi-attribute order placing, multi-attribute batch purchase of commodities
- Black Horse Chang Shopping Mall - - - 3. Gestion des produits de base
- Thinkphp3 count ` *'problem
猜你喜欢
Explain factor analysis in simple terms, with case teaching (full)
Dark horse shopping mall ---6 Brand, specification statistics, condition filtering, paging sorting, highlighting
揭秘GaussDB(for Redis):全面对比Codis
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
MySQL common interview questions
19. Implementation of MVVM architecture based on WPF event to command
plt.gca()画框及打标签
15、wpf之button样式小记
2022年首期Techo Day腾讯技术开放日将于6月28日线上举办
Today, I will explain to you what is DFI and its development prospects
随机推荐
揭秘GaussDB(for Redis):全面對比Codis
R语言dist函数计算dataframe数据中两两样本之间的距离返回样本间距离矩阵,通过method参数指定距离计算的方法、例如欧几里得距离
Why do we do autocorrelation analysis? Explain application scenarios and specific operations
15、wpf之button样式小记
confluence7.4. X upgrade record
MySQL common interview questions
实现领域驱动设计 - 使用ABP框架 - 系列文章汇总
An article clearly explains MySQL's clustering / Federation / coverage index, back to table, and index push down
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
Learning notes 2022 overview | automatic graph machine learning, describing AGML methods, libraries and directions
Arm V7 coprocessor
The R language uses the follow up The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The type parameter specifies the line type of
R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、epiDisplay包的poisgof函数对拟合的泊松回归模型进行拟合优度检验(检验模型效果)
Hook技术
SDN system method | 9 Access network
JS monitors the width and height changes of div
plt.gca()画框及打标签
揭秘GaussDB(for Redis):全面对比Codis
VIM common commands and shortcut keys
Kotlin study notes