Good Encryption
| From: | William Ahern | Date: | Fri, 21 Jul 2000 21:31:38 +0000 |
| Subject: | Good Encryption | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7632@lists.php.net to get a copy of this message | ||
Hey,
I have a few of questions that I haven't been able to find easily elsewhere,
at least for a lay person ;)
If the key size for TWOFISH_256 is 32 bits, but I pass a string that is
something longer to mcrypt, will only the first 32 bits be used?
If this is the case, should I break up the string along the n bit boundaries
into blocks and loop through each block of the key encrypting the previous
output?
I want to generate a random n bit key. Currently I'm looping through successive
calls to mt_rand(0,1) and building the key (i.e. $binarykey .= mt_rand(1,0),
then returning it w/ unpack("A$bits",$binarystring). There must be a better
way, and is this even remotely a good way to do this, i.e. is it flawed?
TIA!
Please CC me since I'm not subscribed.
Bill