draft-ietf-openpgp-crypto-refresh-01.txt   draft-ietf-openpgp-crypto-refresh-02.txt 
Network Working Group W. Koch, Ed. Network Working Group W. Koch, Ed.
Internet-Draft GnuPG e.V. Internet-Draft GnuPG e.V.
Obsoletes: 4880, 5581 (if approved) P. Wouters, Ed. Obsoletes: 4880, 5581, 6637 (if approved) P. Wouters, Ed.
Intended status: Standards Track 5 February 2021 Intended status: Standards Track 22 February 2021
Expires: 9 August 2021 Expires: 26 August 2021
OpenPGP Message Format OpenPGP Message Format
draft-ietf-openpgp-crypto-refresh-01 draft-ietf-openpgp-crypto-refresh-02
Abstract Abstract
{ Work in progress to update the OpenPGP specification from RFC4880 } { Work in progress to update the OpenPGP specification from RFC4880 }
This document specifies the message formats used in OpenPGP. OpenPGP This document specifies the message formats used in OpenPGP. OpenPGP
provides encryption with public-key or symmetric cryptographic provides encryption with public-key or symmetric cryptographic
algorithms, digital signatures, compression and key management. algorithms, digital signatures, compression and key management.
This document is maintained in order to publish all necessary This document is maintained in order to publish all necessary
skipping to change at page 1, line 44 skipping to change at page 1, line 44
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 9 August 2021. This Internet-Draft will expire on 26 August 2021.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2. General functions . . . . . . . . . . . . . . . . . . . . . . 5 2. General functions . . . . . . . . . . . . . . . . . . . . . . 7
2.1. Confidentiality via Encryption . . . . . . . . . . . . . 6 2.1. Confidentiality via Encryption . . . . . . . . . . . . . 7
2.2. Authentication via Digital Signature . . . . . . . . . . 6 2.2. Authentication via Digital Signature . . . . . . . . . . 8
2.3. Compression . . . . . . . . . . . . . . . . . . . . . . . 7 2.3. Compression . . . . . . . . . . . . . . . . . . . . . . . 8
2.4. Conversion to Radix-64 . . . . . . . . . . . . . . . . . 7 2.4. Conversion to Radix-64 . . . . . . . . . . . . . . . . . 9
2.5. Signature-Only Applications . . . . . . . . . . . . . . . 8 2.5. Signature-Only Applications . . . . . . . . . . . . . . . 9
3. Data Element Formats . . . . . . . . . . . . . . . . . . . . 8 3. Data Element Formats . . . . . . . . . . . . . . . . . . . . 9
3.1. Scalar Numbers . . . . . . . . . . . . . . . . . . . . . 8 3.1. Scalar Numbers . . . . . . . . . . . . . . . . . . . . . 9
3.2. Multiprecision Integers . . . . . . . . . . . . . . . . . 8 3.2. Multiprecision Integers . . . . . . . . . . . . . . . . . 9
3.3. Key IDs . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3. Key IDs . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4. Text . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.4. Text . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5. Time Fields . . . . . . . . . . . . . . . . . . . . . . . 9 3.5. Time Fields . . . . . . . . . . . . . . . . . . . . . . . 10
3.6. Keyrings . . . . . . . . . . . . . . . . . . . . . . . . 9 3.6. Keyrings . . . . . . . . . . . . . . . . . . . . . . . . 11
3.7. String-to-Key (S2K) Specifiers . . . . . . . . . . . . . 9 3.7. String-to-Key (S2K) Specifiers . . . . . . . . . . . . . 11
3.7.1. String-to-Key (S2K) Specifier Types . . . . . . . . . 9 3.7.1. String-to-Key (S2K) Specifier Types . . . . . . . . . 11
3.7.2. String-to-Key Usage . . . . . . . . . . . . . . . . . 12 3.7.1.1. Simple S2K . . . . . . . . . . . . . . . . . . . 11
4. Packet Syntax . . . . . . . . . . . . . . . . . . . . . . . . 13 3.7.1.2. Salted S2K . . . . . . . . . . . . . . . . . . . 12
4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 13 3.7.1.3. Iterated and Salted S2K . . . . . . . . . . . . . 12
4.2. Packet Headers . . . . . . . . . . . . . . . . . . . . . 13 3.7.2. String-to-Key Usage . . . . . . . . . . . . . . . . . 13
4.2.1. Old Format Packet Lengths . . . . . . . . . . . . . . 14 3.7.2.1. Secret-Key Encryption . . . . . . . . . . . . . . 13
4.2.2. New Format Packet Lengths . . . . . . . . . . . . . . 14 3.7.2.2. Symmetric-Key Message Encryption . . . . . . . . 14
4.2.3. Packet Length Examples . . . . . . . . . . . . . . . 16 4. Packet Syntax . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3. Packet Tags . . . . . . . . . . . . . . . . . . . . . . . 16 4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 14
5. Packet Types . . . . . . . . . . . . . . . . . . . . . . . . 17 4.2. Packet Headers . . . . . . . . . . . . . . . . . . . . . 14
5.1. Public-Key Encrypted Session Key Packets (Tag 1) . . . . 18 4.2.1. Old Format Packet Lengths . . . . . . . . . . . . . . 15
5.2. Signature Packet (Tag 2) . . . . . . . . . . . . . . . . 19 4.2.2. New Format Packet Lengths . . . . . . . . . . . . . . 16
5.2.1. Signature Types . . . . . . . . . . . . . . . . . . . 19 4.2.2.1. One-Octet Lengths . . . . . . . . . . . . . . . . 16
5.2.2. Version 3 Signature Packet Format . . . . . . . . . . 21 4.2.2.2. Two-Octet Lengths . . . . . . . . . . . . . . . . 16
5.2.3. Version 4 Signature Packet Format . . . . . . . . . . 24 4.2.2.3. Five-Octet Lengths . . . . . . . . . . . . . . . 16
5.2.4. Computing Signatures . . . . . . . . . . . . . . . . 39 4.2.2.4. Partial Body Lengths . . . . . . . . . . . . . . 17
5.3. Symmetric-Key Encrypted Session Key Packets (Tag 3) . . . 41 4.2.3. Packet Length Examples . . . . . . . . . . . . . . . 17
5.4. One-Pass Signature Packets (Tag 4) . . . . . . . . . . . 42 4.3. Packet Tags . . . . . . . . . . . . . . . . . . . . . . . 18
5.5. Key Material Packet . . . . . . . . . . . . . . . . . . . 43 5. Packet Types . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5.1. Key Packet Variants . . . . . . . . . . . . . . . . . 43 5.1. Public-Key Encrypted Session Key Packets (Tag 1) . . . . 20
5.5.2. Public-Key Packet Formats . . . . . . . . . . . . . . 43 5.2. Signature Packet (Tag 2) . . . . . . . . . . . . . . . . 21
5.5.3. Secret-Key Packet Formats . . . . . . . . . . . . . . 45 5.2.1. Signature Types . . . . . . . . . . . . . . . . . . . 21
5.6. Compressed Data Packet (Tag 8) . . . . . . . . . . . . . 47 5.2.2. Version 3 Signature Packet Format . . . . . . . . . . 24
5.7. Symmetrically Encrypted Data Packet (Tag 9) . . . . . . . 48 5.2.3. Version 4 Signature Packet Format . . . . . . . . . . 27
5.8. Marker Packet (Obsolete Literal Packet) (Tag 10) . . . . 48 5.2.3.1. Signature Subpacket Specification . . . . . . . . 29
5.9. Literal Data Packet (Tag 11) . . . . . . . . . . . . . . 49 5.2.3.2. Signature Subpacket Types . . . . . . . . . . . . 31
5.10. Trust Packet (Tag 12) . . . . . . . . . . . . . . . . . . 50 5.2.3.3. Notes on Self-Signatures . . . . . . . . . . . . 32
5.11. User ID Packet (Tag 13) . . . . . . . . . . . . . . . . . 50 5.2.3.4. Signature Creation Time . . . . . . . . . . . . . 33
5.12. User Attribute Packet (Tag 17) . . . . . . . . . . . . . 50 5.2.3.5. Issuer . . . . . . . . . . . . . . . . . . . . . 33
5.12.1. The Image Attribute Subpacket . . . . . . . . . . . 51 5.2.3.6. Key Expiration Time . . . . . . . . . . . . . . . 33
5.13. Sym. Encrypted Integrity Protected Data Packet (Tag 5.2.3.7. Preferred Symmetric Algorithms . . . . . . . . . 33
18) . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.2.3.8. Preferred Hash Algorithms . . . . . . . . . . . . 33
5.14. Modification Detection Code Packet (Tag 19) . . . . . . . 55 5.2.3.9. Preferred Compression Algorithms . . . . . . . . 34
6. Radix-64 Conversions . . . . . . . . . . . . . . . . . . . . 55 5.2.3.10. Signature Expiration Time . . . . . . . . . . . . 34
6.1. An Implementation of the CRC-24 in "C" . . . . . . . . . 56 5.2.3.11. Exportable Certification . . . . . . . . . . . . 34
6.2. Forming ASCII Armor . . . . . . . . . . . . . . . . . . . 56 5.2.3.12. Revocable . . . . . . . . . . . . . . . . . . . . 35
6.3. Encoding Binary in Radix-64 . . . . . . . . . . . . . . . 59 5.2.3.13. Trust Signature . . . . . . . . . . . . . . . . . 35
6.4. Decoding Radix-64 . . . . . . . . . . . . . . . . . . . . 61 5.2.3.14. Regular Expression . . . . . . . . . . . . . . . 35
6.5. Examples of Radix-64 . . . . . . . . . . . . . . . . . . 61 5.2.3.15. Revocation Key . . . . . . . . . . . . . . . . . 36
6.6. Example of an ASCII Armored Message . . . . . . . . . . . 62 5.2.3.16. Notation Data . . . . . . . . . . . . . . . . . . 36
7. Cleartext Signature Framework . . . . . . . . . . . . . . . . 62 5.2.3.17. Key Server Preferences . . . . . . . . . . . . . 37
7.1. Dash-Escaped Text . . . . . . . . . . . . . . . . . . . . 63 5.2.3.18. Preferred Key Server . . . . . . . . . . . . . . 38
8. Regular Expressions . . . . . . . . . . . . . . . . . . . . . 64 5.2.3.19. Primary User ID . . . . . . . . . . . . . . . . . 38
9. Constants . . . . . . . . . . . . . . . . . . . . . . . . . . 64 5.2.3.20. Policy URI . . . . . . . . . . . . . . . . . . . 38
9.1. Public-Key Algorithms . . . . . . . . . . . . . . . . . . 65 5.2.3.21. Key Flags . . . . . . . . . . . . . . . . . . . . 39
9.2. Symmetric-Key Algorithms . . . . . . . . . . . . . . . . 65 5.2.3.22. Signer's User ID . . . . . . . . . . . . . . . . 40
9.3. Compression Algorithms . . . . . . . . . . . . . . . . . 66 5.2.3.23. Reason for Revocation . . . . . . . . . . . . . . 40
9.4. Hash Algorithms . . . . . . . . . . . . . . . . . . . . . 67 5.2.3.24. Features . . . . . . . . . . . . . . . . . . . . 42
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 68 5.2.3.25. Signature Target . . . . . . . . . . . . . . . . 42
10.1. New String-to-Key Specifier Types . . . . . . . . . . . 68 5.2.3.26. Embedded Signature . . . . . . . . . . . . . . . 43
10.2. New Packets . . . . . . . . . . . . . . . . . . . . . . 68 5.2.4. Computing Signatures . . . . . . . . . . . . . . . . 43
10.2.1. User Attribute Types . . . . . . . . . . . . . . . . 68 5.2.4.1. Subpacket Hints . . . . . . . . . . . . . . . . . 45
10.2.2. New Signature Subpackets . . . . . . . . . . . . . . 69 5.3. Symmetric-Key Encrypted Session Key Packets (Tag 3) . . . 45
10.2.3. New Packet Versions . . . . . . . . . . . . . . . . 70 5.4. One-Pass Signature Packets (Tag 4) . . . . . . . . . . . 46
10.3. New Algorithms . . . . . . . . . . . . . . . . . . . . . 70 5.5. Key Material Packet . . . . . . . . . . . . . . . . . . . 47
10.3.1. Public-Key Algorithms . . . . . . . . . . . . . . . 71 5.5.1. Key Packet Variants . . . . . . . . . . . . . . . . . 47
10.3.2. Symmetric-Key Algorithms . . . . . . . . . . . . . . 71 5.5.1.1. Public-Key Packet (Tag 6) . . . . . . . . . . . . 47
10.3.3. Hash Algorithms . . . . . . . . . . . . . . . . . . 71 5.5.1.2. Public-Subkey Packet (Tag 14) . . . . . . . . . . 47
10.3.4. Compression Algorithms . . . . . . . . . . . . . . . 71 5.5.1.3. Secret-Key Packet (Tag 5) . . . . . . . . . . . . 47
11. Packet Composition . . . . . . . . . . . . . . . . . . . . . 71 5.5.1.4. Secret-Subkey Packet (Tag 7) . . . . . . . . . . 48
11.1. Transferable Public Keys . . . . . . . . . . . . . . . . 72 5.5.2. Public-Key Packet Formats . . . . . . . . . . . . . . 48
11.2. Transferable Secret Keys . . . . . . . . . . . . . . . . 73 5.5.3. Secret-Key Packet Formats . . . . . . . . . . . . . . 49
11.3. OpenPGP Messages . . . . . . . . . . . . . . . . . . . . 73 5.6. Algorithm-specific Parts of Keys . . . . . . . . . . . . 50
11.4. Detached Signatures . . . . . . . . . . . . . . . . . . 74 5.6.1. Algorithm-Specific Part for RSA Keys . . . . . . . . 51
12. Enhanced Key Formats . . . . . . . . . . . . . . . . . . . . 74 5.6.2. Algorithm-Specific Part for DSA Keys . . . . . . . . 51
12.1. Key Structures . . . . . . . . . . . . . . . . . . . . . 74 5.6.3. Algorithm-Specific Part for Elgamal Keys . . . . . . 51
12.2. Key IDs and Fingerprints . . . . . . . . . . . . . . . . 75 5.6.4. Algorithm-Specific Part for ECDSA Keys . . . . . . . 52
13. Notes on Algorithms . . . . . . . . . . . . . . . . . . . . . 76 5.6.5. Algorithm-Specific Part for ECDH Keys . . . . . . . . 52
13.1. PKCS#1 Encoding in OpenPGP . . . . . . . . . . . . . . . 76 5.7. Compressed Data Packet (Tag 8) . . . . . . . . . . . . . 53
13.1.1. EME-PKCS1-v1_5-ENCODE . . . . . . . . . . . . . . . 77 5.8. Symmetrically Encrypted Data Packet (Tag 9) . . . . . . . 53
13.1.2. EME-PKCS1-v1_5-DECODE . . . . . . . . . . . . . . . 77 5.9. Marker Packet (Obsolete Literal Packet) (Tag 10) . . . . 54
13.1.3. EMSA-PKCS1-v1_5 . . . . . . . . . . . . . . . . . . 78 5.10. Literal Data Packet (Tag 11) . . . . . . . . . . . . . . 55
13.2. Symmetric Algorithm Preferences . . . . . . . . . . . . 79 5.11. Trust Packet (Tag 12) . . . . . . . . . . . . . . . . . . 56
13.3. Other Algorithm Preferences . . . . . . . . . . . . . . 80 5.12. User ID Packet (Tag 13) . . . . . . . . . . . . . . . . . 56
13.3.1. Compression Preferences . . . . . . . . . . . . . . 80 5.13. User Attribute Packet (Tag 17) . . . . . . . . . . . . . 56
13.3.2. Hash Algorithm Preferences . . . . . . . . . . . . . 80 5.13.1. The Image Attribute Subpacket . . . . . . . . . . . 57
13.4. Plaintext . . . . . . . . . . . . . . . . . . . . . . . 81 5.14. Sym. Encrypted Integrity Protected Data Packet (Tag
13.5. RSA . . . . . . . . . . . . . . . . . . . . . . . . . . 81 18) . . . . . . . . . . . . . . . . . . . . . . . . . . 58
13.6. DSA . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5.15. Modification Detection Code Packet (Tag 19) . . . . . . . 61
13.7. Elgamal . . . . . . . . . . . . . . . . . . . . . . . . 82 6. Radix-64 Conversions . . . . . . . . . . . . . . . . . . . . 61
13.8. Reserved Algorithm Numbers . . . . . . . . . . . . . . . 82 6.1. An Implementation of the CRC-24 in "C" . . . . . . . . . 62
13.9. OpenPGP CFB Mode . . . . . . . . . . . . . . . . . . . . 82 6.2. Forming ASCII Armor . . . . . . . . . . . . . . . . . . . 63
13.10. Private or Experimental Parameters . . . . . . . . . . . 83 6.3. Encoding Binary in Radix-64 . . . . . . . . . . . . . . . 65
13.11. Extension of the MDC System . . . . . . . . . . . . . . 84 6.4. Decoding Radix-64 . . . . . . . . . . . . . . . . . . . . 68
13.12. Meta-Considerations for Expansion . . . . . . . . . . . 85 6.5. Examples of Radix-64 . . . . . . . . . . . . . . . . . . 68
14. Security Considerations . . . . . . . . . . . . . . . . . . . 85 6.6. Example of an ASCII Armored Message . . . . . . . . . . . 69
15. Implementation Nits . . . . . . . . . . . . . . . . . . . . . 89 7. Cleartext Signature Framework . . . . . . . . . . . . . . . . 69
16. References . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.1. Dash-Escaped Text . . . . . . . . . . . . . . . . . . . . 70
16.1. Normative References . . . . . . . . . . . . . . . . . . 90 8. Regular Expressions . . . . . . . . . . . . . . . . . . . . . 71
16.2. Informative References . . . . . . . . . . . . . . . . . 93 9. Constants . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 93 9.1. Public-Key Algorithms . . . . . . . . . . . . . . . . . . 72
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 93 9.2. ECC Curve OID . . . . . . . . . . . . . . . . . . . . . . 73
9.3. Symmetric-Key Algorithms . . . . . . . . . . . . . . . . 73
9.4. Compression Algorithms . . . . . . . . . . . . . . . . . 74
9.5. Hash Algorithms . . . . . . . . . . . . . . . . . . . . . 75
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 76
10.1. New String-to-Key Specifier Types . . . . . . . . . . . 76
10.2. New Packets . . . . . . . . . . . . . . . . . . . . . . 76
10.2.1. User Attribute Types . . . . . . . . . . . . . . . . 76
10.2.1.1. Image Format Subpacket Types . . . . . . . . . . 76
10.2.2. New Signature Subpackets . . . . . . . . . . . . . . 77
10.2.2.1. Signature Notation Data Subpackets . . . . . . . 77
10.2.2.2. Signature Notation Data Subpacket Notation
Flags . . . . . . . . . . . . . . . . . . . . . . . 77
10.2.2.3. Key Server Preference Extensions . . . . . . . . 77
10.2.2.4. Key Flags Extensions . . . . . . . . . . . . . . 78
10.2.2.5. Reason for Revocation Extensions . . . . . . . . 78
10.2.2.6. Implementation Features . . . . . . . . . . . . 78
10.2.3. New Packet Versions . . . . . . . . . . . . . . . . 78
10.3. New Algorithms . . . . . . . . . . . . . . . . . . . . . 79
10.3.1. Public-Key Algorithms . . . . . . . . . . . . . . . 79
10.3.2. Symmetric-Key Algorithms . . . . . . . . . . . . . . 79
10.3.3. Hash Algorithms . . . . . . . . . . . . . . . . . . 79
10.3.4. Compression Algorithms . . . . . . . . . . . . . . . 80
11. Packet Composition . . . . . . . . . . . . . . . . . . . . . 80
11.1. Transferable Public Keys . . . . . . . . . . . . . . . . 80
11.2. Transferable Secret Keys . . . . . . . . . . . . . . . . 82
11.3. OpenPGP Messages . . . . . . . . . . . . . . . . . . . . 82
11.4. Detached Signatures . . . . . . . . . . . . . . . . . . 83
12. Enhanced Key Formats . . . . . . . . . . . . . . . . . . . . 83
12.1. Key Structures . . . . . . . . . . . . . . . . . . . . . 83
12.2. Key IDs and Fingerprints . . . . . . . . . . . . . . . . 84
13. Elliptic Curve Cryptography . . . . . . . . . . . . . . . . . 85
13.1. Supported ECC Curves . . . . . . . . . . . . . . . . . . 85
13.2. ECDSA and ECDH Conversion Primitives . . . . . . . . . . 86
13.3. Key Derivation Function . . . . . . . . . . . . . . . . 86
13.4. EC DH Algorithm (ECDH) . . . . . . . . . . . . . . . . . 87
14. Notes on Algorithms . . . . . . . . . . . . . . . . . . . . . 90
14.1. PKCS#1 Encoding in OpenPGP . . . . . . . . . . . . . . . 90
14.1.1. EME-PKCS1-v1_5-ENCODE . . . . . . . . . . . . . . . 90
14.1.2. EME-PKCS1-v1_5-DECODE . . . . . . . . . . . . . . . 91
14.1.3. EMSA-PKCS1-v1_5 . . . . . . . . . . . . . . . . . . 91
14.2. Symmetric Algorithm Preferences . . . . . . . . . . . . 92
14.3. Other Algorithm Preferences . . . . . . . . . . . . . . 93
14.3.1. Compression Preferences . . . . . . . . . . . . . . 93
14.3.2. Hash Algorithm Preferences . . . . . . . . . . . . . 94
14.4. Plaintext . . . . . . . . . . . . . . . . . . . . . . . 94
14.5. RSA . . . . . . . . . . . . . . . . . . . . . . . . . . 94
14.6. DSA . . . . . . . . . . . . . . . . . . . . . . . . . . 95
14.7. Elgamal . . . . . . . . . . . . . . . . . . . . . . . . 95
14.8. Reserved Algorithm Numbers . . . . . . . . . . . . . . . 95
14.9. OpenPGP CFB Mode . . . . . . . . . . . . . . . . . . . . 96
14.10. Private or Experimental Parameters . . . . . . . . . . . 97
14.11. Extension of the MDC System . . . . . . . . . . . . . . 97
14.12. Meta-Considerations for Expansion . . . . . . . . . . . 98
15. Security Considerations . . . . . . . . . . . . . . . . . . . 99
16. Compatibility Profiles . . . . . . . . . . . . . . . . . . . 105
16.1. OpenPGP ECC Profile . . . . . . . . . . . . . . . . . . 105
16.2. Suite-B Profile . . . . . . . . . . . . . . . . . . . . 105
16.2.1. Security Strength at 192 Bits . . . . . . . . . . . 106
16.2.2. Security Strength at 128 Bits . . . . . . . . . . . 106
17. Implementation Nits . . . . . . . . . . . . . . . . . . . . . 106
18. References . . . . . . . . . . . . . . . . . . . . . . . . . 107
18.1. Normative References . . . . . . . . . . . . . . . . . . 107
18.2. Informative References . . . . . . . . . . . . . . . . . 110
Appendix A. Document Workflow . . . . . . . . . . . . . . . . . 111
Appendix B. ECC Point compression flag bytes . . . . . . . . . . 112
Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 112
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 112
1. Introduction 1. Introduction
{ This is work in progress to update OpenPGP. Editorial notes are { This is work in progress to update OpenPGP. Editorial notes are
enclosed in curly braces. } enclosed in curly braces. }
This document provides information on the message-exchange packet This document provides information on the message-exchange packet
formats used by OpenPGP to provide encryption, decryption, signing, formats used by OpenPGP to provide encryption, decryption, signing,
and key management functions. It is a revision of RFC 4880, "OpenPGP and key management functions. It is a revision of RFC 4880, "OpenPGP
Message Format", which is a revision of RFC 2440, which itself Message Format", which is a revision of RFC 2440, which itself
replaces RFC 1991, "PGP Message Exchange Formats" [RFC1991] [RFC2440] replaces RFC 1991, "PGP Message Exchange Formats" [RFC1991] [RFC2440]
[RFC4880]. [RFC4880].
This document obsoletes: RFC 4880 (OpenPGP) and RFC 5581 (Camellia This document obsoletes: RFC 4880 (OpenPGP), RFC 5581 (Camellia
cipher). cipher) and RFC 6637 (ECC for OpenPGP).
1.1. Terms 1.1. Terms
* OpenPGP - This is a term for security software that uses PGP 5 as * OpenPGP - This is a term for security software that uses PGP 5 as
a basis, formalized in this document. a basis, formalized in this document.
* PGP - Pretty Good Privacy. PGP is a family of software systems * PGP - Pretty Good Privacy. PGP is a family of software systems
developed by Philip R. Zimmermann from which OpenPGP is based. developed by Philip R. Zimmermann from which OpenPGP is based.
* PGP 2 - This version of PGP has many variants; where necessary a * PGP 2 - This version of PGP has many variants; where necessary a
skipping to change at page 5, line 28 skipping to change at page 6, line 45
keys. keys.
"PGP", "Pretty Good", and "Pretty Good Privacy" are trademarks of PGP "PGP", "Pretty Good", and "Pretty Good Privacy" are trademarks of PGP
Corporation and are used with permission. The term "OpenPGP" refers Corporation and are used with permission. The term "OpenPGP" refers
to the protocol described in this and related documents. to the protocol described in this and related documents.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
The key words "PRIVATE USE", "HIERARCHICAL ALLOCATION", "FIRST COME The key words "PRIVATE USE", "SPECIFICATION REQUIRED", and "RFC
FIRST SERVED", "EXPERT REVIEW", "SPECIFICATION REQUIRED", "IESG REQUIRED" that appear in this document when used to describe
APPROVAL", "IETF CONSENSUS", and "STANDARDS ACTION" that appear in namespace allocation are to be interpreted as described in [RFC8126].
this document when used to describe namespace allocation are to be
interpreted as described in [RFC2434].
2. General functions 2. General functions
OpenPGP provides data integrity services for messages and data files OpenPGP provides data integrity services for messages and data files
by using these core technologies: by using these core technologies:
* digital signatures * digital signatures
* encryption * encryption
skipping to change at page 17, line 44 skipping to change at page 19, line 44
| 13 | User ID Packet | | 13 | User ID Packet |
+----------+----------------------------------------------------+ +----------+----------------------------------------------------+
| 14 | Public-Subkey Packet | | 14 | Public-Subkey Packet |
+----------+----------------------------------------------------+ +----------+----------------------------------------------------+
| 17 | User Attribute Packet | | 17 | User Attribute Packet |
+----------+----------------------------------------------------+ +----------+----------------------------------------------------+
| 18 | Sym. Encrypted and Integrity Protected Data Packet | | 18 | Sym. Encrypted and Integrity Protected Data Packet |
+----------+----------------------------------------------------+ +----------+----------------------------------------------------+
| 19 | Modification Detection Code Packet | | 19 | Modification Detection Code Packet |
+----------+----------------------------------------------------+ +----------+----------------------------------------------------+
| 20 | Reserved (AEAD Encrypted Data) |
+----------+----------------------------------------------------+
| 60 to 63 | Private or Experimental Values | | 60 to 63 | Private or Experimental Values |
+----------+----------------------------------------------------+ +----------+----------------------------------------------------+
Table 2: Packet type registry Table 2: Packet type registry
5. Packet Types 5. Packet Types
5.1. Public-Key Encrypted Session Key Packets (Tag 1) 5.1. Public-Key Encrypted Session Key Packets (Tag 1)
A Public-Key Encrypted Session Key packet holds the session key used A Public-Key Encrypted Session Key packet holds the session key used
to encrypt a message. Zero or more Public-Key Encrypted Session Key to encrypt a message. Zero or more Public-Key Encrypted Session Key
skipping to change at page 18, line 45 skipping to change at page 20, line 45
Algorithm Specific Fields for RSA encryption: Algorithm Specific Fields for RSA encryption:
- Multiprecision integer (MPI) of RSA encrypted value m**e mod n. - Multiprecision integer (MPI) of RSA encrypted value m**e mod n.
Algorithm Specific Fields for Elgamal encryption: Algorithm Specific Fields for Elgamal encryption:
- MPI of Elgamal (Diffie-Hellman) value g**k mod p. - MPI of Elgamal (Diffie-Hellman) value g**k mod p.
- MPI of Elgamal (Diffie-Hellman) value m * y**k mod p. - MPI of Elgamal (Diffie-Hellman) value m * y**k mod p.
Algorithm-Specific Fields for ECDH encryption:
- MPI of an EC point representing an ephemeral public key.
- a one-octet size, followed by a symmetric key encoded using the
method described in Section 13.4.
The value "m" in the above formulas is derived from the session key The value "m" in the above formulas is derived from the session key
as follows. First, the session key is prefixed with a one-octet as follows. First, the session key is prefixed with a one-octet
algorithm identifier that specifies the symmetric encryption algorithm identifier that specifies the symmetric encryption
algorithm used to encrypt the following Symmetrically Encrypted Data algorithm used to encrypt the following Symmetrically Encrypted Data
Packet. Then a two-octet checksum is appended, which is equal to the Packet. Then a two-octet checksum is appended, which is equal to the
sum of the preceding session key octets, not including the algorithm sum of the preceding session key octets, not including the algorithm
identifier, modulo 65536. This value is then encoded as described in identifier, modulo 65536. This value is then encoded as described in
PKCS#1 block encoding EME-PKCS1-v1_5 in Section 7.2.1 of [RFC3447] to PKCS#1 block encoding EME-PKCS1-v1_5 in Section 7.2.1 of [RFC3447] to
form the "m" value used in the formulas above. See Section 13.1 in form the "m" value used in the formulas above. See Section 14.1 in
this document for notes on OpenPGP's use of PKCS#1. this document for notes on OpenPGP's use of PKCS#1.
Note that when an implementation forms several PKESKs with one Note that when an implementation forms several PKESKs with one
session key, forming a message that can be decrypted by several keys, session key, forming a message that can be decrypted by several keys,
the implementation MUST make a new PKCS#1 encoding for each key. the implementation MUST make a new PKCS#1 encoding for each key.
An implementation MAY accept or use a Key ID of zero as a "wild card" An implementation MAY accept or use a Key ID of zero as a "wild card"
or "speculative" Key ID. In this case, the receiving implementation or "speculative" Key ID. In this case, the receiving implementation
would try all available private keys, checking for a valid decrypted would try all available private keys, checking for a valid decrypted
session key. This format helps reduce traffic analysis of messages. session key. This format helps reduce traffic analysis of messages.
skipping to change at page 19, line 28 skipping to change at page 21, line 36
A Signature packet describes a binding between some public key and A Signature packet describes a binding between some public key and
some data. The most common signatures are a signature of a file or a some data. The most common signatures are a signature of a file or a
block of text, and a signature that is a certification of a User ID. block of text, and a signature that is a certification of a User ID.
Two versions of Signature packets are defined. Version 3 provides Two versions of Signature packets are defined. Version 3 provides
basic signature information, while version 4 provides an expandable basic signature information, while version 4 provides an expandable
format with subpackets that can specify more information about the format with subpackets that can specify more information about the
signature. PGP 2.6.x only accepts version 3 signatures. signature. PGP 2.6.x only accepts version 3 signatures.
Implementations SHOULD accept V3 signatures. Implementations SHOULD Implementations SHOULD generate V4 signatures. Implementations MUST
generate V4 signatures. NOT create version 3 signatures; they MAY accept version 3
signatures.
Note that if an implementation is creating an encrypted and signed
message that is encrypted to a V3 key, it is reasonable to create a
V3 signature.
5.2.1. Signature Types 5.2.1. Signature Types
There are a number of possible meanings for a signature, which are There are a number of possible meanings for a signature, which are
indicated in a signature type octet in any given signature. Please indicated in a signature type octet in any given signature. Please
note that the vagueness of these meanings is not a flaw, but a note that the vagueness of these meanings is not a flaw, but a
feature of the system. Because OpenPGP places final authority for feature of the system. Because OpenPGP places final authority for
validity upon the receiver of a signature, it may be that one validity upon the receiver of a signature, it may be that one
signer's casual act might be more rigorous than some other signer's casual act might be more rigorous than some other
authority's positive act. See Section 5.2.4 for detailed information authority's positive act. See Section 5.2.4 for detailed information
skipping to change at page 22, line 26 skipping to change at page 24, line 32
* Two-octet field holding left 16 bits of signed hash value. * Two-octet field holding left 16 bits of signed hash value.
* One or more multiprecision integers comprising the signature. * One or more multiprecision integers comprising the signature.
This portion is algorithm specific, as described below. This portion is algorithm specific, as described below.
The concatenation of the data to be signed, the signature type, and The concatenation of the data to be signed, the signature type, and
creation time from the Signature packet (5 additional octets) is creation time from the Signature packet (5 additional octets) is
hashed. The resulting hash value is used in the signature algorithm. hashed. The resulting hash value is used in the signature algorithm.
The high 16 bits (first two octets) of the hash are included in the The high 16 bits (first two octets) of the hash are included in the
Signature packet to provide a quick test to reject some invalid Signature packet to provide a way to reject some invalid signatures
signatures. without performing a signature verification.
Algorithm-Specific Fields for RSA signatures: Algorithm-Specific Fields for RSA signatures:
* Multiprecision integer (MPI) of RSA signature value m**d mod n. * Multiprecision integer (MPI) of RSA signature value m**d mod n.
Algorithm-Specific Fields for DSA signatures: Algorithm-Specific Fields for DSA and ECDSA signatures:
* MPI of DSA value r. * MPI of DSA or ECDSA value r.
* MPI of DSA value s. * MPI of DSA or ECDSA value s.
The signature calculation is based on a hash of the signed data, as The signature calculation is based on a hash of the signed data, as
described above. The details of the calculation are different for described above. The details of the calculation are different for
DSA signatures than for RSA signatures. DSA signatures than for RSA signatures.
With RSA signatures, the hash value is encoded using PKCS#1 encoding With RSA signatures, the hash value is encoded using PKCS#1 encoding
type EMSA-PKCS1-v1_5 as described in Section 9.2 of [RFC3447]. This type EMSA-PKCS1-v1_5 as described in Section 9.2 of [RFC3447]. This
requires inserting the hash value as an octet string into an ASN.1 requires inserting the hash value as an octet string into an ASN.1
structure. The object identifier for the type of hash being used is structure. The object identifier for the type of hash being used is
included in the structure. The hexadecimal representations for the included in the structure. The hexadecimal representations for the
skipping to change at page 25, line 28 skipping to change at page 28, line 28
* Two-octet scalar octet count for the following unhashed subpacket * Two-octet scalar octet count for the following unhashed subpacket
data. Note that this is the length in octets of all of the data. Note that this is the length in octets of all of the
unhashed subpackets; a pointer incremented by this number will unhashed subpackets; a pointer incremented by this number will
skip over the unhashed subpackets. skip over the unhashed subpackets.
* Unhashed subpacket data set (zero or more subpackets). * Unhashed subpacket data set (zero or more subpackets).
* Two-octet field holding the left 16 bits of the signed hash value. * Two-octet field holding the left 16 bits of the signed hash value.
* One or more multiprecision integers comprising the signature. * One or more multiprecision integers comprising the signature.
This portion is algorithm specific, as described above. This portion is algorithm specific:
Algorithm-Specific Fields for RSA signatures:
- Multiprecision integer (MPI) of RSA signature value m**d mod n.
Algorithm-Specific Fields for DSA or ECDSA signatures:
- MPI of DSA or ECDSA value r.
- MPI of DSA or ECDSA value s.
The concatenation of the data being signed and the signature data The concatenation of the data being signed and the signature data
from the version number through the hashed subpacket data (inclusive) from the version number through the hashed subpacket data (inclusive)
is hashed. The resulting hash value is what is signed. The left 16 is hashed. The resulting hash value is what is signed. The high 16
bits of the hash are included in the Signature packet to provide a bits (first two octets) of the hash are included in the Signature
quick test to reject some invalid signatures. packet to provide a way to reject some invalid signatures without
performing a signature verification.
There are two fields consisting of Signature subpackets. The first There are two fields consisting of Signature subpackets. The first
field is hashed with the rest of the signature data, while the second field is hashed with the rest of the signature data, while the second
is unhashed. The second set of subpackets is not cryptographically is unhashed. The second set of subpackets is not cryptographically
protected by the signature and should include only advisory protected by the signature and should include only advisory
information. information.
The algorithms for converting the hash function result to a signature The algorithms for converting the hash function result to a signature
are described in a section below. are described in a section below.
skipping to change at page 26, line 32 skipping to change at page 29, line 43
if the 1st octet >= 192 and < 255, then if the 1st octet >= 192 and < 255, then
lengthOfLength = 2 lengthOfLength = 2
subpacketLen = ((1st_octet - 192) << 8) + (2nd_octet) + 192 subpacketLen = ((1st_octet - 192) << 8) + (2nd_octet) + 192
if the 1st octet = 255, then if the 1st octet = 255, then
lengthOfLength = 5 lengthOfLength = 5
subpacket length = [four-octet scalar starting at 2nd_octet] subpacket length = [four-octet scalar starting at 2nd_octet]
The value of the subpacket type octet may be: The value of the subpacket type octet may be:
+============+========================================+ +============+===========================================+
| Type | Description | | Type | Description |
+============+========================================+ +============+===========================================+
| 0 | Reserved | | 0 | Reserved |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 1 | Reserved | | 1 | Reserved |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 2 | Signature Creation Time | | 2 | Signature Creation Time |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 3 | Signature Expiration Time | | 3 | Signature Expiration Time |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 4 | Exportable Certification | | 4 | Exportable Certification |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 5 | Trust Signature | | 5 | Trust Signature |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 6 | Regular Expression | | 6 | Regular Expression |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 7 | Revocable | | 7 | Revocable |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 8 | Reserved | | 8 | Reserved |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 9 | Key Expiration Time | | 9 | Key Expiration Time |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 10 | Placeholder for backward compatibility | | 10 | Placeholder for backward compatibility |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 11 | Preferred Symmetric Algorithms | | 11 | Preferred Symmetric Algorithms |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 12 | Revocation Key | | 12 | Revocation Key |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 13 | Reserved | | 13 to 15 | Reserved |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 14 | Reserved | | 16 | Issuer |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 15 | Reserved | | 17 to 19 | Reserved |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 16 | Issuer | | 20 | Notation Data |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 17 | Reserved | | 21 | Preferred Hash Algorithms |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 18 | Reserved | | 22 | Preferred Compression Algorithms |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 19 | Reserved | | 23 | Key Server Preferences |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 20 | Notation Data | | 24 | Preferred Key Server |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 21 | Preferred Hash Algorithms | | 25 | Primary User ID |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 22 | Preferred Compression Algorithms | | 26 | Policy URI |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 23 | Key Server Preferences | | 27 | Key Flags |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 24 | Preferred Key Server | | 28 | Signer's User ID |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 25 | Primary User ID | | 29 | Reason for Revocation |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 26 | Policy URI | | 30 | Features |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 27 | Key Flags | | 31 | Signature Target |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 28 | Signer's User ID | | 32 | Embedded Signature |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 29 | Reason for Revocation | | 33 | Reserved (Issuer Fingerprint) |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 30 | Features | | 34 | Reserved (Preferred AEAD Algorithms) |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 31 | Signature Target | | 35 | Reserved (Intended Recipient Fingerprint) |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 32 | Embedded Signature | | 37 | Reserved (Attested Certifications) |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 100 to 110 | Private or experimental | | 38 | Reserved (Key Block) |
+------------+----------------------------------------+ +------------+-------------------------------------------+
| 100 to 110 | Private or experimental |
+------------+-------------------------------------------+
Table 6: Subpacket type registry Table 6: Subpacket type registry
An implementation SHOULD ignore any subpacket of a type that it does An implementation SHOULD ignore any subpacket of a type that it does
not recognize. not recognize.
Bit 7 of the subpacket type is the "critical" bit. If set, it Bit 7 of the subpacket type is the "critical" bit. If set, it
denotes that the subpacket is one that is critical for the evaluator denotes that the subpacket is one that is critical for the evaluator
of the signature to recognize. If a subpacket is encountered that is of the signature to recognize. If a subpacket is encountered that is
marked critical but is unknown to the evaluating software, the marked critical but is unknown to the evaluating software, the
evaluator SHOULD consider the signature to be in error. evaluator SHOULD consider the signature to be in error.
skipping to change at page 30, line 30 skipping to change at page 33, line 45
a self-signature. a self-signature.
5.2.3.7. Preferred Symmetric Algorithms 5.2.3.7. Preferred Symmetric Algorithms
(array of one-octet values) (array of one-octet values)
Symmetric algorithm numbers that indicate which algorithms the key Symmetric algorithm numbers that indicate which algorithms the key
holder prefers to use. The subpacket body is an ordered list of holder prefers to use. The subpacket body is an ordered list of
octets with the most preferred listed first. It is assumed that only octets with the most preferred listed first. It is assumed that only
algorithms listed are supported by the recipient's software. algorithms listed are supported by the recipient's software.
Algorithm numbers are in Section 9.2. This is only found on a self- Algorithm numbers are in Section 9.3. This is only found on a self-
signature. signature.
5.2.3.8. Preferred Hash Algorithms 5.2.3.8. Preferred Hash Algorithms
(array of one-octet values) (array of one-octet values)
Message digest algorithm numbers that indicate which algorithms the Message digest algorithm numbers that indicate which algorithms the
key holder prefers to receive. Like the preferred symmetric key holder prefers to receive. Like the preferred symmetric
algorithms, the list is ordered. Algorithm numbers are in algorithms, the list is ordered. Algorithm numbers are in
Section 9.4. This is only found on a self-signature. Section 9.5. This is only found on a self-signature.
5.2.3.9. Preferred Compression Algorithms 5.2.3.9. Preferred Compression Algorithms
(array of one-octet values) (array of one-octet values)
Compression algorithm numbers that indicate which algorithms the key Compression algorithm numbers that indicate which algorithms the key
holder prefers to use. Like the preferred symmetric algorithms, the holder prefers to use. Like the preferred symmetric algorithms, the
list is ordered. Algorithm numbers are in Section 9.3. If this list is ordered. Algorithm numbers are in Section 9.4. If this
subpacket is not included, ZIP is preferred. A zero denotes that subpacket is not included, ZIP is preferred. A zero denotes that
uncompressed data is preferred; the key holder's software might have uncompressed data is preferred; the key holder's software might have
no compression software in that implementation. This is only found no compression software in that implementation. This is only found
on a self-signature. on a self-signature.
5.2.3.10. Signature Expiration Time 5.2.3.10. Signature Expiration Time
(4-octet time field) (4-octet time field)
The validity period of the signature. This is the number of seconds The validity period of the signature. This is the number of seconds
skipping to change at page 36, line 25 skipping to change at page 39, line 37
+------+-------------------------------------------------+ +------+-------------------------------------------------+
| 0x10 | The private component of this key may have been | | 0x10 | The private component of this key may have been |
| | split by a secret-sharing mechanism. | | | split by a secret-sharing mechanism. |
+------+-------------------------------------------------+ +------+-------------------------------------------------+
| 0x20 | This key may be used for authentication. | | 0x20 | This key may be used for authentication. |
+------+-------------------------------------------------+ +------+-------------------------------------------------+
| 0x80 | The private component of this key may be in the | | 0x80 | The private component of this key may be in the |
| | possession of more than one person. | | | possession of more than one person. |
+------+-------------------------------------------------+ +------+-------------------------------------------------+
Table 9: Key flags registry Table 9: Key flags registry (first octet)
Second octet:
+======+==========================+
| flag | definition |
+======+==========================+
| 0x04 | Reserved (ADSK). |
+------+--------------------------+
| 0x08 | Reserved (timestamping). |
+------+--------------------------+
Table 10: Key flags registry
(second octet)
Usage notes: Usage notes:
The flags in this packet may appear in self-signatures or in The flags in this packet may appear in self-signatures or in
certification signatures. They mean different things depending on certification signatures. They mean different things depending on
who is making the statement -- for example, a certification signature who is making the statement -- for example, a certification signature
that has the "sign data" flag is stating that the certification is that has the "sign data" flag is stating that the certification is
for that use. On the other hand, the "communications encryption" for that use. On the other hand, the "communications encryption"
flag in a self-signature is stating a preference that a given key be flag in a self-signature is stating a preference that a given key be
used for communications. Note however, that it is a thorny issue to used for communications. Note however, that it is a thorny issue to
skipping to change at page 37, line 45 skipping to change at page 41, line 26
+---------+----------------------------------+ +---------+----------------------------------+
| 3 | Key is retired and no longer | | 3 | Key is retired and no longer |
| | used (key revocations) | | | used (key revocations) |
+---------+----------------------------------+ +---------+----------------------------------+
| 32 | User ID information is no longer | | 32 | User ID information is no longer |
| | valid (cert revocations) | | | valid (cert revocations) |
+---------+----------------------------------+ +---------+----------------------------------+
| 100-110 | Private Use | | 100-110 | Private Use |
+---------+----------------------------------+ +---------+----------------------------------+
Table 10: Reasons for revocation Table 11: Reasons for revocation
Following the revocation code is a string of octets that gives Following the revocation code is a string of octets that gives
information about the Reason for Revocation in human-readable form information about the Reason for Revocation in human-readable form
(UTF-8). The string may be null, that is, of zero length. The (UTF-8). The string may be null, that is, of zero length. The
length of the subpacket is the length of the reason string plus one. length of the subpacket is the length of the reason string plus one.
An implementation SHOULD implement this subpacket, include it in all An implementation SHOULD implement this subpacket, include it in all
revocation signatures, and interpret revocations appropriately. revocation signatures, and interpret revocations appropriately.
There are important semantic differences between the reasons, and There are important semantic differences between the reasons, and
there are thus important reasons for revoking signatures. there are thus important reasons for revoking signatures.
skipping to change at page 38, line 46 skipping to change at page 42, line 30
Defined features are as follows: Defined features are as follows:
First octet: First octet:
+=========+============================================+ +=========+============================================+
| feature | definition | | feature | definition |
+=========+============================================+ +=========+============================================+
| 0x01 | Modification Detection (packets 18 and 19) | | 0x01 | Modification Detection (packets 18 and 19) |
+---------+--------------------------------------------+ +---------+--------------------------------------------+
| 0x02 | Reserved (AEAD Data & v5 SKESK) |
+---------+--------------------------------------------+
| 0x04 | Reserved (v5 pubkey & fingerprint) |
+---------+--------------------------------------------+
Table 11: Features registry Table 12: Features registry
If an implementation implements any of the defined features, it If an implementation implements any of the defined features, it
SHOULD implement the Features subpacket, too. SHOULD implement the Features subpacket, too.
An implementation may freely infer features from other suitable An implementation may freely infer features from other suitable
implementation-dependent mechanisms. implementation-dependent mechanisms.
5.2.3.25. Signature Target 5.2.3.25. Signature Target
(1 octet public-key algorithm, 1 octet hash algorithm, N octets hash) (1 octet public-key algorithm, 1 octet hash algorithm, N octets hash)
skipping to change at page 40, line 10 skipping to change at page 44, line 5
A certification signature (type 0x10 through 0x13) hashes the User ID A certification signature (type 0x10 through 0x13) hashes the User ID
being bound to the key into the hash context after the above data. A being bound to the key into the hash context after the above data. A
V3 certification hashes the contents of the User ID or attribute V3 certification hashes the contents of the User ID or attribute
packet packet, without any header. A V4 certification hashes the packet packet, without any header. A V4 certification hashes the
constant 0xB4 for User ID certifications or the constant 0xD1 for constant 0xB4 for User ID certifications or the constant 0xD1 for
User Attribute certifications, followed by a four-octet number giving User Attribute certifications, followed by a four-octet number giving
the length of the User ID or User Attribute data, and then the User the length of the User ID or User Attribute data, and then the User
ID or User Attribute data. ID or User Attribute data.
When a signature is made over a Signature packet (type 0x50), the When a signature is made over a Signature packet (type 0x50, "Third-
hash data starts with the octet 0x88, followed by the four-octet Party Confirmation signature"), the hash data starts with the octet
length of the signature, and then the body of the Signature packet. 0x88, followed by the four-octet length of the signature, and then
(Note that this is an old-style packet header for a Signature packet the body of the Signature packet. (Note that this is an old-style
with the length-of-length set to zero.) The unhashed subpacket data packet header for a Signature packet with the length-of-length field
of the Signature packet being hashed is not included in the hash, and set to zero.) The unhashed subpacket data of the Signature packet
the unhashed subpacket data length value is set to zero. being hashed is not included in the hash, and the unhashed subpacket
data length value is set to zero.
Once the data body is hashed, then a trailer is hashed. A V3 Once the data body is hashed, then a trailer is hashed. This trailer
signature hashes five octets of the packet body, starting from the depends on the version of the signature.
signature type field. This data is the signature type, followed by
the four-octet signature time. A V4 signature hashes the packet body
starting from its first field, the version number, through the end of
the hashed subpacket data. Thus, the fields hashed are the signature
version, the signature type, the public-key algorithm, the hash
algorithm, the hashed subpacket length, and the hashed subpacket
body.
V4 signatures also hash in a final trailer of six octets: the version * A V3 signature hashes five octets of the packet body, starting
of the Signature packet, i.e., 0x04; 0xFF; and a four-octet, big- from the signature type field. This data is the signature type,
endian number that is the length of the hashed data from the followed by the four-octet signature time.
Signature packet (note that this number does not include these final
six octets). * A V4 signature hashes the packet body starting from its first
field, the version number, through the end of the hashed subpacket
data and a final extra trailer. Thus, the hashed fields are:
- the signature version (0x04),
- the signature type,
- the public-key algorithm,
- the hash algorithm,
- the hashed subpacket length,
- the hashed subpacket body,
- the two octets 0x04 and 0xFF,
- a four-octet big-endian number that is the length of the hashed
data from the Signature packet stopping right before the 0x04,
0xff octets.
After all this has been hashed in a single hash context, the After all this has been hashed in a single hash context, the
resulting hash field is used in the signature algorithm and placed at resulting hash field is used in the signature algorithm and placed at
the end of the Signature packet. the end of the Signature packet.
5.2.4.1. Subpacket Hints 5.2.4.1. Subpacket Hints
It is certainly possible for a signature to contain conflicting It is certainly possible for a signature to contain conflicting
information in subpackets. For example, a signature may contain information in subpackets. For example, a signature may contain
multiple copies of a preference or multiple expiration times. In multiple copies of a preference or multiple expiration times. In
skipping to change at page 41, line 45 skipping to change at page 46, line 11
* A one-octet number describing the symmetric algorithm used. * A one-octet number describing the symmetric algorithm used.
* A string-to-key (S2K) specifier, length as defined above. * A string-to-key (S2K) specifier, length as defined above.
* Optionally, the encrypted session key itself, which is decrypted * Optionally, the encrypted session key itself, which is decrypted
with the string-to-key object. with the string-to-key object.
If the encrypted session key is not present (which can be detected on If the encrypted session key is not present (which can be detected on
the basis of packet length and S2K specifier size), then the S2K the basis of packet length and S2K specifier size), then the S2K
algorithm applied to the passphrase produces the session key for algorithm applied to the passphrase produces the session key for
decrypting the file, using the symmetric cipher algorithm from the decrypting the message, using the symmetric cipher algorithm from the
Symmetric-Key Encrypted Session Key packet. Symmetric-Key Encrypted Session Key packet.
If the encrypted session key is present, the result of applying the If the encrypted session key is present, the result of applying the
S2K algorithm to the passphrase is used to decrypt just that S2K algorithm to the passphrase is used to decrypt just that
encrypted session key field, using CFB mode with an IV of all zeros. encrypted session key field, using CFB mode with an IV of all zeros.
The decryption result consists of a one-octet algorithm identifier The decryption result consists of a one-octet algorithm identifier
that specifies the symmetric-key encryption algorithm used to encrypt that specifies the symmetric-key encryption algorithm used to encrypt
the following Symmetrically Encrypted Data packet, followed by the the following Symmetrically Encrypted Data packet, followed by the
session key octets themselves. session key octets themselves.
skipping to change at page 44, line 50 skipping to change at page 49, line 20
A version 4 packet contains: A version 4 packet contains:
* A one-octet version number (4). * A one-octet version number (4).
* A four-octet number denoting the time that the key was created. * A four-octet number denoting the time that the key was created.
* A one-octet number denoting the public-key algorithm of this key. * A one-octet number denoting the public-key algorithm of this key.
* A series of multiprecision integers comprising the key material. * A series of multiprecision integers comprising the key material.
This algorithm-specific portion is: This is algorithm-specific and described in Section 5.6.
Algorithm-Specific Fields for RSA public keys:
- multiprecision integer (MPI) of RSA public modulus n;
- MPI of RSA public encryption exponent e.
Algorithm-Specific Fields for DSA public keys:
- MPI of DSA prime p;
- MPI of DSA group order q (q is a prime divisor of p-1);
- MPI of DSA group generator g;
- MPI of DSA public-key value y (= g**x mod p where x is secret).
Algorithm-Specific Fields for Elgamal public keys:
- MPI of Elgamal prime p;
- MPI of Elgamal group generator g;
- MPI of Elgamal public key value y (= g**x mod p where x is
secret).
5.5.3. Secret-Key Packet Formats 5.5.3. Secret-Key Packet Formats
The Secret-Key and Secret-Subkey packets contain all the data of the The Secret-Key and Secret-Subkey packets contain all the data of the
Public-Key and Public-Subkey packets, with additional algorithm- Public-Key and Public-Subkey packets, with additional algorithm-
specific secret-key data appended, usually in encrypted form. specific secret-key data appended, usually in encrypted form.
The packet contains: The packet contains:
* A Public-Key or Public-Subkey packet, as described above. * A Public-Key or Public-Subkey packet, as described above.
skipping to change at page 46, line 6 skipping to change at page 49, line 49
* [Optional] If string-to-key usage octet was 255 or 254, a string- * [Optional] If string-to-key usage octet was 255 or 254, a string-
to-key specifier. The length of the string-to-key specifier is to-key specifier. The length of the string-to-key specifier is
implied by its type, as described above. implied by its type, as described above.
* [Optional] If secret data is encrypted (string-to-key usage octet * [Optional] If secret data is encrypted (string-to-key usage octet
not zero), an Initial Vector (IV) of the same length as the not zero), an Initial Vector (IV) of the same length as the
cipher's block size. cipher's block size.
* Plain or encrypted multiprecision integers comprising the secret * Plain or encrypted multiprecision integers comprising the secret
key data. These algorithm-specific fields are as described below. key data. This is algorithm-specific and described in section
Section 5.6.
* If the string-to-key usage octet is zero or 255, then a two-octet * If the string-to-key usage octet is zero or 255, then a two-octet
checksum of the plaintext of the algorithm-specific portion (sum checksum of the plaintext of the algorithm-specific portion (sum
of all octets, mod 65536). If the string-to-key usage octet was of all octets, mod 65536). If the string-to-key usage octet was
254, then a 20-octet SHA-1 hash of the plaintext of the algorithm- 254, then a 20-octet SHA-1 hash of the plaintext of the algorithm-
specific portion. This checksum or hash is encrypted together specific portion. This checksum or hash is encrypted together
with the algorithm-specific fields (if string-to-key usage octet with the algorithm-specific fields (if string-to-key usage octet
is not zero). Note that for all other values, a two-octet is not zero). Note that for all other values, a two-octet
checksum is required. checksum is required.
Algorithm-Specific Fields for RSA secret keys:
- multiprecision integer (MPI) of RSA secret exponent d.
- MPI of RSA secret prime value p.
- MPI of RSA secret prime value q (p < q).
- MPI of u, the multiplicative inverse of p, mod q.
Algorithm-Specific Fields for DSA secret keys:
- MPI of DSA secret exponent x.
Algorithm-Specific Fields for Elgamal secret keys:
- MPI of Elgamal secret exponent x.
Secret MPI values can be encrypted using a passphrase. If a string- Secret MPI values can be encrypted using a passphrase. If a string-
to-key specifier is given, that describes the algorithm for to-key specifier is given, that describes the algorithm for
converting the passphrase to a key, else a simple MD5 hash of the converting the passphrase to a key, else a simple MD5 hash of the
passphrase is used. Implementations MUST use a string-to-key passphrase is used. Implementations MUST use a string-to-key
specifier; the simple hash is for backward compatibility and is specifier; the simple hash is for backward compatibility and is
deprecated, though implementations MAY continue to use existing deprecated, though implementations MAY continue to use existing
private keys in the old format. The cipher for encrypting the MPIs private keys in the old format. The cipher for encrypting the MPIs
is specified in the Secret-Key packet. is specified in the Secret-Key packet.
Encryption/decryption of the secret data is done in CFB mode using Encryption/decryption of the secret data is done in CFB mode using
skipping to change at page 47, line 19 skipping to change at page 50, line 46
the algebraic sum, mod 65536, of the plaintext of all the algorithm- the algebraic sum, mod 65536, of the plaintext of all the algorithm-
specific octets (including MPI prefix and data). With V3 keys, the specific octets (including MPI prefix and data). With V3 keys, the
checksum is stored in the clear. With V4 keys, the checksum is checksum is stored in the clear. With V4 keys, the checksum is
encrypted like the algorithm-specific data. This value is used to encrypted like the algorithm-specific data. This value is used to
check that the passphrase was correct. However, this checksum is check that the passphrase was correct. However, this checksum is
deprecated; an implementation SHOULD NOT use it, but should rather deprecated; an implementation SHOULD NOT use it, but should rather
use the SHA-1 hash denoted with a usage octet of 254. The reason for use the SHA-1 hash denoted with a usage octet of 254. The reason for
this is that there are some attacks that involve undetectably this is that there are some attacks that involve undetectably
modifying the secret key. modifying the secret key.
5.6. Compressed Data Packet (Tag 8) 5.6. Algorithm-specific Parts of Keys
The public and secret key format specifies algorithm-specific parts
of a key. The following sections describe them in detail.
5.6.1. Algorithm-Specific Part for RSA Keys
The public key is this series of multiprecision integers:
* MPI of RSA public modulus n;
* MPI of RSA public encryption exponent e.
The secret key is this series of multiprecision integers:
* MPI of RSA secret exponent d;
* MPI of RSA secret prime value p;
* MPI of RSA secret prime value q (p < q);
* MPI of u, the multiplicative inverse of p, mod q.
5.6.2. Algorithm-Specific Part for DSA Keys
The public key is this series of multiprecision integers:
* MPI of DSA prime p;
* MPI of DSA group order q (q is a prime divisor of p-1);
* MPI of DSA group generator g;
* MPI of DSA public-key value y (= g**x mod p where x is secret).
The secret key is this single multiprecision integer:
* MPI of DSA secret exponent x.
5.6.3. Algorithm-Specific Part for Elgamal Keys
The public key is this series of multiprecision integers:
* MPI of Elgamal prime p;
* MPI of Elgamal group generator g;
* MPI of Elgamal public key value y (= g**x mod p where x is
secret).
The secret key is this single multiprecision integer:
* MPI of Elgamal secret exponent x.
5.6.4. Algorithm-Specific Part for ECDSA Keys
The public key is this series of values:
* a variable-length field containing a curve OID, formatted as
follows:
- a one-octet size of the following field; values 0 and 0xFF are
reserved for future extensions,
- the octets representing a curve OID, defined in Section 9.2;
* a MPI of an EC point representing a public key.
The secret key is this single multiprecision integer:
* MPI of an integer representing the secret key, which is a scalar
of the public EC point.
5.6.5. Algorithm-Specific Part for ECDH Keys
The public key is this series of values:
* a variable-length field containing a curve OID, formatted as
follows:
- a one-octet size of the following field; values 0 and 0xFF are
reserved for future extensions,
- the octets representing a curve OID, defined in Section 9.2;
* a MPI of an EC point representing a public key;
* a variable-length field containing KDF parameters, formatted as
follows:
- a one-octet size of the following fields; values 0 and 0xff are
reserved for future extensions;
- a one-octet value 1, reserved for future extensions;
- a one-octet hash function ID used with a KDF;
- a one-octet algorithm ID for the symmetric algorithm used to
wrap the symmetric key used for the message encryption; see
Section 13.4 for details.
Observe that an ECDH public key is composed of the same sequence of
fields that define an ECDSA key, plus the KDF parameters field.
The secret key is this single multiprecision integer:
* MPI of an integer representing the secret key, which is a scalar
of the public EC point.
5.7. Compressed Data Packet (Tag 8)
The Compressed Data packet contains compressed data. Typically, this The Compressed Data packet contains compressed data. Typically, this
packet is found as the contents of an encrypted packet, or following packet is found as the contents of an encrypted packet, or following
a Signature or One-Pass Signature packet, and contains a literal data a Signature or One-Pass Signature packet, and contains a literal data
packet. packet.
The body of this packet consists of: The body of this packet consists of:
* One octet that gives the algorithm used to compress the packet. * One octet that gives the algorithm used to compress the packet.
skipping to change at page 48, line 5 skipping to change at page 53, line 41
blocks. Note that PGP V2.6 uses 13 bits of compression. If an blocks. Note that PGP V2.6 uses 13 bits of compression. If an
implementation uses more bits of compression, PGP V2.6 cannot implementation uses more bits of compression, PGP V2.6 cannot
decompress it. decompress it.
ZLIB-compressed packets are compressed with [RFC1950] ZLIB-style ZLIB-compressed packets are compressed with [RFC1950] ZLIB-style
blocks. blocks.
BZip2-compressed packets are compressed using the BZip2 [BZ2] BZip2-compressed packets are compressed using the BZip2 [BZ2]
algorithm. algorithm.
5.7. Symmetrically Encrypted Data Packet (Tag 9) 5.8. Symmetrically Encrypted Data Packet (Tag 9)
The Symmetrically Encrypted Data packet contains data encrypted with The Symmetrically Encrypted Data packet contains data encrypted with
a symmetric-key algorithm. When it has been decrypted, it contains a symmetric-key algorithm. When it has been decrypted, it contains
other packets (usually a literal data packet or compressed data other packets (usually a literal data packet or compressed data
packet, but in theory other Symmetrically Encrypted Data packets or packet, but in theory other Symmetrically Encrypted Data packets or
sequences of packets that form whole OpenPGP messages). sequences of packets that form whole OpenPGP messages).
This packet is obsolete. An implementation MUST NOT create this
packet. An implementation MAY process such a packet but it MUST
return a clear diagnostic that a non-integrity protected packet has
been processed. The implementation SHOULD also return an error in
this case and stop processing.
The body of this packet consists of: The body of this packet consists of:
* Encrypted data, the output of the selected symmetric-key cipher * Encrypted data, the output of the selected symmetric-key cipher
operating in OpenPGP's variant of Cipher Feedback (CFB) mode. operating in OpenPGP's variant of Cipher Feedback (CFB) mode.
The symmetric cipher used may be specified in a Public-Key or The symmetric cipher used may be specified in a Public-Key or
Symmetric-Key Encrypted Session Key packet that precedes the Symmetric-Key Encrypted Session Key packet that precedes the
Symmetrically Encrypted Data packet. In that case, the cipher Symmetrically Encrypted Data packet. In that case, the cipher
algorithm octet is prefixed to the session key before it is algorithm octet is prefixed to the session key before it is
encrypted. If no packets of these types precede the encrypted data, encrypted. If no packets of these types precede the encrypted data,
skipping to change at page 48, line 44 skipping to change at page 54, line 42
octet 8. In a cipher of length 16, octet 17 is a repeat of octet 15 octet 8. In a cipher of length 16, octet 17 is a repeat of octet 15
and octet 18 is a repeat of octet 16. As a pedantic clarification, and octet 18 is a repeat of octet 16. As a pedantic clarification,
in both these examples, we consider the first octet to be numbered 1. in both these examples, we consider the first octet to be numbered 1.
After encrypting the first block-size-plus-two octets, the CFB state After encrypting the first block-size-plus-two octets, the CFB state
is resynchronized. The last block-size octets of ciphertext are is resynchronized. The last block-size octets of ciphertext are
passed through the cipher and the block boundary is reset. passed through the cipher and the block boundary is reset.
The repetition of 16 bits in the random data prefixed to the message The repetition of 16 bits in the random data prefixed to the message
allows the receiver to immediately check whether the session key is allows the receiver to immediately check whether the session key is
incorrect. See Section 14 for hints on the proper use of this "quick incorrect. See Section 15 for hints on the proper use of this "quick
check". check".
5.8. Marker Packet (Obsolete Literal Packet) (Tag 10) 5.9. Marker Packet (Obsolete Literal Packet) (Tag 10)
An experimental version of PGP used this packet as the Literal An experimental version of PGP used this packet as the Literal
packet, but no released version of PGP generated Literal packets with packet, but no released version of PGP generated Literal packets with
this tag. With PGP 5, this packet has been reassigned and is this tag. With PGP 5, this packet has been reassigned and is
reserved for use as the Marker packet. reserved for use as the Marker packet.
The body of this packet consists of: The body of this packet consists of:
* The three octets 0x50, 0x47, 0x50 (which spell "PGP" in UTF-8). * The three octets 0x50, 0x47, 0x50 (which spell "PGP" in UTF-8).
Such a packet MUST be ignored when received. It may be placed at the Such a packet MUST be ignored when received. It may be placed at the
beginning of a message that uses features not available in PGP beginning of a message that uses features not available in PGP
version 2.6 in order to cause that version to report that newer version 2.6 in order to cause that version to report that newer
software is necessary to process the message. software is necessary to process the message.
5.9. Literal Data Packet (Tag 11) 5.10. Literal Data Packet (Tag 11)
A Literal Data packet contains the body of a message; data that is A Literal Data packet contains the body of a message; data that is
not to be further interpreted. not to be further interpreted.
The body of this packet consists of: The body of this packet consists of:
* A one-octet field that describes how the data is formatted. * A one-octet field that describes how the data is formatted.
If it is a "b" (0x62), then the Literal packet contains binary If it is a "b" (0x62), then the Literal packet contains binary
data. If it is a "t" (0x74), then it contains text data, and thus data. If it is a "t" (0x74), then it contains text data, and thus
skipping to change at page 50, line 9 skipping to change at page 56, line 9
literal data. Commonly, the date might be the modification date literal data. Commonly, the date might be the modification date
of a file, or the time the packet was created, or a zero that of a file, or the time the packet was created, or a zero that
indicates no specific time. indicates no specific time.
* The remainder of the packet is literal data. * The remainder of the packet is literal data.
Text data is stored with <CR><LF> text endings (i.e., network- Text data is stored with <CR><LF> text endings (i.e., network-
normal line endings). These should be converted to native line normal line endings). These should be converted to native line
endings by the receiving software. endings by the receiving software.
5.10. Trust Packet (Tag 12) 5.11. Trust Packet (Tag 12)
The Trust packet is used only within keyrings and is not normally The Trust packet is used only within keyrings and is not normally
exported. Trust packets contain data that record the user's exported. Trust packets contain data that record the user's
specifications of which key holders are trustworthy introducers, specifications of which key holders are trustworthy introducers,
along with other information that implementing software uses for along with other information that implementing software uses for
trust information. The format of Trust packets is defined by a given trust information. The format of Trust packets is defined by a given
implementation. implementation.
Trust packets SHOULD NOT be emitted to output streams that are Trust packets SHOULD NOT be emitted to output streams that are
transferred to other users, and they SHOULD be ignored on any input transferred to other users, and they SHOULD be ignored on any input
other than local keyring files. other than local keyring files.
5.11. User ID Packet (Tag 13) 5.12. User ID Packet (Tag 13)
A User ID packet consists of UTF-8 text that is intended to represent A User ID packet consists of UTF-8 text that is intended to represent
the name and email address of the key holder. By convention, it the name and email address of the key holder. By convention, it
includes an [RFC2822] mail name-addr, but there are no restrictions includes an [RFC2822] mail name-addr, but there are no restrictions
on its content. The packet length in the header specifies the length on its content. The packet length in the header specifies the length
of the User ID. of the User ID.
5.12. User Attribute Packet (Tag 17) 5.13. User Attribute Packet (Tag 17)
The User Attribute packet is a variation of the User ID packet. It The User Attribute packet is a variation of the User ID packet. It
is capable of storing more types of data than the User ID packet, is capable of storing more types of data than the User ID packet,
which is limited to text. Like the User ID packet, a User Attribute which is limited to text. Like the User ID packet, a User Attribute
packet may be certified by the key owner ("self-signed") or any other packet may be certified by the key owner ("self-signed") or any other
key owner who cares to certify it. Except as noted, a User Attribute key owner who cares to certify it. Except as noted, a User Attribute
packet may be used anywhere that a User ID packet may be used. packet may be used anywhere that a User ID packet may be used.
While User Attribute packets are not a required part of the OpenPGP While User Attribute packets are not a required part of the OpenPGP
standard, implementations SHOULD provide at least enough standard, implementations SHOULD provide at least enough
skipping to change at page 51, line 6 skipping to change at page 57, line 6
The User Attribute packet is made up of one or more attribute The User Attribute packet is made up of one or more attribute
subpackets. Each subpacket consists of a subpacket header and a subpackets. Each subpacket consists of a subpacket header and a
body. The header consists of: body. The header consists of:
* the subpacket length (1, 2, or 5 octets) * the subpacket length (1, 2, or 5 octets)
* the subpacket type (1 octet) * the subpacket type (1 octet)
and is followed by the subpacket specific data. and is followed by the subpacket specific data.
The only currently defined subpacket type is 1, signifying an image. The following table lists the currently known subpackets:
+=========+===========================+
| Type | Attribute Subpacket |
+=========+===========================+
| 1 | Image Attribute Subpacket |
+---------+---------------------------+
| 100-110 | Private/Experimental Use |
+---------+---------------------------+
Table 13: User Attribute type registry
An implementation SHOULD ignore any subpacket of a type that it does An implementation SHOULD ignore any subpacket of a type that it does
not recognize. Subpacket types 100 through 110 are reserved for not recognize.
private or experimental use.
5.12.1. The Image Attribute Subpacket 5.13.1. The Image Attribute Subpacket
The Image Attribute subpacket is used to encode an image, presumably The Image Attribute subpacket is used to encode an image, presumably
(but not required to be) that of the key owner. (but not required to be) that of the key owner.
The Image Attribute subpacket begins with an image header. The first The Image Attribute subpacket begins with an image header. The first
two octets of the image header contain the length of the image two octets of the image header contain the length of the image
header. Note that unlike other multi-octet numerical values in this header. Note that unlike other multi-octet numerical values in this
document, due to a historical accident this value is encoded as a document, due to a historical accident this value is encoded as a
little-endian number. The image header length is followed by a little-endian number. The image header length is followed by a
single octet for the image header version. The only currently single octet for the image header version. The only currently
skipping to change at page 51, line 43 skipping to change at page 58, line 5
The rest of the image subpacket contains the image itself. As the The rest of the image subpacket contains the image itself. As the
only currently defined image type is JPEG, the image is encoded in only currently defined image type is JPEG, the image is encoded in
the JPEG File Interchange Format (JFIF), a standard file format for the JPEG File Interchange Format (JFIF), a standard file format for
JPEG images [JFIF]. JPEG images [JFIF].
An implementation MAY try to determine the type of an image by An implementation MAY try to determine the type of an image by
examination of the image data if it is unable to handle a particular examination of the image data if it is unable to handle a particular
version of the image header or if a specified encoding format value version of the image header or if a specified encoding format value
is not recognized. is not recognized.
5.13. Sym. Encrypted Integrity Protected Data Packet (Tag 18) 5.14. Sym. Encrypted Integrity Protected Data Packet (Tag 18)
The Symmetrically Encrypted Integrity Protected Data packet is a The Symmetrically Encrypted Integrity Protected Data packet is a
variant of the Symmetrically Encrypted Data packet. It is a new variant of the Symmetrically Encrypted Data packet. It is a new
feature created for OpenPGP that addresses the problem of detecting a feature created for OpenPGP that addresses the problem of detecting a
modification to encrypted data. It is used in combination with a modification to encrypted data. It is used in combination with a
Modification Detection Code packet. Modification Detection Code packet.
There is a corresponding feature in the features Signature subpacket There is a corresponding feature in the features Signature subpacket
that denotes that an implementation can properly use this packet that denotes that an implementation can properly use this packet
type. An implementation MUST support decrypting these packets and type. An implementation MUST support decrypting these packets and
skipping to change at page 53, line 8 skipping to change at page 59, line 17
zeros. Instead of using an IV, OpenPGP prefixes an octet string to zeros. Instead of using an IV, OpenPGP prefixes an octet string to
the data before it is encrypted. The length of the octet string the data before it is encrypted. The length of the octet string
equals the block size of the cipher in octets, plus two. The first equals the block size of the cipher in octets, plus two. The first
octets in the group, of length equal to the block size of the cipher, octets in the group, of length equal to the block size of the cipher,
are random; the last two octets are each copies of their 2nd are random; the last two octets are each copies of their 2nd
preceding octet. For example, with a cipher whose block size is 128 preceding octet. For example, with a cipher whose block size is 128
bits or 16 octets, the prefix data will contain 16 random octets, bits or 16 octets, the prefix data will contain 16 random octets,
then two more octets, which are copies of the 15th and 16th octets, then two more octets, which are copies of the 15th and 16th octets,
respectively. Unlike the Symmetrically Encrypted Data Packet, no respectively. Unlike the Symmetrically Encrypted Data Packet, no
special CFB resynchronization is done after encrypting this prefix special CFB resynchronization is done after encrypting this prefix
data. See Section 13.9 for more details. data. See Section 14.9 for more details.
The repetition of 16 bits in the random data prefixed to the message The repetition of 16 bits in the random data prefixed to the message
allows the receiver to immediately check whether the session key is allows the receiver to immediately check whether the session key is
incorrect. incorrect.
The plaintext of the data to be encrypted is passed through the SHA-1 The plaintext of the data to be encrypted is passed through the SHA-1
hash function, and the result of the hash is appended to the hash function, and the result of the hash is appended to the
plaintext in a Modification Detection Code packet. The input to the plaintext in a Modification Detection Code packet. The input to the
hash function includes the prefix data described above; it includes hash function includes the prefix data described above; it includes
all of the plaintext, and then also includes two octets of values all of the plaintext, and then also includes two octets of values
skipping to change at page 54, line 52 skipping to change at page 61, line 15
are no parameters in the MDC system. It hard-defines SHA-1 as its are no parameters in the MDC system. It hard-defines SHA-1 as its
hash function. This is not an accident. It is an intentional hash function. This is not an accident. It is an intentional
choice to avoid downgrade and cross-grade attacks while making a choice to avoid downgrade and cross-grade attacks while making a
simple, fast system. (A downgrade attack would be an attack that simple, fast system. (A downgrade attack would be an attack that
replaced SHA2-256 with SHA-1, for example. A cross-grade attack replaced SHA2-256 with SHA-1, for example. A cross-grade attack
would replace SHA-1 with another 160-bit hash, such as RIPE- would replace SHA-1 with another 160-bit hash, such as RIPE-
MD/160, for example.) MD/160, for example.)
However, given the present state of hash function cryptanalysis However, given the present state of hash function cryptanalysis
and cryptography, it may be desirable to upgrade the MDC system to and cryptography, it may be desirable to upgrade the MDC system to
a new hash function. See Section 13.11 for guidance. a new hash function. See Section 14.11 for guidance.
5.14. Modification Detection Code Packet (Tag 19) 5.15. Modification Detection Code Packet (Tag 19)
The Modification Detection Code packet contains a SHA-1 hash of The Modification Detection Code packet contains a SHA-1 hash of
plaintext data, which is used to detect message modification. It is plaintext data, which is used to detect message modification. It is
only used with a Symmetrically Encrypted Integrity Protected Data only used with a Symmetrically Encrypted Integrity Protected Data
packet. The Modification Detection Code packet MUST be the last packet. The Modification Detection Code packet MUST be the last
packet in the plaintext data that is encrypted in the Symmetrically packet in the plaintext data that is encrypted in the Symmetrically
Encrypted Integrity Protected Data packet, and MUST appear in no Encrypted Integrity Protected Data packet, and MUST appear in no
other place. other place.
A Modification Detection Code packet MUST have a length of 20 octets. A Modification Detection Code packet MUST have a length of 20 octets.
skipping to change at page 57, line 4 skipping to change at page 63, line 16
When OpenPGP encodes data into ASCII Armor, it puts specific headers When OpenPGP encodes data into ASCII Armor, it puts specific headers
around the Radix-64 encoded data, so OpenPGP can reconstruct the data around the Radix-64 encoded data, so OpenPGP can reconstruct the data
later. An OpenPGP implementation MAY use ASCII armor to protect raw later. An OpenPGP implementation MAY use ASCII armor to protect raw
binary data. OpenPGP informs the user what kind of data is encoded binary data. OpenPGP informs the user what kind of data is encoded
in the ASCII armor through the use of the headers. in the ASCII armor through the use of the headers.
Concatenating the following data creates ASCII Armor: Concatenating the following data creates ASCII Armor:
* An Armor Header Line, appropriate for the type of data * An Armor Header Line, appropriate for the type of data
* Armor Headers * Armor Headers
* A blank line * A blank (zero-length, or containing only whitespace) line
* The ASCII-Armored data * The ASCII-Armored data
* An Armor Checksum * An Armor Checksum
* The Armor Tail, which depends on the Armor Header Line * The Armor Tail, which depends on the Armor Header Line
An Armor Header Line consists of the appropriate header line text An Armor Header Line consists of the appropriate header line text
surrounded by five (5) dashes ("-", 0x2D) on either side of the surrounded by five (5) dashes ("-", 0x2D) on either side of the
header line text. The header line text is chosen based upon the type header line text. The header line text is chosen based upon the type
skipping to change at page 58, line 9 skipping to change at page 64, line 14
BEGIN PGP SIGNATURE BEGIN PGP SIGNATURE
Used for detached signatures, OpenPGP/MIME signatures, and Used for detached signatures, OpenPGP/MIME signatures, and
cleartext signatures. Note that PGP 2 uses BEGIN PGP MESSAGE for cleartext signatures. Note that PGP 2 uses BEGIN PGP MESSAGE for
detached signatures. detached signatures.
Note that all these Armor Header Lines are to consist of a complete Note that all these Armor Header Lines are to consist of a complete
line. That is to say, there is always a line ending preceding the line. That is to say, there is always a line ending preceding the
starting five dashes, and following the ending five dashes. The starting five dashes, and following the ending five dashes. The
header lines, therefore, MUST start at the beginning of a line, and header lines, therefore, MUST start at the beginning of a line, and
MUST NOT have text other than whitespace -- space (0x20), tab (0x09) MUST NOT have text other than whitespace following them on the same
or carriage return (0x0d) -- following them on the same line. These line. These line endings are considered a part of the Armor Header
line endings are considered a part of the Armor Header Line for the Line for the purposes of determining the content they delimit. This
purposes of determining the content they delimit. This is is particularly important when computing a cleartext signature (see
particularly important when computing a cleartext signature (see
below). below).
The Armor Headers are pairs of strings that can give the user or the The Armor Headers are pairs of strings that can give the user or the
receiving OpenPGP implementation some information about how to decode receiving OpenPGP implementation some information about how to decode
or use the message. The Armor Headers are a part of the armor, not a or use the message. The Armor Headers are a part of the armor, not a
part of the message, and hence are not protected by any signatures part of the message, and hence are not protected by any signatures
applied to the message. applied to the message.
The format of an Armor Header is that of a key-value pair. A colon The format of an Armor Header is that of a key-value pair. A colon
(":" 0x38) and a single space (0x20) separate the key and value. (":" 0x38) and a single space (0x20) separate the key and value.
skipping to change at page 59, line 28 skipping to change at page 65, line 35
implementation will get best results by translating into and out implementation will get best results by translating into and out
of UTF-8. However, there are many instances where this is easier of UTF-8. However, there are many instances where this is easier
said than done. Also, there are communities of users who have no said than done. Also, there are communities of users who have no
need for UTF-8 because they are all happy with a character set need for UTF-8 because they are all happy with a character set
like ISO Latin-5 or a Japanese character set. In such instances, like ISO Latin-5 or a Japanese character set. In such instances,
an implementation MAY override the UTF-8 default by using this an implementation MAY override the UTF-8 default by using this
header key. An implementation MAY implement this key and any header key. An implementation MAY implement this key and any
translations it cares to; an implementation MAY ignore it and translations it cares to; an implementation MAY ignore it and
assume all text is UTF-8. assume all text is UTF-8.
The blank line can either be zero-length or contain only whitespace,
that is spaces (0x20), tabs (0x09) or carriage returns (0x0d).
The Armor Tail Line is composed in the same manner as the Armor The Armor Tail Line is composed in the same manner as the Armor
Header Line, except the string "BEGIN" is replaced by the string Header Line, except the string "BEGIN" is replaced by the string
"END". "END".
6.3. Encoding Binary in Radix-64 6.3. Encoding Binary in Radix-64
The encoding process represents 24-bit groups of input bits as output The encoding process represents 24-bit groups of input bits as output
strings of 4 encoded characters. Proceeding from left to right, a strings of 4 encoded characters. Proceeding from left to right, a
24-bit input group is formed by concatenating three 8-bit input 24-bit input group is formed by concatenating three 8-bit input
groups. These 24 bits are then treated as four concatenated 6-bit groups. These 24 bits are then treated as four concatenated 6-bit
skipping to change at page 60, line 46 skipping to change at page 67, line 43
+-----+--------++-----+---------++-----+----------++-----+----------+ +-----+--------++-----+---------++-----+----------++-----+----------+
| 13|N || 30|e || 47| v || | | | 13|N || 30|e || 47| v || | |
+-----+--------++-----+---------++-----+----------++-----+----------+ +-----+--------++-----+---------++-----+----------++-----+----------+
| 14|O || 31|f || 48| w ||(pad)| = | | 14|O || 31|f || 48| w ||(pad)| = |
+-----+--------++-----+---------++-----+----------++-----+----------+ +-----+--------++-----+---------++-----+----------++-----+----------+
| 15|P || 32|g || 49| x || | | | 15|P || 32|g || 49| x || | |
+-----+--------++-----+---------++-----+----------++-----+----------+ +-----+--------++-----+---------++-----+----------++-----+----------+
| 16|Q || 33|h || 50| y || | | | 16|Q || 33|h || 50| y || | |
+-----+--------++-----+---------++-----+----------++-----+----------+ +-----+--------++-----+---------++-----+----------++-----+----------+
Table 12: Encoding for Radix-64 Table 14: Encoding for Radix-64
The encoded output stream must be represented in lines of no more The encoded output stream must be represented in lines of no more
than 76 characters each. than 76 characters each.
Special processing is performed if fewer than 24 bits are available Special processing is performed if fewer than 24 bits are available
at the end of the data being encoded. There are three possibilities: at the end of the data being encoded. There are three possibilities:
1. The last data group has 24 bits (3 octets). No special 1. The last data group has 24 bits (3 octets). No special
processing is needed. processing is needed.
skipping to change at page 62, line 45 skipping to change at page 69, line 45
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
Note that this example has extra indenting; an actual armored message Note that this example has extra indenting; an actual armored message
would have no leading whitespace. would have no leading whitespace.
7. Cleartext Signature Framework 7. Cleartext Signature Framework
It is desirable to be able to sign a textual octet stream without It is desirable to be able to sign a textual octet stream without
ASCII armoring the stream itself, so the signed text is still ASCII armoring the stream itself, so the signed text is still
readable without special software. In order to bind a signature to readable without special software. In order to bind a signature to
such a cleartext, this framework is used. (Note that this framework such a cleartext, this framework is used, which follows the same
is not intended to be reversible. [RFC3156] defines another way to basic format and restrictions as the ASCII armoring described in
sign cleartext messages for environments that support MIME.) Section 6.2. (Note that this framework is not intended to be
reversible. [RFC3156] defines another way to sign cleartext messages
for environments that support MIME.)
The cleartext signed message consists of: The cleartext signed message consists of:
* The cleartext header "-----BEGIN PGP SIGNED MESSAGE-----" on a * The cleartext header "-----BEGIN PGP SIGNED MESSAGE-----" on a
single line, single line,
* One or more "Hash" Armor Headers, * One or more "Hash" Armor Headers,
* Exactly one blank line not included into the message digest, * Exactly one empty line not included into the message digest,
* The dash-escaped cleartext that is included into the message * The dash-escaped cleartext that is included into the message
digest, digest,
* The ASCII armored signature(s) including the "-----BEGIN PGP * The ASCII armored signature(s) including the "-----BEGIN PGP
SIGNATURE-----" Armor Header and Armor Tail Lines. SIGNATURE-----" Armor Header and Armor Tail Lines.
If the "Hash" Armor Header is given, the specified message digest If the "Hash" Armor Header is given, the specified message digest
algorithm(s) are used for the signature. If there are no such algorithm(s) are used for the signature. If there are no such
headers, MD5 is used. If MD5 is the only hash used, then an headers, MD5 is used. If MD5 is the only hash used, then an
skipping to change at page 64, line 9 skipping to change at page 71, line 9
As with binary signatures on text documents, a cleartext signature is As with binary signatures on text documents, a cleartext signature is
calculated on the text using canonical <CR><LF> line endings. The calculated on the text using canonical <CR><LF> line endings. The
line ending (i.e., the <CR><LF>) before the "-----BEGIN PGP line ending (i.e., the <CR><LF>) before the "-----BEGIN PGP
SIGNATURE-----" line that terminates the signed text is not SIGNATURE-----" line that terminates the signed text is not
considered part of the signed text. considered part of the signed text.
When reversing dash-escaping, an implementation MUST strip the string When reversing dash-escaping, an implementation MUST strip the string
"-" if it occurs at the beginning of a line, and SHOULD warn on "-" "-" if it occurs at the beginning of a line, and SHOULD warn on "-"
and any character other than a space at the beginning of a line. and any character other than a space at the beginning of a line.
Also, any trailing whitespace -- spaces (0x20), tabs (0x09) or Also, any trailing whitespace -- spaces (0x20) and tabs (0x09) -- at
carriage returns (0x0d) -- at the end of any line is removed when the the end of any line is removed when the cleartext signature is
cleartext signature is generated and verified. generated.
8. Regular Expressions 8. Regular Expressions
A regular expression is zero or more branches, separated by "|". It A regular expression is zero or more branches, separated by "|". It
matches anything that matches one of the branches. matches anything that matches one of the branches.
A branch is zero or more pieces, concatenated. It matches a match A branch is zero or more pieces, concatenated. It matches a match
for the first, followed by a match for the second, etc. for the first, followed by a match for the second, etc.
A piece is an atom possibly followed by "*", "+", or "?". An atom A piece is an atom possibly followed by "*", "+", or "?". An atom
skipping to change at page 65, line 5 skipping to change at page 72, line 5
9. Constants 9. Constants
This section describes the constants used in OpenPGP. This section describes the constants used in OpenPGP.
Note that these tables are not exhaustive lists; an implementation Note that these tables are not exhaustive lists; an implementation
MAY implement an algorithm not on these lists, so long as the MAY implement an algorithm not on these lists, so long as the
algorithm numbers are chosen from the private or experimental algorithm numbers are chosen from the private or experimental
algorithm range. algorithm range.
See Section 13 for more discussion of the algorithms. See Section 14 for more discussion of the algorithms.
9.1. Public-Key Algorithms 9.1. Public-Key Algorithms
+========+===================================================+ +========+===================================================+
| ID | Algorithm | | ID | Algorithm |
+========+===================================================+ +========+===================================================+
| 1 | RSA (Encrypt or Sign) [HAC] | | 1 | RSA (Encrypt or Sign) [HAC] |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 2 | RSA Encrypt-Only [HAC] | | 2 | RSA Encrypt-Only [HAC] |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 3 | RSA Sign-Only [HAC] | | 3 | RSA Sign-Only [HAC] |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 16 | Elgamal (Encrypt-Only) [ELGAMAL] [HAC] | | 16 | Elgamal (Encrypt-Only) [ELGAMAL] [HAC] |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 17 | DSA (Digital Signature Algorithm) [FIPS186] [HAC] | | 17 | DSA (Digital Signature Algorithm) [FIPS186] [HAC] |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 18 | Reserved for Elliptic Curve | | 18 | ECDH public key algorithm |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 19 | Reserved for ECDSA | | 19 | ECDSA public key algorithm [FIPS186] |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 20 | Reserved (formerly Elgamal Encrypt or Sign) | | 20 | Reserved (formerly Elgamal Encrypt or Sign) |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 21 | Reserved for Diffie-Hellman (X9.42, as defined | | 21 | Reserved for Diffie-Hellman (X9.42, as defined |
| | for IETF-S/MIME) | | | for IETF-S/MIME) |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
| 22 | Reserved (EdDSA) |
+--------+---------------------------------------------------+
| 23 | Reserved (AEDH) |
+--------+---------------------------------------------------+
| 24 | Reserved (AEDSA) |
+--------+---------------------------------------------------+
| 100 to | Private/Experimental algorithm | | 100 to | Private/Experimental algorithm |
| 110 | | | 110 | |
+--------+---------------------------------------------------+ +--------+---------------------------------------------------+
Table 13: Public-key algorithm registry Table 15: Public-key algorithm registry
Implementations MUST implement DSA for signatures, and Elgamal for Implementations MUST implement DSA for signatures, and Elgamal for
encryption. Implementations SHOULD implement RSA keys (1). RSA encryption. Implementations SHOULD implement RSA keys (1). RSA
Encrypt-Only (2) and RSA Sign-Only (3) are deprecated and SHOULD NOT Encrypt-Only (2) and RSA Sign-Only (3) are deprecated and SHOULD NOT
be generated, but may be interpreted. See Section 13.5. See be generated, but may be interpreted. See Section 14.5. See
Section 13.8 for notes on Elliptic Curve (18), ECDSA (19), Elgamal Section 14.8 for notes on Elgamal Encrypt or Sign (20), and X9.42
Encrypt or Sign (20), and X9.42 (21). Implementations MAY implement (21). Implementations MAY implement any other algorithm.
any other algorithm.
9.2. Symmetric-Key Algorithms A compatible specification of ECDSA is given in [RFC6090] as "KT-I
Signatures" and in [SEC1]; ECDH is defined in Section 13.4 this
document.
9.2. ECC Curve OID
The parameter curve OID is an array of octets that define a named
curve. The table below specifies the exact sequence of bytes for
each named curve referenced in this document:
+========================+=====+=================+============+
| ASN.1 Object | OID | Curve OID bytes | Curve name |
| Identifier | len | in hexadecimal | |
| | | representation | |
+========================+=====+=================+============+
| 1.2.840.10045.3.1.7 | 8 | 2A 86 48 CE 3D | NIST P-256 |
| | | 03 01 07 | |
+------------------------+-----+-----------------+------------+
| 1.3.132.0.34 | 5 | 2B 81 04 00 22 | NIST P-384 |
+------------------------+-----+-----------------+------------+
| 1.3.132.0.35 | 5 | 2B 81 04 00 23 | NIST P-521 |
+------------------------+-----+-----------------+------------+
| 1.3.6.1.4.1.3029.1.5.1 | 10 | 2B 06 01 04 01 | Curve25519 |
| | | 97 55 01 05 01 | |
+------------------------+-----+-----------------+------------+
Table 16: ECC Curve OID registry
The sequence of octets in the third column is the result of applying
the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier
with subsequent truncation. The truncation removes the two fields of
encoded Object Identifier. The first omitted field is one octet
representing the Object Identifier tag, and the second omitted field
is the length of the Object Identifier body. For example, the
complete ASN.1 DER encoding for the NIST P-256 curve OID is "06 08 2A
86 48 CE 3D 03 01 07", from which the first entry in the table above
is constructed by omitting the first two octets. Only the truncated
sequence of octets is the valid representation of a curve OID.
9.3. Symmetric-Key Algorithms
+========+=======================================+ +========+=======================================+
| ID | Algorithm | | ID | Algorithm |
+========+=======================================+ +========+=======================================+
| 0 | Plaintext or unencrypted data | | 0 | Plaintext or unencrypted data |
+--------+---------------------------------------+ +--------+---------------------------------------+
| 1 | IDEA [IDEA] | | 1 | IDEA [IDEA] |
+--------+---------------------------------------+ +--------+---------------------------------------+
| 2 | TripleDES (DES-EDE, [SCHNEIER], [HAC] | | 2 | TripleDES (DES-EDE, [SCHNEIER], [HAC] |
| | - 168 bit key derived from 192) | | | - 168 bit key derived from 192) |
skipping to change at page 66, line 35 skipping to change at page 74, line 30
| 11 | Camellia with 128-bit key [RFC3713] | | 11 | Camellia with 128-bit key [RFC3713] |
+--------+---------------------------------------+ +--------+---------------------------------------+
| 12 | Camellia with 192-bit key | | 12 | Camellia with 192-bit key |
+--------+---------------------------------------+ +--------+---------------------------------------+
| 13 | Camellia with 256-bit key | | 13 | Camellia with 256-bit key |
+--------+---------------------------------------+ +--------+---------------------------------------+
| 100 to | Private/Experimental algorithm | | 100 to | Private/Experimental algorithm |
| 110 | | | 110 | |
+--------+---------------------------------------+ +--------+---------------------------------------+
Table 14: Symmetric-key algorithm registry Table 17: Symmetric-key algorithm registry
Implementations MUST implement TripleDES. Implementations SHOULD Implementations MUST implement TripleDES. Implementations SHOULD
implement AES-128 and CAST5. Implementations that interoperate with implement AES-128 and CAST5. Implementations that interoperate with
PGP 2.6 or earlier need to support IDEA, as that is the only PGP 2.6 or earlier need to support IDEA, as that is the only
symmetric cipher those versions use. Implementations MAY implement symmetric cipher those versions use. Implementations MAY implement
any other algorithm. any other algorithm.
9.3. Compression Algorithms 9.4. Compression Algorithms
+============+================================+ +============+================================+
| ID | Algorithm | | ID | Algorithm |
+============+================================+ +============+================================+
| 0 | Uncompressed | | 0 | Uncompressed |
+------------+--------------------------------+ +------------+--------------------------------+
| 1 | ZIP [RFC1951] | | 1 | ZIP [RFC1951] |
+------------+--------------------------------+ +------------+--------------------------------+
| 2 | ZLIB [RFC1950] | | 2 | ZLIB [RFC1950] |
+------------+--------------------------------+ +------------+--------------------------------+
| 3 | BZip2 [BZ2] | | 3 | BZip2 [BZ2] |
+------------+--------------------------------+ +------------+--------------------------------+
| 100 to 110 | Private/Experimental algorithm | | 100 to 110 | Private/Experimental algorithm |
+------------+--------------------------------+ +------------+--------------------------------+
Table 15: Compression algorithm registry Table 18: Compression algorithm registry
Implementations MUST implement uncompressed data. Implementations Implementations MUST implement uncompressed data. Implementations
SHOULD implement ZIP. Implementations MAY implement any other SHOULD implement ZIP. Implementations MAY implement any other
algorithm. algorithm.
9.4. Hash Algorithms 9.5. Hash Algorithms
+============+================================+=============+ +============+================================+=============+
| ID | Algorithm | Text Name | | ID | Algorithm | Text Name |
+============+================================+=============+ +============+================================+=============+
| 1 | MD5 [HAC] | "MD5" | | 1 | MD5 [HAC] | "MD5" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 2 | SHA-1 [FIPS180] | "SHA1" | | 2 | SHA-1 [FIPS180] | "SHA1" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 3 | RIPE-MD/160 [HAC] | "RIPEMD160" | | 3 | RIPE-MD/160 [HAC] | "RIPEMD160" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
skipping to change at page 67, line 44 skipping to change at page 75, line 39
| 7 | Reserved | | | 7 | Reserved | |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 8 | SHA2-256 [FIPS180] | "SHA256" | | 8 | SHA2-256 [FIPS180] | "SHA256" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 9 | SHA2-384 [FIPS180] | "SHA384" | | 9 | SHA2-384 [FIPS180] | "SHA384" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 10 | SHA2-512 [FIPS180] | "SHA512" | | 10 | SHA2-512 [FIPS180] | "SHA512" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 11 | SHA2-224 [FIPS180] | "SHA224" | | 11 | SHA2-224 [FIPS180] | "SHA224" |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
| 12 | SHA3-256 [FIPS202] | "SHA3-256" |
+------------+--------------------------------+-------------+
| 13 | Reserved | |
+------------+--------------------------------+-------------+
| 14 | SHA3-512 [FIPS202] | "SHA3-512" |
+------------+--------------------------------+-------------+
| 100 to 110 | Private/Experimental algorithm | | | 100 to 110 | Private/Experimental algorithm | |
+------------+--------------------------------+-------------+ +------------+--------------------------------+-------------+
Table 16: Hash algorithm registry Table 19: Hash algorithm registry
Implementations MUST implement SHA-1. Implementations MAY implement Implementations MUST implement SHA-1. Implementations MAY implement
other algorithms. MD5 is deprecated. other algorithms. MD5 is deprecated.
10. IANA Considerations 10. IANA Considerations
OpenPGP is highly parameterized, and consequently there are a number OpenPGP is highly parameterized, and consequently there are a number
of considerations for allocating parameters for extensions. This of considerations for allocating parameters for extensions. This
section describes how IANA should look at extensions to the protocol section describes how IANA should look at extensions to the protocol
as described in this document. as described in this document.
10.1. New String-to-Key Specifier Types 10.1. New String-to-Key Specifier Types
OpenPGP S2K specifiers contain a mechanism for new algorithms to turn OpenPGP S2K specifiers contain a mechanism for new algorithms to turn
a string into a key. This specification creates a registry of S2K a string into a key. This specification creates a registry of S2K
specifier types. The registry includes the S2K type, the name of the specifier types. The registry includes the S2K type, the name of the
S2K, and a reference to the defining specification. The initial S2K, and a reference to the defining specification. The initial
values for this registry can be found in Section 3.7.1. Adding a new values for this registry can be found in Section 3.7.1. Adding a new
S2K specifier MUST be done through the IETF CONSENSUS method, as S2K specifier MUST be done through the SPECIFICATION REQUIRED method,
described in [RFC2434]. as described in [RFC8126].
10.2. New Packets 10.2. New Packets
Major new features of OpenPGP are defined through new packet types. Major new features of OpenPGP are defined through new packet types.
This specification creates a registry of packet types. The registry This specification creates a registry of packet types. The registry
includes the packet type, the name of the packet, and a reference to includes the packet type, the name of the packet, and a reference to
the defining specification. The initial values for this registry can the defining specification. The initial values for this registry can
be found in Section 4.3. Adding a new packet type MUST be done be found in Section 4.3. Adding a new packet type MUST be done
through the IETF CONSENSUS method, as described in [RFC2434]. through the RFC REQUIRED method, as described in [RFC8126].
10.2.1. User Attribute Types 10.2.1. User Attribute Types
The User Attribute packet permits an extensible mechanism for other The User Attribute packet permits an extensible mechanism for other
types of certificate identification. This specification creates a types of certificate identification. This specification creates a
registry of User Attribute types. The registry includes the User registry of User Attribute types. The registry includes the User
Attribute type, the name of the User Attribute, and a reference to Attribute type, the name of the User Attribute, and a reference to
the defining specification. The initial values for this registry can the defining specification. The initial values for this registry can
be found in Section 5.12. Adding a new User Attribute type MUST be be found in Section 5.13. Adding a new User Attribute type MUST be
done through the IETF CONSENSUS method, as described in [RFC2434]. done through the SPECIFICATION REQUIRED method, as described in
[RFC8126].
10.2.1.1. Image Format Subpacket Types 10.2.1.1. Image Format Subpacket Types
Within User Attribute packets, there is an extensible mechanism for Within User Attribute packets, there is an extensible mechanism for
other types of image-based User Attributes. This specification other types of image-based User Attributes. This specification
creates a registry of Image Attribute subpacket types. The registry creates a registry of Image Attribute subpacket types. The registry
includes the Image Attribute subpacket type, the name of the Image includes the Image Attribute subpacket type, the name of the Image
Attribute subpacket, and a reference to the defining specification. Attribute subpacket, and a reference to the defining specification.
The initial values for this registry can be found in Section 5.12.1. The initial values for this registry can be found in Section 5.13.1.
Adding a new Image Attribute subpacket type MUST be done through the Adding a new Image Attribute subpacket type MUST be done through the
IETF CONSENSUS method, as described in [RFC2434]. SPECIFICATION REQUIRED method, as described in [RFC8126].
10.2.2. New Signature Subpackets 10.2.2. New Signature Subpackets
OpenPGP signatures contain a mechanism for signed (or unsigned) data OpenPGP signatures contain a mechanism for signed (or unsigned) data
to be added to them for a variety of purposes in the Signature to be added to them for a variety of purposes in the Signature
subpackets as discussed in Section 5.2.3.1. This specification subpackets as discussed in Section 5.2.3.1. This specification
creates a registry of Signature subpacket types. The registry creates a registry of Signature subpacket types. The registry
includes the Signature subpacket type, the name of the subpacket, and includes the Signature subpacket type, the name of the subpacket, and
a reference to the defining specification. The initial values for a reference to the defining specification. The initial values for
this registry can be found in Section 5.2.3.1. Adding a new this registry can be found in Section 5.2.3.1. Adding a new
Signature subpacket MUST be done through the IETF CONSENSUS method, Signature subpacket MUST be done through the SPECIFICATION REQUIRED
as described in [RFC2434]. method, as described in [RFC8126].
10.2.2.1. Signature Notation Data Subpackets 10.2.2.1. Signature Notation Data Subpackets
OpenPGP signatures further contain a mechanism for extensions in OpenPGP signatures further contain a mechanism for extensions in
signatures. These are the Notation Data subpackets, which contain a signatures. These are the Notation Data subpackets, which contain a
key/value pair. Notations contain a user space that is completely key/value pair. Notations contain a user space that is completely
unmanaged and an IETF space. unmanaged and an IETF space.
This specification creates a registry of Signature Notation Data This specification creates a registry of Signature Notation Data
types. The registry includes the Signature Notation Data type, the types. The registry includes the Signature Notation Data type, the
name of the Signature Notation Data, its allowed values, and a name of the Signature Notation Data, its allowed values, and a
reference to the defining specification. The initial values for this reference to the defining specification. The initial values for this
registry can be found in Section 5.2.3.16. Adding a new Signature registry can be found in Section 5.2.3.16. Adding a new Signature
Notation Data subpacket MUST be done through the EXPERT REVIEW Notation Data subpacket MUST be done through the SPECIFICATION
method, as described in [RFC2434]. REQUIRED method, as described in [RFC8126].
10.2.2.2. Key Server Preference Extensions 10.2.2.2. Signature Notation Data Subpacket Notation Flags
This specification creates a new registry of Signature Notation Data
Subpacket Notation Flags. The registry includes the columns "Flag",
"Description", "Security Recommended", "Interoperability
Recommended", and "Reference". Adding a new item MUST be done
through the SPECIFICATION REQUIRED method, as described in [RFC8126].
10.2.2.3. Key Server Preference Extensions
OpenPGP signatures contain a mechanism for preferences to be OpenPGP signatures contain a mechanism for preferences to be
specified about key servers. This specification creates a registry specified about key servers. This specification creates a registry
of key server preferences. The registry includes the key server of key server preferences. The registry includes the key server
preference, the name of the preference, and a reference to the preference, the name of the preference, and a reference to the
defining specification. The initial values for this registry can be defining specification. The initial values for this registry can be
found in Section 5.2.3.17. Adding a new key server preference MUST found in Section 5.2.3.17. Adding a new key server preference MUST
be done through the IETF CONSENSUS method, as described in [RFC2434]. be done through the SPECIFICATION REQUIRED method, as described in
[RFC8126].
10.2.2.3. Key Flags Extensions 10.2.2.4. Key Flags Extensions
OpenPGP signatures contain a mechanism for flags to be specified OpenPGP signatures contain a mechanism for flags to be specified
about key usage. This specification creates a registry of key usage about key usage. This specification creates a registry of key usage
flags. The registry includes the key flags value, the name of the flags. The registry includes the key flags value, the name of the
flag, and a reference to the defining specification. The initial flag, and a reference to the defining specification. The initial
values for this registry can be found in Section 5.2.3.21. Adding a values for this registry can be found in Section 5.2.3.21. Adding a
new key usage flag MUST be done through the IETF CONSENSUS method, as new key usage flag MUST be done through the SPECIFICATION REQUIRED
described in [RFC2434]. method, as described in [RFC8126].
10.2.2.4. Reason for Revocation Extensions 10.2.2.5. Reason for Revocation Extensions
OpenPGP signatures contain a mechanism for flags to be specified OpenPGP signatures contain a mechanism for flags to be specified
about why a key was revoked. This specification creates a registry about why a key was revoked. This specification creates a registry
of "Reason for Revocation" flags. The registry includes the "Reason of "Reason for Revocation" flags. The registry includes the "Reason
for Revocation" flags value, the name of the flag, and a reference to for Revocation" flags value, the name of the flag, and a reference to
the defining specification. The initial values for this registry can the defining specification. The initial values for this registry can
be found in Section 5.2.3.23. Adding a new feature flag MUST be done be found in Section 5.2.3.23. Adding a new feature flag MUST be done
through the IETF CONSENSUS method, as described in [RFC2434]. through the SPECIFICATION REQUIRED method, as described in [RFC8126].
10.2.2.5. Implementation Features 10.2.2.6. Implementation Features
OpenPGP signatures contain a mechanism for flags to be specified OpenPGP signatures contain a mechanism for flags to be specified
stating which optional features an implementation supports. This stating which optional features an implementation supports. This
specification creates a registry of feature-implementation flags. specification creates a registry of feature-implementation flags.
The registry includes the feature-implementation flags value, the The registry includes the feature-implementation flags value, the
name of the flag, and a reference to the defining specification. The name of the flag, and a reference to the defining specification. The
initial values for this registry can be found in Section 5.2.3.24. initial values for this registry can be found in Section 5.2.3.24.
Adding a new feature-implementation flag MUST be done through the Adding a new feature-implementation flag MUST be done through the
IETF CONSENSUS method, as described in [RFC2434]. SPECIFICATION REQUIRED method, as described in [RFC8126].
Also see Section 13.12 for more information about when feature flags Also see Section 14.12 for more information about when feature flags
are needed. are needed.
10.2.3. New Packet Versions 10.2.3. New Packet Versions
The core OpenPGP packets all have version numbers, and can be revised The core OpenPGP packets all have version numbers, and can be revised
by introducing a new version of an existing packet. This by introducing a new version of an existing packet. This
specification creates a registry of packet types. The registry specification creates a registry of packet types. The registry
includes the packet type, the number of the version, and a reference includes the packet type, the number of the version, and a reference
to the defining specification. The initial values for this registry to the defining specification. The initial values for this registry
can be found in Section 5. Adding a new packet version MUST be done can be found in Section 5. Adding a new packet version MUST be done
through the IETF CONSENSUS method, as described in [RFC2434]. through the RFC REQUIRED method, as described in [RFC8126].
10.3. New Algorithms 10.3. New Algorithms
Section 9 lists the core algorithms that OpenPGP uses. Adding in a Section 9 lists the core algorithms that OpenPGP uses. Adding in a
new algorithm is usually simple. For example, adding in a new new algorithm is usually simple. For example, adding in a new
symmetric cipher usually would not need anything more than allocating symmetric cipher usually would not need anything more than allocating
a constant for that cipher. If that cipher had other than a 64-bit a constant for that cipher. If that cipher had other than a 64-bit
or 128-bit block size, there might need to be additional or 128-bit block size, there might need to be additional
documentation describing how OpenPGP-CFB mode would be adjusted. documentation describing how OpenPGP-CFB mode would be adjusted.
Similarly, when DSA was expanded from a maximum of 1024-bit public Similarly, when DSA was expanded from a maximum of 1024-bit public
skipping to change at page 71, line 12 skipping to change at page 79, line 25
enough information itself to allow implementation. Changes to this enough information itself to allow implementation. Changes to this
document were made mainly for emphasis. document were made mainly for emphasis.
10.3.1. Public-Key Algorithms 10.3.1. Public-Key Algorithms
OpenPGP specifies a number of public-key algorithms. This OpenPGP specifies a number of public-key algorithms. This
specification creates a registry of public-key algorithm identifiers. specification creates a registry of public-key algorithm identifiers.
The registry includes the algorithm name, its key sizes and The registry includes the algorithm name, its key sizes and
parameters, and a reference to the defining specification. The parameters, and a reference to the defining specification. The
initial values for this registry can be found in Section 9.1. Adding initial values for this registry can be found in Section 9.1. Adding
a new public-key algorithm MUST be done through the IETF CONSENSUS a new public-key algorithm MUST be done through the SPECIFICATION
method, as described in [RFC2434]. REQUIRED method, as described in [RFC8126].
10.3.2. Symmetric-Key Algorithms 10.3.2. Symmetric-Key Algorithms
OpenPGP specifies a number of symmetric-key algorithms. This OpenPGP specifies a number of symmetric-key algorithms. This
specification creates a registry of symmetric-key algorithm specification creates a registry of symmetric-key algorithm
identifiers. The registry includes the algorithm name, its key sizes identifiers. The registry includes the algorithm name, its key sizes
and block size, and a reference to the defining specification. The and block size, and a reference to the defining specification. The
initial values for this registry can be found in Section 9.2. Adding initial values for this registry can be found in Section 9.3. Adding
a new symmetric-key algorithm MUST be done through the IETF CONSENSUS a new symmetric-key algorithm MUST be done through the SPECIFICATION
method, as described in [RFC2434]. REQUIRED method, as described in [RFC8126].
10.3.3. Hash Algorithms 10.3.3. Hash Algorithms
OpenPGP specifies a number of hash algorithms. This specification OpenPGP specifies a number of hash algorithms. This specification
creates a registry of hash algorithm identifiers. The registry creates a registry of hash algorithm identifiers. The registry
includes the algorithm name, a text representation of that name, its includes the algorithm name, a text representation of that name, its
block size, an OID hash prefix, and a reference to the defining block size, an OID hash prefix, and a reference to the defining
specification. The initial values for this registry can be found in specification. The initial values for this registry can be found in
Section 9.4 for the algorithm identifiers and text names, and Section 9.5 for the algorithm identifiers and text names, and
Section 5.2.2 for the OIDs and expanded signature prefixes. Adding a Section 5.2.2 for the OIDs and expanded signature prefixes. Adding a
new hash algorithm MUST be done through the IETF CONSENSUS method, as new hash algorithm MUST be done through the SPECIFICATION REQUIRED
described in [RFC2434]. method, as described in [RFC8126].
This document requests IANA register the following hash algorithms:
+====+===========+===========+
| ID | Algorithm | Reference |
+====+===========+===========+
| 12 | SHA3-256 | This doc |
+----+-----------+-----------+
| 13 | Reserved | |
+----+-----------+-----------+
| 14 | SHA3-512 | This doc |
+----+-----------+-----------+
Table 20: New hash
algorithms registered
[Notes to RFC-Editor: Please remove the table above on publication.
It is desirable not to reuse old or reserved algorithms because some
existing tools might print a wrong description. The ID 13 has been
reserved so that the SHA3 algorithm IDs align nicely with their SHA2
counterparts.]
10.3.4. Compression Algorithms 10.3.4. Compression Algorithms
OpenPGP specifies a number of compression algorithms. This OpenPGP specifies a number of compression algorithms. This
specification creates a registry of compression algorithm specification creates a registry of compression algorithm
identifiers. The registry includes the algorithm name and a identifiers. The registry includes the algorithm name and a
reference to the defining specification. The initial values for this reference to the defining specification. The initial values for this
registry can be found in Section 9.3. Adding a new compression key registry can be found in Section 9.4. Adding a new compression key
algorithm MUST be done through the IETF CONSENSUS method, as algorithm MUST be done through the SPECIFICATION REQUIRED method, as
described in [RFC2434]. described in [RFC8126].
11. Packet Composition 11. Packet Composition
OpenPGP packets are assembled into sequences in order to create OpenPGP packets are assembled into sequences in order to create
messages and to transfer keys. Not all possible packet sequences are messages and to transfer keys. Not all possible packet sequences are
meaningful and correct. This section describes the rules for how meaningful and correct. This section describes the rules for how
packets should be placed into sequences. packets should be placed into sequences.
11.1. Transferable Public Keys 11.1. Transferable Public Keys
skipping to change at page 75, line 52 skipping to change at page 84, line 52
and MD5 are deprecated. and MD5 are deprecated.
A V4 fingerprint is the 160-bit SHA-1 hash of the octet 0x99, A V4 fingerprint is the 160-bit SHA-1 hash of the octet 0x99,
followed by the two-octet packet length, followed by the entire followed by the two-octet packet length, followed by the entire
Public-Key packet starting with the version field. The Key ID is the Public-Key packet starting with the version field. The Key ID is the
low-order 64 bits of the fingerprint. Here are the fields of the low-order 64 bits of the fingerprint. Here are the fields of the
hash material, with the example of a DSA key: hash material, with the example of a DSA key:
a.1) 0x99 (1 octet) a.1) 0x99 (1 octet)
a.2) high-order length octet of (b)-(e) (1 octet) a.2) two-octet scalar octet count of (b)-(e)
a.3) low-order length octet of (b)-(e) (1 octet)
b) version number = 4 (1 octet); b) version number = 4 (1 octet);
c) timestamp of key creation (4 octets); c) timestamp of key creation (4 octets);
d) algorithm (1 octet): 17 = DSA (example); d) algorithm (1 octet): 17 = DSA (example);
e) Algorithm-specific fields. e) Algorithm-specific fields.
Algorithm-Specific Fields for DSA keys (example): Algorithm-Specific Fields for DSA keys (example):
skipping to change at page 76, line 37 skipping to change at page 85, line 35
the same fingerprint. the same fingerprint.
Also note that if V3 and V4 format keys share the same RSA key Also note that if V3 and V4 format keys share the same RSA key
material, they will have different Key IDs as well as different material, they will have different Key IDs as well as different
fingerprints. fingerprints.
Finally, the Key ID and fingerprint of a subkey are calculated in the Finally, the Key ID and fingerprint of a subkey are calculated in the
same way as for a primary key, including the 0x99 as the first octet same way as for a primary key, including the 0x99 as the first octet
(even though this is not a valid packet ID for a public subkey). (even though this is not a valid packet ID for a public subkey).
13. Notes on Algorithms 13. Elliptic Curve Cryptography
13.1. PKCS#1 Encoding in OpenPGP This section descripes algorithms and parameters used with Elliptic
Curve Cryptography (ECC) keys. A thorough introduction to ECC can be
found in [KOBLITZ].
13.1. Supported ECC Curves
This document references three named prime field curves, defined in
[FIPS186] as "Curve P-256", "Curve P-384", and "Curve P-521".
Further curve "Curve25519", defined in [RFC7748] is referenced for
use with X25519 (ECDH encryption).
The named curves are referenced as a sequence of bytes in this
document, called throughout, curve OID. Section 9.2 describes in
detail how this sequence of bytes is formed.
13.2. ECDSA and ECDH Conversion Primitives
This document defines the uncompressed point format for ECDSA and
ECDH and a custom compression format for certain curves. The point
is encoded in the Multiprecision Integer (MPI) format.
For an uncompressed point the content of the MPI is:
B = 04 || x || y
where x and y are coordinates of the point P = (x, y), each encoded
in the big-endian format and zero-padded to the adjusted underlying
field size. The adjusted underlying field size is the underlying
field size that is rounded up to the nearest 8-bit boundary. This
encoding is compatible with the definition given in [SEC1].
For a custom compressed point the content of the MPI is:
B = 40 || x
where x is the x coordinate of the point P encoded to the rules
defined for the specified curve. This format is used for ECDH keys
based on curves expressed in Montgomery form.
Therefore, the exact size of the MPI payload is 515 bits for "Curve
P-256", 771 for "Curve P-384", 1059 for "Curve P-521", and 263 for
Curve25519.
Even though the zero point, also called the point at infinity, may
occur as a result of arithmetic operations on points of an elliptic
curve, it SHALL NOT appear in data structures defined in this
document.
If other conversion methods are defined in the future, a compliant
application MUST NOT use a new format when in doubt that any
recipient can support it. Consider, for example, that while both the
public key and the per-recipient ECDH data structure, respectively
defined in Section 5.6.5 and Section 5.1, contain an encoded point
field, the format changes to the field in Section 5.1 only affect a
given recipient of a given message.
13.3. Key Derivation Function
A key derivation function (KDF) is necessary to implement the EC
encryption. The Concatenation Key Derivation Function (Approved
Alternative 1) [SP800-56A] with the KDF hash function that is
SHA2-256 [FIPS180] or stronger is REQUIRED. See Section 16 for the
details regarding the choice of the hash function.
For convenience, the synopsis of the encoding method is given below
with significant simplifications attributable to the restricted
choice of hash functions in this document. However, [SP800-56A] is
the normative source of the definition.
// Implements KDF( X, oBits, Param );
// Input: point X = (x,y)
// oBits - the desired size of output
// hBits - the size of output of hash function Hash
// Param - octets representing the parameters
// Assumes that oBits <= hBits
// Convert the point X to the octet string:
// ZB' = 04 || x || y
// and extract the x portion from ZB'
ZB = x;
MB = Hash ( 00 || 00 || 00 || 01 || ZB || Param );
return oBits leftmost bits of MB.
Note that ZB in the KDF description above is the compact
representation of X, defined in Section 4.2 of [RFC6090].
13.4. EC DH Algorithm (ECDH)
The method is a combination of an ECC Diffie-Hellman method to
establish a shared secret, a key derivation method to process the
shared secret into a derived key, and a key wrapping method that uses
the derived key to protect a session key used to encrypt a message.
The One-Pass Diffie-Hellman method C(1, 1, ECC CDH) [SP800-56A] MUST
be implemented with the following restrictions: the ECC CDH primitive
employed by this method is modified to always assume the cofactor as
1, the KDF specified in Section 13.3 is used, and the KDF parameters
specified below are used.
The KDF parameters are encoded as a concatenation of the following 5
variable-length and fixed-length fields, compatible with the
definition of the OtherInfo bitstring [SP800-56A]:
* a variable-length field containing a curve OID, formatted as
follows:
- a one-octet size of the following field
- the octets representing a curve OID, defined in Section 9.2
* a one-octet public key algorithm ID defined in Section 9.1
* a variable-length field containing KDF parameters, identical to
the corresponding field in the ECDH public key, formatted as
follows:
- a one-octet size of the following fields; values 0 and 0xff are
reserved for future extensions
- a one-octet value 01, reserved for future extensions
- a one-octet hash function ID used with the KDF
- a one-octet algorithm ID for the symmetric algorithm used to
wrap the symmetric key for message encryption; see Section 13.4
for details
* 20 octets representing the UTF-8 encoding of the string "Anonymous
Sender ", which is the octet sequence 41 6E 6F 6E 79 6D 6F 75
73 20 53 65 6E 64 65 72 20 20 20 20
* 20 octets representing a recipient encryption subkey or a master
key fingerprint, identifying the key material that is needed for
the decryption. For version 5 keys the 20 leftmost octets of the
fingerprint are used.
The size of the KDF parameters sequence, defined above, is either 54
for the NIST curve P-256, 51 for the curves P-384 and P-521, or 56
for Curve25519.
The key wrapping method is described in [RFC3394]. KDF produces a
symmetric key that is used as a key-encryption key (KEK) as specified
in [RFC3394]. Refer to Section 15 for the details regarding the
choice of the KEK algorithm, which SHOULD be one of three AES
algorithms. Key wrapping and unwrapping is performed with the
default initial value of [RFC3394].
The input to the key wrapping method is the value "m" derived from
the session key, as described in Section 5.1, "Public-Key Encrypted
Session Key Packets (Tag 1)", except that the PKCS #1.5 padding step
is omitted. The result is padded using the method described in
[PKCS5] to the 8-byte granularity. For example, the following
AES-256 session key, in which 32 octets are denoted from k0 to k31,
is composed to form the following 40 octet sequence:
09 k0 k1 ... k31 c0 c1 05 05 05 05 05
The octets c0 and c1 above denote the checksum. This encoding allows
the sender to obfuscate the size of the symmetric encryption key used
to encrypt the data. For example, assuming that an AES algorithm is
used for the session key, the sender MAY use 21, 13, and 5 bytes of
padding for AES-128, AES-192, and AES-256, respectively, to provide
the same number of octets, 40 total, as an input to the key wrapping
method.
The output of the method consists of two fields. The first field is
the MPI containing the ephemeral key used to establish the shared
secret. The second field is composed of the following two fields:
* a one-octet encoding the size in octets of the result of the key
wrapping method; the value 255 is reserved for future extensions;
* up to 254 octets representing the result of the key wrapping
method, applied to the 8-byte padded session key, as described
above.
Note that for session key sizes 128, 192, and 256 bits, the size of
the result of the key wrapping method is, respectively, 32, 40, and
48 octets, unless the size obfuscation is used.
For convenience, the synopsis of the encoding method is given below;
however, this section, [SP800-56A], and [RFC3394] are the normative
sources of the definition.
* Obtain the authenticated recipient public key R
* Generate an ephemeral key pair {v, V=vG}
* Compute the shared point S = vR;
* m = symm_alg_ID || session key || checksum || pkcs5_padding;
* curve_OID_len = (byte)len(curve_OID);
* Param = curve_OID_len || curve_OID || public_key_alg_ID || 03 ||
01 || KDF_hash_ID || KEK_alg_ID for AESKeyWrap || "Anonymous
Sender " || recipient_fingerprint;
* Z_len = the key size for the KEK_alg_ID used with AESKeyWrap
* Compute Z = KDF( S, Z_len, Param );
* Compute C = AESKeyWrap( Z, m ) as per [RFC3394]
* VB = convert point V to the octet string
* Output (MPI(VB) || len(C) || C).
The decryption is the inverse of the method given. Note that the
recipient obtains the shared secret by calculating
S = rV = rvG, where (r,R) is the recipient's key pair.
Consistent with Section 5.14, Modification Detection Code (MDC) MUST
be used anytime the symmetric key is protected by ECDH.
14. Notes on Algorithms
14.1. PKCS#1 Encoding in OpenPGP
This standard makes use of the PKCS#1 functions EME-PKCS1-v1_5 and This standard makes use of the PKCS#1 functions EME-PKCS1-v1_5 and
EMSA-PKCS1-v1_5. However, the calling conventions of these functions EMSA-PKCS1-v1_5. However, the calling conventions of these functions
has changed in the past. To avoid potential confusion and has changed in the past. To avoid potential confusion and
interoperability problems, we are including local copies in this interoperability problems, we are including local copies in this
document, adapted from those in PKCS#1 v2.1 [RFC3447]. [RFC3447] document, adapted from those in PKCS#1 v2.1 [RFC3447]. [RFC3447]
should be treated as the ultimate authority on PKCS#1 for OpenPGP. should be treated as the ultimate authority on PKCS#1 for OpenPGP.
Nonetheless, we believe that there is value in having a self- Nonetheless, we believe that there is value in having a self-
contained document that avoids problems in the future with needed contained document that avoids problems in the future with needed
changes in the conventions. changes in the conventions.
13.1.1. EME-PKCS1-v1_5-ENCODE 14.1.1. EME-PKCS1-v1_5-ENCODE
Input: Input:
k = the length in octets of the key modulus. k = the length in octets of the key modulus.
M = message to be encoded, an octet string of length mLen, where M = message to be encoded, an octet string of length mLen, where
mLen <= k - 11. mLen <= k - 11.
Output: Output:
skipping to change at page 77, line 34 skipping to change at page 91, line 7
pseudo-randomly generated nonzero octets. The length of PS will pseudo-randomly generated nonzero octets. The length of PS will
be at least eight octets. be at least eight octets.
3. Concatenate PS, the message M, and other padding to form an 3. Concatenate PS, the message M, and other padding to form an
encoded message EM of length k octets as encoded message EM of length k octets as
EM = 0x00 || 0x02 || PS || 0x00 || M. EM = 0x00 || 0x02 || PS || 0x00 || M.
4. Output EM. 4. Output EM.
13.1.2. EME-PKCS1-v1_5-DECODE 14.1.2. EME-PKCS1-v1_5-DECODE
Input: Input:
EM = encoded message, an octet string EM = encoded message, an octet string
Output: Output:
M = message, an octet string. M = message, an octet string.
Error: "decryption error". Error: "decryption error".
skipping to change at page 78, line 9 skipping to change at page 91, line 29
To decode an EME-PKCS1_v1_5 message, separate the encoded message EM To decode an EME-PKCS1_v1_5 message, separate the encoded message EM
into an octet string PS consisting of nonzero octets and a message M into an octet string PS consisting of nonzero octets and a message M
as follows as follows
EM = 0x00 || 0x02 || PS || 0x00 || M. EM = 0x00 || 0x02 || PS || 0x00 || M.
If the first octet of EM does not have hexadecimal value 0x00, if the If the first octet of EM does not have hexadecimal value 0x00, if the
second octet of EM does not have hexadecimal value 0x02, if there is second octet of EM does not have hexadecimal value 0x02, if there is
no octet with hexadecimal value 0x00 to separate PS from M, or if the no octet with hexadecimal value 0x00 to separate PS from M, or if the
length of PS is less than 8 octets, output "decryption error" and length of PS is less than 8 octets, output "decryption error" and
stop. See also the security note in Section 14 regarding differences stop. See also the security note in Section 15 regarding differences
in reporting between a decryption error and a padding error. in reporting between a decryption error and a padding error.
13.1.3. EMSA-PKCS1-v1_5 14.1.3. EMSA-PKCS1-v1_5
This encoding method is deterministic and only has an encoding This encoding method is deterministic and only has an encoding
operation. operation.
Option: Option:
Hash - a hash function in which hLen denotes the length in octets of Hash - a hash function in which hLen denotes the length in octets of
the hash function output. the hash function output.
Input: Input:
skipping to change at page 78, line 48 skipping to change at page 92, line 19
1. Apply the hash function to the message M to produce a hash value 1. Apply the hash function to the message M to produce a hash value
H: H:
H = Hash(M). H = Hash(M).
If the hash function outputs "message too long," output "message If the hash function outputs "message too long," output "message
too long" and stop. too long" and stop.
2. Using the list in Section 5.2.2, produce an ASN.1 DER value for 2. Using the list in Section 5.2.2, produce an ASN.1 DER value for
the hash function used. Let T be the full hash prefix from the hash function used. Let T be the full hash prefix from the
Section 5.2.2, and let tLen be the length in octets of T. list, and let tLen be the length in octets of T.
3. If emLen < tLen + 11, output "intended encoded message length too 3. If emLen < tLen + 11, output "intended encoded message length too
short" and stop. short" and stop.
4. Generate an octet string PS consisting of emLen - tLen - 3 octets 4. Generate an octet string PS consisting of emLen - tLen - 3 octets
with hexadecimal value 0xFF. The length of PS will be at least 8 with hexadecimal value 0xFF. The length of PS will be at least 8
octets. octets.
5. Concatenate PS, the hash prefix T, and other padding to form the 5. Concatenate PS, the hash prefix T, and other padding to form the
encoded message EM as encoded message EM as
EM = 0x00 || 0x01 || PS || 0x00 || T. EM = 0x00 || 0x01 || PS || 0x00 || T.
6. Output EM. 6. Output EM.
13.2. Symmetric Algorithm Preferences 14.2. Symmetric Algorithm Preferences
The symmetric algorithm preference is an ordered list of algorithms The symmetric algorithm preference is an ordered list of algorithms
that the keyholder accepts. Since it is found on a self-signature, that the keyholder accepts. Since it is found on a self-signature,
it is possible that a keyholder may have multiple, different it is possible that a keyholder may have multiple, different
preferences. For example, Alice may have TripleDES only specified preferences. For example, Alice may have TripleDES only specified
for "alice@work.com" but CAST5, Blowfish, and TripleDES specified for for "alice@work.com" but CAST5, Blowfish, and TripleDES specified for
"alice@home.org". Note that it is also possible for preferences to "alice@home.org". Note that it is also possible for preferences to
be in a subkey's binding signature. be in a subkey's binding signature.
Since TripleDES is the MUST-implement algorithm, if it is not Since TripleDES is the MUST-implement algorithm, if it is not
skipping to change at page 80, line 5 skipping to change at page 93, line 23
If an implementation can decrypt a message that a keyholder doesn't If an implementation can decrypt a message that a keyholder doesn't
have in their preferences, the implementation SHOULD decrypt the have in their preferences, the implementation SHOULD decrypt the
message anyway, but MUST warn the keyholder that the protocol has message anyway, but MUST warn the keyholder that the protocol has
been violated. For example, suppose that Alice, above, has software been violated. For example, suppose that Alice, above, has software
that implements all algorithms in this specification. Nonetheless, that implements all algorithms in this specification. Nonetheless,
she prefers subsets for work or home. If she is sent a message she prefers subsets for work or home. If she is sent a message
encrypted with IDEA, which is not in her preferences, the software encrypted with IDEA, which is not in her preferences, the software
warns her that someone sent her an IDEA-encrypted message, but it warns her that someone sent her an IDEA-encrypted message, but it
would ideally decrypt it anyway. would ideally decrypt it anyway.
13.3. Other Algorithm Preferences 14.3. Other Algorithm Preferences
Other algorithm preferences work similarly to the symmetric algorithm Other algorithm preferences work similarly to the symmetric algorithm
preference, in that they specify which algorithms the keyholder preference, in that they specify which algorithms the keyholder
accepts. There are two interesting cases that other comments need to accepts. There are two interesting cases that other comments need to
be made about, though, the compression preferences and the hash be made about, though, the compression preferences and the hash
preferences. preferences.
13.3.1. Compression Preferences 14.3.1. Compression Preferences
Compression has been an integral part of PGP since its first days. Compression has been an integral part of PGP since its first days.
OpenPGP and all previous versions of PGP have offered compression. OpenPGP and all previous versions of PGP have offered compression.
In this specification, the default is for messages to be compressed, In this specification, the default is for messages to be compressed,
although an implementation is not required to do so. Consequently, although an implementation is not required to do so. Consequently,
the compression preference gives a way for a keyholder to request the compression preference gives a way for a keyholder to request
that messages not be compressed, presumably because they are using a that messages not be compressed, presumably because they are using a
minimal implementation that does not include compression. minimal implementation that does not include compression.
Additionally, this gives a keyholder a way to state that it can Additionally, this gives a keyholder a way to state that it can
support alternate algorithms. support alternate algorithms.
skipping to change at page 80, line 38 skipping to change at page 94, line 13
Uncompressed(0)]. Uncompressed(0)].
Additionally, an implementation MUST implement this preference to the Additionally, an implementation MUST implement this preference to the
degree of recognizing when to send an uncompressed message. A robust degree of recognizing when to send an uncompressed message. A robust
implementation would satisfy this requirement by looking at the implementation would satisfy this requirement by looking at the
recipient's preference and acting accordingly. A minimal recipient's preference and acting accordingly. A minimal
implementation can satisfy this requirement by never generating a implementation can satisfy this requirement by never generating a
compressed message, since all implementations can handle messages compressed message, since all implementations can handle messages
that have not been compressed. that have not been compressed.
13.3.2. Hash Algorithm Preferences 14.3.2. Hash Algorithm Preferences
Typically, the choice of a hash algorithm is something the signer Typically, the choice of a hash algorithm is something the signer
does, rather than the verifier, because a signer rarely knows who is does, rather than the verifier, because a signer rarely knows who is
going to be verifying the signature. This preference, though, allows going to be verifying the signature. This preference, though, allows
a protocol based upon digital signatures ease in negotiation. a protocol based upon digital signatures ease in negotiation.
Thus, if Alice is authenticating herself to Bob with a signature, it Thus, if Alice is authenticating herself to Bob with a signature, it
makes sense for her to use a hash algorithm that Bob's software uses. makes sense for her to use a hash algorithm that Bob's software uses.
This preference allows Bob to state in his key which algorithms Alice This preference allows Bob to state in his key which algorithms Alice
may use. may use.
Since SHA1 is the MUST-implement hash algorithm, if it is not Since SHA1 is the MUST-implement hash algorithm, if it is not
explicitly in the list, it is tacitly at the end. However, it is explicitly in the list, it is tacitly at the end. However, it is
good form to place it there explicitly. good form to place it there explicitly.
13.4. Plaintext 14.4. Plaintext
Algorithm 0, "plaintext", may only be used to denote secret keys that Algorithm 0, "plaintext", may only be used to denote secret keys that
are stored in the clear. Implementations MUST NOT use plaintext in are stored in the clear. Implementations MUST NOT use plaintext in
Symmetrically Encrypted Data packets; they must use Literal Data Symmetrically Encrypted Data packets; they must use Literal Data
packets to encode unencrypted or literal data. packets to encode unencrypted or literal data.
13.5. RSA 14.5. RSA
There are algorithm types for RSA Sign-Only, and RSA Encrypt-Only There are algorithm types for RSA Sign-Only, and RSA Encrypt-Only
keys. These types are deprecated. The "key flags" subpacket in a keys. These types are deprecated. The "key flags" subpacket in a
signature is a much better way to express the same idea, and signature is a much better way to express the same idea, and
generalizes it to all algorithms. An implementation SHOULD NOT generalizes it to all algorithms. An implementation SHOULD NOT
create such a key, but MAY interpret it. create such a key, but MAY interpret it.
An implementation SHOULD NOT implement RSA keys of size less than An implementation SHOULD NOT implement RSA keys of size less than
1024 bits. 1024 bits.
13.6. DSA 14.6. DSA
An implementation SHOULD NOT implement DSA keys of size less than An implementation SHOULD NOT implement DSA keys of size less than
1024 bits. It MUST NOT implement a DSA key with a q size of less 1024 bits. It MUST NOT implement a DSA key with a q size of less
than 160 bits. DSA keys MUST also be a multiple of 64 bits, and the than 160 bits. DSA keys MUST also be a multiple of 64 bits, and the
q size MUST be a multiple of 8 bits. The Digital Signature Standard q size MUST be a multiple of 8 bits. The Digital Signature Standard
(DSS) [FIPS186] specifies that DSA be used in one of the following (DSS) [FIPS186] specifies that DSA be used in one of the following
ways: ways:
* 1024-bit key, 160-bit q, SHA-1, SHA2-224, SHA2-256, SHA2-384, or * 1024-bit key, 160-bit q, SHA-1, SHA2-224, SHA2-256, SHA2-384, or
SHA2-512 hash SHA2-512 hash
skipping to change at page 82, line 5 skipping to change at page 95, line 36
SHOULD use one of the above key and q size pairs when generating DSA SHOULD use one of the above key and q size pairs when generating DSA
keys. If DSS compliance is desired, one of the specified SHA hashes keys. If DSS compliance is desired, one of the specified SHA hashes
must be used as well. [FIPS186] is the ultimate authority on DSS, must be used as well. [FIPS186] is the ultimate authority on DSS,
and should be consulted for all questions of DSS compliance. and should be consulted for all questions of DSS compliance.
Note that earlier versions of this standard only allowed a 160-bit q Note that earlier versions of this standard only allowed a 160-bit q
with no truncation allowed, so earlier implementations may not be with no truncation allowed, so earlier implementations may not be
able to handle signatures with a different q size or a truncated able to handle signatures with a different q size or a truncated
hash. hash.
13.7. Elgamal 14.7. Elgamal
An implementation SHOULD NOT implement Elgamal keys of size less than An implementation SHOULD NOT implement Elgamal keys of size less than
1024 bits. 1024 bits.
13.8. Reserved Algorithm Numbers 14.8. Reserved Algorithm Numbers
A number of algorithm IDs have been reserved for algorithms that A number of algorithm IDs have been reserved for algorithms that
would be useful to use in an OpenPGP implementation, yet there are would be useful to use in an OpenPGP implementation, yet there are
issues that prevent an implementer from actually implementing the issues that prevent an implementer from actually implementing the
algorithm. These are marked in Section 9.1 as "reserved for". algorithm. These are marked in Section 9.1 as "reserved for".
The reserved public-key algorithms, Elliptic Curve (18), ECDSA (19), The reserved public-key algorithm X9.42 (21) does not have the
and X9.42 (21), do not have the necessary parameters, parameter necessary parameters, parameter order, or semantics defined. The
order, or semantics defined. same is currently true for reserved public-key algorithms AEDH (23)
and AEDSA (24).
Previous versions of OpenPGP permitted Elgamal [ELGAMAL] signatures Previous versions of OpenPGP permitted Elgamal [ELGAMAL] signatures
with a public-key identifier of 20. These are no longer permitted. with a public-key identifier of 20. These are no longer permitted.
An implementation MUST NOT generate such keys. An implementation An implementation MUST NOT generate such keys. An implementation
MUST NOT generate Elgamal signatures. See [BLEICHENBACHER]. MUST NOT generate Elgamal signatures. See [BLEICHENBACHER].
13.9. OpenPGP CFB Mode 14.9. OpenPGP CFB Mode
OpenPGP does symmetric encryption using a variant of Cipher Feedback OpenPGP does symmetric encryption using a variant of Cipher Feedback
mode (CFB mode). This section describes the procedure it uses in mode (CFB mode). This section describes the procedure it uses in
detail. This mode is what is used for Symmetrically Encrypted Data detail. This mode is what is used for Symmetrically Encrypted Data
Packets; the mechanism used for encrypting secret-key material is Packets; the mechanism used for encrypting secret-key material is
similar, and is described in the sections above. similar, and is described in the sections above.
In the description below, the value BS is the block size in octets of In the description below, the value BS is the block size in octets of
the cipher. Most ciphers have a block size of 8 octets. The AES and the cipher. Most ciphers have a block size of 8 octets. The AES and
Twofish have a block size of 16 octets. Also note that the Twofish have a block size of 16 octets. Also note that the
skipping to change at page 83, line 44 skipping to change at page 97, line 28
10. FR is loaded with C[BS+3] to C[BS + (BS+2)] (which is C11-C18 10. FR is loaded with C[BS+3] to C[BS + (BS+2)] (which is C11-C18
for an 8-octet block). for an 8-octet block).
11. FR is encrypted to produce FRE. 11. FR is encrypted to produce FRE.
12. FRE is xored with the next BS octets of plaintext, to produce 12. FRE is xored with the next BS octets of plaintext, to produce
the next BS octets of ciphertext. These are loaded into FR, and the next BS octets of ciphertext. These are loaded into FR, and
the process is repeated until the plaintext is used up. the process is repeated until the plaintext is used up.
13.10. Private or Experimental Parameters 14.10. Private or Experimental Parameters
S2K specifiers, Signature subpacket types, User Attribute types, S2K specifiers, Signature subpacket types, User Attribute types,
image format types, and algorithms described in Section 9 all reserve image format types, and algorithms described in Section 9 all reserve
the range 100 to 110 for private and experimental use. Packet types the range 100 to 110 for private and experimental use. Packet types
reserve the range 60 to 63 for private and experimental use. These reserve the range 60 to 63 for private and experimental use. These
are intentionally managed with the PRIVATE USE method, as described are intentionally managed with the PRIVATE USE method, as described
in [RFC2434]. in [RFC8126].
However, implementations need to be careful with these and promote However, implementations need to be careful with these and promote
them to full IANA-managed parameters when they grow beyond the them to full IANA-managed parameters when they grow beyond the
original, limited system. original, limited system.
13.11. Extension of the MDC System 14.11. Extension of the MDC System
As described in the non-normative explanation in Section 5.13, the As described in the non-normative explanation in Section 5.14, the
MDC system is uniquely unparameterized in OpenPGP. This was an MDC system is uniquely unparameterized in OpenPGP. This was an
intentional decision to avoid cross-grade attacks. If the MDC system intentional decision to avoid cross-grade attacks. If the MDC system
is extended to a stronger hash function, care must be taken to avoid is extended to a stronger hash function, care must be taken to avoid
downgrade and cross-grade attacks. downgrade and cross-grade attacks.
One simple way to do this is to create new packets for a new MDC. One simple way to do this is to create new packets for a new MDC.
For example, instead of the MDC system using packets 18 and 19, a new For example, instead of the MDC system using packets 18 and 19, a new
MDC could use 20 and 21. This has obvious drawbacks (it uses two MDC could use 20 and 21. This has obvious drawbacks (it uses two
packet numbers for each new hash function in a space that is limited packet numbers for each new hash function in a space that is limited
to a maximum of 60). to a maximum of 60).
skipping to change at page 84, line 45 skipping to change at page 98, line 33
of packet 19 would have to have unique sizes. If there were two of packet 19 would have to have unique sizes. If there were two
versions each with 256-bit hashes, they could not both have 32-octet versions each with 256-bit hashes, they could not both have 32-octet
packet 19s without admitting the chance of a cross-grade attack. packet 19s without admitting the chance of a cross-grade attack.
Yet another, complex approach to extend the MDC system would be a Yet another, complex approach to extend the MDC system would be a
hybrid of the two above -- create a new pair of MDC packets that are hybrid of the two above -- create a new pair of MDC packets that are
fully parameterized, and yet protected from downgrade and cross- fully parameterized, and yet protected from downgrade and cross-
grade. grade.
Any change to the MDC system MUST be done through the IETF CONSENSUS Any change to the MDC system MUST be done through the IETF CONSENSUS
method, as described in [RFC2434]. method, as described in [RFC8126].
13.12. Meta-Considerations for Expansion 14.12. Meta-Considerations for Expansion
If OpenPGP is extended in a way that is not backwards-compatible, If OpenPGP is extended in a way that is not backwards-compatible,
meaning that old implementations will not gracefully handle their meaning that old implementations will not gracefully handle their
absence of a new feature, the extension proposal can be declared in absence of a new feature, the extension proposal can be declared in
the key holder's self-signature as part of the Features signature the key holder's self-signature as part of the Features signature
subpacket. subpacket.
We cannot state definitively what extensions will not be upwards- We cannot state definitively what extensions will not be upwards-
compatible, but typically new algorithms are upwards-compatible, compatible, but typically new algorithms are upwards-compatible,
whereas new packets are not. whereas new packets are not.
If an extension proposal does not update the Features system, it If an extension proposal does not update the Features system, it
SHOULD include an explanation of why this is unnecessary. If the SHOULD include an explanation of why this is unnecessary. If the
proposal contains neither an extension to the Features system nor an proposal contains neither an extension to the Features system nor an
explanation of why such an extension is unnecessary, the proposal explanation of why such an extension is unnecessary, the proposal
SHOULD be rejected. SHOULD be rejected.
14. Security Considerations 15. Security Considerations
* As with any technology involving cryptography, you should check * As with any technology involving cryptography, you should check
the current literature to determine if any algorithms used here the current literature to determine if any algorithms used here
have been found to be vulnerable to attack. have been found to be vulnerable to attack.
* This specification uses Public-Key Cryptography technologies. It * This specification uses Public-Key Cryptography technologies. It
is assumed that the private key portion of a public-private key is assumed that the private key portion of a public-private key
pair is controlled and secured by the proper party or parties. pair is controlled and secured by the proper party or parties.
* Certain operations in this specification involve the use of random * Certain operations in this specification involve the use of random
skipping to change at page 86, line 40 skipping to change at page 100, line 19
+---------------------+-----------+--------------------+ +---------------------+-----------+--------------------+
| 2048 | 224 | 112 | | 2048 | 224 | 112 |
+---------------------+-----------+--------------------+ +---------------------+-----------+--------------------+
| 3072 | 256 | 128 | | 3072 | 256 | 128 |
+---------------------+-----------+--------------------+ +---------------------+-----------+--------------------+
| 7680 | 384 | 192 | | 7680 | 384 | 192 |
+---------------------+-----------+--------------------+ +---------------------+-----------+--------------------+
| 15360 | 512 | 256 | | 15360 | 512 | 256 |
+---------------------+-----------+--------------------+ +---------------------+-----------+--------------------+
Table 17: Key length equivalences Table 21: Key length equivalences
* There is a somewhat-related potential security problem in * There is a somewhat-related potential security problem in
signatures. If an attacker can find a message that hashes to the signatures. If an attacker can find a message that hashes to the
same hash with a different algorithm, a bogus signature structure same hash with a different algorithm, a bogus signature structure
can be constructed that evaluates correctly. can be constructed that evaluates correctly.
For example, suppose Alice DSA signs message M using hash For example, suppose Alice DSA signs message M using hash
algorithm H. Suppose that Mallet finds a message M' that has the algorithm H. Suppose that Mallet finds a message M' that has the
same hash value as M with H'. Mallet can then construct a same hash value as M with H'. Mallet can then construct a
signature block that verifies as Alice's signature of M' with H'. signature block that verifies as Alice's signature of M' with H'.
skipping to change at page 89, line 11 skipping to change at page 102, line 31
timing information about the check can be exposed to an attacker, timing information about the check can be exposed to an attacker,
particularly via an automated service that allows rapidly repeated particularly via an automated service that allows rapidly repeated
queries. queries.
On the other hand, it is inconvenient to the user to be informed On the other hand, it is inconvenient to the user to be informed
that they typed in the wrong passphrase only after a petabyte of that they typed in the wrong passphrase only after a petabyte of
data is decrypted. There are many cases in cryptographic data is decrypted. There are many cases in cryptographic
engineering where the implementer must use care and wisdom, and engineering where the implementer must use care and wisdom, and
this is one. this is one.
15. Implementation Nits * Refer to [FIPS186], B.4.1, for the method to generate a uniformly
distributed ECC private key.
* The curves proposed in this document correspond to the symmetric
key sizes 128 bits, 192 bits, and 256 bits, as described in the
table below. This allows a compliant application to offer
balanced public key security, which is compatible with the
symmetric key strength for each AES algorithm defined here.
The following table defines the hash and the symmetric encryption
algorithm that SHOULD be used with a given curve for ECDSA or
ECDH. A stronger hash algorithm or a symmetric key algorithm MAY
be used for a given ECC curve. However, note that the increase in
the strength of the hash algorithm or the symmetric key algorithm
may not increase the overall security offered by the given ECC
key.
+============+=====+==============+=====================+===========+
| Curve name | ECC | RSA | Hash size strength, | Symmetric |
| | | strength | informative | key size |
+============+=====+==============+=====================+===========+
| NIST P-256 | 256 | 3072 | 256 | 128 |
+------------+-----+--------------+---------------------+-----------+
| NIST P-384 | 384 | 7680 | 384 | 192 |
+------------+-----+--------------+---------------------+-----------+
| NIST P-521 | 521 | 15360 | 512 | 256 |
+------------+-----+--------------+---------------------+-----------+
Table 22: Elliptic Curve cryptographic guidance
* Requirement levels indicated elsewhere in this document lead to
the following combinations of algorithms in the OpenPGP profile:
MUST implement NIST curve P-256 / SHA2-256 / AES-128, SHOULD
implement NIST curve P-521 / SHA2-512 / AES-256, MAY implement
NIST curve P-384 / SHA2-384 / AES-256, among other allowed
combinations.
Consistent with the table above, the following table defines the
KDF hash algorithm and the AES KEK encryption algorithm that
SHOULD be used with a given curve for ECDH. A stronger KDF hash
algorithm or AES KEK algorithm MAY be used for a given ECC curve.
+============+=================+======================+
| Curve name | Recommended KDF | Recommended KEK |
| | hash algorithm | encryption algorithm |
+============+=================+======================+
| NIST P-256 | SHA2-256 | AES-128 |
+------------+-----------------+----------------------+
| NIST P-384 | SHA2-384 | AES-192 |
+------------+-----------------+----------------------+
| NIST P-521 | SHA2-512 | AES-256 |
+------------+-----------------+----------------------+
Table 23: Elliptic Curve KDF and KEK recommendations
* This document explicitly discourages the use of algorithms other
than AES as a KEK algorithm because backward compatibility of the
ECDH format is not a concern. The KEK algorithm is only used
within the scope of a Public-Key Encrypted Session Key Packet,
which represents an ECDH key recipient of a message. Compare this
with the algorithm used for the session key of the message, which
MAY be different from a KEK algorithm.
Compliant applications SHOULD implement, advertise through key
preferences, and use the strongest algorithms specified in this
document.
Note that the symmetric algorithm preference list may make it
impossible to use the balanced strength of symmetric key
algorithms for a corresponding public key. For example, the
presence of the symmetric key algorithm IDs and their order in the
key preference list affects the algorithm choices available to the
encoding side, which in turn may make the adherence to the table
above infeasible. Therefore, compliance with this specification
is a concern throughout the life of the key, starting immediately
after the key generation when the key preferences are first added
to a key. It is generally advisable to position a symmetric
algorithm ID of strength matching the public key at the head of
the key preference list.
Encryption to multiple recipients often results in an unordered
intersection subset. For example, if the first recipient's set is
{A, B} and the second's is {B, A}, the intersection is an
unordered set of two algorithms, A and B. In this case, a
compliant application SHOULD choose the stronger encryption
algorithm.
Resource constraints, such as limited computational power, is a
likely reason why an application might prefer to use the weakest
algorithm. On the other side of the spectrum are applications
that can implement every algorithm defined in this document. Most
applications are expected to fall into either of two categories.
A compliant application in the second, or strongest, category
SHOULD prefer AES-256 to AES-192.
SHA-1 MUST NOT be used with the ECDSA or the KDF in the ECDH
method.
MDC MUST be used when a symmetric encryption key is protected by
ECDH. None of the ECC methods described in this document are
allowed with deprecated V3 keys. A compliant application MUST
only use iterated and salted S2K to protect private keys, as
defined in Section 3.7.1.3, "Iterated and Salted S2K".
Side channel attacks are a concern when a compliant application's
use of the OpenPGP format can be modeled by a decryption or
signing oracle model, for example, when an application is a
network service performing decryption to unauthenticated remote
users. ECC scalar multiplication operations used in ECDSA and
ECDH are vulnerable to side channel attacks. Countermeasures can
often be taken at the higher protocol level, such as limiting the
number of allowed failures or time-blinding of the operations
associated with each network interface. Mitigations at the scalar
multiplication level seek to eliminate any measurable distinction
between the ECC point addition and doubling operations.
16. Compatibility Profiles
16.1. OpenPGP ECC Profile
A compliant application MUST implement NIST curve P-256, SHOULD
implement NIST curve P-521, and SHOULD implement Curve25519 as
defined in Section 9.2. A compliant application MUST implement
SHA2-256 and SHOULD implement SHA2-384 and SHA2-512. A compliant
application MUST implement AES-128 and SHOULD implement AES-256.
A compliant application SHOULD follow Section 15 regarding the choice
of the following algorithms for each curve:
* the KDF hash algorithm,
* the KEK algorithm,
* the message digest algorithm and the hash algorithm used in the
key certifications,
* the symmetric algorithm used for message encryption.
It is recommended that the chosen symmetric algorithm for message
encryption be no less secure than the KEK algorithm.
16.2. Suite-B Profile
A subset of algorithms allowed by this document can be used to
achieve [SuiteB] compatibility. The references to [SuiteB] in this
document are informative. This document is primarily concerned with
format specification, leaving additional security restrictions
unspecified, such as matching the assigned security level of
information to authorized recipients or interoperability concerns
arising from fewer allowed algorithms in [SuiteB] than allowed by
this document.
16.2.1. Security Strength at 192 Bits
To achieve the security strength of 192 bits, [SuiteB] requires NIST
curve P-384, AES-256, and SHA2-384. The symmetric algorithm
restriction means that the algorithm of KEK used for key wrapping in
Section 13.4 and an OpenPGP session key used for message encryption
must be AES-256. The hash algorithm restriction means that the hash
algorithms of KDF and the OpenPGP message digest calculation must be
SHA2-384.
16.2.2. Security Strength at 128 Bits
The set of algorithms in Section 16.2.1 is extended to allow NIST
curve P-256, AES-128, and SHA2-256.
17. Implementation Nits
This section is a collection of comments to help an implementer, This section is a collection of comments to help an implementer,
particularly with an eye to backward compatibility. Previous particularly with an eye to backward compatibility. Previous
implementations of PGP are not OpenPGP compliant. Often the implementations of PGP are not OpenPGP compliant. Often the
differences are small, but small differences are frequently more differences are small, but small differences are frequently more
vexing than large differences. Thus, this is a non-comprehensive vexing than large differences. Thus, this is a non-comprehensive
list of potential problems and gotchas for a developer who is trying list of potential problems and gotchas for a developer who is trying
to be backward-compatible. to be backward-compatible.
* The IDEA algorithm is patented, and yet it is required for PGP 2 * The IDEA algorithm is patented, and yet it is required for PGP 2
skipping to change at page 90, line 34 skipping to change at page 107, line 41
unnecessary. OpenPGP permits an implementation to declare what unnecessary. OpenPGP permits an implementation to declare what
features it does and does not support, but ASCII armor is not one features it does and does not support, but ASCII armor is not one
of these. Since most implementations allow binary and armored of these. Since most implementations allow binary and armored
objects to be used indiscriminately, an implementation that does objects to be used indiscriminately, an implementation that does
not implement ASCII armor may find itself with compatibility not implement ASCII armor may find itself with compatibility
issues with general-purpose implementations. Moreover, issues with general-purpose implementations. Moreover,
implementations of OpenPGP-MIME [RFC3156] already have a implementations of OpenPGP-MIME [RFC3156] already have a
requirement for ASCII armor so those implementations will requirement for ASCII armor so those implementations will
necessarily have support. necessarily have support.
16. References 18. References
16.1. Normative References 18.1. Normative References
[AES] NIST, "FIPS PUB 197, Advanced Encryption Standard (AES)", [AES] NIST, "FIPS PUB 197, Advanced Encryption Standard (AES)",
November 2001, November 2001,
<http://csrc.nist.gov/publications/fips/fips197/fips- <http://csrc.nist.gov/publications/fips/fips197/fips-
197.{ps,pdf}>. 197.{ps,pdf}>.
[BLOWFISH] Schneier, B., "Description of a New Variable-Length Key, [BLOWFISH] Schneier, B., "Description of a New Variable-Length Key,
64-Bit Block Cipher (Blowfish)", Fast Software Encryption, 64-Bit Block Cipher (Blowfish)", Fast Software Encryption,
Cambridge Security Workshop Proceedings Springer-Verlag, Cambridge Security Workshop Proceedings Springer-Verlag,
1994, pp191-204, December 1993, 1994, pp191-204, December 1993,
skipping to change at page 91, line 20 skipping to change at page 108, line 29
[FIPS180] National Institute of Standards and Technology, U.S. [FIPS180] National Institute of Standards and Technology, U.S.
Department of Commerce, "Secure Hash Standard (SHS), FIPS Department of Commerce, "Secure Hash Standard (SHS), FIPS
180-4", August 2015, 180-4", August 2015,
<http://dx.doi.org/10.6028/NIST.FIPS.180-4>. <http://dx.doi.org/10.6028/NIST.FIPS.180-4>.
[FIPS186] National Institute of Standards and Technology, U.S. [FIPS186] National Institute of Standards and Technology, U.S.
Department of Commerce, "Digital Signature Standard (DSS), Department of Commerce, "Digital Signature Standard (DSS),
FIPS 186-4", July 2013, FIPS 186-4", July 2013,
<http://dx.doi.org/10.6028/NIST.FIPS.186-4>. <http://dx.doi.org/10.6028/NIST.FIPS.186-4>.
[FIPS202] National Institute of Standards and Technology, U.S.
Department of Commerce, "SHA-3 Standard: Permutation-Based
Hash and Extendable-Output Functions, FIPS 202", August
2015, <http://dx.doi.org/10.6028/NIST.FIPS.202>.
[HAC] Menezes, A.J., Oorschot, P.v., and S. Vanstone, "Handbook [HAC] Menezes, A.J., Oorschot, P.v., and S. Vanstone, "Handbook
of Applied Cryptography", 1996. of Applied Cryptography", 1996.
[IDEA] Lai, X., "On the design and security of block ciphers", [IDEA] Lai, X., "On the design and security of block ciphers",
ETH Series in Information Processing, J.L. Massey ETH Series in Information Processing, J.L. Massey
(editor) Vol. 1, Hartung-Gorre Verlag Konstanz, Technische (editor) Vol. 1, Hartung-Gorre Verlag Konstanz, Technische
Hochschule (Zurich), 1992. Hochschule (Zurich), 1992.
[ISO10646] International Organization for Standardization, [ISO10646] International Organization for Standardization,
"Information Technology - Universal Multiple-octet coded "Information Technology - Universal Multiple-octet coded
Character Set (UCS) - Part 1: Architecture and Basic Character Set (UCS) - Part 1: Architecture and Basic
Multilingual Plane", ISO Standard 10646-1, May 1993. Multilingual Plane", ISO Standard 10646-1, May 1993.
[JFIF] CA, E.H.M., "JPEG File Interchange Format (Version [JFIF] CA, E.H.M., "JPEG File Interchange Format (Version
1.02).", September 1996. 1.02).", September 1996.
[PKCS5] RSA Laboratories, "PKCS #5 v2.0: Password-Based
Cryptography Standard", 25 March 1999.
[RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format
Specification version 3.3", RFC 1950, Specification version 3.3", RFC 1950,
DOI 10.17487/RFC1950, May 1996, DOI 10.17487/RFC1950, May 1996,
<https://www.rfc-editor.org/info/rfc1950>. <https://www.rfc-editor.org/info/rfc1950>.
[RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification
version 1.3", RFC 1951, DOI 10.17487/RFC1951, May 1996, version 1.3", RFC 1951, DOI 10.17487/RFC1951, May 1996,
<https://www.rfc-editor.org/info/rfc1951>. <https://www.rfc-editor.org/info/rfc1951>.
[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
skipping to change at page 92, line 14 skipping to change at page 109, line 28
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC2144] Adams, C., "The CAST-128 Encryption Algorithm", RFC 2144, [RFC2144] Adams, C., "The CAST-128 Encryption Algorithm", RFC 2144,
DOI 10.17487/RFC2144, May 1997, DOI 10.17487/RFC2144, May 1997,
<https://www.rfc-editor.org/info/rfc2144>. <https://www.rfc-editor.org/info/rfc2144>.
[RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", RFC 2434,
DOI 10.17487/RFC2434, October 1998,
<https://www.rfc-editor.org/info/rfc2434>.
[RFC2822] Resnick, P., Ed., "Internet Message Format", RFC 2822, [RFC2822] Resnick, P., Ed., "Internet Message Format", RFC 2822,
DOI 10.17487/RFC2822, April 2001, DOI 10.17487/RFC2822, April 2001,
<https://www.rfc-editor.org/info/rfc2822>. <https://www.rfc-editor.org/info/rfc2822>.
[RFC3156] Elkins, M., Del Torto, D., Levien, R., and T. Roessler, [RFC3156] Elkins, M., Del Torto, D., Levien, R., and T. Roessler,
"MIME Security with OpenPGP", RFC 3156, "MIME Security with OpenPGP", RFC 3156,
DOI 10.17487/RFC3156, August 2001, DOI 10.17487/RFC3156, August 2001,
<https://www.rfc-editor.org/info/rfc3156>. <https://www.rfc-editor.org/info/rfc3156>.
[RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard
(AES) Key Wrap Algorithm", RFC 3394, DOI 10.17487/RFC3394,
September 2002, <https://www.rfc-editor.org/info/rfc3394>.
[RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
Standards (PKCS) #1: RSA Cryptography Specifications Standards (PKCS) #1: RSA Cryptography Specifications
Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February
2003, <https://www.rfc-editor.org/info/rfc3447>. 2003, <https://www.rfc-editor.org/info/rfc3447>.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
2003, <https://www.rfc-editor.org/info/rfc3629>. 2003, <https://www.rfc-editor.org/info/rfc3629>.
[RFC3713] Matsui, M., Nakajima, J., and S. Moriai, "A Description of [RFC3713] Matsui, M., Nakajima, J., and S. Moriai, "A Description of
the Camellia Encryption Algorithm", RFC 3713, the Camellia Encryption Algorithm", RFC 3713,
DOI 10.17487/RFC3713, April 2004, DOI 10.17487/RFC3713, April 2004,
<https://www.rfc-editor.org/info/rfc3713>. <https://www.rfc-editor.org/info/rfc3713>.
[RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker,
"Randomness Requirements for Security", BCP 106, RFC 4086, "Randomness Requirements for Security", BCP 106, RFC 4086,
DOI 10.17487/RFC4086, June 2005, DOI 10.17487/RFC4086, June 2005,
<https://www.rfc-editor.org/info/rfc4086>. <https://www.rfc-editor.org/info/rfc4086>.
[RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves
for Security", RFC 7748, DOI 10.17487/RFC7748, January
2016, <https://www.rfc-editor.org/info/rfc7748>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
[SCHNEIER] Schneier, B., "Applied Cryptography Second Edition: [SCHNEIER] Schneier, B., "Applied Cryptography Second Edition:
protocols, algorithms, and source code in C", 1996. protocols, algorithms, and source code in C", 1996.
[SP800-56A]
Barker, E., Johnson, D., and M. Smid, "Recommendation for
Pair-Wise Key Establishment Schemes Using Discrete
Logarithm Cryptography", NIST Special Publication 800-56A
Revision 1, March 2007.
[SuiteB] National Security Agency, "NSA Suite B Cryptography", 11
March 2010,
<http://www.nsa.gov/ia/programs/suiteb_cryptography/>.
[TWOFISH] Schneier, B., Kelsey, J., Whiting, D., Wagner, D., Hall, [TWOFISH] Schneier, B., Kelsey, J., Whiting, D., Wagner, D., Hall,
C., and N. Ferguson, "The Twofish Encryption Algorithm", C., and N. Ferguson, "The Twofish Encryption Algorithm",
1999. 1999.
16.2. Informative References 18.2. Informative References
[BLEICHENBACHER] [BLEICHENBACHER]
Bleichenbacher, D., "Generating ElGamal Signatures Without Bleichenbacher, D., "Generating ElGamal Signatures Without
Knowing the Secret Key", Lecture Notes in Computer Knowing the Secret Key", Lecture Notes in Computer
Science Volume 1070, pp. 10-18, 1996. Science Volume 1070, pp. 10-18, 1996.
[JKS02] Jallad, K., Katz, J., and B. Schneier, "Implementation of [JKS02] Jallad, K., Katz, J., and B. Schneier, "Implementation of
Chosen-Ciphertext Attacks against PGP and GnuPG", 2002, Chosen-Ciphertext Attacks against PGP and GnuPG", 2002,
<http://www.counterpane.com/pgp-attack.html>. <http://www.counterpane.com/pgp-attack.html>.
[KOBLITZ] Koblitz, N., "A course in number theory and cryptography,
Chapter VI. Elliptic Curves", ISBN 0-387-96576-9, 1997.
[MZ05] Mister, S. and R. Zuccherato, "An Attack on CFB Mode [MZ05] Mister, S. and R. Zuccherato, "An Attack on CFB Mode
Encryption As Used By OpenPGP", IACR ePrint Archive Report Encryption As Used By OpenPGP", IACR ePrint Archive Report
2005/033, 8 February 2005, 2005/033, 8 February 2005,
<http://eprint.iacr.org/2005/033>. <http://eprint.iacr.org/2005/033>.
[REGEX] Friedl, J., "Mastering Regular Expressions", [REGEX] Friedl, J., "Mastering Regular Expressions",
ISBN 0-596-00289-0, August 2002. ISBN 0-596-00289-0, August 2002.
[RFC1991] Atkins, D., Stallings, W., and P. Zimmermann, "PGP Message [RFC1991] Atkins, D., Stallings, W., and P. Zimmermann, "PGP Message
Exchange Formats", RFC 1991, DOI 10.17487/RFC1991, August Exchange Formats", RFC 1991, DOI 10.17487/RFC1991, August
skipping to change at page 93, line 37 skipping to change at page 111, line 29
[RFC2440] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer, [RFC2440] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer,
"OpenPGP Message Format", RFC 2440, DOI 10.17487/RFC2440, "OpenPGP Message Format", RFC 2440, DOI 10.17487/RFC2440,
November 1998, <https://www.rfc-editor.org/info/rfc2440>. November 1998, <https://www.rfc-editor.org/info/rfc2440>.
[RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R.
Thayer, "OpenPGP Message Format", RFC 4880, Thayer, "OpenPGP Message Format", RFC 4880,
DOI 10.17487/RFC4880, November 2007, DOI 10.17487/RFC4880, November 2007,
<https://www.rfc-editor.org/info/rfc4880>. <https://www.rfc-editor.org/info/rfc4880>.
[RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic
Curve Cryptography Algorithms", RFC 6090,
DOI 10.17487/RFC6090, February 2011,
<https://www.rfc-editor.org/info/rfc6090>.
[SEC1] Standards for Efficient Cryptography Group, "SEC 1:
Elliptic Curve Cryptography", September 2000.
[SP800-57] NIST, "Recommendation on Key Management", NIST Special [SP800-57] NIST, "Recommendation on Key Management", NIST Special
Publication 800-57, March 2007, Publication 800-57, March 2007,
<http://csrc.nist.gov/publications/nistpubs/800-57/ <http://csrc.nist.gov/publications/nistpubs/800-57/
SP800-57-Part{1,2}.pdf>. SP800-57-Part{1,2}.pdf>.
Appendix A. Acknowledgements Appendix A. Document Workflow
This document is built from markdown using ruby-kramdown-rfc2629
(https://rubygems.org/gems/kramdown-rfc2629), and tracked using git
(https://git-scm.com/). The markdown source under development can be
found in the file "crypto-refresh.md" in the "main" branch of the git
repository (https://gitlab.com/openpgp-wg/rfc4880bis). Discussion of
this document should take place on the openpgp@ietf.org mailing list
(https://www.ietf.org/mailman/listinfo/openpgp).
A non-substantive editorial nit can be submitted directly as a merge
request (https://gitlab.com/openpgp-wg/rfc4880bis/-/merge_requests/
new). A substantive proposed edit may also be submitted as a merge
request, but should simultaneously be sent to the mailing list for
discussion.
An open problem can be recorded and tracked as an issue
(https://gitlab.com/openpgp-wg/rfc4880bis/-/issues) in the gitlab
issue tracker, but discussion of the issue should take place on the
mailing list.
[Note to RFC-Editor: Please remove this section on publication.]
Appendix B. ECC Point compression flag bytes
This specification introduces the new flag byte 0x40 to indicate the
point compression format. The value has been chosen so that the high
bit is not cleared and thus to avoid accidental sign extension. Two
other values might also be interesting for other ECC specifications:
Flag Description
---- -----------
0x04 Standard flag for uncompressed format
0x40 Native point format of the curve follows
0x41 Only X coordinate follows.
0x42 Only Y coordinate follows.
Appendix C. Acknowledgements
This memo also draws on much previous work from a number of other This memo also draws on much previous work from a number of other
authors, including: Derek Atkins, Charles Breed, Dave Del Torto, Marc authors, including: Derek Atkins, Charles Breed, Dave Del Torto, Marc
Dyksterhouse, Gail Haspert, Gene Hoffman, Paul Hoffman, Ben Laurie, Dyksterhouse, Gail Haspert, Gene Hoffman, Paul Hoffman, Ben Laurie,
Raph Levien, Colin Plumb, Will Price, David Shaw, William Stallings, Raph Levien, Colin Plumb, Will Price, David Shaw, William Stallings,
Mark Weaver, and Philip R. Zimmermann. Mark Weaver, and Philip R. Zimmermann.
Authors' Addresses Authors' Addresses
Werner Koch (editor) Werner Koch (editor)
GnuPG e.V. GnuPG e.V.
Rochusstr. 44 Rochusstr. 44
40479 Duesseldorf 40479 Duesseldorf
Germany Germany
Email: wk@gnupg.org Email: wk@gnupg.org
URI: https://gnupg.org/verein URI: https://gnupg.org/verein
Paul Wouters (editor) Paul Wouters (editor)
Email: pwouters@redhat.com Email: pwouters@redhat.com
 End of changes. 135 change blocks. 
406 lines changed or deleted 1138 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/