Giter Site home page Giter Site logo

edk0 / iphide Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 15 KB

proof of concept structure-preserving IP mangling

License: Do What The F*ck You Want To Public License

Makefile 4.36% C 95.64%
c siphash irc encryption permutation obfuscation format-preserving-encryption

iphide's Introduction

iphide

structure-preserving encryption for IP addresses

Home-grown crypto features ahead, so I'll include the standard warning about feet and bazookas, though in this case I'd posit that very little could be worse than current alternatives ;)

The encryption key is currently compiled into the binary.

I wrote this in the hope of solving all the problems with IP cloaking on IRC. My attempt encrypts each bit of an IP address based on all the bits preceding it, preserving the prefix structure of IP addresses:

$ ./iphide 1.1.1.1
1.1.1.1 -> 8.33.150.83
$ ./iphide 1.1.200.200
1.1.200.200 -> 8.33.1.83

even—uniquely, as far as I'm aware—in the middle of octets:

$ ./iphide 1.1.64.1
1.1.64.1 -> 8.33.234.173
$ ./iphide 1.1.96.1
1.1.96.1 -> 8.33.221.132

while revealing as little information as possible about their contents: You can tell how many bits of prefix two encrypted IP addresses share, but nothing else. In order to improve privacy at the expense of structure-preservingness, an prefix of the IP address can use full-blown format-preserving encryption instead (12 bits by default for V4 addresses, but it's configurable in the source).

Of course, since everything we're doing is encryption (and not hashing), this process is guaranteed to be completely collision-free and reversible, given the key:

$ ./iphide ?8.33.221.132
8.33.221.132 -> 1.1.96.1

iphide's People

Contributors

edk0 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jamesnjan

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.