Skip to content

Commit 372c310

Browse files
committed
Merge About and Case Studies pages
1 parent 94acd41 commit 372c310

File tree

3 files changed

+171
-259
lines changed

3 files changed

+171
-259
lines changed

www/_config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ navigation:
9595
url: /code-examples/
9696
- title: Resources
9797
url: /resources/
98-
- title: Case Studies
99-
url: /case-studies/
10098

10199
# Social links
102100
social_links:

www/pages/about.md

Lines changed: 171 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
33
title: About IPCrypt
4-
description: Learn about IPCrypt, its purpose, benefits, and how it addresses privacy concerns in network operations and analytics.
4+
description: Learn about IPCrypt, its purpose, benefits, and how it addresses privacy concerns in network operations and analytics with real-world examples.
55
permalink: /about/
66
---
77

@@ -80,38 +80,6 @@ IPCrypt operates by converting IP addresses to a 16-byte representation and then
8080
- Highest security margin with 128-bit tweak space
8181
- Suitable for applications requiring maximum security and correlation protection
8282

83-
## Use Cases
84-
85-
### Privacy-Preserving Logging
86-
87-
Store encrypted IP addresses in logs instead of cleartext addresses. This allows for:
88-
- Counting unique clients
89-
- Implementing rate limiting
90-
- Analyzing traffic patterns
91-
- All without exposing actual IP addresses
92-
93-
### Secure Data Sharing
94-
95-
Share network data with researchers, partners, or third parties while protecting user privacy:
96-
- Research institutions can analyze traffic patterns
97-
- Security firms can investigate incidents
98-
- Partners can process data without accessing sensitive information
99-
100-
### Third-Party Service Integration
101-
102-
Use encrypted IP addresses when integrating with external services:
103-
- CDN providers
104-
- DDoS protection services
105-
- Analytics platforms
106-
- Cloud services
107-
108-
### Regulatory Compliance
109-
110-
Help meet data protection requirements by encrypting IP addresses:
111-
- GDPR compliance in the European Union
112-
- CCPA compliance in California
113-
- Other regional privacy regulations
114-
11583
## Comparison with Ad-hoc Mechanisms
11684

11785
Many organizations currently use ad-hoc mechanisms to protect IP addresses, such as:
@@ -133,6 +101,176 @@ IPCrypt offers several advantages over these approaches:
133101
| Decryption Capability | Often one-way | Fully invertible |
134102
| Documentation | Typically minimal | Comprehensive specification |
135103

104+
## Real-World Applications
105+
106+
This section showcases practical examples of how IPCrypt can be used in various environments.
107+
108+
### Network Logging and Analysis
109+
110+
Network logs often contain IP addresses that may be considered personal data under privacy regulations. By using IPCrypt, organizations can maintain the utility of their logs while protecting user privacy.
111+
112+
```python
113+
# Example: Privacy-preserving logging with IPCrypt
114+
from ipcrypt import IPCrypt
115+
import logging
116+
117+
# Initialize IPCrypt with a secure key
118+
key = bytes.fromhex("0123456789abcdeffedcba9876543210")
119+
ipcrypt = IPCrypt(key)
120+
121+
def log_network_event(client_ip, event_type, timestamp):
122+
# Encrypt the IP address using deterministic mode
123+
encrypted_ip = ipcrypt.encrypt_deterministic(client_ip)
124+
125+
# Log the event with the encrypted IP
126+
logging.info(f"Event: {event_type}, IP: {encrypted_ip}, Time: {timestamp}")
127+
128+
# For internal analysis, we can still group by IP address
129+
# since deterministic mode produces consistent results
130+
return encrypted_ip
131+
```
132+
133+
**Benefits:**
134+
- Logs can still be analyzed for patterns and anomalies
135+
- IP addresses are protected from casual observation
136+
- Compliance with privacy regulations is improved
137+
- Original IPs can be recovered if necessary with the key
138+
139+
### Data Sharing Between Organizations
140+
141+
Security researchers often need to share data about network attacks across organizational boundaries. Using IPCrypt's non-deterministic modes allows for secure sharing without revealing the actual IP addresses.
142+
143+
```python
144+
# Example: Sharing security data between organizations
145+
from ipcrypt import IPCrypt
146+
import os
147+
import json
148+
149+
# Each organization uses their own key
150+
org_key = bytes.fromhex("0123456789abcdeffedcba9876543210")
151+
ipcrypt = IPCrypt(org_key)
152+
153+
def prepare_data_for_sharing(attack_data):
154+
sanitized_data = []
155+
156+
for incident in attack_data:
157+
# Generate a random tweak for each sharing instance
158+
tweak = os.urandom(16)
159+
160+
# Use non-deterministic extended mode for maximum security
161+
encrypted_ip = ipcrypt.encrypt_ndx(incident["source_ip"], tweak)
162+
163+
# Replace the actual IP with the encrypted version
164+
incident_copy = incident.copy()
165+
incident_copy["source_ip"] = encrypted_ip
166+
incident_copy["tweak"] = tweak.hex() # Include the tweak for potential decryption
167+
168+
sanitized_data.append(incident_copy)
169+
170+
return json.dumps(sanitized_data)
171+
```
172+
173+
**Benefits:**
174+
- Attack patterns can be shared without exposing actual IP addresses
175+
- Each sharing instance uses different tweaks, preventing correlation
176+
- The original organization can still decrypt if needed
177+
- Recipient organizations can analyze patterns without seeing actual IPs
178+
179+
### Database Storage and Querying
180+
181+
When storing IP addresses in databases, organizations often need to balance privacy with the ability to query and analyze the data. IPCrypt's deterministic mode enables this balance.
182+
183+
```sql
184+
-- Example database schema with IPCrypt-encrypted IP addresses
185+
186+
CREATE TABLE web_traffic (
187+
id SERIAL PRIMARY KEY,
188+
encrypted_ip_deterministic VARCHAR(39) NOT NULL, -- For querying
189+
encrypted_ip_nd TEXT, -- For maximum privacy
190+
request_path TEXT NOT NULL,
191+
user_agent TEXT,
192+
timestamp TIMESTAMP NOT NULL,
193+
response_code INTEGER
194+
);
195+
196+
-- Create an index on the deterministic version for efficient queries
197+
CREATE INDEX idx_web_traffic_ip ON web_traffic(encrypted_ip_deterministic);
198+
199+
-- Example query to find all requests from a specific IP (after encrypting it)
200+
SELECT request_path, timestamp, response_code
201+
FROM web_traffic
202+
WHERE encrypted_ip_deterministic = 'ENCRYPTED_IP_VALUE';
203+
204+
-- Example query to count requests by IP (privacy-preserving analytics)
205+
SELECT encrypted_ip_deterministic, COUNT(*) as request_count
206+
FROM web_traffic
207+
GROUP BY encrypted_ip_deterministic
208+
ORDER BY request_count DESC
209+
LIMIT 10;
210+
```
211+
212+
**Benefits:**
213+
- IP addresses are not stored in plaintext
214+
- Queries can still be performed efficiently using indexes
215+
- Analytics and grouping operations work as expected
216+
- Privacy is maintained while preserving functionality
217+
218+
### Regulatory Compliance
219+
220+
Under GDPR and similar regulations, IP addresses are considered personal data. IPCrypt can help organizations comply with these regulations while still collecting necessary analytics.
221+
222+
```python
223+
# Example: GDPR-compliant analytics collection
224+
from ipcrypt import IPCrypt
225+
import time
226+
227+
# Initialize IPCrypt with a secure key
228+
key = bytes.fromhex("0123456789abcdeffedcba9876543210")
229+
ipcrypt = IPCrypt(key)
230+
231+
class PrivacyCompliantAnalytics:
232+
def __init__(self):
233+
self.page_views = {}
234+
self.unique_visitors = set()
235+
236+
def record_page_view(self, client_ip, page_path):
237+
# Use deterministic encryption for consistent visitor counting
238+
encrypted_ip = ipcrypt.encrypt_deterministic(client_ip)
239+
240+
# Count the page view
241+
if page_path not in self.page_views:
242+
self.page_views[page_path] = 0
243+
self.page_views[page_path] += 1
244+
245+
# Count unique visitors
246+
self.unique_visitors.add(encrypted_ip)
247+
248+
def get_analytics_report(self):
249+
return {
250+
"total_page_views": sum(self.page_views.values()),
251+
"unique_visitors": len(self.unique_visitors),
252+
"popular_pages": sorted(self.page_views.items(),
253+
key=lambda x: x[1],
254+
reverse=True)
255+
}
256+
```
257+
258+
**Benefits:**
259+
- Analytics can be collected without storing personal data
260+
- Unique visitor counting still works accurately
261+
- No need to obtain explicit consent for IP storage
262+
- Reduced risk in case of data breaches
263+
264+
## Implementation Considerations
265+
266+
When implementing IPCrypt in real-world applications, consider the following:
267+
268+
1. **Key Management**: Securely store and manage encryption keys
269+
2. **Mode Selection**: Choose the appropriate encryption mode based on your specific needs
270+
3. **Performance**: For high-volume applications, consider caching or batch processing
271+
4. **Backup**: Ensure keys are securely backed up to prevent data loss
272+
5. **Documentation**: Clearly document the encryption approach for future reference
273+
136274
## Getting Started
137275

138276
Ready to implement IPCrypt in your project? Check out our [developer resources]({{ site.baseurl }}/resources/) and choose from [multiple language implementations]({{ site.baseurl }}/implementations/).

0 commit comments

Comments
 (0)