Re: Proposed new package
| From: | Christian Dickmann | Date: | Sun, 16 Feb 2003 11:41:40 +0000 |
| Subject: | Re: Proposed new package | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-13370@lists.php.net to get a copy of this message | ||
> Attached is a package that implements DES, both as a native processor
> and as a wrapper for libmcrypt. I believe I've taken all of the
> necessary formatting steps for PEAR compliance. I am placing this
> package up for review by this list with the intent of acquiring a PEAR
> account. Thank you.
I think your implementation of DES could be much better when
using bit operations instead of this nice workaround. In C/Delphi it would
be MUCH faster using bit operations, but I don't know how much it
is an issue for PHP.
I implemented DES for Delphi. With bit operation one can merge
S-Box and P-Box, don't know if this works in your way too.
How? S-Box has clearly defined outputs (the values in the array).
P-Box comes directly after S-Box and transforms the S-Box
output values. So one could transform all S-Box values once with
P-Box and save the result as a SP-Box. Was _much_ faster in
Delphi. Even your current code could be tweaked.
Bit operations will have the problem, that PHP has no 64 bit
type. We can assume 32 bit, which means every value would
have to be splitted into 2 32 bit values, which makes bit operations
a bit more complex.
Christian Dickmann
PS: Your example code does not work! Your specified key does
not pass the check. How to generate a Key that passes it?