Skip to content

Commit f8b38ed

Browse files
author
ID Bot
committed
Script updating gh-pages from f7b81e3. [ci skip]
1 parent 0cfe2ce commit f8b38ed

2 files changed

Lines changed: 42 additions & 133 deletions

File tree

‎draft-denis-dprive-dnscrypt.html‎

Lines changed: 25 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,33 +1409,9 @@ <h2 id="name-conventions-and-definitions">
14091409
<h2 id="name-protocol-flow">
14101410
<a href="#section-3" class="section-number selfRef">3. </a><a href="#name-protocol-flow" class="section-name selfRef">Protocol Flow</a>
14111411
</h2>
1412-
<p id="section-3-1">The DNSCrypt protocol consists of two distinct phases:<a href="#section-3-1" class="pilcrow"></a></p>
1413-
<ol start="1" type="1" class="normal type-1" id="section-3-2">
1414-
<li id="section-3-2.1">
1415-
<p id="section-3-2.1.1"><strong>Initial Setup Phase</strong> (one-time):<a href="#section-3-2.1.1" class="pilcrow"></a></p>
1416-
<ul class="normal">
1417-
<li class="normal" id="section-3-2.1.2.1">
1418-
<p id="section-3-2.1.2.1.1">The client requests the server's certificate<a href="#section-3-2.1.2.1.1" class="pilcrow"></a></p>
1419-
</li>
1420-
<li class="normal" id="section-3-2.1.2.2">
1421-
<p id="section-3-2.1.2.2.1">The server responds with its certificate containing public keys<a href="#section-3-2.1.2.2.1" class="pilcrow"></a></p>
1422-
</li>
1423-
</ul>
1424-
</li>
1425-
<li id="section-3-2.2">
1426-
<p id="section-3-2.2.1"><strong>Ongoing Communication Phase</strong> (repeated as needed):<a href="#section-3-2.2.1" class="pilcrow"></a></p>
1427-
<ul class="normal">
1428-
<li class="normal" id="section-3-2.2.2.1">
1429-
<p id="section-3-2.2.2.1.1">The client sends encrypted DNS queries<a href="#section-3-2.2.2.1.1" class="pilcrow"></a></p>
1430-
</li>
1431-
<li class="normal" id="section-3-2.2.2.2">
1432-
<p id="section-3-2.2.2.2.1">The server responds with encrypted DNS responses<a href="#section-3-2.2.2.2.1" class="pilcrow"></a></p>
1433-
</li>
1434-
</ul>
1435-
</li>
1436-
</ol>
1437-
<p id="section-3-3">The following diagram illustrates the complete protocol flow:<a href="#section-3-3" class="pilcrow"></a></p>
1438-
<div class="alignLeft art-text artwork" id="section-3-4">
1412+
<p id="section-3-1">DNSCrypt starts with certificate retrieval and then exchanges encrypted DNS
1413+
queries and responses:<a href="#section-3-1" class="pilcrow"></a></p>
1414+
<div class="alignLeft art-text artwork" id="section-3-2">
14391415
<pre>
14401416
+--------+ +--------+
14411417
| | | |
@@ -1468,31 +1444,31 @@ <h2 id="name-protocol-flow">
14681444
|&lt;----------------------------|
14691445
| |
14701446
| |
1471-
</pre><a href="#section-3-4" class="pilcrow"></a>
1447+
</pre><a href="#section-3-2" class="pilcrow"></a>
14721448
</div>
1473-
<p id="section-3-5">The initial setup phase (steps 1-2) occurs only when:<a href="#section-3-5" class="pilcrow"></a></p>
1449+
<p id="section-3-3">The client retrieves certificates when:<a href="#section-3-3" class="pilcrow"></a></p>
14741450
<ul class="normal">
1475-
<li class="normal" id="section-3-6.1">
1476-
<p id="section-3-6.1.1">A client first starts using a DNSCrypt server<a href="#section-3-6.1.1" class="pilcrow"></a></p>
1451+
<li class="normal" id="section-3-4.1">
1452+
<p id="section-3-4.1.1">A client first starts using a DNSCrypt server<a href="#section-3-4.1.1" class="pilcrow"></a></p>
14771453
</li>
1478-
<li class="normal" id="section-3-6.2">
1479-
<p id="section-3-6.2.1">The client's cached certificate expires<a href="#section-3-6.2.1" class="pilcrow"></a></p>
1454+
<li class="normal" id="section-3-4.2">
1455+
<p id="section-3-4.2.1">The client's cached certificate expires<a href="#section-3-4.2.1" class="pilcrow"></a></p>
14801456
</li>
1481-
<li class="normal" id="section-3-6.3">
1482-
<p id="section-3-6.3.1">The client detects a certificate with a higher serial number<a href="#section-3-6.3.1" class="pilcrow"></a></p>
1457+
<li class="normal" id="section-3-4.3">
1458+
<p id="section-3-4.3.1">The client detects a certificate with a higher serial number<a href="#section-3-4.3.1" class="pilcrow"></a></p>
14831459
</li>
14841460
</ul>
1485-
<p id="section-3-7">After the initial setup, the client and server engage in the ongoing communication phase (steps 3-8), where encrypted queries and responses are exchanged as needed. This phase can be repeated indefinitely until the certificate expires or a new certificate is available.<a href="#section-3-7" class="pilcrow"></a></p>
1486-
<p id="section-3-8">The ongoing communication phase operates with several important characteristics that distinguish it from traditional DNS:<a href="#section-3-8" class="pilcrow"></a></p>
1487-
<ol start="1" type="1" class="normal type-1" id="section-3-9">
1488-
<li id="section-3-9.1">
1489-
<p id="section-3-9.1.1"><strong>Stateless Operation</strong>: Each query and response is independent. The server does not maintain state between queries.<a href="#section-3-9.1.1" class="pilcrow"></a></p>
1461+
<p id="section-3-5">After selecting a certificate, every encrypted query and response is
1462+
self-contained:<a href="#section-3-5" class="pilcrow"></a></p>
1463+
<ol start="1" type="1" class="normal type-1" id="section-3-6">
1464+
<li id="section-3-6.1">
1465+
<p id="section-3-6.1.1"><strong>Stateless Operation</strong>: Each query and response is independent. The server does not maintain state between queries.<a href="#section-3-6.1.1" class="pilcrow"></a></p>
14901466
</li>
1491-
<li id="section-3-9.2">
1492-
<p id="section-3-9.2.1"><strong>Out-of-Order Responses</strong>: Responses may arrive in a different order than the queries were sent. Each response is self-contained and can be processed independently.<a href="#section-3-9.2.1" class="pilcrow"></a></p>
1467+
<li id="section-3-6.2">
1468+
<p id="section-3-6.2.1"><strong>Out-of-Order Responses</strong>: Responses may arrive in a different order than the queries were sent. Each response is self-contained and can be processed independently.<a href="#section-3-6.2.1" class="pilcrow"></a></p>
14931469
</li>
1494-
<li id="section-3-9.3">
1495-
<p id="section-3-9.3.1"><strong>Concurrent Queries</strong>: A client can send multiple queries without waiting for earlier responses, and responses can be processed independently as they arrive.<a href="#section-3-9.3.1" class="pilcrow"></a></p>
1470+
<li id="section-3-6.3">
1471+
<p id="section-3-6.3.1"><strong>Concurrent Queries</strong>: A client can send multiple queries without waiting for earlier responses, and responses can be processed independently as they arrive.<a href="#section-3-6.3.1" class="pilcrow"></a></p>
14961472
</li>
14971473
</ol>
14981474
</section>
@@ -1589,7 +1565,7 @@ <h2 id="name-protocol-components">
15891565
| Client Magic |
15901566
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
15911567
| |
1592-
+ Client Public Key +
1568+
+ Client Key-Exchange Value +
15931569
| |
15941570
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
15951571
| |
@@ -1753,12 +1729,11 @@ <h3 id="name-session-establishment">
17531729
<a href="#section-5.4" class="section-number selfRef">5.4. </a><a href="#name-session-establishment" class="section-name selfRef">Session Establishment</a>
17541730
</h3>
17551731
<p id="section-5.4-1">From the client's perspective, a DNSCrypt session is initiated when the client sends an unauthenticated DNS query to a DNSCrypt-capable resolver. This DNS query contains the major protocol version and a public identifier of the desired provider.<a href="#section-5.4-1" class="pilcrow"></a></p>
1756-
<p id="section-5.4-2">The resolver sends back a collection of signed certificates that the client <span class="bcp14">MUST</span> verify using the pre-distributed provider public key. Each certificate includes a validity period, a serial number, a version that defines a key exchange mechanism, an authenticated encryption algorithm and its parameters, as well as a short-term public key, known as the resolver public key.<a href="#section-5.4-2" class="pilcrow"></a></p>
1757-
<p id="section-5.4-3">Resolvers have the ability to support various algorithms and can concurrently advertise multiple short-term public keys (resolver public keys). The client selects one of the currently valid certificates according to the certificate selection rules below.<a href="#section-5.4-3" class="pilcrow"></a></p>
1732+
<p id="section-5.4-2">The resolver sends back a collection of signed certificates that the client <span class="bcp14">MUST</span> verify using the pre-distributed provider public key. Each certificate includes a validity period, a serial number, a version that defines the key-exchange and authenticated-encryption system, and the resolver key-exchange public field for that system.<a href="#section-5.4-2" class="pilcrow"></a></p>
1733+
<p id="section-5.4-3">Resolvers can concurrently advertise multiple encryption systems and multiple short-term resolver key-exchange public fields. The client selects one of the currently valid certificates according to the certificate selection rules below.<a href="#section-5.4-3" class="pilcrow"></a></p>
17581734
<p id="section-5.4-4">Every certificate contains a unique magic number that the client <span class="bcp14">MUST</span> include at the beginning of their queries. This allows the resolver to identify which certificate the client selected for crafting a particular query.<a href="#section-5.4-4" class="pilcrow"></a></p>
1759-
<p id="section-5.4-5">The encryption algorithm, resolver public key, and client magic number from the chosen certificate are then used by the client to send encrypted queries. These queries include the <code>&lt;client-pk&gt;</code> key-exchange field.<a href="#section-5.4-5" class="pilcrow"></a></p>
1735+
<p id="section-5.4-5">The encryption system, resolver key-exchange public field, and client magic number from the chosen certificate are then used by the client to send encrypted queries. These queries include the <code>&lt;client-pk&gt;</code> key-exchange field.<a href="#section-5.4-5" class="pilcrow"></a></p>
17601736
<p id="section-5.4-6">With the chosen certificate, the corresponding resolver secret key, and the query's <code>&lt;client-pk&gt;</code> field, the resolver is able to verify and decrypt the query, then encrypt the response with the same parameters.<a href="#section-5.4-6" class="pilcrow"></a></p>
1761-
<p id="section-5.4-7">Once the session is established through certificate exchange, the ongoing query processing follows specific rules for different transport protocols and padding requirements.<a href="#section-5.4-7" class="pilcrow"></a></p>
17621737
</section>
17631738
</div>
17641739
<div id="query-processing">
@@ -1873,7 +1848,6 @@ <h4 id="name-resolver-responses-over-tcp">
18731848
<p id="section-5.5.7-1">The resolver <span class="bcp14">MUST</span> authenticate and decrypt client queries as described for UDP. Queries that cannot be authenticated, decrypted, unpadded, or parsed as DNS messages <span class="bcp14">MUST</span> be ignored.<a href="#section-5.5.7-1" class="pilcrow"></a></p>
18741849
<p id="section-5.5.7-2">Responses sent over TCP <span class="bcp14">MUST</span> be padded as described in "Padding For Resolver Responses" and encrypted as <code>&lt;dnscrypt-response&gt;</code>. The complete encrypted response packet is then prefixed with a two-byte big-endian length.<a href="#section-5.5.7-2" class="pilcrow"></a></p>
18751850
<p id="section-5.5.7-3">Cleartext DNS response payloads are not prefixed by their length before encryption, even when the DNSCrypt packet is sent over TCP. Unlike UDP responses, TCP responses <span class="bcp14">MUST</span> be sent unmodified even if their encrypted length exceeds the encrypted query length.<a href="#section-5.5.7-3" class="pilcrow"></a></p>
1876-
<p id="section-5.5.7-4">The query and response processing rules described above depend on the certificate information obtained during session establishment. The certificate format and management procedures are critical to the protocol's security.<a href="#section-5.5.7-4" class="pilcrow"></a></p>
18771851
</section>
18781852
</div>
18791853
</section>
@@ -1898,7 +1872,7 @@ <h3 id="name-certificates">
18981872
| |
18991873
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
19001874
| |
1901-
+ Resolver Public Key +
1875+
+ Resolver Key-Exchange Field +
19021876
| |
19031877
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
19041878
| Client Magic |
@@ -2091,7 +2065,6 @@ <h2 id="name-implementation-status">
20912065
</h2>
20922066
<p id="section-7-1"><em>Note: This section is to be removed before publishing as an RFC.</em><a href="#section-7-1" class="pilcrow"></a></p>
20932067
<p id="section-7-2">Multiple implementations of the protocol described in this document have been developed and verified for interoperability. A comprehensive list of known implementations can be found at <a href="https://dnscrypt.info/implementations">dnscrypt.info implementations</a>.<a href="#section-7-2" class="pilcrow"></a></p>
2094-
<p id="section-7-3">The successful deployment of multiple interoperable implementations demonstrates the protocol's maturity. However, proper implementation requires careful attention to security considerations.<a href="#section-7-3" class="pilcrow"></a></p>
20952068
</section>
20962069
</div>
20972070
<div id="security-considerations">
@@ -2119,7 +2092,6 @@ <h3 id="name-protocol-security">
21192092
<p id="section-8.1-2.4.1"><strong>Short-Term Resolver Keys</strong>: Resolver certificates carry short-term public keys, limiting the impact of key compromise and enabling regular key rotation.<a href="#section-8.1-2.4.1" class="pilcrow"></a></p>
21202093
</li>
21212094
</ol>
2122-
<p id="section-8.1-3">These fundamental security properties depend on correct implementation practices. Several implementation-specific security aspects require particular attention.<a href="#section-8.1-3" class="pilcrow"></a></p>
21232095
</section>
21242096
</div>
21252097
<div id="implementation-security">
@@ -2220,7 +2192,6 @@ <h3 id="name-attack-mitigation">
22202192
<p id="section-8.3-2.4.1"><strong>Replay Exposure Reduction</strong>: Nonces make responses query-specific. Clients can discard late, duplicate, or unrelated responses by checking the returned <code>&lt;client-nonce&gt;</code> against local outstanding-query state and request deadlines, without exposing timestamps in plaintext nonce values.<a href="#section-8.3-2.4.1" class="pilcrow"></a></p>
22212193
</li>
22222194
</ol>
2223-
<p id="section-8.3-3">While DNSCrypt effectively mitigates these attacks, implementers should also be aware of privacy considerations that extend beyond basic protocol security.<a href="#section-8.3-3" class="pilcrow"></a></p>
22242195
</section>
22252196
</div>
22262197
<div id="privacy-considerations">
@@ -2243,7 +2214,6 @@ <h3 id="name-privacy-considerations">
22432214
<p id="section-8.4-2.4.1"><strong>Certificate Requests</strong>: Initial certificate requests are unencrypted but only return public data. This is a one-time exposure per session.<a href="#section-8.4-2.4.1" class="pilcrow"></a></p>
22442215
</li>
22452216
</ol>
2246-
<p id="section-8.4-3">These privacy considerations complement the security measures and should inform operational practices for DNSCrypt deployments.<a href="#section-8.4-3" class="pilcrow"></a></p>
22472217
</section>
22482218
</div>
22492219
<div id="operational-security">
@@ -2310,7 +2280,6 @@ <h3 id="name-operational-security">
23102280
</ul>
23112281
</li>
23122282
</ol>
2313-
<p id="section-8.5-3">These operational security practices work together with the technical security measures to provide comprehensive protection. Additional operational considerations extend beyond security to include practical deployment aspects.<a href="#section-8.5-3" class="pilcrow"></a></p>
23142283
</section>
23152284
</div>
23162285
</section>
@@ -2327,7 +2296,6 @@ <h2 id="name-operational-considerations">
23272296
<p id="section-9-5">Resolvers <span class="bcp14">MUST</span> rotate each short-term key pair every 24 hours at most. After a key rotation, a resolver <span class="bcp14">MUST</span> continue accepting queries for every unexpired certificate it still serves, which requires retaining the corresponding resolver secret keys. Once all certificates for an old resolver key have expired or been withdrawn, the resolver <span class="bcp14">MUST</span> discard that old secret key. If an old resolver key is believed to be compromised, the resolver <span class="bcp14">MUST</span> withdraw the related certificates and discard the key instead of continuing to accept it.<a href="#section-9-5" class="pilcrow"></a></p>
23282297
<p id="section-9-6">Provider public keys <span class="bcp14">MAY</span> be published as DNSSEC-signed <code>TXT</code> records <span>[<a href="#RFC1035" class="cite xref">RFC1035</a>]</span>, in the same zone as the provider name. For example, a query for the <code>TXT</code> type on the name <code>"2.pubkey.example.com"</code> may return a signed record containing a hexadecimal-encoded provider public key for the provider name <code>"2.dnscrypt-cert.example.com"</code>.<a href="#section-9-6" class="pilcrow"></a></p>
23292298
<p id="section-9-7">For encryption systems where clients reuse a key pair, servers are encouraged to cache shared keys instead of performing the X25519 operation for each query. This makes the computational overhead of classical DNSCrypt negligible compared to plain DNS.<a href="#section-9-7" class="pilcrow"></a></p>
2330-
<p id="section-9-8">While DNSCrypt provides strong encryption and authentication, some use cases require additional privacy protection. The Anonymized DNSCrypt extension addresses scenarios where hiding client IP addresses from resolvers is necessary.<a href="#section-9-8" class="pilcrow"></a></p>
23312299
</section>
23322300
</div>
23332301
<div id="anonymized-dnscrypt">
@@ -2336,7 +2304,6 @@ <h2 id="name-anonymized-dnscrypt">
23362304
<a href="#section-10" class="section-number selfRef">10. </a><a href="#name-anonymized-dnscrypt" class="section-name selfRef">Anonymized DNSCrypt</a>
23372305
</h2>
23382306
<p id="section-10-1">While DNSCrypt encrypts DNS traffic, DNS server operators can still observe client IP addresses. Anonymized DNSCrypt is an extension to the DNSCrypt protocol that allows queries and responses to be relayed by an intermediate server, hiding the client's IP address from the resolver.<a href="#section-10-1" class="pilcrow"></a></p>
2339-
<p id="section-10-2">This extension maintains all the security properties of standard DNSCrypt while adding an additional layer of privacy protection.<a href="#section-10-2" class="pilcrow"></a></p>
23402307
<div id="protocol-overview">
23412308
<section id="section-10.1">
23422309
<h3 id="name-protocol-overview">

0 commit comments

Comments
 (0)