idnits 2.17.1 draft-koch-eddsa-for-openpgp-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC4880, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC4880, updated by this document, for RFC5378 checks: 1999-12-21) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 4, 2015) is 3341 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group W. Koch 3 Internet-Draft g10 Code 4 Updates: 4880 (if approved) March 4, 2015 5 Intended status: Informational 6 Expires: September 5, 2015 8 EdDSA for OpenPGP 9 draft-koch-eddsa-for-openpgp-02 11 Abstract 13 This specification extends OpenPGP with the EdDSA public key 14 algorithm and describes the use of curve Ed25519. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on September 5, 2015. 33 Copyright Notice 35 Copyright (c) 2015 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 2. Supported Curves . . . . . . . . . . . . . . . . . . . . . . 2 52 3. Point Format . . . . . . . . . . . . . . . . . . . . . . . . 3 53 4. Encoding of Public and Private Keys . . . . . . . . . . . . . 3 54 5. Message Encoding . . . . . . . . . . . . . . . . . . . . . . 4 55 6. Curve OID . . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 7. Security Considerations . . . . . . . . . . . . . . . . . . . 4 57 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 58 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 5 59 10. Normative References . . . . . . . . . . . . . . . . . . . . 5 60 Appendix A. Test vectors . . . . . . . . . . . . . . . . . . . . 6 61 A.1. Sample key . . . . . . . . . . . . . . . . . . . . . . . 6 62 A.2. Sample signature . . . . . . . . . . . . . . . . . . . . 6 63 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 65 1. Introduction 67 The OpenPGP specification in [RFC4880] defines the RSA, Elgamal, and 68 DSA public key algorithms. [RFC6637] adds support for Elliptic Curve 69 Cryptography and specifies the ECDSA and ECDH algorithms. Due to 70 patent reasons no point compression was defined. 72 This document specifies how to use the EdDSA public key signature 73 algorithm [ED25519] with the OpenPGP standard. It defines a new 74 signature algorithm named EdDSA and specifies how to use the Ed25519 75 curve with EdDSA. This algorithm uses a custom point compression 76 method. There are three main advantages of the EdDSA algorithm: It 77 does not require the use of a unique random number for each 78 signature, there are no padding or truncation issues as with ECDSA, 79 and it is more resilient to side-channel attacks. 81 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 82 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 83 document are to be interpreted as described in [RFC2119]. 85 2. Supported Curves 87 This document references the Curve "Ed25519" which is the Edwards 88 form of "Curve25519" and specified in the same paper as the "EdDSA" 89 algorithm ([ED25519]). 91 Other curves may be used by using a specific OID for the curve and 92 its EdDSA parameters. 94 The following public key algorithm IDs are added to expand section 95 9.1 of [RFC4880], "Public-Key Algorithms": 97 +-------+-----------------------------+ 98 | ID | Description of Algorithm | 99 +-------+-----------------------------+ 100 | TBD1 | EdDSA public key algorithm | 101 +-------+-----------------------------+ 103 Compliant applications MUST support EdDSA with the curve Ed25519. 104 Applications MAY support other curves as long as a dedicated OID for 105 using that curve with EdDSA is used. 107 3. Point Format 109 The EdDSA algorithm defines a specific point compression format. To 110 indicate the use of this compression format and to make sure that the 111 key can be represented in the Multiprecision Internet (MPI) format of 112 [RFC4880] the octet string specifying the point is prefixed with the 113 octet 0x40. This encoding is an extension of the encoding given in 114 [RFC6637] which uses 0x04 to indicate an uncompressed point. 116 For example, the length of a public key for the curve Ed25519 is 263 117 bit: 7 bit to represent the 0x40 prefix octet and 32 octets for the 118 native value of the public key. 120 4. Encoding of Public and Private Keys 122 The following algorithm specific packets are added to Section 5.5.2 123 of [RFC4880], "Public-Key Packet Formats", to support EdDSA. 125 Algorithm-Specific Fields for EdDSA keys: 127 o a variable length field containing a curve OID, formatted as 128 follows: 130 * a one-octet size of the following field; values 0 and 0xFF are 131 reserved for future extensions, 133 * octets representing a curve OID, defined in Section 6. 135 o MPI of an EC point representing a public key Q as described under 136 Point Format above. 138 The following algorithm specific packets are added to Section 5.5.3 139 of [RFC4880], "Secret-Key Packet Formats", to support EdDSA. 141 Algorithm-Specific Fields for EdDSA keys: 143 o an MPI of an integer representing the secret key, which is a 144 scalar of the public EC point. 146 The version 4 packet format MUST be used. 148 5. Message Encoding 150 Section 5.2.3 of [RFC4880], "Version 4 Signature Packet Format" 151 specifies formats. To support EdDSA no change is required, the MPIs 152 representing the R and S value are encoded as MPIs in the same way as 153 done for the DSA and ECDSA algorithms; in particular the Algorithm- 154 Specific Fields for an EdDSA signature are: 156 - MPI of EdDSA value r. 158 - MPI of EdDSA value s. 160 Note that the compressed version of R and S as specified for EdDSA 161 ([ED25519]) is used. 163 The version 3 signature format MUST NOT be used with EdDSA. 165 Although that algorithm allows arbitrary data as input, its use with 166 OpenPGP requires that a digest of the message is used as input. See 167 section 5.2.4 of [RFC4880], "Computing Signatures" for details. 168 Truncation of the resulting digest is never applied; the resulting 169 digest value is used verbatim as input to the EdDSA algorithm. 171 6. Curve OID 173 The EdDSA key parameter curve OID is an array of octets that defines 174 a named curve. The table below specifies the exact sequence of bytes 175 for each named curve referenced in this document: 177 +------------------------+------+------------------------+----------+ 178 | OID | Len | Encoding in hex format | Name | 179 +------------------------+------+------------------------+----------+ 180 | 1.3.6.1.4.1.11591.15.1 | 9 | 2B 06 01 04 01 DA 47 | Ed25519 | 181 | | | 0F 01 | | 182 +------------------------+------+------------------------+----------+ 184 See [RFC6637] for a description of the OID encoding given in the 185 second and third columns. 187 7. Security Considerations 189 The security considerations of [RFC4880] apply accordingly. 191 Although technically possible the use of EdDSA with digest algorithms 192 weaker than SHA-256 (e.g. SHA-1) is not suggested. 194 8. IANA Considerations 196 IANA is requested to assign an algorithm number from the OpenPGP 197 Public-Key Algorithms range, or the "namespace" in the terminology of 198 [RFC5226], that was created by [RFC4880]. See section 2. 200 +-------+-----------------------------+------------+ 201 | ID | Algorithm | Reference | 202 +-------+-----------------------------+------------+ 203 | TBD1 | EdDSA public key algorithm | This doc | 204 +-------+-----------------------------+------------+ 206 [Notes to RFC-Editor: Please remove the table above on publication. 207 It is desirable not to reuse old or reserved algorithms because some 208 existing tools might print a wrong description. A higher number is 209 also an indication for a newer algorithm. As of now 22 is the next 210 free number.] 212 9. Acknowledgments 214 The author would like to acknowledge the help of the individuals who 215 kindly voiced their opinions on the IETF OpenPGP and GnuPG mailing 216 lists, in particular, the help of Andrey Jivsov, Jon Callas, and 217 NIIBE Yutaka. 219 10. Normative References 221 [ED25519] Bernstein, D., Duif, N., Lange, T., Schwabe, P., and B. 222 Yang, "High-speed high-security signatures", Journal of 223 Cryptographic Engineering Volume 2, Issue 2, pp. 77-89, 224 September 2011, 225 . 227 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 228 Requirement Levels", BCP 14, RFC 2119, March 1997. 230 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 231 Thayer, "OpenPGP Message Format", RFC 4880, November 2007. 233 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 234 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 235 May 2008. 237 [RFC6637] Jivsov, A., "Elliptic Curve Cryptography (ECC) in 238 OpenPGP", RFC 6637, June 2012. 240 Appendix A. Test vectors 242 To help implementing this specification a non-normative example is 243 given. This example assumes that the algorithm id for EdDSA will be 244 22. 246 A.1. Sample key 248 The secret key used for this example is: 250 D: 1a8b1ff05ded48e18bf50166c664ab023ea70003d78d9e41f5758a91d850f8d2 252 Note that this is the raw secret key as used as input to the EdDSA 253 signing operation. The key was created on 2014-08-19 14:28:27 and 254 thus the fingerprint of the OpenPGP key is: 256 C959 BDBA FA32 A2F8 9A15 3B67 8CFD E121 9796 5A9A 258 The algorithm specific input parameters without the MPI length 259 headers are: 261 oid: 2b06010401da470f01 263 q: 403f098994bdd916ed4053197934e4a87c80733a1280d62f8010992e43ee3b2406 265 The entire public key packet is thus 267 98 33 04 53 f3 5f 0b 16 09 2b 06 01 04 01 da 47 268 0f 01 01 07 40 3f 09 89 94 bd d9 16 ed 40 53 19 269 79 34 e4 a8 7c 80 73 3a 12 80 d6 2f 80 10 99 2e 270 43 ee 3b 24 06 272 A.2. Sample signature 274 The signature is created using the sample key over the input data 275 "OpenPGP" on 2015-09-16 12:24:53 and thus the input to the hash 276 function is 278 m: 4f70656e504750040016080006050255f95f9504ff0000000c 280 using the SHA-256 hash algorithm yields this digest 282 d: f6220a3f757814f4c2176ffbb68b00249cd4ccdc059c4b34ad871f30b1740280 284 which is fed into the EdDSA signature function and yields this 285 signature: 287 r: 56f90cca98e2102637bd983fdb16c131dfd27ed82bf4dde5606e0d756aed3366 288 s: d09c4fa11527f038e0f57f2201d82f2ea2c9033265fa6ceb489e854bae61b404 290 Note that the MPI encoding rules require that the value of S needs to 291 be prefixed with a 0x00 octet. The entire signature packet is thus 293 88 5e 04 00 16 08 00 06 05 02 55 f9 5f 95 00 0a 294 09 10 8c fd e1 21 97 96 5a 9a f6 22 01 00 56 f9 295 0c ca 98 e2 10 26 37 bd 98 3f db 16 c1 31 df d2 296 7e d8 2b f4 dd e5 60 6e 0d 75 6a ed 33 66 01 00 297 d0 9c 4f a1 15 27 f0 38 e0 f5 7f 22 01 d8 2f 2e 298 a2 c9 03 32 65 fa 6c eb 48 9e 85 4b ae 61 b4 04 300 Author's Address 302 Werner Koch 303 g10 Code 305 Email: wk@gnupg.org 306 URI: https://g10code.com