A public key is a point (X, Y)
Its serialization is 04+X+Y as uncompressed, and (02+X as compressed if Y is even), and (03+X as compressed if Y is odd). X and Y are here the corresponding 64-character hexadecimal string
OK, let me give an example of what I want to do. Take the ECDH demo here
http://www-cs-students.stanford.edu/~tjw/jsbn/ecdh.htmlIf I generate a private key for alice I can get
P = 1175846487558108474218546536054752289210804601041
Which gives the following public key point.
X = 583857549063195252150226340830731484791130788759
Y = 1195037839477751118658084226553581900533276838164
So with the compression above, Y is even so I prefix with 02 and use X as the point so the compressed point would be.
02583857549063195252150226340830731484791130788759
First you need to
make it hexadecimalDoing this you see that it has 40 digits which is "too low", it should be 64 (or 63 or sometimes less). I think you clicked on a curve with too small parameters, try secp256r1. (but be aware it's not the curve Bitcoin uses!)
Then do it again.
For example: private key = 85028609766675152251934575542315533189276559485968373120473797427005522772778
That makes
X=74025470963109022618637889099135097200712436357290103177754999741983793503008
Y=50024355523753322356558351156744867670202798471897393499007716154220308517913
So:
X(hex)=a3a8ee8a09fa012934eb0eee2150d4bcb6268f2b4430abf31f4a58c95b365b20
Y(hex)=6e98c827edc5e80829c71e1fa9a83043379344316ba641d7c9c0850f687ed419
So the two corresponding public keys are
pbk1='04a3a8ee8a09fa012934eb0eee2150d4bcb6268f2b4430abf31f4a58c95b365b206e98c827edc5e
80829c71e1fa9a83043379344316ba641d7c9c0850f687ed419'
pbk2='03a3a8ee8a09fa012934eb0eee2150d4bcb6268f2b4430abf31f4a58c95b365b20' because Y is odd
So how would I go from the above back to the original X,Y point assuming I don't have the private key ?
https://bitcointalk.org/index.php?topic=162805.0