You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Dart implementation of IPCrypt that provides IP address encryption and obfuscation methods following the IPCrypt specification. This implementation supports all three encryption modes and is designed for native Dart applications.
125
+
A Dart implementation of IPCrypt that provides IP address encryption and obfuscation methods following the IPCrypt specification. This implementation supports all four encryption modes and is designed for native Dart applications.
126
126
127
127
## Installation
128
128
@@ -146,11 +146,12 @@ dart pub get
146
146
147
147
## Usage
148
148
149
-
The Dart implementation provides three encryption methods as global functions:
149
+
The Dart implementation provides encryption methods as global functions:
150
150
151
151
1.`ipCryptDeterministic` - Deterministic encryption using AES-128
152
-
2.`ipCryptNonDeterministic` - Non-deterministic encryption using KIASU-BC
The Python implementation serves as the reference implementation for IPCrypt. It provides all three encryption modes and is designed to be clear, well-documented, and easy to understand.
61
+
The Python implementation serves as the reference implementation for IPCrypt. It provides all four encryption modes and is designed to be clear, well-documented, and easy to understand.
62
62
63
63
## Installation
64
64
@@ -83,11 +83,12 @@ cd draft-denis-ipcrypt/implementations/python
83
83
84
84
## Usage
85
85
86
-
The Python implementation provides three separate classes for the different encryption modes:
86
+
The Python implementation provides separate classes for the different encryption modes:
87
87
88
88
1.`IPCryptDeterministic` - Deterministic encryption using AES-128
89
-
2.`IPCryptNd` - Non-deterministic encryption using KIASU-BC
90
-
3.`IPCryptNdx` - Non-deterministic extended encryption using AES-XTS
89
+
2.`IPCryptPfx` - Prefix-preserving encryption using dual AES-128
90
+
3.`IPCryptNd` - Non-deterministic encryption using KIASU-BC
91
+
4.`IPCryptNdx` - Non-deterministic extended encryption using AES-XTS
- Attack patterns can be shared without exposing actual IP addresses
183
185
- Each sharing instance uses different tweaks, preventing correlation
184
186
- The original organization can still decrypt if needed
@@ -218,6 +220,7 @@ LIMIT 10;
218
220
```
219
221
220
222
**Benefits:**
223
+
221
224
- IP addresses are not stored in plaintext
222
225
- Queries can still be performed efficiently using indexes
223
226
- Analytics and grouping operations work as expected
@@ -264,6 +267,7 @@ class PrivacyCompliantAnalytics:
264
267
```
265
268
266
269
**Benefits:**
270
+
267
271
- Analytics can be collected without storing personal data
268
272
- Unique visitor counting still works accurately
269
273
- No need to obtain explicit consent for IP storage
@@ -283,4 +287,4 @@ When implementing IPCrypt in real-world applications, consider the following:
283
287
284
288
Ready to implement IPCrypt in your project? Check out our [developer resources]({{ site.baseurl }}/resources/) and choose from [multiple language implementations]({{ site.baseurl }}/implementations/).
285
289
286
-
For a detailed understanding of the cryptographic constructions, read the full [specification](https://datatracker.ietf.org/doc/draft-denis-ipcrypt/){:target="_blank" rel="noopener"}.
290
+
For a detailed understanding of the cryptographic constructions, read the full [specification](https://datatracker.ietf.org/doc/draft-denis-ipcrypt/){:target="_blank" rel="noopener"}.
Copy file name to clipboardExpand all lines: www/pages/encryption-modes.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
layout: page
3
3
title: IPCrypt Encryption Modes
4
-
description: Detailed explanations of IPCrypt's encryption modes - deterministic, non-deterministic (nd), and extended non-deterministic (ndx).
4
+
description: Detailed explanations of IPCrypt's four encryption modes - deterministic, prefix-preserving (pfx), non-deterministic (nd), and extended non-deterministic (ndx).
5
5
permalink: /encryption-modes/
6
6
---
7
7
@@ -405,7 +405,11 @@ IPCrypt offers the following encryption modes:
405
405
<div class="feature-list">
406
406
<div class="feature-item">
407
407
<div class="feature-icon">🔑</div>
408
-
<div class="feature-text"><strong>Key Requirement</strong>: Uses a 32-byte key for enhanced security</div>
408
+
<div class="feature-text"><strong>Key Requirement</strong>: Uses a 32-byte key split into two independent 16-byte AES-128 keys (K1 and K2) for the sum-of-permutations PRF construction</div>
409
+
</div>
410
+
<div class="feature-item">
411
+
<div class="feature-icon">⚠️</div>
412
+
<div class="feature-text"><strong>Critical Constraint</strong>: The two 16-byte halves of the key MUST NOT be identical. Using identical values for K1 and K2 causes the XOR operation to cancel out, returning the original IP address unchanged.</div>
Deterministic mode produces valid IP addresses, enabling encrypted addresses to flow through existing infrastructure without modification.
54
+
Deterministic and prefix-preserving modes produce valid IP addresses, enabling encrypted addresses to flow through existing infrastructure without modification.
Copy file name to clipboardExpand all lines: www/pages/resources.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,32 +25,33 @@ To implement IPCrypt:
25
25
26
26
1.**Choose an encryption mode** based on your requirements:
27
27
-`ipcrypt-deterministic`: When you need format preservation or duplicate detection
28
+
-`ipcrypt-pfx`: When you need to preserve network structure for analytics
28
29
-`ipcrypt-nd`: For general privacy protection with reasonable storage overhead
29
30
-`ipcrypt-ndx`: For maximum privacy protection when storage permits
30
31
2.**Generate appropriate keys**:
31
32
- 16 bytes (128 bits) for deterministic and nd modes
32
-
- 32 bytes (256 bits) for ndx mode
33
+
- 32 bytes (256 bits) for pfx and ndx modes
33
34
3.**For non-deterministic modes**, use uniformly random tweaks
34
35
4.**Test against the specification's test vectors** to ensure correctness
35
36
36
37
## Implementation Information
37
38
38
39
### Key Management Suggestions
39
40
40
-
Good key management practices are important when using IPCrypt:
41
+
Good key management practices are essential when using IPCrypt:
41
42
42
-
-**Creating Keys**: Consider using a cryptographically secure random number generator
43
-
-**Storing Keys**: Try to store keys securely, such as in a key management system
44
-
-**Changing Keys**: Consider rotating keys periodically as a security practice
45
-
-**Key Separation**: Use different keys for different applications or data sets
43
+
-**Creating Keys**: Keys MUST be generated using a cryptographically secure random number generator (see RFC 4086)
44
+
-**Storing Keys**: Store keys securely, such as in a key management system
45
+
-**Changing Keys**: Rotate keys periodically as a security practice
46
+
-**Key Separation**: Use different keys for different applications or data sets. The specification defines HKDF-based key derivation for deriving mode-specific keys from a single master key
46
47
47
48
### Helpful Tips
48
49
49
50
When working with IPCrypt, here are some suggestions that might be helpful:
50
51
51
52
1.**Check IP Formats**: It's a good idea to make sure IP addresses are properly formatted before encryption
52
53
2.**Handle Errors Kindly**: Consider how your code will respond if something unexpected happens
53
-
3.**Think About Timing**: For security-sensitive applications, constant-time operations can help prevent timing analysis
54
+
3.**Constant-time Operations**: Implementations MUST use constant-time operations to mitigate side-channel attacks
54
55
4.**Test Your Code**: You might want to check your implementation against the examples in the specification
55
56
5.**Performance Optimization**: All variants are designed for single-block speed critical for network-rate processing
0 commit comments