A Common Approach to IP Address Encryption

IPCrypt is a simple, open specification for encrypting and obfuscating IP addresses, balancing privacy considerations with practical network operations.

What is IPCrypt?

IPCrypt is a simple, open specification that defines methods for encrypting and obfuscating IP addresses. It offers both deterministic format-preserving and non-deterministic approaches that work with both IPv4 and IPv6 addresses.

Unlike truncation that destroys data irreversibly and hashing that cannot be reversed, IPCrypt provides cryptographically secure, reversible encryption designed for high-performance processing at network speeds.

Simplicity is a core value in IPCrypt's design. Rather than trying to create new cryptographic methods, we've used established standards that are well-understood and widely available, making it easier for anyone to implement.

Key Features

Privacy Protection

Prevent exposure of sensitive user information to third parties without key access, addressing data minimization concerns from RFC6973.

Format Preservation

Deterministic mode produces valid IP addresses, enabling encrypted addresses to flow through existing infrastructure without modification.

Correlation Protection

Non-deterministic modes use random tweaks to produce different ciphertexts for the same IP, preventing pattern analysis.

Privacy-Preserving Analytics

Count unique clients, implement rate limiting, and perform deduplication directly on encrypted addresses without revealing original values.

Seamless Integration

Use encrypted IPs as privacy-preserving identifiers when interacting with untrusted services, cloud providers, or external platforms.

High Performance

All variants operate on exactly 128 bits, achieving single-block encryption speed critical for network-rate processing.

See IPCrypt in Action

Each mode offers different privacy and operational characteristics. See how the same IP addresses transform:

ipcrypt-deterministic

Format-preserving

Valid IP addresses, same input always produces same output

192.168.1.1 d1e9:518:d5bc:4487:51c6:c51f:44ed:e9f6
192.168.1.254 fd7e:f70f:44d7:cdb2:2992:95a1:e692:7696
192.168.1.254 fd7e:f70f:44d7:cdb2:2992:95a1:e692:7696 ✓ Same

ipcrypt-pfx

Prefix-preserving

Maintains network structure, same prefix when IPs share prefix

192.168.1.1 251.81.131.124
192.168.1.254 251.81.131.159 ✓ Prefix
172.16.69.42 165.228.146.177

ipcrypt-nd

Non-deterministic

Compact 24-byte output, different each time

192.168.1.1 f0ea0bbd...03aa9fcb
192.168.1.254 620b58d8...2ff8086f
192.168.1.254 35fc2338...25abed5d ≠ Different

ipcrypt-ndx

Extended non-deterministic

32-byte output, unlimited operations per key

192.168.1.1 5862dc6d...ddb3693f
192.168.1.254 e697ca59...e5c41875
192.168.1.254 9b11a0aa...39de0a77 ≠ Different

Community Implementations

Freely Available in Many Programming Languages

IPCrypt has been implemented in Python, C, Rust, JavaScript, Go, Java, Lua, Swift, Elixir, Ruby, Kotlin, AWK, Dart, Zig, PHP, D, and more, making it accessible to developers across different platforms.

Each implementation is open source and follows the same specification, allowing developers to choose the language that best fits their project.

Browse All Implementations
Python C Rust JavaScript Go Java Lua Swift Elixir Ruby Kotlin AWK Dart Zig PHP D

Interactive Playground

Try IPCrypt in Your Browser

Experience IPCrypt directly in your browser with our interactive playground. Encrypt and decrypt IP addresses using different modes, generate random keys and tweaks, and see the results instantly.

The playground uses the JavaScript implementation of IPCrypt, allowing you to test all four encryption modes with both IPv4 and IPv6 addresses.

Try the Playground
192.168.1.1
10.237.143.87

Join the Community

Interested in using or contributing to IPCrypt? Explore our resources, try the interactive playground, or check out the open source implementations. All are freely available for anyone to use.