Giter VIP home page Giter VIP logo

p3lib's Introduction

p3lib

Build Status Version

The toolbox for enhancing privacy in P2P networks

p3lib implements a set of privacy preserving primitives and protocols that help engineers to build P2P and decentralized systems that protect peer's privacy.

The primitives implemented by p3lib are based on privacy enhancing technology research:

  • p3lib-sphinx implements a general-purpose onion routing packet construction and processor based on Sphinx [1]. p3lib aims at adding more primitives and protocols in the future. Stay tuned and let us know what you'd like to see as part of p3lib library.

  • p3lib-fullrt implements a full routing table DHT lookup for libp2p that was suggested by OctupusDHT [2], to protect DHT initiator privacy during the recursive network lookup.

  • p3lib-sinkhole is a computational PIR system [3] that complements DHT lookups and guarantees probavle privacy for DHT lookup initiators

Layer p3lib components implementation status
Packet format p3lib-sphinx [1] v0.1
Full Routing Table request p3lib-fullrt [2] v0.1
Sinkhole DHT p3lib-sinkhole specs

If you are interested about implementation details and APIs of p3lib components, check the specifications.

p3lib is designed to integrate seamlessly with libp2p.

Do you have ideas about some rad stuff you'd like to see implemented by p3lib? Open an issue or let's have a chat!.

References

[1] Sphinx: A Compact and Provably Secure Mix Format

[3] Private Information Retrieval

Contributing

Fork and PR. Issues for discussion.

License and support

© MIT (hashmatter)

This work is supported by hashmatter. Want to become a supporter? Reach out!

p3lib's People

Contributors

derlaft avatar gpestana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

p3lib's Issues

[research] What are the privacy needs of current P2P projects?

It would be very helpful to start understanding what are the privacy requirements and current vulnerabilities of current projects using IPFS, Dat and other P2P networks. This study could be used as basis for new or improved features of existent p3lib modules.

Default nonce security

Double check if using default nonce everywhere is ok in creating the cipher stream for encryption and signatures.

[meta issue]create mix header

This is a rather large task and comprises almost all the work for this lib.

  • define packet structure
  • generate ECDH shared secret (crypto, individual pairs)
  • generate fillers for each header
  • generate shared keys for a given circuit
  • generate blinding factors
  • packet MAC

[discussion] Mitigate DoS attacks on Sphinx relays

When processing the packets, each hop derives the shared key and then verifies if the key has been used before. If that is the case, it will discard the packet since it may be from a replay/DoS attack. It is important to make sure that the packet processing will happen only after the relay makes sure the packet has not been processed yet. This way, the DoS attack vector is bound to the capacity of the attacker to generate many valid packets with different shared keys between himself and the relay being attacked. The packet construction works effectively as a crypto puzzle to mitigate DoS attacks against relayers.

Is there any other mechanism that could be used? Do we need to add a more expensive puzzle?

[octopusdht] should the implementation include active attacks detection?

The OctopusDHT lookup assumes that active adversaries are detected and removed from the network by turning nodes into "shadow nodes" that use anonymous full routing table requests to verify if other peers are modifying the routing table (active attacks). Should this protocol be implemented too, or should we focus only on the multipath lookup with dummy queries?

Requests and ideas: What next?

This issue is for requesting and discussion ideas about what primitives should be used next. Add a new comment per request and feel free to add more comments for discussion. If you'd like to see on one (or more) of the suggestions prioritised, vote on its comment with a 👍!

Add support to more ECDSA implementations

Currently, p3lib-sphinx is using only crypto/ecdsa key implementations for ECDSA. The goal is to allow for secure and sensible "bring your own crypto", so the implementation must be abstracted with interfaces.

go mod: unexpected module path "p3lib"

Hello over there,

I am trying to include this repository to my code using p3lib and have a trouble doing that:

% go build .
go: github.com/hashmatter/[email protected]: parsing go.mod: unexpected module path "p3lib"
go: error loading module requirements

I think it is probably because go.mod currently has module p3lib, but not module github.com/hashmatter/p3lib, but I am not yet completely sure.

Steps to reproduce:

  1. Create a new empty go mod project.
  2. Try to github.com/hashmatter/p3lib/sphinx
  3. Get this error.

Thank you.

Packet payload HMAC

Implement packet payload signature and add to specs. Would there be any way to use only one HMAC instead of 2? (header and packet payload)

Name

IMO libpp is a good name but suspiciously similar to libp2p 😅and might get people confused, specially because some libp2p interfaces will most likely be used. libpp stands roughly for "lib for privacy preserving" and it would be cool to keep the name close to that idea.

How about:

  • ppp (as of privacy preserving primitives/protocols)
  • 3plib , p3lib (privacy preserving primitives/protocols library)
  • ppplib
  • libppp
  • lib3p

edit: I kinda like p3lib (e.g. p3lib-sphinx, p3lib-componentX,)

Specs and implement SURBs

SURB (single-use-reply-block) allows the last relay to send the response back to the initiator, while respecting the privacy and security properties of onion routing. Using SURBs must be optional.

  • add specs
  • implementation and testing

DHT anonymous lookup - requesting full routing table

As a developer, in libp2p, I'd like to have more control over how much information the lookup protocol leaks and how the lookup peer 'candidate list' is populated. Instead of sending a GET_VALUE request to a peer - which conceals what content ID the initiator is looking for - I'd like to request the peer's full routing table and make the decision locally about how to populate the candidate list.

This changes the Kademlia protocol considerably (as in specs), so I'm thinking of building a simple protocol on top of the current overlay. The idea would to define the protocol /p3lib/rt/1.0.0 that would request the authenticated routing table of a destination peer (how to secure the routing table against bias and other active attacks is another topic to be covered separately).

Having this feature in place is a first step towards implementing a privacy preserving lookup which does not disclose the target ID to a local passive adversary that controls up to 10-20% of network nodes. This lookup protocol is still open to range estimation attacks [ref] when the adversary controls more than one of the peers used to resolve the final peer ID. That can be mitigated by using multiple query paths with dummy requests [ref]. Other protocols can be used to mitigate the range estimation attacks, but the above mentioned mechanism is always a requirement for any DHT lookup protocol that does not leak information about the initiator's interests to local, passive adversaries.

[p3lib-sphinx v0.1] release!

Keeping all non-code related tasks for p3lib-sphinx v0.1:

  • Minimum protocol specs in place;
  • Interfaces and API documented;
  • Code examples;
  • Video with example on how to use p3lib-sphinx and libp2p peers;
  • Blogpost (why p3lib is important and 1st steps with p3lib-sphinx);

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.