This content has been marked as final.
Show 6 replies

1. Re: conversion of public key to biginteger
sabre150 May 16, 2012 9:01 AM (in response to 909533)You can't represent the java.security.spec.ECPoint as a single BigInteger (or at least not without some reversible transformation of the two component parts). Check the Javadoc for java.security.spec.ECPoint . 
2. Re: conversion of public key to biginteger
EJP May 16, 2012 10:06 AM (in response to 909533)Here the public key is ECPoint which is a point on the curve (x,y). I don't know how to convert this into a BigInteger.
You can't convert it to a single number, because it is two numbers. Surely this is obvious? 
3. Re: conversion of public key to biginteger
909533 May 17, 2012 9:08 AM (in response to sabre150)hi thanks for your response..please do suggest me any other methods to convert the public key into biginteger..for converting the private key into biginteger i used these code..
BigInteger s = ((ECPrivateKey) privKey).getS();
is there any methods like this for public key also??while am surfing about this i got this..we can get the value of X and Y by using getAffineX() and getAfiineY() and finally by using XOR operation (x,y)values can be converted into single value..but i dont know how to use this methods... 
4. Re: conversion of public key to biginteger
EJP May 17, 2012 10:25 AM (in response to 909533)hi thanks for your response
Have you read it?please do suggest me any other methods to convert the public key into biginteger
Err, no, you haven't read it. The public key is composed of two numbers. (x,y) You can convert each of those to a BigInteger. You can't convert the key itself to a BigInteger, because it isn't a number. It is two numbers. I already said that.for converting the private key into biginteger i used these code..
That code converts one of the numbers comprising the private key to a BigInteger. It isn't useful without the other nunber, and it doesn't constitute 'convert[ing] the private key to a BigInteger'.
BigInteger s = ((ECPrivateKey) privKey).getS();
I seem to be repeating myself here. Why is that?by using XOR operation (x,y)values can be converted into single value
Certainly, but the process loses information so you cannot recover the key from that number.
> but I don't know how to use this methods ...
You don't know how to use XOR? 
5. Re: conversion of public key to biginteger
909533 May 17, 2012 10:30 AM (in response to EJP)thanks for your response...anyway i tried and i got it by using getaffine methods.. 
6. Re: conversion of public key to biginteger
sabre150 May 17, 2012 3:33 PM (in response to 909533)906530 wrote:
You didn't get the PublicKey as a BigInteger by "using getaffine methods" ! You got TWO BigInteger values which, as we explained 3 times, are the component parts of the key!
thanks for your response...anyway i tried and i got it by using getaffine methods..