>From: [email protected] On Behalf Of Nazeer S
>Sent: Sunday, 13 January, 2013 20:24

This is not a -dev question.

>I am working with OpenSSL ECDH function to generate the required 
>Key Material. When I am sending the Private data of 32 bytes with 
>32nd byte as 0x00, Key Material generated is unable to decrypt the 
>Data. If the 32nd byte of the Private key is not 0x00, key material 
>generated was able to decrypt the required data. I am using P-256 
>elliptical curve for my application. Do you have any possible solution 
>for this issue? or if you any suggestion in this regard, please do let me
know.
        
The solution depends on what you're doing wrong.

First of all, you should never be "sending" an ECDH (or other) 
private key anywhere; it should be restricted only to its owner.

For ECDH key agreement, each party should generate (or have) a 
keypair, and send the public key to the other party (or provide it 
some other way such as publication in a directory). There are 
several possible representations of a public key, but the one 
used by OpenSSL by default is one octet 04 plus the x coordinate 
of the point which for P-256 is 32 octets. The x coordinate (and 
also y in other representation) is practically random bits which 
can easily include an octet of 00, or other sometimes-special 
octets like 0D, 0A, 1A, etc. You must send it (and store it, 
if static) by means that preserve all binary values; in some 
situations this means encoding, escaping, etc.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to