Coder Social home page Coder Social logo

yacryptopan's Introduction

Yet another Crypto-PAn implementation for Python

Overview

This package provides a function to anonymize IP addresses keeping their prefix consistency. This program is based on the paper "Prefix-Preserving IP Address Anonymization: Measurement-based Security Evaluation and a New Cryptography-based Scheme" written by Jun Xu, Jinliang Fan, Mostafa H. Ammar, and Sue B. Moon. The detailed explanation can be found in [Xu2002].

This package supports both IPv4 and IPv6 anonymization.

Usage

>>> from yacryptopan import CryptoPAn
>>> cp = CryptoPAn('32-char-str-for-AES-key-and-pad.')
>>> cp.anonymize('192.0.2.1')
'192.0.125.244'
>>> cp.anonymize_bin(0xc0000201, version=4)
3221257716L
>>> cp.anonymize('2001:db8::1')
'27fe:8bc7:fee:1e:1e1f:f0fe:f0e1:83fd'
>>> cp.anonymize_bin(0x20010db8000000000000000000000001, version=6)
53161570263948813229648829710638089213L

Code

The source code is available at https://github.com/keiichishima/yacryptopan

Bug Reports

Please submit bug reports or patches through the GitHub interface.

References

[Xu2002] Jun Xu, Jinliang Fan, Mostafa H. Ammar, and Sue B. Moon, "Prefix-Preserving IP Address Anonymization: Measurement-based Security Evaluation and a New Cryptography-based Scheme", in Proceedings of the IEEE International Conference on Network Protocols, Paris, 2002.

Contributors

Author

Keiichi SHIMA / IIJ Innovation Institute Inc. / WIDE project

yacryptopan's People

Contributors

diekmann avatar keiichishima avatar thewall89 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.