I need to create a public/private key, but I don't need big keys, I try to use the follow code:
<?php
$config = array('private_key_bits' => 128);
$res = openssl_pkey_new($config);
?>
but I get this warning:
Warning: openssl_pkey_new(): private key length is too short; it needs to be at least 384 bits, not 64
Do I have to change something? (config files, modules etc etc?)
Upgraded to answer:
as I didnt know (I'm well away from web development currently!) I looked up the size limits on a cookie and they are 4kb each and you can create upto 20 per domain you should have space for a 1024 bit key even if you do have to use a dictionary lookup system between the cookies.
Also please make sure that the private key is sent using an ssl connection otherwise someone can intercept the private key and all your work will have been in vain