certtools/cryptopanwrapper

Name: cryptopanwrapper

Owner: CERT-Tools

Description: null

Created: 2018-05-23 21:59:43.0

Updated: 2018-05-23 22:16:10.0

Pushed: 2018-05-23 22:16:09.0

Homepage: null

Size: 17

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

CryptoPanWrapper

(Copyright 2018 by L. Aaron Kaplan kaplan@cert.at, all rights reserved)

TL;DR

This is a simple wrapper class around the following libraries:

What is Crypto-PAn?

Crypto-PAn stands for Cryptograpy-based prefix preserving Anonymization. Quoting from the original site:

“This is an implementation of the cryptography based prefix-preserving trace anonymization technique described in “Prefix-Preserving IP Address Anonymization: Measurement-based Security Evaluation and a New Cryptography- based Scheme” authored by Jun Xu, Jinliang Fan, Mostafa Ammar and Sue Moon. In this implementation, we use Rijndael cipher(AES algorithm) as underlying pseudorandom function. "

Note: technically speaking, what Crypto-PAn does, is actually pseudonymization of IP addresses. Since every IP address is mapped uniquely (1-1) onto another IP address (via AES encryption). Anonymization would be the process of mapping multiple IP addresses to the very same target IP address, efectively making the oringial IPs indistinguishable (non-reverse mappable).

So, for all purposes of GDPR, Crypto-PAn does pseudonymization. However, the original paper called it anonymization. We will use these two terms within this page synonimously (although it's actually wrong). Please just bear in mind that all we will be talkig about is actually meant to be pseudonymizaiton.

Implementations

Currently there are many implementations of the Crypto-PAn Algorithm:

The CryptoPanWrapper

This code wraps the different implementations and especially makes using David Stott's Lucent implementation useable via Python.

How to use it?

from  CryptoPanWrapper import CryptoPanWrapper
cp = CryptoPanWrapper(b'32-char-str-for-AES-key-and-pad.', use="yacryptopan")
cp.anonymize('192.0.2.1') == '192.0.125.244')
cp2 = CryptoPanWrapper(b'32-char-str-for-AES-key-and-pad.', use="pycryptopan")
assert(cp2.anonymize('192.0.2.1') == '192.0.125.244')
cp3 = CryptoPanWrapper(b'32-char-str-for-AES-key-and-pad.', use="cpp-cryptopan")
cp3.anonymize('192.0.2.1')


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.