EdDSA

From HandWiki
Short description: Digital signature scheme
EdDSA
General
DesignersDaniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe, Bo-Yin Yang, et al.
First published26 September 2011 (12 years ago) (2011-09-26)
Detail
StructureElliptic-curve cryptography

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.[1] 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.[2] The reference implementation is public-domain software.[3]

Summary

The following is a simplified description of EdDSA, ignoring details of encoding integers and curve points as bit strings; the full details are in the papers and RFC.[4][2][1]

An EdDSA signature scheme is a choice:[4]:1–2[2]:5–6[1]:5–7

  • of finite field [math]\displaystyle{ \mathbb{F}_q }[/math] over odd prime power [math]\displaystyle{ q }[/math];
  • of elliptic curve [math]\displaystyle{ E }[/math] over [math]\displaystyle{ \mathbb{F}_q }[/math] whose group [math]\displaystyle{ E(\mathbb{F}_q) }[/math] of [math]\displaystyle{ \mathbb{F} q }[/math]-rational points has order [math]\displaystyle{ \#E(\mathbb{F}_q) = 2^c \ell }[/math], where [math]\displaystyle{ \ell }[/math] is a large prime and [math]\displaystyle{ 2^c }[/math] is called the cofactor;
  • of base point [math]\displaystyle{ B \in E(\mathbb{F}_q) }[/math] with order [math]\displaystyle{ \ell }[/math]; and
  • of cryptographic hash function [math]\displaystyle{ H }[/math] with [math]\displaystyle{ 2b }[/math]-bit outputs, where [math]\displaystyle{ 2^{b - 1} \gt q }[/math] so that elements of [math]\displaystyle{ \mathbb{F}_q }[/math] and curve points in [math]\displaystyle{ E(\mathbb{F}_q) }[/math] can be represented by strings of [math]\displaystyle{ b }[/math] bits.

These parameters are common to all users of the EdDSA signature scheme. The security of the EdDSA signature scheme depends critically on the choices of parameters, except for the arbitrary choice of base point—for example, Pollard's rho algorithm for logarithms is expected to take approximately [math]\displaystyle{ \sqrt{\ell\pi/4} }[/math] curve additions before it can compute a discrete logarithm,[5] so [math]\displaystyle{ \ell }[/math] must be large enough for this to be infeasible, and is typically taken to exceed 2200.[6] The choice of [math]\displaystyle{ \ell }[/math] is limited by the choice of [math]\displaystyle{ q }[/math], since by Hasse's theorem, [math]\displaystyle{ \#E(\mathbb{F}_q) = 2^c \ell }[/math] cannot differ from [math]\displaystyle{ q + 1 }[/math] by more than [math]\displaystyle{ 2\sqrt{q} }[/math]. The hash function [math]\displaystyle{ H }[/math] is normally modelled as a random oracle in formal analyses of EdDSA's security.

Within an EdDSA signature scheme,

Public key
An EdDSA public key is a curve point [math]\displaystyle{ A \in E(\mathbb{F}_q) }[/math], encoded in [math]\displaystyle{ b }[/math] bits.
Signature
An EdDSA signature on a message [math]\displaystyle{ M }[/math] by public key [math]\displaystyle{ A }[/math] is the pair [math]\displaystyle{ (R, S) }[/math], encoded in [math]\displaystyle{ 2b }[/math] bits, of a curve point [math]\displaystyle{ R \in E(\mathbb{F}_q) }[/math] and an integer [math]\displaystyle{ 0 \lt S \lt \ell }[/math] satisfying the following verification equation. [math]\displaystyle{ \parallel }[/math] denotes concatenation.

[math]\displaystyle{ 2^c S B = 2^c R + 2^c H(R \parallel A \parallel M) A }[/math]

Private key
An EdDSA private key is a [math]\displaystyle{ b }[/math]-bit string [math]\displaystyle{ k }[/math] which should be chosen uniformly at random. The corresponding public key is [math]\displaystyle{ A = s B }[/math], where [math]\displaystyle{ s = H_{0,\dots,b - 1}(k) }[/math] is the least significant [math]\displaystyle{ b }[/math] bits of [math]\displaystyle{ H(k) }[/math] interpreted as an integer in little-endian. The signature on a message [math]\displaystyle{ M }[/math] is [math]\displaystyle{ (R, S) }[/math] where [math]\displaystyle{ R = r B }[/math] for [math]\displaystyle{ r = H(H_{b,\dots,2b - 1}(k) \parallel M) }[/math], and [math]\displaystyle{ S \equiv r + H(R \parallel A \parallel M) s \pmod \ell. }[/math] This satisfies the verification equation:

[math]\displaystyle{ \begin{align} 2^c S B &= 2^c (r + H(R \parallel A \parallel M) s) B \\ &= 2^c r B + 2^c H(R \parallel A \parallel M) s B \\ &= 2^c R + 2^c H(R \parallel A \parallel M) A. \end{align} }[/math]

Ed25519

Ed25519 is the EdDSA signature scheme using SHA-512 (SHA-2) and Curve25519[2] where

  • [math]\displaystyle{ q = 2^{255} - 19, }[/math]
  • [math]\displaystyle{ E/\mathbb{F}_q }[/math] is the twisted Edwards curve

[math]\displaystyle{ -x^2 + y^2 = 1 - \frac{121665}{121666}x^2y^2, }[/math]

  • [math]\displaystyle{ \ell = 2^{252} + 27742317777372353535851937790883648493 }[/math] and [math]\displaystyle{ c = 3 }[/math]
  • [math]\displaystyle{ B }[/math] is the unique point in [math]\displaystyle{ E(\mathbb{F}_q) }[/math] whose [math]\displaystyle{ y }[/math] coordinate is [math]\displaystyle{ 4/5 }[/math] and whose [math]\displaystyle{ x }[/math] coordinate is positive.
    "positive" is defined in terms of bit-encoding:
    • "positive" coordinates are even coordinates (least significant bit is cleared)
    • "negative" coordinates are odd coordinates (least significant bit is set)
  • [math]\displaystyle{ H }[/math] is SHA-512, with [math]\displaystyle{ b = 256 }[/math].

The curve [math]\displaystyle{ E(\mathbb{F}_q) }[/math] is birationally equivalent to the Montgomery curve known as Curve25519. The equivalence is[2][7] [math]\displaystyle{ x = \frac{u}{v}\sqrt{-486664}, \quad y = \frac{u - 1}{u + 1}. }[/math]

Performance

The original team has optimized Ed25519 for the x86-64 Nehalem/Westmere processor family. Verification can be performed in batches of 64 signatures for even greater throughput. Ed25519 is intended to provide attack resistance comparable to quality 128-bit symmetric ciphers.[8]

Public keys are 256 bits long and signatures are 512 bits long.[9]

Secure coding

Ed25519 is designed to avoid implementations that use branch conditions or array indices that depend on secret data,[2]:2[1]:40 in order to mitigate side-channel attacks.

As with other discrete-log-based signature schemes, EdDSA uses a secret value called a nonce unique to each signature. In the signature schemes DSA and ECDSA, this nonce is traditionally generated randomly for each signature—and if the random number generator is ever broken and predictable when making a signature, the signature can leak the private key, as happened with the Sony PlayStation 3 firmware update signing key.[10][11][12]

In contrast, EdDSA chooses the nonce deterministically as the hash of a part of the private key and the message. Thus, once a private key is generated, EdDSA has no further need for a random number generator in order to make signatures, and there is no danger that a broken random number generator used to make a signature will reveal the private key.[2]:8

Standardization and implementation inconsistencies

Note that there are two standardization efforts for EdDSA, one from IETF, an informational RFC 8032 and one from NIST as part of FIPS 186-5.[13] The differences between the standards have been analyzed,[14][15] and test vectors are available.[16]

Software

Notable uses of Ed25519 include OpenSSH,[17] GnuPG[18] and various alternatives, and the signify tool by OpenBSD.[19] Usage of Ed25519 (and Ed448) in the SSH protocol has been standardized.[20] In 2023 the final version of the FIPS 186-5 standard included deterministic Ed25519 as an approved signature scheme.[13]

Ed448

Ed448 is the EdDSA signature scheme using SHAKE256 and Curve448 defined in RFC 8032. It has also been approved in the final version the FIPS 186-5 standard.[13]

References

  1. 1.0 1.1 1.2 1.3 Josefsson, S.; Liusvaara, I. (January 2017), Edwards-Curve Digital Signature Algorithm (EdDSA), IRTF, doi:10.17487/RFC8032, RFC 8032, ISSN 2070-1721, https://tools.ietf.org/html/rfc8032, retrieved 2022-07-11 
  2. 2.0 2.1 2.2 2.3 2.4 2.5 2.6 Bernstein, Daniel J.; Duif, Niels; Lange, Tanja; Schwabe, Peter; Bo-Yin Yang (2012). "High-speed high-security signatures". Journal of Cryptographic Engineering 2 (2): 77–89. doi:10.1007/s13389-012-0027-1. https://ed25519.cr.yp.to/ed25519-20110926.pdf. 
  3. "Software". 2015-06-11. https://ed25519.cr.yp.to/software.html. "The Ed25519 software is in the public domain." 
  4. 4.0 4.1 Template:Cite tech report
  5. Template:Cite tech report
  6. Bernstein, Daniel J.; Lange, Tanja. "ECDLP Security: Rho". https://safecurves.cr.yp.to/rho.html. 
  7. Bernstein, Daniel J.; Lange, Tanja (2007). "Faster addition and doubling on elliptic curves". in Kurosawa, Kaoru. Advances in cryptology—ASIACRYPT. 4833. Berlin: Springer. pp. 29–50. doi:10.1007/978-3-540-76900-2_3. ISBN 978-3-540-76899-9. https://eprint.iacr.org/2007/286. 
  8. Bernstein, Daniel J. (2017-01-22). "Ed25519: high-speed high-security signatures". https://ed25519.cr.yp.to/. "This system has a 2^128 security target; breaking it has similar difficulty to breaking NIST P-256, RSA with ~3000-bit keys, strong 128-bit block ciphers, etc." 
  9. Bernstein, Daniel J. (2017-01-22). "Ed25519: high-speed high-security signatures". https://ed25519.cr.yp.to/. "Signatures fit into 64 bytes. […] Public keys consume only 32 bytes." 
  10. Johnston, Casey (2010-12-30). "PS3 hacked through poor cryptography implementation". Ars Technica. https://arstechnica.com/gaming/2010/12/ps3-hacked-through-poor-implementation-of-cryptography/. 
  11. fail0verflow (2010-12-29). "Console Hacking 2010: PS3 Epic Fail". Chaos Communication Congress. https://events.ccc.de/congress/2010/Fahrplan/attachments/1780_27c3_console_hacking_2010.pdf. Retrieved 2016-11-15. 
  12. "27th Chaos Communication Congress: Console Hacking 2010: PS3 Epic Fail". https://www.cs.cmu.edu/~dst/GeoHot/1780_27c3_console_hacking_2010.pdf. 
  13. 13.0 13.1 13.2 Moody, Dustin (2023-02-03). FIPS 186-5: Digital Signature Standard (DSS). NIST. doi:10.6028/NIST.FIPS.186-5. https://csrc.nist.gov/publications/detail/fips/186/5/final. Retrieved 2023-03-04. 
  14. Konstantinos Chalkias, Francois Garillot and Valeria Nikolaenko (2020-10-01). "Taming the many EdDSAs". Security Standardisation Research Conference (SSR 2020). https://eprint.iacr.org/2020/1244. Retrieved 2021-02-15. 
  15. Jacqueline Brendel, Cas Cremers, Dennis Jackson, and Mang Zhao (2020-07-03). "The provable security of ed25519: Theory and practice". IEEE Symposium on Security and Privacy (S&P 2021). https://eprint.iacr.org/2020/823. Retrieved 2021-02-15. 
  16. "ed25519-speccheck". https://github.com/novifinancial/ed25519-speccheck. 
  17. "Changes since OpenSSH 6.4". 2014-01-03. http://www.openssh.com/txt/release-6.5. 
  18. "What's new in GnuPG 2.1". 2016-07-14. https://gnupg.org/faq/whats-new-in-2.1.html. 
  19. "Things that use Ed25519". 2016-10-06. https://ianix.com/pub/ed25519-deployment.html. 
  20. Harris, B.; Velvindron, L. (February 2020), Ed25519 and Ed448 Public Key Algorithms for the Secure Shell (SSH) Protocol, IETF, doi:10.17487/RFC8709, RFC 8709, ISSN 2070-1721, https://tools.ietf.org/html/rfc8709, retrieved 2022-07-11 
  21. "System security for watchOS". https://support.apple.com/guide/security/system-security-for-watchos-secc7d85209d/. 
  22. Matt Johnston (2013-11-14). "DROPBEAR_2013.61test". https://secure.ucc.asn.au/hg/dropbear/rev/DROPBEAR_2013.61test. 
  23. "Heuristic Algorithms and Distributed Computing" (in ru). Èvrističeskie Algoritmy I Raspredelennye Vyčisleniâ: 55–56. 2015. ISSN 2311-8563. http://algorithms.samsu.ru/-tom2-nom4.pdf. Retrieved 2016-10-07. 
  24. Frank Denis. "Minisign: A dead simple tool to sign files and verify signatures.". https://jedisct1.github.io/minisign. 
  25. on GitHub
  26. Frank Denis (2016-06-29). "libsodium/ChangeLog". https://github.com/jedisct1/libsodium/blob/a162c09b69075c467dfa985cd605a80955512c48/ChangeLog. 
  27. "OpenSSL CHANGES". July 31, 2019. https://www.openssl.org/news/cl111.txt. 
  28. "python/ed25519.py: the main subroutines". 2011-07-06. https://ed25519.cr.yp.to/python/ed25519.py. 
  29. "Software: Alternate implementations". 2015-06-11. https://ed25519.cr.yp.to/software.html. 
  30. "eBACS: ECRYPT Benchmarking of Cryptographic Systems: SUPERCOP". 2016-09-10. https://bench.cr.yp.to/supercop.html. 
  31. "Virgil Security Crypto Library for C: Library: Foundation". https://github.com/VirgilSecurity/virgil-crypto-c#library-foundation. 
  32. "wolfSSL Embedded SSL Library (formerly CyaSSL)". https://www.wolfssl.com/wolfSSL/Products-wolfssl.html. 

External links