Skip to content

Commit a4b809b

Browse files
committed
Remove markdown **
1 parent 904989b commit a4b809b

1 file changed

Lines changed: 48 additions & 48 deletions

File tree

draft-denis-ipcrypt.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,23 @@ This work directly addresses concerns raised in {{!RFC7624}} regarding confident
153153

154154
Organizations handling IP addresses face a critical dilemma: they must protect user privacy while maintaining operational capabilities. Generic encryption systems, though secure, are poorly suited for IP addresses - they expand data unpredictably, break compatibility with network tools, and operate too slowly for high-volume processing. The specialized methods in this specification resolve these conflicts through purpose-built cryptographic techniques:
155155

156-
- **Efficiency and Compactness:** All variants operate on exactly 128 bits, achieving single-block encryption speed critical for network-rate processing. Non-deterministic variants add only 8-16 bytes of tweak overhead versus potentially hundreds of bytes with generic encryption. This difference enables processing billions of addresses in real-time rather than requiring expensive batch operations.
156+
- Efficiency and Compactness: All variants operate on exactly 128 bits, achieving single-block encryption speed critical for network-rate processing. Non-deterministic variants add only 8-16 bytes of tweak overhead versus potentially hundreds of bytes with generic encryption. This difference enables processing billions of addresses in real-time rather than requiring expensive batch operations.
157157

158-
- **High Usage Limits:** Non-deterministic variants safely handle massive volumes - approximately 4 billion operations for `ipcrypt-nd` and 18 quintillion for `ipcrypt-ndx` per key - without degrading security. Generic encryption often requires complex key rotation schemes at much lower thresholds.
158+
- High Usage Limits: Non-deterministic variants safely handle massive volumes - approximately 4 billion operations for `ipcrypt-nd` and 18 quintillion for `ipcrypt-ndx` per key - without degrading security. Generic encryption often requires complex key rotation schemes at much lower thresholds.
159159

160-
- **Format Preservation (Deterministic):** The `ipcrypt-deterministic` variant produces valid IP addresses, not arbitrary ciphertext. This enables encrypted addresses to flow through existing network infrastructure, monitoring tools, and databases without modification (see {{format-preservation-and-limitations}}).
160+
- Format Preservation (Deterministic): The `ipcrypt-deterministic` variant produces valid IP addresses, not arbitrary ciphertext. This enables encrypted addresses to flow through existing network infrastructure, monitoring tools, and databases without modification (see {{format-preservation-and-limitations}}).
161161

162-
- **Interoperability:** This specification ensures that encrypted IP addresses can be exchanged between different systems, vendors, and programming languages. All conforming implementations produce identical results, enabling seamless data exchange and avoiding vendor lock-in.
162+
- Interoperability: This specification ensures that encrypted IP addresses can be exchanged between different systems, vendors, and programming languages. All conforming implementations produce identical results, enabling seamless data exchange and avoiding vendor lock-in.
163163

164164
These specialized encryption methods unlock several critical use cases:
165165

166-
- **Privacy Protection:** They prevent the exposure of sensitive user information to third parties in logs, analytics data, and network measurements ({{!RFC6973}}). Note that protection is specifically against parties without key access; the key holder retains full decryption capability.
166+
- Privacy Protection: They prevent the exposure of sensitive user information to third parties in logs, analytics data, and network measurements ({{!RFC6973}}). Note that protection is specifically against parties without key access; the key holder retains full decryption capability.
167167

168-
- **Correlation Attack Resistance:** While deterministic encryption can reveal repeated inputs, the non-deterministic variants leverage random tweaks to hide patterns and enhance confidentiality (see {{non-deterministic-encryption}}).
168+
- Correlation Attack Resistance: While deterministic encryption can reveal repeated inputs, the non-deterministic variants leverage random tweaks to hide patterns and enhance confidentiality (see {{non-deterministic-encryption}}).
169169

170-
- **Privacy-Preserving Analytics:** Encrypted IP addresses can be used directly for operations such as counting unique clients, rate limiting, or deduplication—without needing to reveal the original values to third-party processors. This approach addresses the anonymization requirements for DNS query data sharing outlined in {{RSSAC040}}, enabling research while protecting source IP privacy. Since network hierarchy and geographic relationships are not preserved by encryption, organizations requiring such metadata SHOULD extract and store it separately (e.g., country, ASN) rather than relying on the flawed practice of IP address truncation, which provides inconsistent privacy protection and irreversibly destroys information.
170+
- Privacy-Preserving Analytics: Encrypted IP addresses can be used directly for operations such as counting unique clients, rate limiting, or deduplication—without needing to reveal the original values to third-party processors. This approach addresses the anonymization requirements for DNS query data sharing outlined in {{RSSAC040}}, enabling research while protecting source IP privacy. Since network hierarchy and geographic relationships are not preserved by encryption, organizations requiring such metadata SHOULD extract and store it separately (e.g., country, ASN) rather than relying on the flawed practice of IP address truncation, which provides inconsistent privacy protection and irreversibly destroys information.
171171

172-
- **Seamless Third-Party Integration:** Encrypted IPs can act as privacy-preserving identifiers when interacting with untrusted services, cloud providers, or external platforms.
172+
- Seamless Third-Party Integration: Encrypted IPs can act as privacy-preserving identifiers when interacting with untrusted services, cloud providers, or external platforms.
173173

174174
For implementation guidelines and practical examples, see {{implementation-details}}.
175175

@@ -187,12 +187,12 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
187187

188188
Throughout this document, the following terms and conventions apply:
189189

190-
- **IP Address:** An IPv4 or IPv6 address as defined in {{!RFC4291}}.
191-
- **16-Byte Representation:** A fixed-length representation used for both IPv4 (via IPv4-mapped IPv6) and IPv6 addresses.
192-
- **Tweak:** A non-secret, additional input to a tweakable block cipher that further randomizes the output.
193-
- **Deterministic Encryption:** Encryption that always produces the same ciphertext for a given input and key.
194-
- **Non-Deterministic Encryption:** Encryption that produces different ciphertexts for the same input due to the inclusion of a randomly sampled tweak.
195-
- **(Input, Tweak) Collision:** A scenario where the same input is encrypted with the same tweak. This reveals that the input was repeated but not the input's value.
190+
- IP Address: An IPv4 or IPv6 address as defined in {{!RFC4291}}.
191+
- 16-Byte Representation: A fixed-length representation used for both IPv4 (via IPv4-mapped IPv6) and IPv6 addresses.
192+
- Tweak: A non-secret, additional input to a tweakable block cipher that further randomizes the output.
193+
- Deterministic Encryption: Encryption that always produces the same ciphertext for a given input and key.
194+
- Non-Deterministic Encryption: Encryption that produces different ciphertexts for the same input due to the inclusion of a randomly sampled tweak.
195+
- (Input, Tweak) Collision: A scenario where the same input is encrypted with the same tweak. This reveals that the input was repeated but not the input's value.
196196

197197
# IP Address Conversion
198198

@@ -234,23 +234,23 @@ The conversion algorithm is as follows:
234234

235235
This specification defines two generic cryptographic constructions:
236236

237-
1. **128-bit Block Cipher Construction:**
237+
1. 128-bit Block Cipher Construction:
238238
- Used in deterministic encryption (see {{deterministic-encryption}})
239239
- Operates on a single 16-byte block
240240
- Example: AES-128 treated as a permutation
241241

242-
2. **128-bit Tweakable Block Cipher (TBC) Construction:**
242+
2. 128-bit Tweakable Block Cipher (TBC) Construction:
243243
- Used in non-deterministic encryption (see {{non-deterministic-encryption}})
244244
- Accepts a key, a tweak, and a message
245245
- The tweak must be uniformly random when generated
246246
- Reuse of the same tweak on different inputs does not compromise confidentiality
247247

248248
Valid options for implementing a tweakable block cipher include, but are not limited to:
249249

250-
- **SKINNY** (see {{SKINNY}})
251-
- **DEOXYS-BC** (see {{DEOXYS-BC}})
252-
- **KIASU-BC** (see {{implementing-kiasu-bc}} for implementation details)
253-
- **AES-XTS** (see {{ipcrypt-ndx}} for usage)
250+
- SKINNY (see {{SKINNY}})
251+
- DEOXYS-BC (see {{DEOXYS-BC}})
252+
- KIASU-BC (see {{implementing-kiasu-bc}} for implementation details)
253+
- AES-XTS (see {{ipcrypt-ndx}} for usage)
254254

255255
Implementers MUST choose a cipher that meets the required security properties and provides robust resistance against related-tweak and other cryptographic attacks.
256256

@@ -383,8 +383,8 @@ The output of non-deterministic encryption is binary data. For applications that
383383

384384
This document defines two concrete instantiations:
385385

386-
- **`ipcrypt-nd`:** Uses the KIASU-BC tweakable block cipher with an 8-byte (64-bit) tweak. See {{KIASU-BC}} for details.
387-
- **`ipcrypt-ndx`:** Uses the AES-XTS tweakable block cipher with a 16-byte (128-bit) tweak. See {{XTS-AES}} for background.
386+
- `ipcrypt-nd`: Uses the KIASU-BC tweakable block cipher with an 8-byte (64-bit) tweak. See {{KIASU-BC}} for details.
387+
- `ipcrypt-ndx`: Uses the AES-XTS tweakable block cipher with a 16-byte (128-bit) tweak. See {{XTS-AES}} for background.
388388

389389
In both cases, if a tweak is generated randomly, it MUST be uniformly random. Reusing the same randomly generated tweak on different inputs is acceptable from a confidentiality standpoint.
390390

@@ -413,45 +413,45 @@ As with `ipcrypt-nd`, an `(input, tweak)` collision reveals repetition without c
413413

414414
Choosing the right mode depends on specific privacy requirements and operational constraints:
415415

416-
- **Deterministic (`ipcrypt-deterministic`):**
417-
- **Output size:** 16 bytes (most compact)
418-
- **Privacy:** Same IP always produces same ciphertext (allows correlation)
419-
- **Use case:** When duplicate identification is needed or when format preservation is critical
420-
- **Performance:** Fastest (single AES operation)
416+
- Deterministic (`ipcrypt-deterministic`):
417+
- Output size: 16 bytes (most compact)
418+
- Privacy: Same IP always produces same ciphertext (allows correlation)
419+
- Use case: When duplicate identification is needed or when format preservation is critical
420+
- Performance: Fastest (single AES operation)
421421

422-
- **Non-Deterministic `ipcrypt-nd` (KIASU-BC):**
423-
- **Output size:** 24 bytes (16-byte ciphertext + 8-byte tweak)
424-
- **Privacy:** Same IP produces different ciphertexts (prevents most correlation)
425-
- **Use case:** General privacy protection with reasonable storage overhead
426-
- **Collision resistance:** Approximately 4 billion operations per key
422+
- Non-Deterministic `ipcrypt-nd` (KIASU-BC):
423+
- Output size: 24 bytes (16-byte ciphertext + 8-byte tweak)
424+
- Privacy: Same IP produces different ciphertexts (prevents most correlation)
425+
- Use case: General privacy protection with reasonable storage overhead
426+
- Collision resistance: Approximately 4 billion operations per key
427427

428-
- **Non-Deterministic `ipcrypt-ndx` (AES-XTS):**
429-
- **Output size:** 32 bytes (16-byte ciphertext + 16-byte tweak)
430-
- **Privacy:** Same IP produces different ciphertexts (prevents correlation)
431-
- **Use case:** Maximum privacy protection when storage permits
432-
- **Collision resistance:** Approximately 18 quintillion operations per key
428+
- Non-Deterministic `ipcrypt-ndx` (AES-XTS):
429+
- Output size: 32 bytes (16-byte ciphertext + 16-byte tweak)
430+
- Privacy: Same IP produces different ciphertexts (prevents correlation)
431+
- Use case: Maximum privacy protection when storage permits
432+
- Collision resistance: Approximately 18 quintillion operations per key
433433

434434
## Alternatives to Random Tweaks {#alternatives-to-random-tweaks}
435435

436436
While this specification recommends the use of uniformly random tweaks for non-deterministic encryption, implementers may consider alternative approaches:
437437

438-
- **Monotonic Counter:** A counter could be used as a tweak, but this is difficult to maintain in distributed systems. If the counter is not encrypted and the tweakable block cipher is not secure against related-tweak attacks, this could enable correlation attacks.
438+
- Monotonic Counter: A counter could be used as a tweak, but this is difficult to maintain in distributed systems. If the counter is not encrypted and the tweakable block cipher is not secure against related-tweak attacks, this could enable correlation attacks.
439439

440-
- **UUIDs:** UUIDs (such as UUIDv6 or UUIDv7) could be used as tweaks; however, these would reveal the original timestamp of the logged IP addresses, which may not be desirable from a privacy perspective.
440+
- UUIDs: UUIDs (such as UUIDv6 or UUIDv7) could be used as tweaks; however, these would reveal the original timestamp of the logged IP addresses, which may not be desirable from a privacy perspective.
441441

442442
Although the birthday bound is a concern with random tweaks, the use of random tweaks remains the recommended and most practical approach, offering the best tradeoffs for most real-world use cases.
443443

444444
# Security Considerations
445445

446446
The methods specified in this document provide strong confidentiality guarantees but explicitly do not provide integrity protection. Understanding this distinction is critical for secure deployment:
447447

448-
**What these methods protect against:**
448+
What these methods protect against:
449449

450450
- Unauthorized parties learning the original IP addresses (without the key)
451451
- Statistical analysis revealing patterns in network traffic (non-deterministic modes)
452452
- Brute-force attacks on the address space (128-bit security level)
453453

454-
**What these methods do NOT protect against:**
454+
What these methods do NOT protect against:
455455

456456
- Active attackers modifying, reordering, or removing encrypted addresses
457457
- Authorized key holders decrypting addresses (by design)
@@ -775,10 +775,10 @@ Example:
775775

776776
Each round of KIASU-BC consists of the following standard AES operations:
777777

778-
1. **SubBytes:** Apply the AES S-box to each byte of the state
779-
2. **ShiftRows:** Rotate each row of the state matrix
780-
3. **MixColumns:** Mix the columns of the state matrix (except in the final round)
781-
4. **AddRoundKey:** XOR the state with the round key and padded tweak
778+
1. SubBytes: Apply the AES S-box to each byte of the state
779+
2. ShiftRows: Rotate each row of the state matrix
780+
3. MixColumns: Mix the columns of the state matrix (except in the final round)
781+
4. AddRoundKey: XOR the state with the round key and padded tweak
782782

783783
For details about these operations, see {{FIPS-197}}.
784784

@@ -792,15 +792,15 @@ The key schedule follows the standard AES-128 key expansion:
792792

793793
### Implementation Steps
794794

795-
1. **Key Expansion:**
795+
1. Key Expansion:
796796
- Expand the 16-byte key into 11 round keys using the standard AES key schedule
797797
- Each round key is 16 bytes
798798

799-
2. **Tweak Processing:**
799+
2. Tweak Processing:
800800
- Pad the 8-byte tweak to 16 bytes as described above
801801
- XOR the padded tweak with each round key before use
802802

803-
3. **Encryption Process:**
803+
3. Encryption Process:
804804
- Perform initial AddRoundKey with the first tweaked round key
805805
- For rounds 1-9:
806806
- SubBytes

0 commit comments

Comments
 (0)