2007-07-24 09:34:06 UTC
Just a quick heads up to anyone installing this on a Windows machine - you'll need to edit classes/clsPpmCrypt.php (line 9) to reference MCrypt's built in random seed generator.
A quick fix that I found to work is to replace MCRYPT_DEV_URANDOM with MCRYPT_RAND, not forgetting that you need to seed the generator with srand(); before the call. An updated createIV() could look something like this:
function createIV() {
// TODO: Add proper check for Windows platform to determine iv source
srand(); //could add a seed generated from microtime or similar
$resEncDes = mcrypt_module_open('rijndael-256', '', 'cbc', '');
$strInitialVector = mcrypt_create_iv(mcrypt_enc_get_iv_size($resEncDes), MCRYPT_RAND); //modified for Windows support
mcrypt_module_close($resEncDes);
return $strInitialVector;
}
Hope this helps somebody!
Rob