Jump to content

Elliptic Curve Digital Signature Algorithm

From Wikipedia, the free encyclopedia
(Redirected fromElliptic Curve DSA)

Incryptography,theElliptic Curve Digital Signature Algorithm(ECDSA) offers a variant of theDigital Signature Algorithm(DSA) which useselliptic-curve cryptography.

Key and signature sizes

[edit]

As with elliptic-curve cryptography in general, the bitsizeof theprivate keybelieved to be needed for ECDSA is about twice the size of thesecurity level,in bits.[1]For example, at a security level of 80 bits—meaning an attacker requires a maximum of aboutoperations to find the private key—the size of an ECDSA private key would be 160 bits. On the other hand, the signature size is the same for both DSA and ECDSA: approximatelybits, whereis the exponent in the formula,that is, about 320 bits for a security level of 80 bits, which is equivalent tooperations.

Signature generation algorithm

[edit]

SupposeAlicewants to send a signed message toBob.Initially, they must agree on the curve parameters.In addition to thefieldand equation of the curve, we need,a base point of prime order on the curve;is the multiplicative order of the point.

Parameter
CURVE the elliptic curve field and equation used
G elliptic curve base point, a point on the curve that generates asubgroup of large prime order n
n integer order ofG,means that,whereis the identity element.
the private key (randomly selected)
the public key(calculated by elliptic curve)
m the message to send

The orderof the base pointmust be prime.Indeed, we assume that every nonzero element of theringis invertible, so thatmust be afield.It implies thatmust be prime (cf.Bézout's identity).

Alice creates a key pair, consisting of a private key integer,randomly selected in the interval;and a public key curve point.We useto denoteelliptic curve point multiplication by a scalar.

For Alice to sign a message,she follows these steps:

  1. Calculate.(Here HASH is acryptographic hash function,such asSHA-2,with the output converted to an integer.)
  2. Letbe theleftmost bits of,whereis the bit length of the group order.(Note thatcan begreaterthanbut notlonger.[2])
  3. Select acryptographically secure randomintegerfrom.
  4. Calculate the curve point.
  5. Calculate.If,go back to step 3.
  6. Calculate.If,go back to step 3.
  7. The signature is the pair.(Andis also a valid signature.)

As the standard notes, it is not only required forto be secret, but it is also crucial to select differentfor different signatures. Otherwise, the equation in step 6 can be solved for,the private key: given two signaturesand,employing the same unknownfor different known messagesand,an attacker can calculateand,and since(all operations in this paragraph are done modulo) the attacker can find.Since,the attacker can now calculate the private key.

This implementation failure was used, for example, to extract the signing key used for thePlayStation 3gaming-console.[3]

Another way ECDSA signature may leak private keys is whenis generated by a faultyrandom number generator.Such a failure in random number generation caused users of Android Bitcoin Wallet to lose their funds in August 2013.[4]

To ensure thatis unique for each message, one may bypass random number generation completely and generate deterministic signatures by derivingfrom both the message and the private key.[5]

Signature verification algorithm

[edit]

For Bob to authenticate Alice's signatureon a message,he must have a copy of her public-key curve point.Bob can verifyis a valid curve point as follows:

  1. Check thatis not equal to the identity elementO,and its coordinates are otherwise valid.
  2. Check thatlies on the curve.
  3. Check that.

After that, Bob follows these steps:

  1. Verify thatrandsare integers in.If not, the signature is invalid.
  2. Calculate,where HASH is the same function used in the signature generation.
  3. Letbe theleftmost bits ofe.
  4. Calculateand.
  5. Calculate the curve point.Ifthen the signature is invalid.
  6. The signature is valid if,invalid otherwise.

Note that an efficient implementation would compute inverseonly once. Also, using Shamir's trick, a sum of two scalar multiplicationscan be calculated faster than two scalar multiplications done independently.[6]

Correctness of the algorithm

[edit]

It is not immediately obvious why verification even functions correctly. To see why, denote asCthe curve point computed in step 5 of verification,

From the definition of the public key as,

Because elliptic curve scalar multiplication distributes over addition,

Expanding the definition ofandfrom verification step 4,

Collecting the common term,

Expanding the definition ofsfrom signature step 6,

Since the inverse of an inverse is the original element, and the product of an element's inverse and the element is the identity, we are left with

From the definition ofr,this is verification step 6.

This shows only that a correctly signed message will verify correctly; other properties such as incorrectly signed messages failing to verify correctly and resistance tocryptanalyticattacks are required for a secure signature algorithm.

Public key recovery

[edit]

Given a messagemand Alice's signatureon that message, Bob can (potentially) recover Alice's public key:[7]

  1. Verify thatrandsare integers in.If not, the signature is invalid.
  2. Calculate a curve pointwhereis one of,,,etc. (providedis not too large for thefieldof the curve) andis a value such that the curve equation is satisfied. Note that there may be several curve points satisfying these conditions, and each differentRvalue results in a distinct recovered key.
  3. Calculate,where HASH is the same function used in the signature generation.
  4. Letzbe theleftmost bits ofe.
  5. Calculateand.
  6. Calculate the curve point.
  7. The signature is valid if,matches Alice's public key.
  8. The signature is invalid if all the possibleRpoints have been tried and none match Alice's public key.

Note that an invalid signature, or a signature from a different message, will result in the recovery of an incorrect public key. The recovery algorithm can only be used to check validity of a signature if the signer's public key (or its hash) is known beforehand.

Correctness of the recovery algorithm

[edit]

Start with the definition offrom recovery step 6,

From the definitionfrom signing step 4,

Because elliptic curve scalar multiplication distributes over addition,

Expanding the definition ofandfrom recovery step 5,

Expanding the definition ofsfrom signature step 6,

Since the product of an element's inverse and the element is the identity, we are left with

The first and second terms cancel each other out,

From the definition of,this is Alice's public key.

This shows that a correctly signed message will recover the correct public key, provided additional information was shared to uniquely calculate curve pointfrom signature valuer.

Security

[edit]

In December 2010, a group calling itselffail0verflowannounced the recovery of the ECDSA private key used bySonyto sign software for thePlayStation 3game console. However, this attack only worked because Sony did not properly implement the algorithm, becausewas static instead of random. As pointed out in theSignature generation algorithmsection above, this makessolvable, rendering the entire algorithm useless.[8]

On March 29, 2011, two researchers published anIACRpaper[9]demonstrating that it is possible to retrieve a TLS private key of a server usingOpenSSLthat authenticates with Elliptic Curves DSA over a binaryfieldvia atiming attack.[10]The vulnerability was fixed in OpenSSL 1.0.0e.[11]

In August 2013, it was revealed that bugs in some implementations of theJavaclassSecureRandomsometimes generated collisions in thevalue. This allowed hackers to recover private keys giving them the same control over bitcoin transactions as legitimate keys' owners had, using the same exploit that was used to reveal the PS3 signing key on someAndroidapp implementations, which use Java and rely on ECDSA to authenticate transactions.[12]

This issue can be prevented by deterministic generation of k, as described by RFC 6979.

Concerns

[edit]

Some concerns expressed about ECDSA:

  1. Political concerns:the trustworthiness ofNIST-produced curves being questioned after revelations were made that theNSAwillingly insertsbackdoorsinto software, hardware components and published standards; well-known cryptographers[13]have expressed[14][15]doubts about how the NIST curves were designed, and voluntary tainting has already been proved in the past.[16][17](See also thelibsshcurve25519introduction.[18]) Nevertheless, a proof that the named NIST curves exploit a rare weakness is missing yet.
  2. Technical concerns:the difficulty of properly implementing the standard, its slowness, and design flaws which reduce security in insufficiently defensive implementations.[19]

Implementations

[edit]

Below is a list of cryptographic libraries that provide support for ECDSA:

See also

[edit]

References

[edit]
  1. ^Johnson, Don; Menezes, Alfred (1999). "The Elliptic Curve Digital Signature Algorithm (ECDSA)".Certicom research. Canada.CiteSeerX10.1.1.38.8014.
  2. ^ NIST FIPS 186-4, July 2013, pp. 19 and 26
  3. ^Console Hacking 2010 - PS3 Epic FailArchivedDecember 15, 2014, at theWayback Machine,page 123–128
  4. ^"Android Security Vulnerability".RetrievedFebruary 24,2015.
  5. ^Pornin, T. (2013).RFC 6979 - Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)(Technical report).doi:10.17487/RFC6979.RetrievedFebruary 24,2015.
  6. ^"The Double-Base Number System in Elliptic Curve Cryptography"(PDF).RetrievedApril 22,2014.
  7. ^Daniel R. L. BrownSECGSEC 1: Elliptic Curve Cryptography (Version 2.0)https:// secg.org/sec1-v2.pdf
  8. ^Bendel, Mike (December 29, 2010)."Hackers Describe PS3 Security As Epic Fail, Gain Unrestricted Access".Exophase.RetrievedJanuary 5,2011.
  9. ^"Cryptology ePrint Archive: Report 2011/232".RetrievedFebruary 24,2015.
  10. ^"Vulnerability Note VU#536044 - OpenSSL leaks ECDSA private key through a remote timing attack".kb.cert.org.
  11. ^"ChangeLog".OpenSSL Project.RetrievedApril 22,2014.
  12. ^"Android bug batters Bitcoin wallets".The Register. August 12, 2013.
  13. ^Schneier, Bruce (September 5, 2013)."The NSA Is Breaking Most Encryption on the Internet".Schneier on Security.
  14. ^"SafeCurves: choosing safe curves for elliptic-curve cryptography".October 25, 2013.
  15. ^Bernstein, Daniel J.;Lange, Tanja(May 31, 2013)."Security dangers of the NIST curves"(PDF).
  16. ^Schneier, Bruce (November 15, 2007)."The Strange Story of Dual_EC_DRBG".Schneier on Security.
  17. ^Greenemeier, Larry (September 18, 2013)."NSA Efforts to Evade Encryption Technology Damaged U.S. Cryptography Standard".Scientific American.
  18. ^"[email protected]\doc - projects/libssh.git".libssh shared repository.
  19. ^Bernstein, Daniel J. (March 23, 2014)."How to design an elliptic-curve signature system".The cr.yp.to blog.

Further reading

[edit]
[edit]