RC2: fix issue with decrypting

This commit is contained in:
terrafrost 2016-03-01 16:30:36 -06:00
parent 1e93192721
commit da36b5c91e
2 changed files with 4 additions and 1 deletions

View File

@ -514,7 +514,7 @@ class Crypt_RC2 extends Crypt_Base
return $result; return $result;
} }
return parent::encrypt($ciphertext); return parent::decrypt($ciphertext);
} }
/** /**

View File

@ -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");
} }
} }