提交 ac0bdcf2 编写于 作者: T tianhe1986

变量调整。

Signed-off-by: Ntianhe1986 <w1s2j3229@163.com>
上级 eaf41c62
...@@ -65,8 +65,7 @@ class NavicatPassword ...@@ -65,8 +65,7 @@ class NavicatPassword
{ {
return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING); return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
} }
protected function xorBytes($str1, $str2) protected function xorBytes($str1, $str2)
{ {
$result = ''; $result = '';
...@@ -82,7 +81,7 @@ class NavicatPassword ...@@ -82,7 +81,7 @@ class NavicatPassword
$result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv); $result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
return strtoupper(bin2hex($result)); return strtoupper(bin2hex($result));
} }
public function decrypt($string) public function decrypt($string)
{ {
$result = FALSE; $result = FALSE;
...@@ -110,8 +109,9 @@ class NavicatPassword ...@@ -110,8 +109,9 @@ class NavicatPassword
$currentVector = $this->blowIv; $currentVector = $this->blowIv;
for ($i = 0; $i < $round; $i++) { for ($i = 0; $i < $round; $i++) {
$temp = $this->xorBytes($this->decryptBlock(substr($string, 8 * $i, 8)), $currentVector); $encryptedBlock = substr($string, 8 * $i, 8);
$currentVector = $this->xorBytes($currentVector, substr($string, 8 * $i, 8)); $temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);
$currentVector = $this->xorBytes($currentVector, $encryptedBlock);
$result .= $temp; $result .= $temp;
} }
...@@ -122,6 +122,7 @@ class NavicatPassword ...@@ -122,6 +122,7 @@ class NavicatPassword
return $result; return $result;
} }
protected function decryptTwelve($upperString) protected function decryptTwelve($upperString)
{ {
$string = hex2bin(strtolower($upperString)); $string = hex2bin(strtolower($upperString));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册