HOME

TheInfoList



OR:

In
cryptography Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or '' -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adv ...
, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the
Digital Signature Algorithm The Digital Signature Algorithm (DSA) is a public-key cryptosystem and Federal Information Processing Standard for digital signatures, based on the mathematical concept of modular exponentiation and the discrete logarithm problem. DSA is a var ...
(DSA) which uses
elliptic-curve cryptography Elliptic-curve cryptography (ECC) is an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields. ECC allows smaller keys compared to non-EC cryptography (based on plain Galois fields) to provide eq ...
.


Key and signature-size

As with elliptic-curve cryptography in general, the bit
size Size in general is the magnitude or dimensions of a thing. More specifically, ''geometrical size'' (or ''spatial size'') can refer to linear dimensions ( length, width, height, diameter, perimeter), area, or volume. Size can also be me ...
of the
private key Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
believed to be needed for ECDSA is about twice the size of the
security level In cryptography, security level is a measure of the strength that a cryptographic primitive — such as a cipher or hash function — achieves. Security level is usually expressed as a number of " bits of security" (also security stren ...
, in bits. For example, at a security level of 80 bits—meaning an attacker requires a maximum of about 2^ 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: approximately 4 t bits, where t is the security level measured in bits, that is, about 320 bits for a security level of 80 bits.


Signature generation algorithm

Suppose
Alice Alice may refer to: * Alice (name), most often a feminine given name, but also used as a surname Literature * Alice (''Alice's Adventures in Wonderland''), a character in books by Lewis Carroll * ''Alice'' series, children's and teen books by ...
wants to send a signed message to Bob. Initially, they must agree on the curve parameters (\textrm, G, n). In addition to the field and equation of the curve, we need G, a base point of prime order on the curve; n is the multiplicative order of the point G. The order n of the base point G must be prime. Indeed, we assume that every nonzero element of the ring \mathbb/n\mathbb is invertible, so that \mathbb/n\mathbb must be a field. It implies that n must be prime (cf.
Bézout's identity In mathematics, Bézout's identity (also called Bézout's lemma), named after Étienne Bézout, is the following theorem: Here the greatest common divisor of and is taken to be . The integers and are called Bézout coefficients for ; they ...
). Alice creates a key pair, consisting of a private key integer d_A, randomly selected in the interval
, n-1 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/math>; and a public key curve point Q_A = d_A \times G. We use \times to denote elliptic curve point multiplication by a scalar. For Alice to sign a message m, she follows these steps: # Calculate e = \textrm(m). (Here HASH is a
cryptographic hash function A cryptographic hash function (CHF) is a hash algorithm (a map of an arbitrary binary string to a binary string with fixed size of n bits) that has special properties desirable for cryptography: * the probability of a particular n-bit output ...
, such as
SHA-2 SHA-2 (Secure Hash Algorithm 2) is a set of cryptographic hash functions designed by the United States National Security Agency (NSA) and first published in 2001. They are built using the Merkle–Damgård construction, from a one-way compres ...
, with the output converted to an integer.) # Let z be the L_n leftmost bits of e, where L_n is the bit length of the group order n. (Note that z can be ''greater'' than n but not ''longer''.) # Select a cryptographically secure random integer k from
, n-1 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/math>. # Calculate the curve point (x_1, y_1) = k \times G. # Calculate r = x_1\,\bmod\,n. If r = 0, go back to step 3. # Calculate s = k^(z + r d_A)\,\bmod\,n. If s = 0, go back to step 3. # The signature is the pair (r, s). (And (r,-s\,\bmod\,n) is also a valid signature.) As the standard notes, it is not only required for k to be secret, but it is also crucial to select different k for different signatures, otherwise the equation in step 6 can be solved for d_A, the private key: given two signatures (r, s) and (r, s'), employing the same unknown k for different known messages m and m', an attacker can calculate z and z', and since s - s' = k^(z - z') (all operations in this paragraph are done modulo n) the attacker can find k = \frac. Since s = k^(z + r d_A), the attacker can now calculate the private key d_A = \frac. This implementation failure was used, for example, to extract the signing key used for the
PlayStation 3 The PlayStation 3 (PS3) is a home video game console developed by Sony Interactive Entertainment, Sony Computer Entertainment. The successor to the PlayStation 2, it is part of the PlayStation brand of consoles. It was first released on Novemb ...
gaming-console. Another way ECDSA signature may leak private keys is when k is generated by a faulty
random number generator Random number generation is a process by which, often by means of a random number generator (RNG), a sequence of numbers or symbols that cannot be reasonably predicted better than by random chance is generated. This means that the particular outc ...
. Such a failure in random number generation caused users of Android Bitcoin Wallet to lose their funds in August 2013. To ensure that k is unique for each message, one may bypass random number generation completely and generate deterministic signatures by deriving k from both the message and the private key.


Signature verification algorithm

For Bob to authenticate Alice's signature, he must have a copy of her public-key curve point Q_A. Bob can verify Q_A is a valid curve point as follows: # Check that Q_A is not equal to the identity element , and its coordinates are otherwise valid # Check that Q_A lies on the curve # Check that n \times Q_A = O After that, Bob follows these steps: # Verify that and are integers in
, n-1 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/math>. If not, the signature is invalid. # Calculate e = \textrm(m), where HASH is the same function used in the signature generation. # Let be the L_n leftmost bits of . # Calculate u_1 = zs^\,\bmod\,n and u_2 = rs^\,\bmod\,n. # Calculate the curve point (x_1, y_1) = u_1 \times G + u_2 \times Q_A. If (x_1, y_1) = O then the signature is invalid. # The signature is valid if r \equiv x_1 \pmod, invalid otherwise. Note that an efficient implementation would compute inverse s^\,\bmod\,n only once. Also, using Shamir's trick, a sum of two scalar multiplications u_1 \times G + u_2 \times Q_A can be calculated faster than two scalar multiplications done independently.


Correctness of the algorithm

It is not immediately obvious why verification even functions correctly. To see why, denote as the curve point computed in step 5 of verification, : C = u_1 \times G + u_2 \times Q_A From the definition of the public key as Q_A = d_A \times G, : C = u_1 \times G + u_2 d_A \times G Because elliptic curve scalar multiplication distributes over addition, : C = (u_1 + u_2 d_A) \times G Expanding the definition of u_1 and u_2 from verification step 4, : C = (z s^ + r d_A s^) \times G Collecting the common term s^, : C = (z + r d_A) s^ \times G Expanding the definition of from signature step 6, : C = (z + r d_A) (z + r d_A)^ (k^)^ \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 \times G From the definition of , this is verification step 6. This shows only that a correctly signed message will verify correctly; many other properties are required for a secure signature algorithm.


Public key recovery

Given a message and Alice's signature r, s on that message, Bob can (potentially) recover Alice's public key: # Verify that and are integers in
, n-1 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/math>. If not, the signature is invalid. # Calculate a curve point R = (x_1, y_1) where x_1 is one of r, r+n, r+2n, etc. (provided x_1 is not too large for a field element) and 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 different value results in a distinct recovered key. # Calculate e = \textrm(m), where HASH is the same function used in the signature generation. # Let be the L_n leftmost bits of . # Calculate u_1 = -zr^\,\bmod\,n and u_2 = sr^\,\bmod\,n. # Calculate the curve point Q_A = (x_A, y_A) = u_1 \times G + u_2 \times R. # The signature is valid if Q_A, matches Alice's public key. # The signature is invalid if all the possible 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

Start with the definition of Q_A from recovery step 6, : Q_A = (x_A, y_A) = u_1 \times G + u_2 \times R From the definition R = (x_1, y_1) = k \times G from signing step 4, : Q_A = u_1 \times G + u_2 k \times G Because elliptic curve scalar multiplication distributes over addition, : Q_A = (u_1 + u_2 k) \times G Expanding the definition of u_1 and u_2 from recovery step 5, : Q_A = (-z r^ + s k r^) \times G Expanding the definition of from signature step 6, : Q_A = (-z r^ + k^ (z + r d_A) k r^) \times G Since the product of an element's inverse and the element is the identity, we are left with : Q_A = (-z r^ + (z r^ + d_A)) \times G The first and second terms cancel each other out, : Q_A = d_A \times G From the definition of 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 point R = (x_1, y_1) from signature value .


Security

In December 2010, a group calling itself ''fail0verflow'' announced recovery of the ECDSA private key used by
Sony , commonly stylized as SONY, is a Japanese multinational conglomerate corporation headquartered in Minato, Tokyo, Japan. As a major technology company, it operates as one of the world's largest manufacturers of consumer and professional ...
to sign software for the
PlayStation 3 The PlayStation 3 (PS3) is a home video game console developed by Sony Interactive Entertainment, Sony Computer Entertainment. The successor to the PlayStation 2, it is part of the PlayStation brand of consoles. It was first released on Novemb ...
game console. However, this attack only worked because Sony did not properly implement the algorithm, because k was static instead of random. As pointed out in the Signature generation algorithm section above, this makes d_A solvable, rendering the entire algorithm useless. On March 29, 2011, two researchers published an IACR paper demonstrating that it is possible to retrieve a TLS private key of a server using
OpenSSL OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping or need to identify the party at the other end. It is widely used by Internet servers, including the majority of HT ...
that authenticates with Elliptic Curves DSA over a binary field via a
timing attack In cryptography, a timing attack is a side-channel attack in which the attacker attempts to compromise a cryptosystem by analyzing the time taken to execute cryptographic algorithms. Every logical operation in a computer takes time to execute, and ...
. The vulnerability was fixed in OpenSSL 1.0.0e. In August 2013, it was revealed that bugs in some implementations of the
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
clas
SecureRandom
sometimes generated collisions in the 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 some Android app implementations, which use Java and rely on ECDSA to authenticate transactions. This issue can be prevented by an unpredictable generation of k, e.g., a deterministic procedure as described by RFC 6979.


Concerns

Some concerns expressed about ECDSA: # ''Political concerns'': the trustworthiness of
NIST The National Institute of Standards and Technology (NIST) is an agency of the United States Department of Commerce whose mission is to promote American innovation and industrial competitiveness. NIST's activities are organized into physical sci ...
-produced curves being questioned after revelations that the
NSA The National Security Agency (NSA) is a national-level intelligence agency of the United States Department of Defense, under the authority of the Director of National Intelligence (DNI). The NSA is responsible for global monitoring, collec ...
willingly inserts backdoors into software, hardware components and published standards were made; well-known cryptographers have expressed doubts about how the NIST curves were designed, and voluntary tainting has already been proved in the past. (See also the ''libssh
curve25519 In cryptography, Curve25519 is an elliptic curve used in elliptic-curve cryptography (ECC) offering 128 bits of security (256-bit key size) and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme. It is one of t ...
introduction''.) Nevertheless, a proof that the named NIST curves exploit a rare weakness, is missing yet. # ''Technical concerns'': the difficulty of properly implementing the standard, its slowness, and design flaws which reduce security in insufficiently defensive implementations.


Implementations

Below is a list of cryptographic libraries that provide support for ECDSA: * Botan *
Bouncy Castle Bounce or The Bounce may refer to: * Deflection (physics), the event where an object collides with and bounces against a plane surface Books * Mr. Bounce, a character from the Mr. Men series of children's books Broadcasting, film and TV * '' ...
* cryptlib *
Crypto++ Crypto++ (also known as CryptoPP, libcrypto++, and libcryptopp) is a free and open-source C++ class library of cryptographic algorithms and schemes written by Wei Dai. Crypto++ has been widely used in academia, student projects, open-source, and no ...
* Crypto API (Linux) *
GnuTLS GnuTLS (, the GNU Transport Layer Security Library) is a free software implementation of the TLS, SSL and DTLS protocols. It offers an application programming interface (API) for applications to enable secure communication over the network trans ...
*
libgcrypt Libgcrypt is a cryptography library developed as a separated module of GnuPG. It can also be used independently of GnuPG, but depends on its error-reporting library Libgpg-error. It provides functions for all fundamental cryptographic building bl ...
* LibreSSL *
mbed TLS Mbed TLS (previously PolarSSL) is an implementation of the TLS and SSL protocols and the respective cryptographic algorithms and support code required. It is distributed under the Apache License version 2.0. Stated on the website is that Mbed ...
* Microsoft CryptoAPI *
OpenSSL OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping or need to identify the party at the other end. It is widely used by Internet servers, including the majority of HT ...
*
wolfCrypt wolfSSL is a small, portable, embedded SSL/TLS library targeted for use by embedded systems developers. It is an open source implementation of TLS (SSL 3.0, TLS 1.0, 1.1, 1.2, 1.3, and DTLS 1.0, 1.2, and 1.3) written in the C programming langu ...


See also

* EdDSA *
RSA (cryptosystem) RSA (Rivest–Shamir–Adleman) is a public-key cryptosystem that is widely used for secure data transmission. It is also one of the oldest. The acronym "RSA" comes from the surnames of Ron Rivest, Adi Shamir and Leonard Adleman, who publi ...


References


Further reading

* Accredited Standards Committe
X9
''ASC X9 Issues New Standard for Public Key Cryptography/ECDSA'', Oct. 6, 2020
Source
* Accredited Standards Committe
X9
''American National Standard X9.62-2005, Public Key Cryptography for the Financial Services Industry, The Elliptic Curve Digital Signature Algorithm (ECDSA)'', November 16, 2005. * Certicom Research
''Standards for efficient cryptography, SEC 1: Elliptic Curve Cryptography''
Version 2.0, May 21, 2009. * López, J. and Dahab, R
''An Overview of Elliptic Curve Cryptography''
Technical Report IC-00-10, State University of Campinas, 2000. * Daniel J. Bernstein
Pippenger's exponentiation algorithm
2002. * Daniel R. L. Brown, ''Generic Groups, Collision Resistance, and ECDSA'', Designs, Codes and Cryptography, 35, 119–152, 2005.
ePrint version
* Ian F. Blake, Gadiel Seroussi, and
Nigel Smart Nigel James Smart (born 21 May 1969) is a former Australian rules footballer who played for the Adelaide Football Club in the Australian Football League (AFL). Smart played most of his career in defence and became a crowd favourite, easily ide ...
, editors, ''Advances in Elliptic Curve Cryptography'', London Mathematical Society Lecture Note Series 317, Cambridge University Press, 2005. *


External links


Digital Signature Standard; includes info on ECDSA

The Elliptic Curve Digital Signature Algorithm (ECDSA); provides an in-depth guide on ECDSAWayback link
{{DEFAULTSORT:Elliptic Curve Dsa Public-key cryptography Elliptic curve cryptography Digital signature schemes Digital Signature Standard