mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 18:25:13 +00:00
RC2: fix issue with decrypting
This commit is contained in:
parent
1e93192721
commit
da36b5c91e
@ -514,7 +514,7 @@ class Crypt_RC2 extends Crypt_Base
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::encrypt($ciphertext);
|
return parent::decrypt($ciphertext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,5 +120,8 @@ class Unit_Crypt_RC2Test extends PhpseclibTestCase
|
|||||||
|
|
||||||
$result = bin2hex($rc2->encrypt(pack('H*', $plaintext)));
|
$result = bin2hex($rc2->encrypt(pack('H*', $plaintext)));
|
||||||
$this->assertEquals($result, $ciphertext, "Failed asserting that $plaintext yielded expected output in $engineName engine");
|
$this->assertEquals($result, $ciphertext, "Failed asserting that $plaintext yielded expected output in $engineName engine");
|
||||||
|
|
||||||
|
$result = bin2hex($rc2->decrypt(pack('H*', $ciphertext)));
|
||||||
|
$this->assertEquals($result, $plaintext, "Failed asserting that decrypted result yielded $plaintext as a result in $engineName engine");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user