Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Elliptic Curve Digital Signature Algorithm

From Wikipedia, the free encyclopedia
Cryptographic algorithm for digital signatures

Not to be confused withEdDSA.

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 bitsize of theprivate key believed 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 about280{\displaystyle 2^{80}} operations 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: approximately4t{\displaystyle 4t} bits, wheret{\displaystyle t} is the exponent in the formula2t{\displaystyle 2^{t}}, that is, about 320 bits for a security level of 80 bits, which is equivalent to280{\displaystyle 2^{80}} operations.

Signature generation algorithm

[edit]

SupposeAlice wants to send a signed message toBob. Initially, they must agree on the curve parameters(CURVE,G,n){\displaystyle ({\textrm {CURVE}},G,n)}. In addition to thefield and equation of the curve, we needG{\displaystyle G}, a base point of prime order on the curve;n{\displaystyle n} is the additive order of the pointG{\displaystyle G}.

Parameter
CURVEthe elliptic curve field and equation used
Gelliptic curve base point, a point on the curve that generates asubgroup of large prime order n
ninteger order ofG, means thatn×G=O{\displaystyle n\times G=O}, whereO{\displaystyle O} is the identity element.
dA{\displaystyle d_{A}}the private key (randomly selected)
QA{\displaystyle Q_{A}}the public keydA×G{\displaystyle d_{A}\times G} (calculated by elliptic curve)
mthe message to send

The ordern{\displaystyle n} of the base pointG{\displaystyle G}must be prime. Indeed, we assume that every nonzero element of theringZ/nZ{\displaystyle \mathbb {Z} /n\mathbb {Z} } is invertible, so thatZ/nZ{\displaystyle \mathbb {Z} /n\mathbb {Z} } must be afield. It implies thatn{\displaystyle n} must be prime (cf.Bézout's identity).

Alice creates a key pair, consisting of a private key integerdA{\displaystyle d_{A}}, randomly selected in the interval[1,n1]{\displaystyle [1,n-1]}; and a public key curve pointQA=dA×G{\displaystyle Q_{A}=d_{A}\times G}. We use×{\displaystyle \times } to denoteelliptic curve point multiplication by a scalar.

For Alice to sign a messagem{\displaystyle m}, she follows these steps:

  1. Calculatee=HASH(m){\displaystyle e={\textrm {HASH}}(m)}. (Here HASH is acryptographic hash function, such asSHA-2, with the output converted to an integer.)
  2. Letz{\displaystyle z} be theLn{\displaystyle L_{n}} leftmost bits ofe{\displaystyle e}, whereLn{\displaystyle L_{n}} is the bit length of the group ordern{\displaystyle n}. (Note thatz{\displaystyle z} can begreater thann{\displaystyle n} but notlonger.[2])
  3. Select acryptographically secure random integerk{\displaystyle k} from[1,n1]{\displaystyle [1,n-1]}.
  4. Calculate the curve point(x1,y1)=k×G{\displaystyle (x_{1},y_{1})=k\times G}.
  5. Calculater=x1modn{\displaystyle r=x_{1}\,{\bmod {\,}}n}. Ifr=0{\displaystyle r=0}, go back to step 3.
  6. Calculates=k1(z+rdA)modn{\displaystyle s=k^{-1}(z+rd_{A})\,{\bmod {\,}}n}. Ifs=0{\displaystyle s=0}, go back to step 3.
  7. The signature is the pair(r,s){\displaystyle (r,s)}. (And(r,smodn){\displaystyle (r,-s\,{\bmod {\,}}n)} is also a valid signature.)

As the standard notes, it is not only required fork{\displaystyle k} to be secret, but it is also crucial to select differentk{\displaystyle k} for different signatures. Otherwise, the equation in step 6 can be solved fordA{\displaystyle d_{A}}, the private key: given two signatures(r,s){\displaystyle (r,s)} and(r,s){\displaystyle (r,s')}, employing the same unknownk{\displaystyle k} for different known messagesm{\displaystyle m} andm{\displaystyle m'}, an attacker can calculatez{\displaystyle z} andz{\displaystyle z'}, and sincess=k1(zz){\displaystyle s-s'=k^{-1}(z-z')} (all operations in this paragraph are done modulon{\displaystyle n}) the attacker can findk=zzss{\displaystyle k={\frac {z-z'}{s-s'}}}. Sinces=k1(z+rdA){\displaystyle s=k^{-1}(z+rd_{A})}, the attacker can now calculate the private keydA=skzr{\displaystyle d_{A}={\frac {sk-z}{r}}}.

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

Another way ECDSA signature may leak private keys is whenk{\displaystyle k} is 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 thatk{\displaystyle k} is unique for each message, one may bypass random number generation completely and generate deterministic signatures by derivingk{\displaystyle k} from both the message and the private key.[5]

Signature verification algorithm

[edit]

For Bob to authenticate Alice's signaturer,s{\displaystyle r,s} on a messagem{\displaystyle m}, he must have a copy of her public-key curve pointQA{\displaystyle Q_{A}}. Bob can verifyQA{\displaystyle Q_{A}} is a valid curve point as follows:

  1. Check thatQA{\displaystyle Q_{A}} is not equal to the identity elementO, and its coordinates are otherwise valid.
  2. Check thatQA{\displaystyle Q_{A}} lies on the curve.
  3. Check thatn×QA=O{\displaystyle n\times Q_{A}=O}.

After that, Bob follows these steps:

  1. Verify thatr ands are integers in[1,n1]{\displaystyle [1,n-1]}. If not, the signature is invalid.
  2. Calculatee=HASH(m){\displaystyle e={\textrm {HASH}}(m)}, where HASH is the same function used in the signature generation.
  3. Letz{\displaystyle z} be theLn{\displaystyle L_{n}} leftmost bits ofe.
  4. Calculateu1=zs1modn{\displaystyle u_{1}=zs^{-1}\,{\bmod {\,}}n} andu2=rs1modn{\displaystyle u_{2}=rs^{-1}\,{\bmod {\,}}n}.
  5. Calculate the curve point(x1,y1)=u1×G+u2×QA{\displaystyle (x_{1},y_{1})=u_{1}\times G+u_{2}\times Q_{A}}. If(x1,y1)=O{\displaystyle (x_{1},y_{1})=O} then the signature is invalid.
  6. The signature is valid ifrx1(modn){\displaystyle r\equiv x_{1}{\pmod {n}}}, invalid otherwise.

Note that an efficient implementation would compute inverses1modn{\displaystyle s^{-1}\,{\bmod {\,}}n} only once. Also, using Shamir's trick, a sum of two scalar multiplicationsu1×G+u2×QA{\displaystyle u_{1}\times G+u_{2}\times Q_{A}} can 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 asC the curve point computed in step 5 of verification,

C=u1×G+u2×QA{\displaystyle C=u_{1}\times G+u_{2}\times Q_{A}}

From the definition of the public key asQA=dA×G{\displaystyle Q_{A}=d_{A}\times G},

C=u1×G+u2dA×G{\displaystyle C=u_{1}\times G+u_{2}d_{A}\times G}

Because elliptic curve scalar multiplication distributes over addition,

C=(u1+u2dA)×G{\displaystyle C=(u_{1}+u_{2}d_{A})\times G}

Expanding the definition ofu1{\displaystyle u_{1}} andu2{\displaystyle u_{2}} from verification step 4,

C=(zs1+rdAs1)×G{\displaystyle C=(zs^{-1}+rd_{A}s^{-1})\times G}

Collecting the common terms1{\displaystyle s^{-1}},

C=(z+rdA)s1×G{\displaystyle C=(z+rd_{A})s^{-1}\times G}

Expanding the definition ofs from signature step 6,

C=(z+rdA)(z+rdA)1(k1)1×G{\displaystyle C=(z+rd_{A})(z+rd_{A})^{-1}(k^{-1})^{-1}\times G}

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

C=k×G{\displaystyle C=k\times G}

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 tocryptanalytic attacks are required for a secure signature algorithm.

Public key recovery

[edit]

Given a messagem and Alice's signaturer,s{\displaystyle r,s} on that message, Bob can (potentially) recover Alice's public key:[7]

  1. Verify thatr ands are integers in[1,n1]{\displaystyle [1,n-1]}. If not, the signature is invalid.
  2. Calculate a curve pointR=(x1,y1){\displaystyle R=(x_{1},y_{1})} wherex1{\displaystyle x_{1}} is one ofr{\displaystyle r},r+n{\displaystyle r+n},r+2n{\displaystyle r+2n}, etc. (providedx1{\displaystyle x_{1}} is not too large for thefield of the curve) andy1{\displaystyle y_{1}} is a value such that the curve equation is satisfied. Note that there may be several curve points satisfying these conditions, and each differentR value results in a distinct recovered key.
  3. Calculatee=HASH(m){\displaystyle e={\textrm {HASH}}(m)}, where HASH is the same function used in the signature generation.
  4. Letz be theLn{\displaystyle L_{n}} leftmost bits ofe.
  5. Calculateu1=zr1modn{\displaystyle u_{1}=-zr^{-1}\,{\bmod {\,}}n} andu2=sr1modn{\displaystyle u_{2}=sr^{-1}\,{\bmod {\,}}n}.
  6. Calculate the curve pointQA=(xA,yA)=u1×G+u2×R{\displaystyle Q_{A}=(x_{A},y_{A})=u_{1}\times G+u_{2}\times R}.
  7. The signature is valid ifQA{\displaystyle Q_{A}}, matches Alice's public key.
  8. The signature is invalid if all the possibleR points 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 ofQA{\displaystyle Q_{A}} from recovery step 6,

QA=(xA,yA)=u1×G+u2×R{\displaystyle Q_{A}=(x_{A},y_{A})=u_{1}\times G+u_{2}\times R}

From the definitionR=(x1,y1)=k×G{\displaystyle R=(x_{1},y_{1})=k\times G} from signing step 4,

QA=u1×G+u2k×G{\displaystyle Q_{A}=u_{1}\times G+u_{2}k\times G}

Because elliptic curve scalar multiplication distributes over addition,

QA=(u1+u2k)×G{\displaystyle Q_{A}=(u_{1}+u_{2}k)\times G}

Expanding the definition ofu1{\displaystyle u_{1}} andu2{\displaystyle u_{2}} from recovery step 5,

QA=(zr1+skr1)×G{\displaystyle Q_{A}=(-zr^{-1}+skr^{-1})\times G}

Expanding the definition ofs from signature step 6,

QA=(zr1+k1(z+rdA)kr1)×G{\displaystyle Q_{A}=(-zr^{-1}+k^{-1}(z+rd_{A})kr^{-1})\times G}

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

QA=(zr1+(zr1+dA))×G{\displaystyle Q_{A}=(-zr^{-1}+(zr^{-1}+d_{A}))\times G}

The first and second terms cancel each other out,

QA=dA×G{\displaystyle Q_{A}=d_{A}\times G}

From the definition ofQA=dA×G{\displaystyle Q_{A}=d_{A}\times G}, 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 pointR=(x1,y1){\displaystyle R=(x_{1},y_{1})} from signature valuer.

Security

[edit]

In December 2010, a group calling itselffail0verflow announced the recovery of the ECDSA private key used bySony to sign software for thePlayStation 3 game console. However, this attack only worked because Sony did not properly implement the algorithm, becausek{\displaystyle k} was static instead of random. As pointed out in theSignature generation algorithm section above, this makesdA{\displaystyle d_{A}} solvable, rendering the entire algorithm useless.[8]

On March 29, 2011, two researchers published anIACR paper[9] demonstrating that it is possible to retrieve a TLS private key of a server usingOpenSSL that authenticates with Elliptic Curves DSA over a binaryfield via 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 theJava classSecureRandom sometimes generated collisions in thek{\displaystyle k} value. 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 someAndroid app 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 theNSA willingly insertsbackdoors into 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 thelibsshcurve25519 introduction.[18]) Nevertheless, a proof that the named NIST curves exploit a rare weakness is still missing.
  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.CiteSeerX 10.1.1.38.8014.
  2. ^"NIST FIPS 186-4, July 2013, pp. 19 and 26"(PDF).Archived(PDF) from the original on December 27, 2016. RetrievedMarch 17, 2014.
  3. ^Console Hacking 2010 - PS3 Epic FailArchived December 15, 2014, at theWayback Machine, page 123–128
  4. ^"Android Security Vulnerability".Archived from the original on April 7, 2019. 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).Archived(PDF) from the original on July 26, 2011. RetrievedApril 22, 2014.
  7. ^Daniel R. L. BrownSECG SEC 1: Elliptic Curve Cryptography (Version 2.0)https://www.secg.org/sec1-v2.pdf
  8. ^Bendel, Mike (December 29, 2010)."Hackers Describe PS3 Security As Epic Fail, Gain Unrestricted Access". Exophase.com.Archived from the original on April 7, 2019. RetrievedJanuary 5, 2011.
  9. ^"Cryptology ePrint Archive: Report 2011/232".Archived from the original on December 8, 2018. RetrievedFebruary 24, 2015.
  10. ^"Vulnerability Note VU#536044 - OpenSSL leaks ECDSA private key through a remote timing attack".www.kb.cert.org.Archived from the original on April 7, 2019. RetrievedMay 24, 2011.
  11. ^"ChangeLog". OpenSSL Project.Archived from the original on August 9, 2020. RetrievedApril 22, 2014.
  12. ^"Android bug batters Bitcoin wallets". The Register. August 12, 2013.Archived from the original on August 15, 2013. RetrievedAugust 27, 2017.
  13. ^Schneier, Bruce (September 5, 2013)."The NSA Is Breaking Most Encryption on the Internet".Schneier on Security.Archived from the original on December 15, 2017. RetrievedJanuary 11, 2018.
  14. ^"SafeCurves: choosing safe curves for elliptic-curve cryptography". October 25, 2013.Archived from the original on April 7, 2019. RetrievedJanuary 11, 2018.
  15. ^Bernstein, Daniel J.;Lange, Tanja (May 31, 2013)."Security dangers of the NIST curves"(PDF).Archived(PDF) from the original on May 28, 2019. RetrievedJanuary 11, 2018.
  16. ^Schneier, Bruce (November 15, 2007)."The Strange Story of Dual_EC_DRBG".Schneier on Security.Archived from the original on April 23, 2019. RetrievedJanuary 11, 2018.
  17. ^Greenemeier, Larry (September 18, 2013)."NSA Efforts to Evade Encryption Technology Damaged U.S. Cryptography Standard". Scientific American.Archived from the original on December 24, 2017. RetrievedJanuary 11, 2018.
  18. ^"curve25519-sha256@libssh.org.txt\doc - projects/libssh.git".libssh shared repository.Archived from the original on March 23, 2019. RetrievedJanuary 11, 2018.
  19. ^Bernstein, Daniel J. (March 23, 2014)."How to design an elliptic-curve signature system".The cr.yp.to blog.Archived from the original on March 23, 2014. RetrievedJanuary 11, 2018.

Further reading

[edit]

External links

[edit]
Algorithms
Integer factorization
Discrete logarithm
Lattice/SVP/CVP/LWE/SIS
Others
Theory
Standardization
Topics
General
Mathematics
People
Lists
Technologies
Forks
Client
Currency
History
Movies
Legal entities
(not exchanges)
Bitcoin in El Salvador
Retrieved from "https://en.wikipedia.org/w/index.php?title=Elliptic_Curve_Digital_Signature_Algorithm&oldid=1301948395"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp