<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version  (Ruby 3.1.2) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

]>


<rfc ipr="trust200902" docName="draft-dkg-openpgp-hardware-secrets-01" category="info" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title>OpenPGP Hardware-Backed Secret Keys</title>

    <author initials="D. K." surname="Gillmor" fullname="Daniel Kahn Gillmor">
      <organization abbrev="ACLU">American Civil Liberties Union</organization>
      <address>
        <postal>
          <street>125 Broad St.</street>
          <city>New York, NY</city>
          <code>10004</code>
          <country>USA</country>
        </postal>
        <email>dkg@fifthhorseman.net</email>
      </address>
    </author>

    <date year="2024" month="April" day="19"/>

    <area>int</area>
    <workgroup>openpgp</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This document defines a standard wire format for indicating that the secret component of an OpenPGP asymmetric key is stored on a hardware device.</t>



    </abstract>

    <note title="About This Document" removeInRFC="true">
      <t>
        The latest revision of this draft can be found at <eref target="https://dkg.gitlab.io/openpgp-hardware-secrets/"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-dkg-openpgp-hardware-secrets/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        OpenPGP Working Group mailing list (<eref target="mailto:openpgp@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/openpgp/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/openpgp/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://gitlab.com/dkg/openpgp-hardware-secrets/"/>.</t>
    </note>


  </front>

  <middle>


<section anchor="introduction"><name>Introduction</name>

<t>Some OpenPGP secret key material is held by hardware devices that permit the user to operate the secret key without divulging it explicitly.
For example, the <xref target="OPENPGP-SMARTCARD"/> specification is intended specifically for this use.
It may also possible for OpenPGP implementations to use hardware-backed secrets via standard platform library interfaces like <xref target="TPM"/>.</t>

<t>An OpenPGP Secret Key Packet (see <xref section="5.5.3" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>) is typically used as part of a Transferable Secret Key (<xref section="10.2" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>) for interoperability between OpenPGP implementations.
An implementation that uses a hardware-backed secret key needs a standardized way to indicate to another implementation specific secret key material has been delegated to some hardware device.</t>

<t>This document defines a simple mechanism for indicating that a secret key has been delegated to a hardware device by allocating a codepoint in the "Secret Key Encryption (S2K Usage Octet)" registry (see <xref section="3.7.2.1" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>).</t>

<t>This document makes no attempt to specify how an OpenPGP implementation discovers, enumerates, or operates hardware, other than to recommend that the hardware should be identifiable by the secret key's corresponding public key material.</t>

<section anchor="requirements-language"><name>Requirements Language</name>

<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>

</section>
<section anchor="terminology"><name>Terminology</name>

<t>"Secret key" refers to a single cryptographic object, for example the "56 octets of the native secret key" of X448, as described in <xref section="5.5.5.8" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>.</t>

<t>"Public key" likewise refers to a single cryptographic object, for example the "56 octets of the native public key" of X448, as above.</t>

<t>"OpenPGP certificate" or just "certificate" refers to an OpenPGP Transferable Public Key (see <xref section="10.1" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>).</t>

<t>"Hardware" refers to any cryptographic device or subsystem capable of performing an asymmetric secret key operation using an embedded secret key without divulging the secret to the user.
For discoverability, the hardware is also expected to be able to produce the public key corresponding to the embedded secret key.</t>

<t>While this document talks about "hardware" in the abstract as referring to a cryptographic device embedding a single secret key, most actual hardware devices will embed and enable the use of multiple secret keys (see <xref target="multiple-key-hardware"/>).</t>

<t>This document uses the term "authorization" to mean any step, such as providing a PIN, password, proof of biometric identity, button-pushing, etc, that the hardware may require for an action.</t>

</section>
</section>
<section anchor="spec"><name>Hardware-backed Secret Key Material</name>

<t>An OpenPGP Secret Key packet (<xref section="5.5.3" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>) indicates that the secret key material is stored in cryptographic hardware that is identifiable by public key parameters in the following way.</t>

<t>The S2K usage octet is set to TBD (252?), known in shorthand as <spanx style="verb">HardwareBacked</spanx>.
A producing implementation <bcp14>MUST NOT</bcp14> include any trailing data in the rest of such a Secret Key packet.
A consuming implementation <bcp14>MUST</bcp14> ignore any trailing data in such a Secret Key packet.</t>

</section>
<section anchor="security-considerations"><name>Security Considerations</name>

<t>Hardware-backed secret keys promise several distinct security advantages to the user:</t>

<t><list style="symbols">
  <t>The secret key cannot be extracted from the device, so "kleptography" (the stealing of secret key material) is harder to perform.</t>
  <t>Some hardware can be moved between machines, enabling secret key portability without expanding the kleptographic attack surface.</t>
  <t>Some hardware devices offer auditability controls in the form of rate-limiting, user-visible authorization steps (e.g., button-presses or biometric sensors), or tamper-resistant usage counters.
Malicious use of a secret key on such a device should be harder, or at least more evident.</t>
  <t>Some hardware security devices can attest that key material has been generated on-card, thereby signaling that - barring a successful attack on the hardware - no other copy of the private key material exists.
Such mechanisms signal that the key holder did not have a chance to mishandle (e.g.: accidentally disclose) the private key material.</t>
</list></t>

<t>However, none of these purported advantages are without caveats.</t>

<t>The hardware itself might actually not resist secret key exfiltration as expected.
For example, isolated hardware devices are sometimes easier to attack physically, via temperature or voltage fluctuations (see <xref target="VOLTAGE-GLITCHING"/> and <xref target="SMART-CARD-FAULTS"/>).</t>

<t>In some cases, dedicated cryptographic hardware that generates a secret key internally may have significant flaws (see <xref target="ROCA"/>).</t>

<t>Furthermore, the most sensitive material in the case of decryption is often the cleartext itself, not the secret key material.
If the host computer itself is potentially compromised, then kleptographic exfiltration of the secret key material itself is only a small risk.
For example, the OpenPGP symmetric session key itself could be exfiltrated, permitting access to the cleartext to anyone without access to the secret key material.</t>

<t>Portability brings with it other risks, including the possibility of abuse by the host software on any of the devices to which the hardware is connected.</t>

<t>Rate-limiting, user-visible authorization steps, and any other form of auditability also suffer from risks related to compromised host operating systems.
Few hardware devices are capable of revealing to the user what operations specifically were performed by the device, so even if the user deliberately uses the device to, say, sign an object, the user depends on the host software to feed the correct object to the device's signing capability.</t>

</section>
<section anchor="usability-considerations"><name>Usability Considerations</name>

<t>Hardware-backed secret keys present specific usability challenges for integration with OpenPGP.</t>

<section anchor="some-hardware-might-be-unavailable-to-some-implementations"><name>Some Hardware Might Be Unavailable To Some Implementations</name>

<t>This specification gives no hints about how to find the hardware device, and presumes that an implementation will be able to probe available hardware to associate it with the corresponding public key material.
In particular, there is no attempt to identify specific hardware or "slots" using identifiers like PKCS #11 URIs (<xref target="RFC7512"/>) or smartcard serial numbers (see <xref target="historical-notes"/>).
This minimalism is deliberate, as it's possible for the same key material to be available on multiple hardware devices, or for a device to be located on one platform with a particular hardware identifier, while on another platform it uses a different hardware identifier.</t>

<t>Not every OpenPGP implementation will be able to talk to every possible hardware device.
If an OpenPGP implementation encounters a hardware-backed secret key as indicated with this mechanism, but cannot identify any attached hardware that lists the corresponding secret key material, it should warn the user that the specific key claims to be hardware-backed but the corresponding hardware cannot be found.
It may also want to inform the user what categories of hardware devices it is capable of probing, for debugging purposes.</t>

</section>
<section anchor="multiple-key-hardware"><name>Hardware Should Support Multiple Secret Keys</name>

<t>Most reasonable OpenPGP configurations require the use of multiple secret keys by a single operator.
For example, the user may use one secret key for signing, and another secret key for decryption, and the corresponding public keys of both are contained in the same OpenPGP certificate.</t>

<t>Reasonable hardware <bcp14>SHOULD</bcp14> support embedding and identifying more than one secret key, so that a typical OpenPGP user can rely on a single device for hardware backing.</t>

</section>
<section anchor="authorization-challenges"><name>Authorization Challenges</name>

<t>Cryptographic hardware can be difficult to use if frequent authorization is required, particularly in circumstances like reading messages in a busy e-mail inbox.
This hardware <bcp14>MAY</bcp14> require authorization for each use of the secret key material as a security measure, but considerations should be made for caching authorization</t>

<t>If the cryptographic hardware requires authorization for listing the corresponding public key material, it becomes even more difficult to use the device in regular operation.
Hardware <bcp14>SHOULD NOT</bcp14> require authorization for the action of producing the corresponding public key.</t>

<t>If a user has two attached pieces of hardware that both hold the same secret key, and one requires authorization while the other does not, it is reasonable for an implementation to try the one that doesn't require authorization first.
Some cryptographic hardware is designed to lock the device on repeated authorization failures (e.g. 3 bad PIN entries locks the device), so this approach reduces the risk of accidental lockout.</t>

</section>
<section anchor="latency-and-error-handling"><name>Latency and Error Handling</name>

<t>While hardware-backed secret key operations can be significantly slower than modern computers, and physical affordances like button-presses or NFC tapping can themselves incur delay, an implementation using a hardware-backed secret key should remain responsive to the user.
It should indicate when some interaction with the hardware may be required, and it should use a sensible timeout if the hardware device appears to be unresponsive.</t>

<t>A reasonable implementation should surface actionable errors or warnings from the hardware to the user where possible.</t>

</section>
</section>
<section anchor="iana-considerations"><name>IANA Considerations</name>

<t>This document asks IANA to make two changes in the "OpenPGP" protocol group.</t>

<t>Add the following row in the "OpenPGP Secret Key Encrpytion (S2K Usage Octet)" registry:</t>

<texttable title="Row to add to OpenPGP Secret Key Encrpytion (S2K Usage Octet) registry">
      <ttcol align='left'>S2K usage octet</ttcol>
      <ttcol align='left'>Shorthand</ttcol>
      <ttcol align='left'>Encryption parameter fields</ttcol>
      <ttcol align='left'>Encryption</ttcol>
      <ttcol align='left'>Generate?</ttcol>
      <c>TBD (252?)</c>
      <c>HardwareBacked</c>
      <c>none</c>
      <c>no data, see <xref target="spec"/> of RFC XXX (this document)</c>
      <c>Yes</c>
</texttable>

<t>Modify this row of the "OpenPGP Symmetric Key Algorithms" registry:</t>

<texttable title="Row to modify in OpenPGP Symmetric Key Algorithms registry">
      <ttcol align='right'>ID</ttcol>
      <ttcol align='left'>Algorithm</ttcol>
      <c>253, 254, and 255</c>
      <c>Reserved to avoid collision with Secret Key Encryption</c>
</texttable>

<t>to include TBD (252?) in this reserved codepoint sequence, resulting in the following entry:</t>

<texttable title="Modified row in OpenPGP Symmetric Key Algorithms registry">
      <ttcol align='right'>ID</ttcol>
      <ttcol align='left'>Algorithm</ttcol>
      <c>TBD (252?), 253, 254, and 255</c>
      <c>Reserved to avoid collision with Secret Key Encryption</c>
</texttable>

</section>


  </middle>

  <back>


    <references title='Normative References'>




<reference anchor='I-D.ietf-openpgp-crypto-refresh'>
   <front>
      <title>OpenPGP</title>
      <author fullname='Paul Wouters' initials='P.' surname='Wouters'>
         <organization>Aiven</organization>
      </author>
      <author fullname='Daniel Huigens' initials='D.' surname='Huigens'>
         <organization>Proton AG</organization>
      </author>
      <author fullname='Justus Winter' initials='J.' surname='Winter'>
         <organization>Sequoia-PGP</organization>
      </author>
      <author fullname='Niibe Yutaka' initials='N.' surname='Yutaka'>
         <organization>FSIJ</organization>
      </author>
      <date day='4' month='January' year='2024'/>
      <abstract>
	 <t>   This document specifies the message formats used in OpenPGP.  OpenPGP
   provides encryption with public-key or symmetric cryptographic
   algorithms, digital signatures, compression and key management.

   This document is maintained in order to publish all necessary
   information needed to develop interoperable applications based on the
   OpenPGP format.  It is not a step-by-step cookbook for writing an
   application.  It describes only the format and methods needed to
   read, check, generate, and write conforming packets crossing any
   network.  It does not deal with storage and implementation questions.
   It does, however, discuss implementation issues necessary to avoid
   security flaws.

   This document obsoletes: RFC 4880 (OpenPGP), RFC 5581 (Camellia in
   OpenPGP) and RFC 6637 (Elliptic Curves in OpenPGP).

	 </t>
      </abstract>
   </front>
   <seriesInfo name='Internet-Draft' value='draft-ietf-openpgp-crypto-refresh-13'/>
   
</reference>

<reference anchor='RFC2119'>
  <front>
    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
    <author fullname='S. Bradner' initials='S.' surname='Bradner'/>
    <date month='March' year='1997'/>
    <abstract>
      <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
    </abstract>
  </front>
  <seriesInfo name='BCP' value='14'/>
  <seriesInfo name='RFC' value='2119'/>
  <seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>

<reference anchor='RFC8174'>
  <front>
    <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
    <author fullname='B. Leiba' initials='B.' surname='Leiba'/>
    <date month='May' year='2017'/>
    <abstract>
      <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
    </abstract>
  </front>
  <seriesInfo name='BCP' value='14'/>
  <seriesInfo name='RFC' value='8174'/>
  <seriesInfo name='DOI' value='10.17487/RFC8174'/>
</reference>




    </references>

    <references title='Informative References'>

<reference anchor="OPENPGP-SMARTCARD" target="https://gnupg.org/ftp/specs/OpenPGP-smart-card-application-3.4.1.pdf">
  <front>
    <title>Functional Specification of the OpenPGP application on ISO Smart Card Operating Systems, Version 3.4.1</title>
    <author initials="A." surname="Pietig" fullname="Achim Pietig">
      <organization></organization>
    </author>
    <date year="2020" month="March" day="18"/>
  </front>
</reference>
<reference anchor="GNUPG-SECRET-STUB" target="https://dev.gnupg.org/source/gnupg/browse/master/doc/DETAILS;gnupg-2.4.3$1511">
  <front>
    <title>GNU Extensions to the S2K algorithm</title>
    <author initials="W." surname="Koch" fullname="Werner Koch">
      <organization>g10 Code</organization>
    </author>
    <date year="2023" month="July" day="04"/>
  </front>
</reference>
<reference anchor="TPM" target="https://trustedcomputinggroup.org/resource/tpm-library-specification/">
  <front>
    <title>Trusted Platform Module Library Specification, Family “2.0”, Level 00, Revision 01.59</title>
    <author >
      <organization>Trusted Computing Group</organization>
    </author>
    <date year="2019" month="November"/>
  </front>
</reference>
<reference anchor="SMART-CARD-FAULTS" target="http://hdl.handle.net/2117/99293">
  <front>
    <title>Smart Card Fault Injections with High Temperatures</title>
    <author initials="P. M. C." surname="Massolino" fullname="Pedro Maat C. Massolino">
      <organization></organization>
    </author>
    <author initials="B." surname="Ege" fullname="Baris Ege">
      <organization></organization>
    </author>
    <author initials="L." surname="Batina" fullname="Lejla Batina">
      <organization></organization>
    </author>
    <date year="2016" month="November" day="15"/>
  </front>
</reference>


<reference anchor='VOLTAGE-GLITCHING'>
  <front>
    <title>The Forgotten Threat of Voltage Glitching: A Case Study on Nvidia Tegra X2 SoCs</title>
    <author fullname='Otto Bittner' initials='O.' surname='Bittner'>
      <organization/>
    </author>
    <author fullname='Thilo Krachenfels' initials='T.' surname='Krachenfels'>
      <organization/>
    </author>
    <author fullname='Andreas Galauner' initials='A.' surname='Galauner'>
      <organization/>
    </author>
    <author fullname='Jean-Pierre Seifert' initials='J.' surname='Seifert'>
      <organization/>
    </author>
    <date year='2021'/>
  </front>
  <seriesInfo name='arXiv' value='article'/>
  <seriesInfo name='DOI' value='10.48550/ARXIV.2108.06131'/>
</reference>

<reference anchor='ROCA'>
  <front>
    <title>The Return of Coppersmith's Attack: Practical Factorization of Widely Used RSA Moduli</title>
    <author fullname='Matus Nemec' initials='M.' surname='Nemec'>
      <organization>Masaryk University, Ca' Foscari University of Venice, Brno, Czech Rep</organization>
    </author>
    <author fullname='Marek Sys' initials='M.' surname='Sys'>
      <organization>Masaryk University, Brno, Czech Rep</organization>
    </author>
    <author fullname='Petr Svenda' initials='P.' surname='Svenda'>
      <organization>Masaryk University, Brno, Czech Rep</organization>
    </author>
    <author fullname='Dusan Klinec' initials='D.' surname='Klinec'>
      <organization>EnigmaBridge, Masaryk University, Brno, Czech Rep</organization>
    </author>
    <author fullname='Vashek Matyas' initials='V.' surname='Matyas'>
      <organization>Masaryk University, Brno, Czech Rep</organization>
    </author>
    <date month='October' year='2017'/>
  </front>
  <seriesInfo name='Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications' value='Security'/>
  <seriesInfo name='DOI' value='10.1145/3133956.3133969'/>
</reference>

<reference anchor='RFC7512'>
  <front>
    <title>The PKCS #11 URI Scheme</title>
    <author fullname='J. Pechanec' initials='J.' surname='Pechanec'/>
    <author fullname='D. Moffat' initials='D.' surname='Moffat'/>
    <date month='April' year='2015'/>
    <abstract>
      <t>This memo specifies a PKCS #11 Uniform Resource Identifier (URI) Scheme for identifying PKCS #11 objects stored in PKCS #11 tokens and also for identifying PKCS #11 tokens, slots, or libraries. The URI scheme is based on how PKCS #11 objects, tokens, slots, and libraries are identified in "PKCS #11 v2.20: Cryptographic Token Interface Standard".</t>
    </abstract>
  </front>
  <seriesInfo name='RFC' value='7512'/>
  <seriesInfo name='DOI' value='10.17487/RFC7512'/>
</reference>




    </references>


<section anchor="historical-notes"><name>Historical notes</name>

<t>Some OpenPGP implementations make use of private codepoint ranges in the OpenPGP specification within an OpenPGP Transferable Secret Key to indicate that the secret key can be found on a smartcard.</t>

<t>For example, GnuPG uses the private/experimental codepoint 101 in the S2K Specifier registry, along with an embedded trailer with an additional codepoint, plus the serial number of the smartcard (see <xref target="GNUPG-SECRET-STUB"/>).</t>

<t>However, recent versions of that implementation ignore the embedded serial number in favor of scanning available devices for a match of the key material, since some people have multiple cards with the same secret key.</t>

</section>
<section anchor="test-vectors"><name>Test vectors</name>

<section anchor="example-transferable-secret-key"><name>Example Transferable Secret Key</name>

<t>The OpenPGP Transferable Secret Key used for this example. It includes (unencrypted) private key material for both its primary key and one subkey:</t>

<figure><sourcecode type="application/pgp-keys" name="software-backed.key"><![CDATA[
-----BEGIN PGP PRIVATE KEY BLOCK-----

xVgEZgWtcxYJKwYBBAHaRw8BAQdAlLK6UPQsVHR2ETk1SwVIG3tBmpiEtikYYlCy
1TIiqzYAAQCwm/O5cWsztxbUcwOHycBwszHpD4Oa+fK8XJDxLWH7dRIZzR08aGFy
ZHdhcmUtc2VjcmV0QGV4YW1wbGUub3JnPsKNBBAWCAA1AhkBBQJmBa1zAhsDCAsJ
CAcKDQwLBRUKCQgLAhYCFiEEXlP8Tur0WZR+f0I33/i9Uh4OHEkACgkQ3/i9Uh4O
HEnryAD8CzH2ajJvASp46ApfI4pLPY57rjBX++d/2FQPRyqGHJUA/RLsNNgxiFYm
K5cjtQe2/DgzWQ7R6PxPC6oa3XM7xPcCx10EZgWtcxIKKwYBBAGXVQEFAQEHQE1Y
XOKeaklwG01Yab4xopP9wbu1E+pCrP1xQpiFZW5KAwEIBwAA/12uOubAQ5nhf1UF
a51SQwFLpggB/Spn29qDnSQXOTzIDvPCeAQYFggAIAUCZgWtcwIbDBYhBF5T/E7q
9FmUfn9CN9/4vVIeDhxJAAoJEN/4vVIeDhxJVTgA/1WaFrKdP3AgL0Ffdooc5XXb
jQsj0uHo6FZSHRI4pchMAQCyJnKQ3RvW/0gm41JCqImyg2fxWG4hY0N5Q7Rc6Pyz
DQ==
=lYbx
-----END PGP PRIVATE KEY BLOCK-----
]]></sourcecode></figure>

</section>
<section anchor="as-a-hardware-backed-secret-key"><name>As a Hardware-Backed Secret Key</name>

<t>The same OpenPGP Transferable Secret Key with the S2K Usage Octet set to 252? (HardwareBacked) for both the Primary Key Packet and the Subkey Packet. This format omits all data following the S2K Usage Octet:</t>

<figure><sourcecode type="application/pgp-keys" name="hardware-backed.key"><![CDATA[
-----BEGIN PGP PRIVATE KEY BLOCK-----

xTQEZgWtcxYJKwYBBAHaRw8BAQdAlLK6UPQsVHR2ETk1SwVIG3tBmpiEtikYYlCy
1TIiqzb8zR08aGFyZHdhcmUtc2VjcmV0QGV4YW1wbGUub3JnPsKNBBAWCAA1AhkB
BQJmBa1zAhsDCAsJCAcKDQwLBRUKCQgLAhYCFiEEXlP8Tur0WZR+f0I33/i9Uh4O
HEkACgkQ3/i9Uh4OHEnryAD8CzH2ajJvASp46ApfI4pLPY57rjBX++d/2FQPRyqG
HJUA/RLsNNgxiFYmK5cjtQe2/DgzWQ7R6PxPC6oa3XM7xPcCxzkEZgWtcxIKKwYB
BAGXVQEFAQEHQE1YXOKeaklwG01Yab4xopP9wbu1E+pCrP1xQpiFZW5KAwEIB/zC
eAQYFggAIAUCZgWtcwIbDBYhBF5T/E7q9FmUfn9CN9/4vVIeDhxJAAoJEN/4vVIe
DhxJVTgA/1WaFrKdP3AgL0Ffdooc5XXbjQsj0uHo6FZSHRI4pchMAQCyJnKQ3RvW
/0gm41JCqImyg2fxWG4hY0N5Q7Rc6PyzDQ==
=3w/O
-----END PGP PRIVATE KEY BLOCK-----
]]></sourcecode></figure>

<t>The (primary) Secret-Key Packet of this key looks as follows, in this format:</t>

<t><spanx style="verb">
00000000  c5                                                 CTB
00000001     34                                              length
00000002        04                                           version
00000003           66 05 ad 73                               creation_time
00000007                       16                            pk_algo
00000008                           09                        curve_len
00000009                              2b 06 01 04 01 da 47   curve
00000010  0f 01
00000012        01 07                                        eddsa_public_len
00000014              40 94 b2 ba  50 f4 2c 54 74 76 11 39   eddsa_public
00000020  35 4b 05 48 1b 7b 41 9a  98 84 b6 29 18 62 50 b2
00000030  d5 32 22 ab 36
00000035                 fc                                  s2k_usage
</spanx></t>

</section>
</section>
<section anchor="acknowledgements"><name>Acknowledgements</name>

<t>This work depends on a history of significant work with hardware-backed OpenPGP secret key material, including useful implementations and guidance from many people, including:</t>

<t><list style="symbols">
  <t>NIIBE Yutaka</t>
  <t>Achim Pietig</t>
  <t>Werner Koch</t>
  <t>Heiko Schäfer</t>
</list></t>

<t>The people acknowledeged in this section are not responsible for any proposals, errors, or omissions in this document.</t>

</section>
<section anchor="document-history"><name>Document History</name>

<section anchor="substantive-changes-from-draft-dkg-openpgp-hardware-secrets-00-to-draft-dkg-openpgp-hardware-secrets-01"><name>Substantive Changes from draft-dkg-openpgp-hardware-secrets-00 to draft-dkg-openpgp-hardware-secrets-01</name>

<t><list style="symbols">
  <t>Added test vector for experimentation</t>
  <t>Mention on-device attestation</t>
  <t>update OpenPGP card spec reference to 3.4.1</t>
</list></t>

</section>
</section>


  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA61c6XLbSJL+j6eooTei7W3xAA9du709FEVJtC5KpCzJExPd
IFAkYeEyCiBFdbtjHmQ3Yn/sk+y+yTzJZmZVgQAP2Y5ohbst4qjKyuPLL7OK
LpfLRuImHj9k1xEP+qd9dmbFztyKefnIsp+4wwbcjnnCzvlCGE5oB5YPDzux
NU7KztOkHMJr0SQqT/Vrgp4X5Zpp2FbCJ2G8OGRuMA4Nw43iQ5bEqUjqtdpB
rW7A8xbeTIx5GD9N4jCNDpka0XjiC7jqHLJekPA44En5GGc1RDryXSHcMBgu
IpCl1x2eGIZIrMD5xfLCAC4tuDAi95D9LQntHSbCOIn5WMBvCx9/+bthWGky
DeNDg5UNBj9uIA7ZcYWdV9ip63l+GNNludhjK3C5x86taVC4G8aTQ9b2eeza
VsA67sz12IU74nHicsHuApCQnhMwO08OmVlvsaM4tECnSYXu2G4Cyrnic/YI
699hV4/ycujAtGatVmuqz2mQoBrvBm26YI1GMZ/B5J2LO7rAfcv1wCxPk7+O
3XEyhbUJuBZUQG3GjAcph6UypeCSMnUJLiWkwtI9TO8GE3aKT+B1OV5J2eKv
Lk/GFVgv3rJiewq3pkkSicNqFZ/ES+6MV/RjVbxQHcXhXPCqGqOK78Y8CnPv
TsD1rFHFDv0qiF7d5kv0qgfOJJLcy/BGRQ3ghq+9i84X+1YCEoIWrvvdK1h8
eXDZvh122rfHqBmWWPEEbZRJFqTRhJYyTqKqiLgtqkptZeFbcVK2YaKyFUUe
WD8BU5cblWbFrETOmMaTQXWSBjbetDw2gDHcsXqYhWOWTHkWdLlxGPzpDa7Z
AGdhHZgFn4rhHthnsBAJ98GTP/AYI4DRpDihA+o5ZPVavVauNcrmPl7LnBx+
pJ8rj26Du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