Re: [PEPr] Comment on Encryption::Crypt_Blowfish
| From: | Ants Aasma | Date: | Tue, 08 Feb 2005 13:51:12 +0000 |
| Subject: | Re: [PEPr] Comment on Encryption::Crypt_Blowfish | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36060@lists.php.net to get a copy of this message | ||
bertrand Gugger wrote:
Alan Knowles wrote:list(,$Xl,$Xr) = unpack("N2",substr($plainText,$i,8)); $this->_encipher($Xl, $Xr); $cipherText .= pack("N2", $Xl, $Xr); to get rid of the ord and chr. Antssomething like this should work, A little bit extra copy and pasting, but it should get rid of the @'s $s = strlen($x); $lr = (($s > ($i+1)) ? ord($x[i+1]) : 0) << 16 + (($s > ($i+2)) ? ord($x[i+2]) : 0) << 8 + (($s > ($i+3)) ? ord($x[i+3]) : 0) << 4 + (($s > ($i+4)) ? ord($x[i+4]) : 0) << 2+Why not: $x .= strlen($x) % 8) ? str_repeat( chr(0), 8 - (strlen($x) % 8)) : ''; and then get rid of @ on ord() ? And use