I am using (this site's) Javascript library and OpenSSL Ruby to compute the symmetric key of Elliptic Curve Diffie Hellman.
However, from my results, OpenSSL Ruby only generated one key unlike that on the site which has X and Y symmetric keys. I am baffled as my OpenSSL symmetric key doesn't match either one of those x and y on the site.
The symmetric(shared secret) keys I got using secp224r1
curve:
Ruby OpenSSL
13506351678569412185536677668115375188438201041599149052762191980775
Using Site's JS Library
x: 26210366144026557327555572210249241206666031403062020900473236895358
y: 19676808255388748321882118528911150828003358302170965920476006073155
My questions are:
1) Why does OpenSSL Ruby yields only one key while that size yields two keys: x and y (as I've assumed x and y won't be concatenated with each other since the bitsize will be too long when compared to the Ruby symmetric key)
2) Is there a way to convert the two symmetric keys (OpenSSL and JSBN-EC library above) from one another? All my attempts to convert failed.
I've been struggling for a week now implementing Ruby OpenSSL with that JSBN-EC library. I've also tried (SJCL library) but similar results (symmetric keys don't match). Please help.
I've managed to work it out now with working symmetric keys on client (JSBN-EC) and on server OpenSSL Ruby
I found out that my problem actually lies in the code itself. After fixing it, I've ended up with a symmetric key on OpenSSL Ruby as follows:
While on the client side using JSBN-EC
Therefore from the looks of it, the symmetric key that matches the Ruby OpenSSL value is the X value of the JSBN-EC symmetric key
I don't know what the Y value is now for. Looks like I won't need it. Cheers! :)