Elliptic Curve Digital Signature Algorithm

Last updated

In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic-curve cryptography.

Contents

Key and signature-size

As with elliptic-curve cryptography in general, the bit size of the private key believed to be needed for ECDSA is about twice the size of the security level, in bits. [1] For example, at a security level of 80 bitsmeaning an attacker requires a maximum of about operations to find the private keythe 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 bits, where is the exponent in the formula , that is, about 320 bits for a security level of 80 bits, which is equivalent to operations.

Signature generation algorithm

Suppose Alice wants to send a signed message to Bob. Initially, they must agree on the curve parameters . In addition to the field and equation of the curve, we need , a base point of prime order on the curve; is the multiplicative order of the point .

Parameter
CURVEthe elliptic curve field and equation used
Gelliptic curve base point, a point on the curve that generates a subgroup of large prime order n
ninteger order of G, means that , where is the identity element.
the private key (randomly selected)
the public key (calculated by elliptic curve)
mthe message to send

The order of the base point must be prime. Indeed, we assume that every nonzero element of the ring is invertible, so that must be a field. It implies that must 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 use to denote elliptic curve point multiplication by a scalar.

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

  1. Calculate . (Here HASH is a cryptographic hash function, such as SHA-2, with the output converted to an integer.)
  2. Let be the leftmost bits of , where is the bit length of the group order . (Note that can be greater than but not longer. [2] )
  3. Select a cryptographically secure random integer from .
  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 . (And is also a valid signature.)

As the standard notes, it is not only required for to be secret, but it is also crucial to select different for different signatures. Otherwise, the equation in step 6 can be solved for , the private key: given two signatures and , employing the same unknown for different known messages and , an attacker can calculate and , 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 the PlayStation 3 gaming-console. [3]

Another way ECDSA signature may leak private keys is when is generated by a faulty random 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 that is unique for each message, one may bypass random number generation completely and generate deterministic signatures by deriving from both the message and the private key. [5]

Signature verification algorithm

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

  1. Check that is not equal to the identity element O, and its coordinates are otherwise valid.
  2. Check that lies on the curve.
  3. Check that .

After that, Bob follows these steps:

  1. Verify that r and s are integers in . If not, the signature is invalid.
  2. Calculate , where HASH is the same function used in the signature generation.
  3. Let be the leftmost bits of e.
  4. Calculate and .
  5. Calculate the curve point . If then the signature is invalid.
  6. The signature is valid if , invalid otherwise.

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

Correctness of the algorithm

It is not immediately obvious why verification even functions correctly. To see why, denote as C the 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 of and from verification step 4,

Collecting the common term ,

Expanding the definition of s from 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 of r, 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 to cryptanalytic attacks are required for a secure signature algorithm.

Public key recovery

Given a message m and Alice's signature on that message, Bob can (potentially) recover Alice's public key: [7]

  1. Verify that r and s are integers in . If not, the signature is invalid.
  2. Calculate a curve point where is one of , , , etc. (provided is not too large for the field of the curve) and is a value such that the curve equation is satisfied. Note that there may be several curve points satisfying these conditions, and each different R value results in a distinct recovered key.
  3. Calculate , where HASH is the same function used in the signature generation.
  4. Let z be the leftmost bits of e.
  5. Calculate and .
  6. Calculate the curve point .
  7. The signature is valid if , matches Alice's public key.
  8. The signature is invalid if all the possible R 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 from recovery step 6,

From the definition from signing step 4,

Because elliptic curve scalar multiplication distributes over addition,

Expanding the definition of and from recovery step 5,

Expanding the definition of s from 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 point from signature value r.

Security

In December 2010, a group calling itself fail0verflow announced the recovery of the ECDSA private key used by Sony to sign software for the PlayStation 3 game console. However, this attack only worked because Sony did not properly implement the algorithm, because was static instead of random. As pointed out in the Signature generation algorithm section above, this makes solvable, rendering the entire algorithm useless. [8]

On March 29, 2011, two researchers published an IACR paper [9] demonstrating that it is possible to retrieve a TLS private key of a server using OpenSSL that authenticates with Elliptic Curves DSA over a binary field via a timing attack. [10] The vulnerability was fixed in OpenSSL 1.0.0e. [11]

In August 2013, it was revealed that bugs in some implementations of the Java class SecureRandom sometimes generated collisions in the 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. [12]

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

Concerns

Some concerns expressed about ECDSA:

  1. Political concerns: the trustworthiness of NIST-produced curves being questioned after revelations were made that the NSA willingly inserts backdoors 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 the libssh curve25519 introduction. [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

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

See also

Related Research Articles

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 to provide equivalent security.

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 variant of the Schnorr and ElGamal signature schemes.

The Lenstra elliptic-curve factorization or the elliptic-curve factorization method (ECM) is a fast, sub-exponential running time, algorithm for integer factorization, which employs elliptic curves. For general-purpose factoring, ECM is the third-fastest known factoring method. The second-fastest is the multiple polynomial quadratic sieve, and the fastest is the general number field sieve. The Lenstra elliptic-curve factorization is named after Hendrik Lenstra.

In computer science, a one-way function is a function that is easy to compute on every input, but hard to invert given the image of a random input. Here, "easy" and "hard" are to be understood in the sense of computational complexity theory, specifically the theory of polynomial time problems. Not being one-to-one is not considered sufficient for a function to be called one-way.

In cryptography, a Schnorr signature is a digital signature produced by the Schnorr signature algorithm that was described by Claus Schnorr. It is a digital signature scheme known for its simplicity, among the first whose security is based on the intractability of certain discrete logarithm problems. It is efficient and generates short signatures. It was covered by U.S. Patent 4,995,082 which expired in February 2008.

The Rabin cryptosystem is a family of public-key encryption schemes based on a trapdoor function whose security, like that of RSA, is related to the difficulty of integer factorization.

The Paillier cryptosystem, invented by and named after Pascal Paillier in 1999, is a probabilistic asymmetric algorithm for public key cryptography. The problem of computing n-th residue classes is believed to be computationally difficult. The decisional composite residuosity assumption is the intractability hypothesis upon which this cryptosystem is based.

KCDSA is a digital signature algorithm created by a team led by the Korea Internet & Security Agency (KISA). It is an ElGamal variant, similar to the Digital Signature Algorithm and GOST R 34.10-94. The standard algorithm is implemented over , but an elliptic curve variant (EC-KCDSA) is also specified.

In computational number theory, the index calculus algorithm is a probabilistic algorithm for computing discrete logarithms. Dedicated to the discrete logarithm in where is a prime, index calculus leads to a family of algorithms adapted to finite fields and to some families of elliptic curves. The algorithm collects relations among the discrete logarithms of small primes, computes them by a linear algebra procedure and finally expresses the desired discrete logarithm with respect to the discrete logarithms of small primes.

The ElGamal signature scheme is a digital signature scheme which is based on the difficulty of computing discrete logarithms. It was described by Taher Elgamal in 1985.

In cryptography, implicit certificates are a variant of public key certificate. A subject's public key is reconstructed from the data in an implicit certificate, and is then said to be "implicitly" verified. Tampering with the certificate will result in the reconstructed public key being invalid, in the sense that it is infeasible to find the matching private key value, as would be required to make use of the tampered certificate.

A BLS digital signature—also known as Boneh–Lynn–Shacham (BLS)—is a cryptographic signature scheme which allows a user to verify that a signer is authentic.

In cryptography, subliminal channels are covert channels that can be used to communicate secretly in normal looking communication over an insecure channel. Subliminal channels in digital signature crypto systems were found in 1984 by Gustavus Simmons.

In mathematics, elliptic curve primality testing techniques, or elliptic curve primality proving (ECPP), are among the quickest and most widely used methods in primality proving. It is an idea put forward by Shafi Goldwasser and Joe Kilian in 1986 and turned into an algorithm by A. O. L. Atkin the same year. The algorithm was altered and improved by several collaborators subsequently, and notably by Atkin and François Morain, in 1993. The concept of using elliptic curves in factorization had been developed by H. W. Lenstra in 1985, and the implications for its use in primality testing followed quickly.

Elliptic curve scalar multiplication is the operation of successively adding a point along an elliptic curve to itself repeatedly. It is used in elliptic curve cryptography (ECC). The literature presents this operation as scalar multiplication, as written in Hessian form of an elliptic curve. A widespread name for this operation is also elliptic curve point multiplication, but this can convey the wrong impression of being a multiplication between two points.

In discrete mathematics, ideal lattices are a special class of lattices and a generalization of cyclic lattices. Ideal lattices naturally occur in many parts of number theory, but also in other areas. In particular, they have a significant place in cryptography. Micciancio defined a generalization of cyclic lattices as ideal lattices. They can be used in cryptosystems to decrease by a square root the number of parameters necessary to describe a lattice, making them more efficient. Ideal lattices are a new concept, but similar lattice classes have been used for a long time. For example, cyclic lattices, a special case of ideal lattices, are used in NTRUEncrypt and NTRUSign.

Network coding has been shown to optimally use bandwidth in a network, maximizing information flow but the scheme is very inherently vulnerable to pollution attacks by malicious nodes in the network. A node injecting garbage can quickly affect many receivers. The pollution of network packets spreads quickly since the output of honest node is corrupted if at least one of the incoming packets is corrupted.

In public-key cryptography, Edwards-curve Digital Signature Algorithm (EdDSA) is a digital signature scheme using a variant of Schnorr signature based on twisted Edwards curves. It is designed to be faster than existing digital signature schemes without sacrificing security. It was developed by a team including Daniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe, and Bo-Yin Yang. The reference implementation is public-domain software.

The Sakai–Kasahara scheme, also known as the Sakai–Kasahara key encryption algorithm (SAKKE), is an identity-based encryption (IBE) system proposed by Ryuichi Sakai and Masao Kasahara in 2003. Alongside the Boneh–Franklin scheme, this is one of a small number of commercially implemented identity-based encryption schemes. It is an application of pairings over elliptic curves and finite fields. A security proof for the algorithm was produced in 2005 by Chen and Cheng. SAKKE is described in Internet Engineering Task Force (IETF) RFC 6508.

In cryptography, a public key exchange algorithm is a cryptographic algorithm which allows two parties to create and share a secret key, which they can use to encrypt messages between themselves. The ring learning with errors key exchange (RLWE-KEX) is one of a new class of public key exchange algorithms that are designed to be secure against an adversary that possesses a quantum computer. This is important because some public key algorithms in use today will be easily broken by a quantum computer if such computers are implemented. RLWE-KEX is one of a set of post-quantum cryptographic algorithms which are based on the difficulty of solving certain mathematical problems involving lattices. Unlike older lattice based cryptographic algorithms, the RLWE-KEX is provably reducible to a known hard problem in lattices.

References

  1. Johnson, Don; Menezes, Alfred (1999). "The Elliptic Curve Digital Signature Algorithm (ECDSA)". CiteSeerX   10.1.1.38.8014 .{{cite journal}}: Cite journal requires |journal= (help)
  2. NIST FIPS 186-4, July 2013, pp. 19 and 26
  3. Console Hacking 2010 - PS3 Epic Fail Archived December 15, 2014, at the Wayback Machine , page 123–128
  4. "Android Security Vulnerability" . Retrieved February 24, 2015.
  5. Pornin, T. (2013). "RFC 6979 - Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)". doi: 10.17487/RFC6979 . Retrieved February 24, 2015.{{cite journal}}: Cite journal requires |journal= (help)
  6. "The Double-Base Number System in Elliptic Curve Cryptography" (PDF). Retrieved April 22, 2014.
  7. Daniel R. L. Brown SECG 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. Retrieved January 5, 2011.
  9. "Cryptology ePrint Archive: Report 2011/232" . Retrieved February 24, 2015.
  10. "Vulnerability Note VU#536044 - OpenSSL leaks ECDSA private key through a remote timing attack". www.kb.cert.org.
  11. "ChangeLog". OpenSSL Project. Retrieved April 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. "curve25519-sha256@libssh.org.txt\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