mirror of
https://codeberg.org/openpgp/notes.git
synced 2024-11-22 15:42:06 +01:00
Compare commits
4 commits
99e2ea7cdd
...
edc2c8322d
Author | SHA1 | Date | |
---|---|---|---|
edc2c8322d | |||
70b6bd2f43 | |||
23d97d6912 | |||
b338286947 |
5 changed files with 170 additions and 7 deletions
74
book/assets/drawio/ops-signed-message.drawio
Normal file
74
book/assets/drawio/ops-signed-message.drawio
Normal file
|
@ -0,0 +1,74 @@
|
|||
<mxfile host="app.diagrams.net" modified="2023-12-19T17:47:29.230Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0" etag="CuD1JH9_KP5-_UnQaIqH" version="22.1.11" type="device">
|
||||
<diagram name="Seite-1" id="06IJX984rhBGnz6KE12L">
|
||||
<mxGraphModel dx="2261" dy="708" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="9NkdM7txntXo-xmCDq8w-1" target="9NkdM7txntXo-xmCDq8w-3" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="9NkdM7txntXo-xmCDq8w-1" target="9NkdM7txntXo-xmCDq8w-14" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="480" y="310" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-1" value="<div>One-Pass-Signature</div><div>Hash: SHA512</div><div>Fingerprint: 0xB0B0<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="50" y="160" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-2" value="<div>Literal Data</div><div>"Hello World!"<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="170" y="160" width="250" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;startArrow=classic;startFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-3" target="9NkdM7txntXo-xmCDq8w-14" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-3" value="<div>Signature</div><div>Hash: SHA512<br></div><div>Issuer: B0B0<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="420" y="160" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="9NkdM7txntXo-xmCDq8w-6" target="9NkdM7txntXo-xmCDq8w-7" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="-10" y="120" />
|
||||
<mxPoint x="660" y="120" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="9NkdM7txntXo-xmCDq8w-6" target="9NkdM7txntXo-xmCDq8w-16" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="640" y="420" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-6" value="<div>One-Pass-Signature</div><div>Hash: SHA384</div><div>Fingerprint: 0xB0B1<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="-70" y="160" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-7" target="9NkdM7txntXo-xmCDq8w-16" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-7" value="<div>Signature</div><div>Hash: SHA384<br></div><div>Issuer: B0B1<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="580" y="160" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;endArrow=oval;endFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-9" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="310" y="280" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-9" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;rotation=-90;" parent="1" vertex="1">
|
||||
<mxGeometry x="300" y="140" width="20" height="220" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endArrow=oval;endFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-10" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="310" y="310" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-10" value=""Hello World!" is hashed" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
|
||||
<mxGeometry x="237.5" y="220" width="145" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-14" value="SHA512 Hash" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="440" y="260" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-16" value="SHA384 Hash" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="600" y="290" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
3
book/assets/drawio/ops-signed-message.svg
Normal file
3
book/assets/drawio/ops-signed-message.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 12 KiB |
63
book/assets/drawio/prefixed-signed-message.drawio
Normal file
63
book/assets/drawio/prefixed-signed-message.drawio
Normal file
|
@ -0,0 +1,63 @@
|
|||
<mxfile host="app.diagrams.net" modified="2023-12-19T17:51:29.565Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0" etag="_bWwKk-sC-z0pngoIar_" version="22.1.11" type="device">
|
||||
<diagram name="Seite-1" id="06IJX984rhBGnz6KE12L">
|
||||
<mxGraphModel dx="2261" dy="708" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-2" value="<div>Literal Data</div><div>"Hello World!"<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="170" y="160" width="250" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;startArrow=classic;startFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-3" target="9NkdM7txntXo-xmCDq8w-16" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endArrow=none;endFill=0;" parent="1" source="9NkdM7txntXo-xmCDq8w-3" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="310" y="360" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="-70" y="360" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-3" value="<div>Signature</div><div>Hash: SHA384<br></div><div>Issuer: B0B0<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="-150" y="160" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;startArrow=none;startFill=0;endArrow=none;endFill=0;" parent="1" source="9NkdM7txntXo-xmCDq8w-7" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="310" y="270" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="90" y="270" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-7" target="9NkdM7txntXo-xmCDq8w-14" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-7" value="<div>Signature</div><div>Hash: SHA512<br></div><div>Issuer: B0B1<br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="10" y="160" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;endArrow=oval;endFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-9" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="310" y="270" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;endArrow=oval;endFill=1;" parent="1" source="9NkdM7txntXo-xmCDq8w-9" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="310" y="360" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-9" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;rotation=-90;" parent="1" vertex="1">
|
||||
<mxGeometry x="300" y="140" width="20" height="220" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-10" value=""Hello World!" is hashed" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
|
||||
<mxGeometry x="237.5" y="220" width="145" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-14" value="SHA512 Hash" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="30" y="300" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="9NkdM7txntXo-xmCDq8w-16" value="SHA384 Hash" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="-130" y="390" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
3
book/assets/drawio/prefixed-signed-message.svg
Normal file
3
book/assets/drawio/prefixed-signed-message.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.4 KiB |
|
@ -41,7 +41,7 @@ Note that {term}`data signatures<Data Signature>` are distinct from [](/signing_
|
|||
|
||||
## Detached signatures
|
||||
|
||||
A {term}`detached signature` is produced by calculating an {term}`OpenPGP signature<OpenPGP Signature Packet>` over the data intended for signing. The original data remains unchanged, and the {term}`OpenPGP signature<OpenPGP Signature Packet>` is stored as a standalone file. A {term}`detached signature` file can be distributed alongside or independent of the original data. The {term}`authenticity<Authentication>` and integrity of the original data file can be {term}`verified<Verification>` by using the {term}`detached signature` file.
|
||||
A {term}`detached signature` is produced by calculating an {term}`OpenPGP signature<OpenPGP Signature Packet>` over the data intended for signing. The original data remains unchanged, and the {term}`OpenPGP signature<OpenPGP Signature Packet>` is stored separately, e.g. as a standalone file. A {term}`detached signature` file can be distributed alongside or independent of the original data. The {term}`authenticity<Authentication>` and integrity of the original data file can be {term}`verified<Verification>` by using the {term}`detached signature` file.
|
||||
|
||||
This {term}`signature<OpenPGP Signature Packet>` format is especially useful for signing software releases and other files where it is imperative that the content remains unaltered during the signing process.
|
||||
|
||||
|
@ -54,7 +54,7 @@ This method is commonly used for signing or encrypting emails. Most email softwa
|
|||
|
||||
OpenPGP defines two variant forms of inline-signed messages:
|
||||
|
||||
1. **{term}`One-pass signed messages<One-pass signed Message>`** This is the commonly used format for inline-signed messages. A signer can produce this format in one pass.
|
||||
1. **{term}`One-pass signed messages<One-pass signed Message>`** This is the commonly used format for inline-signed messages. A signer can produce and a verifier verify this format in one pass.
|
||||
2. **{term}`Prefixed signed messages<Prefixed signed Message>`** This format predates[^inline-signature-formats] {term}`one-pass signed messages<One-pass signed Message>` and is conceptually slightly simpler. However, it has no strong benefits and is now rarely used.
|
||||
|
||||
[^inline-signature-formats]: One-pass signing was first specified in RFC 2440. The format was not supported in PGP 2.6.x.
|
||||
|
@ -68,23 +68,36 @@ This is the commonly used format for inline signed messages.
|
|||
|
||||
A {term}`one-pass signed<One-pass signed Message>` {term}`OpenPGP message` consists of three segments:
|
||||
|
||||
1. [**One-pass signature packets**](https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-12.html#one-pass-sig): These one or more {term}`packets<Packet>` precede the signed data and enable {term}`signature<OpenPGP Signature Packet>` computation in one pass.
|
||||
1. [**One-pass signature packets**](https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-12.html#one-pass-sig): These one or more {term}`packets<Packet>` precede the signed data and enable {term}`signature<OpenPGP Signature Packet>` computation (both creation and verification) in a single pass.
|
||||
|
||||
2. [**Literal data packet**](https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-12.html#lit): This contains the original data (e.g., the body of a message), without additional interpretation or conversion.
|
||||
|
||||
3. **{term}`Data signature packets<OpenPGP Signature Packet>`**: These contain the {term}`cryptographic signature` corresponding to the original data.
|
||||
|
||||
```{figure} plain_svg/ops-signed-message.svg
|
||||
:name: fig-ops-signed-message
|
||||
:alt: Depicts the structure of a one-pass-signed message. Two one-pass-signatures lead the literal data packet, followed by two signature packets. Arrows show, how the hash-algorithm field of the one-pass-signatures is inspected in order to initiate the hashing procedure.
|
||||
|
||||
The structure of a one-pass signed message.
|
||||
```
|
||||
|
||||
```{note}
|
||||
Despite its name, a {term}`one-pass signature packet` is not a type of {term}`signature packet<OpenPGP Signature Packet>`.
|
||||
|
||||
Instead, it's a type of auxiliary packet that can be used in conjunction with {term}`signature packets<OpenPGP Signature Packet>`. Its use allows storing the {term}`signature packets<OpenPGP Signature Packet>` after the message body.
|
||||
|
||||
The position of the signature packet within the OpenPGP message is important for efficient data processing. The plaintext data might be large in size, and memory might be constrained.
|
||||
The producer of a signed OpenPGP message wants to streamline the signature calculation process in such a way that allows to emit the data to be signed while calculating the signature. The signature itself is therefore appended to the data.
|
||||
The verifier on the other hand needs to know the hash algorithm used to calculate the signature before starting the verification process. As a consequence, either the producer would need to pass the plaintext data twice, once to calculate the signature and a second time to emit the signed data (the result is a prefixed-signed message), or the verifier needs to process (and cache) the whole OpenPGP message to reach the signature packets at the end in order to determine the hash algorithm, to then re-process the whole message, verifying the signature.
|
||||
|
||||
The one-pass signature solves this issue, by allowing both the creation and verification of a signed message in a single pass.
|
||||
```
|
||||
|
||||
#### Creation
|
||||
|
||||
To produce an {term}`inline signature`, the {term}`signer` processes the entirety of the data by reading from an input file and writing into an output {term}`OpenPGP message` file. As the data is processed, the {term}`signer` simultaneously calculates a {term}`cryptographic signature`. This procedure results in the appending of a {term}`data signature packet` to the output {term}`OpenPGP message` file, where it can be efficiently stored.
|
||||
To produce an {term}`inline signature`, the {term}`signer` decides on a hash algorithm and emits a {term}`one-pass signature packet<One-pass Signature Packet>` into the destination {term}`OpenPGP message`. This contains essential information such as the {term}`fingerprint<OpenPGP Fingerprint>` of the {term}`signing key<OpenPGP Component Key>` and the {term}`hash<Hash Digest>` algorithm used for computing the {term}`signature<OpenPGP Signature Packet>`'s {term}`hash digest`. The signer then processes the entirety of the plaintext data, emitting it as a {term}`literal data<Literal Data Packet>` into the message as well. Once the data is processed, the {term}`signer` calculates a {term}`cryptographic signature` using the calculated hash value. Lastly, the result is emitted as a {term}`data signature packet` to the output message, and the whole packet sequence can be efficiently stored or transmitted.
|
||||
|
||||
For efficient {term}`verification`, an application must understand how to handle the {term}`literal data<Literal Data Packet>` prior to its reading. This requirement is addressed by the {term}`one-pass signature packets<One-pass Signature Packet>` located at the beginning of {term}`inline-signed<Inline Signature>` messages. These {term}`packets<Packet>` include essential information such as the {term}`fingerprint<OpenPGP Fingerprint>` of the {term}`signing key<OpenPGP Component Key>` and the {term}`hash<Hash Digest>` algorithm used for computing the {term}`signature<OpenPGP Signature Packet>`'s {term}`hash digest`. This setup enables the verifier to process the data correctly and efficiently.
|
||||
For efficient {term}`verification`, an application must understand how to handle the {term}`literal data<Literal Data Packet>` prior to reading from it. This requirement is addressed by the {term}`one-pass signature packets<One-pass Signature Packet>` located at the beginning of {term}`inline-signed<Inline Signature>` messages. This setup enables the verifier to process the data correctly and efficiently in only a single pass.
|
||||
|
||||
Strictly speaking, knowing just the hash algorithm would be sufficient to begin the verification process. However, having efficient access to the signer's fingerprint or key ID upfront allows OpenPGP software to fetch the signer's certificate(s) before processing the entirety of the - potentially large - signed data. This may, for example, involve downloading the certificate from a keyserver. In case fetching the signer's certificate(s) fails, or requires additional input from the user, it is better to signal the user about this before processing the data.
|
||||
|
||||
|
@ -103,7 +116,7 @@ Important to note, the {term}`signer`'s {term}`public key<OpenPGP Certificate>`,
|
|||
(prefixed-signature)=
|
||||
### Prefixed signed message
|
||||
|
||||
A {term}`prefixed signed message` consists of {term}`signature packet(s)<signature packet>` followed by the message. This inline signature format serves the same function as a {term}`one-pass signed message`. For the verifier, the two formats are equally convenient. However, on the signer's side, it takes more computational work to generate a {term}`prefixed signed message`.
|
||||
A {term}`prefixed signed message` consists of {term}`signature packet(s)<signature packet>` followed by the message. For the verifier, processing one-pass-signed and prefixed-signed messages are equally convenient. However, on the signer's side, it takes more resources to generate a {term}`prefixed signed message`.
|
||||
|
||||
#### Structure
|
||||
|
||||
|
@ -113,6 +126,13 @@ In this format, the signature packets are stored ahead of the message itself:
|
|||
|
||||
2. [**Literal data packet**](https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-12.html#lit): This contains the original data (e.g., the body of a message), without additional interpretation or conversion.
|
||||
|
||||
```{figure} plain_svg/prefixed-signed-message.svg
|
||||
:name: fig-prefixed-signed-message
|
||||
:alt: Depicts the structure of a prefixed-signed message. As an example, two signature packets lead a literal data packet. Arrows show, how the signatures hash algorithm field is inspected to start the hashing procedure.
|
||||
|
||||
Structure of a prefixed-signed message.
|
||||
```
|
||||
|
||||
Compared to a {term}`one-pass signed message`, there are no {term}`one-pass signature packets<One-pass Signature Packet>` in this format, and the (otherwise equivalent) {term}`signature packet(s)<signature packet>` are stored ahead of the signed data.
|
||||
|
||||
For verification, this is equally convenient as the one-pass signed message form.
|
||||
|
|
Loading…
Reference in a new issue