2
$\begingroup$

I need a small clarification that why openssl using SHA1 in ECC when I am using secp384r1 curve, but in rfc they are saying we should use SHA2.

Thing here is am using nanoECC in my DTLS, nanoECC using SHA384 for secp384r1 but openssl is using SHA1. So which one to use, if openssl is wrong then how to set openssl to use SHA384 for secp384r1 curve.

$\endgroup$
3
$\begingroup$

I need a small clarification that why openssl using SHA1 in ECC when I am using secp384r1 curve, but in rfc they are saying we should use SHA2.

OpenSSL uses SHA-1 because RFC 4492 defines the use of ECC on SSL with SHA-1. It should also support SHA-384 as defined in RFC 5289.

Which hash algorithm is used in TLS depends on the cipher suite. For example:

  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (uses SHA-1)
  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA384 (uses SHA-384)
$\endgroup$
  • $\begingroup$ Thanks for a quick response. actually I am using nanoECC with curve secp384r1 and while signing it is expecting 48 bytes of hash but am using TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA cipher. $\endgroup$ – user3459631 Oct 29 '14 at 9:04
  • $\begingroup$ @user3459631, are you saying nanoECC doesn't let you use SHA-1? In that case you could switch cipher suites, no? If the issue is that you are using some low level API that expects you to do the hashing, the rest of the 48 bytes should just be zeros (most significant, IIRC). $\endgroup$ – otus Oct 29 '14 at 10:45
  • 1
    $\begingroup$ Thanks, but i can't change cipher suites. And i did the same, first set 48 bytes to 0 and copied 20 bytes of hash in reverse order it is working now. $\endgroup$ – user3459631 Oct 31 '14 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.