Crypto-PAn
Crypto-PAn (Cryptography-based Prefix-preserving Anonymization ) is a cryptographic algorithm for anonymizing IP addresses while preserving their subnet structure.[src] That is, the algorithm encrypts any string of bits x to a new string E_k(x) , while ensuring that for any pair of bit-strings x, y which share a common prefix of length p , their images E_k(x), E_k(y) also share a common prefix of length p .[src] A mapping with this property is called prefix-preserving.[src] In this way, Crypto-PAn is a kind of format-preserving encryption.[src] The mathematical outline of Crypto-PAn was developed by Jinliang Fan, Jun Xu, Mostafa H.[src] Ammar (all of Georgia Tech) and Sue B.[src] Moon.[src] It was inspired by the IP address anonymization done by Greg Minshall's TCPdpriv program circa 1996.[src]
Crypto-PAn (Cryptography-based Prefix-preserving Anonymization ) is a cryptographic algorithm for anonymizing IP addresses while preserving their subnet structure.[src] That is, the algorithm encrypts any string of bits x to a new string E_k(x) , while ensuring that for any pair of bit-strings x, y which share a common prefix of length p , their images E_k(x), E_k(y) also share a common prefix of length p .[src] A mapping with this property is called prefix-preserving.[src] In this way, Crypto-PAn is a kind of format-preserving encryption.[src] The mathematical outline of Crypto-PAn was developed by Jinliang Fan, Jun Xu, Mostafa H.[src] Ammar (all of Georgia Tech) and Sue B.[src] Moon.[src] It was inspired by the IP address anonymization done by Greg Minshall's TCPdpriv program circa 1996.[src] ==Algorithm== Intuitively, Crypto-PAn encrypts a bit-string of length n by descending a binary tree of depth n , one step for each bit in the string.[src] Each of the binary tree's 2^n - 1 non-leaf nodes has been given a value of "0" or "1", according to some pseudo-random function seeded by the encryption key.[src] At each step i of the descent, the algorithm computes the i th bit of the output by XORing the i th bit of the input with the value of the current node.[src] The reference implementation takes a 256-bit key.[src] The first 128 bits of the key material are used to initialize an AES-128 cipher in ECB mode.[src] The second 128 bits of the key material are encrypted with the cipher to produce a 128-bit padding block \mathit{pad} .[src] Given a 32-bit IPv4 address x , the reference implementation performs the following operation for each bit x_i of the input: Compose a 128-bit input block I_i = x_{[0,i)} \mathit{pad}_{[i,128)} .[src] Encrypt I_i with the cipher to produce a 128-bit output block O_i .[src] Finally, XOR the i th bit of that output block with the i th bit of x , and append the result — x_i \oplus O_{i,i} — onto the output bitstring.[src] Once all 32 bits of the output bitstring have been computed, the result is returned as the anonymized output E_k(x) which corresponds to the original input x .[src] The reference implementation does not implement deanonymization; that is, it does not provide a function D_k such that D_k(E_k(x)) = x .[src] However, decryption can be implemented almost identically to encryption, just making sure to compose each input block I_i = x_{[0,i)} \mathit{pad}_{[i,128)} using the plaintext bits of x decrypted so far, rather than using the ciphertext bits: I_i \neq E_k(x)_{[0,i)} \mathit{pad}_{[i,128)} .[src] The reference implementation does not implement encryption of bitstrings of lengths other than 32; for example, it does not support the anonymization of 128-bit IPv6 addresses.[src] In practice, the 32-bit Crypto-PAn algorithm can be used in "ECB mode" itself, so that a 128-bit string x_{[0,128)} might be anonymized as E_k(x_{[0,32)}) E_k(x_{[32,64)}) E_k(x_{[64,96)}) E_k(x_{[96,128)}) .[src] This approach preserves the prefix structure of the 128-bit string, but does leak information about the lower-order chunks; for example, an anonymized IPv6 address consisting of the same 32-bit ciphertext repeated four times is likely the special address :: , which thus reveals the encryption of the 32-bit plaintext 0000:0000 .[src] In principle, the reference implementation's approach (building 128-bit input blocks I_i ) can be extended up to 128 bits.[src] Beyond 128 bits, a different approach would have to be used; but the fundamental algorithm (descending a binary tree whose nodes are marked with a pseudo-random function of the key material) remains valid.[src] ==Implementations== Crypto-PAn's C++ reference implementation was written in 2002 by Jinliang Fan.[src] In 2005, David Stott of Lucent made some improvements to the C++ reference implementation, including a deanonymization routine.[src] Stott also observed that the algorithm preserves prefix structure while destroying suffix structure; running the Crypto-PAn algorithm on a bit-reversed string will preserve any existing suffix structure while destroying prefix structure.[src] Thus, running the algorithm first on the input string, and then again on the bit-reversed output of the first pass, destroys both prefix and suffix structure.[src] (However, once the suffix structure has been destroyed, destroying the remaining prefix structure can be accomplished far more efficiently by simply feeding the non-reversed output to AES-128 in ECB mode.[src] There is no particular reason to reuse Crypto-PAn in the second pass.) A Perl implementation was written in 2005 by John Kristoff.[src] Python and Ruby implementations also exist.[src] Versions of the Crypto-PAn algorithm are used for data anonymization in many applications, including NetSniff and CAIDA's CoralReef library.[src] ==Related work== In 2025, the IPCrypt project proposed standardized methods for encrypting IP addresses, including a prefix-preserving construction (ipcrypt-pfx) intended to work for both IPv4 and IPv6 and to modernize earlier designs such as Crypto-PAn.[src] The corresponding Internet-Draft and a research preprint on the IACR ePrint archive compare IPCrypt’s constructions with Crypto-PAn.[src] ==References==[src]
44 sentences · 44 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Crypto-PAn." encyclopegia.org, 2026, https://encyclopegia.org/wiki/crypto-pan. Accessed 01 December 2026.
Chicago
"Crypto-PAn." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/crypto-pan.
APA
encyclopegia.org. (2026). Crypto-PAn. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/crypto-pan
Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON