Decrypt empty string
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1290 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
05802d9c99
commit
dfbd4608b7
|
@ -43,6 +43,9 @@ function xxtea_mx($z, $y, $sum, $k) {
|
||||||
* @return string binary cipher
|
* @return string binary cipher
|
||||||
*/
|
*/
|
||||||
function encrypt_string($str, $key) {
|
function encrypt_string($str, $key) {
|
||||||
|
if ($str == "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
$v = str2long($str, true);
|
$v = str2long($str, true);
|
||||||
$n = count($v) - 1;
|
$n = count($v) - 1;
|
||||||
$z = $v[$n];
|
$z = $v[$n];
|
||||||
|
@ -72,11 +75,11 @@ function encrypt_string($str, $key) {
|
||||||
* @return string plain-text password
|
* @return string plain-text password
|
||||||
*/
|
*/
|
||||||
function decrypt_string($str, $key) {
|
function decrypt_string($str, $key) {
|
||||||
$v = str2long($str, false);
|
if ($str == "") {
|
||||||
$n = count($v) - 1;
|
|
||||||
if (!$n) {
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
$v = str2long($str, false);
|
||||||
|
$n = count($v) - 1;
|
||||||
$z = $v[$n];
|
$z = $v[$n];
|
||||||
$y = $v[0];
|
$y = $v[0];
|
||||||
$q = floor(6 + 52 / ($n + 1));
|
$q = floor(6 + 52 / ($n + 1));
|
||||||
|
|
Loading…
Reference in a new issue