I'm using geth over rpc in my php script for a website.
In my script I've created a random passphrase that I store in a file so I can use it later to unlock the account.
So, to keep thing simple I create it using this code :
$myfile = fopen($basepath.hash('sha256', $somethingToIdentifyTheAccountInAUniqueWay, "w"));
$passkey = bin2hex(openssl_random_pseudo_bytes(256));
$new_address = $eth->personal_newAccount($passkey);
fwrite($myfile, $passkey);
fclose($myfile);
and then I unlock it with :
$passphrase = fread($myfile,filesize($filepath));
$eth->personal_unlockAccount($address, $passphrase, 5);
The system works, but for some reason 6 of my approximately 30k address are unable to unlock, even manually inside the geth console using the passphrase I got from the file...
The error is :
Error: could not decrypt key with given passphrase
Is there something I can try to unlock the account? Somewhere I can try to track the problem? We do backup each 30min and nothing have change from creation to now. I dont know where to look anymore as everything seems fine... I even try empty passphrase or php error code that could possibly been registered in the variable in case something went wrong somewhere...