mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-29 04:23:34 +00:00
DES: $block wasn't defined
This commit is contained in:
parent
c4b3288851
commit
5f64ab67ab
@ -656,12 +656,13 @@ class Crypt_DES {
|
||||
$xor = $this->encryptIV;
|
||||
if (strlen($buffer['xor'])) {
|
||||
for ($i = 0; $i < strlen($plaintext); $i+=8) {
|
||||
$block = substr($plaintext, $i, 8);
|
||||
if (strlen($block) > strlen($buffer['xor'])) {
|
||||
$xor = $this->_processBlock($xor, CRYPT_DES_ENCRYPT);
|
||||
$buffer['xor'].= $xor;
|
||||
}
|
||||
$key = $this->_string_shift($buffer['xor'], 8);
|
||||
$ciphertext.= substr($plaintext, $i, 8) ^ $key;
|
||||
$ciphertext.= $block ^ $key;
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < strlen($plaintext); $i+=8) {
|
||||
@ -845,12 +846,13 @@ class Crypt_DES {
|
||||
$xor = $this->decryptIV;
|
||||
if (strlen($buffer['xor'])) {
|
||||
for ($i = 0; $i < strlen($ciphertext); $i+=8) {
|
||||
$block = substr($plaintext, $i, 8);
|
||||
if (strlen($block) > strlen($buffer['xor'])) {
|
||||
$xor = $this->_processBlock($xor, CRYPT_DES_ENCRYPT);
|
||||
$buffer['xor'].= $xor;
|
||||
}
|
||||
$key = $this->_string_shift($buffer['xor'], 8);
|
||||
$plaintext.= substr($ciphertext, $i, 8) ^ $key;
|
||||
$plaintext.= $block ^ $key;
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < strlen($ciphertext); $i+=8) {
|
||||
|
Loading…
Reference in New Issue
Block a user