This code generates a mini-key if anyone's interested. I was looking for the next step, priv->pub key when I ran across this thread. It needs tidying of course and I just remembered I'm using the non-crypto rand() so that will need to be fixed too. Maybe I should just delete it
Edit: OK, fixed to use /dev/urandom. Use /dev/random if you'd prefer.
<?php
#Below is full list of available characters.
#"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
$fp=fopen("/dev/urandom","r") or die;
$available_chars="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz";
do{
$minikey='S';
for($i=0;$i<29;$i++){
while(($c=ord(fgetc($fp)))>=strlen($available_chars));
$minikey.=substr($available_chars,$c,1);
}
$check=hash('sha256',$minikey . '?') . "\n";
}while(substr($check,0,2)!='00');
fclose($fp);
$priv=hash('sha256',$minikey);
print "Minikey: $minikey\n";
print "Privkey: $priv\n";
?>
Note that I deliberately exclude "1' and 'o' but you may add them back in if needed.