Posts

Showing posts with the label PHP: Change variable/line to use specific private key instead of random private key

PHP: Change variable/line to use specific private key instead of random private key

PHP: Change variable/line to use specific private key instead of random private key What I want to do: I have a private key and want to convert it to a public key via PHP. The code currently converts a RANDOM privatekey to a public key - but I need to convert a SPECIFIC private key to a publik key. So I found this code here: http://ift.tt/2AW3hLw The keys are created in function "create_key_pair()" between lines 238-274. Line 264 seems to correspond to this step #1 described here: http://ift.tt/1l34mjq (The steps after step1 are clear.) So the needed change must be before variable "$pubBinStr" is used in #264. The code generates a random private key (maybe on line 256 "$point"?) and then creates the public key of that private key. I need to change the code so I am able to input a SPECIFIC privatey key and then calculate its public key. Can someone please point out which line or variable I need to change to be able to input a SPECIFIC private key inst...