Giter Club home page Giter Club logo

libsession-util's People

Contributors

bilb avatar darcys22 avatar dr7ana avatar jagerman avatar majestrate avatar mpretty-cyro avatar yougotwill avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

libsession-util's Issues

Groups: pad encrypted key list size

Our list of group encryption keys won't be entirely encrypted: anyone will be able to read that it is a list of encrypted keys (but inside that each key is encrypted).

This leaks the group size. We can fix it easily, though, by appending dummy values to pad it out to the nearest increment of some multiple (maybe 64; will need to think about the final sizes) so that it doesn't directly leak the group size.

Add sender/signature/content encoding/decoding/verification

For group messages we need encrypted messages to decrypt to something (probably a new protobuf type?) that contains sender, signature, and content, where content is encoded Content protobuf, sender is a Session ID, and signature is an XEd25519 signature*.

(* sort of -- official XEd25519 has a reliance on a random value to make the signature, but since we have full ed keys we can make that EdDSA-style deterministic and do a negation, if necessary, so that we can always verify with the positive of the two possible X->Ed pubkeys).

Add property based testing using RapidCheck

I'm investigating property-based testing for Oxen projects, I think libsession-util is a good start, and session::bt::merge is a good toy study case.

To use property-based testing, the first step is to define data generators, the second step is to define properties.

I implemented a toy data generator for a simplified version of bt_value type, next step is to integrate it into the rest of the code.

Once I have some working prototypes I'll create a draft PR for discussion.

In the meantime comments and feedback are appreciated!

Add config type tag

Add a tag to config messages so that we can identify the message type before parsing, and skip wrong/future types.

Track message hashes to delete

Change the merge API so that we take pairs of hash => data, then make any stale hashes available in some call after the merge so that Session clients can retrieve them and remove them from the server.

Clarify the purpose of the library

It's unclear why the lib is called libsession-util instead of, for example, libsession. Will this be used for everything but client-specific features (e.g., business logic, UI, persistence, etc.) in Session clients, or is this library only a collection of utilities that are useful for building Session clients but not enough (i.e., you will still need to write custom code for handling the cryptography)?

While the answers to those questions would be satisfying for me, it'd be better to add a short description of what the library is/will be in the README. I do understand that it's still in active development, and this will probably be clarified in the future, but it could be helpful for potential future users of the lib (i.e., if this will eventually cover all aspects of the Session protocol, I can already integrate it into a Session Dart package I'm working, figure out the API, make it more idiomatic for Dart, instead of re-implementing everything from ground-up (my original idea)) :)

Groups: use a unique, per-group random seed for subaccount generation

In the current new groups (AKA closed groups) redesign, admins of a group generate a signing subaccount for non-admin members and provide them a signature that they can pass along to the swarm to authenticate; effectively the admin delegates permissions to the user.

@venezuela01 brought up a useful point: this would still allow someone with possession of many storage servers to perform some (limited) social graph construction by observing all the subaccount logins, since a swarm member could perform the same pubkey blinding that admins would be performing.

This is, however, relatively easy to solve: groups can have a "blinding seed" that gets stored in the group's published, encrypted metadata -- a random value that gets used in the calculation of subaccounts, but that is only ever visible to members of the group itself. Then when generating a subaccount, the admin can incorporate this seed into the blinding procedure. From a user's perspective, subaccounts would still work the same way, but since this seed isn't public knowledge, it would break the ability to link accounts to groups by anyone not already in the group.

Version string exposed from the library

Just a function returning a string exposed from the library so we can print on the app startup which version of the library we are running (and include it in the logs if we ever run into an issue)

Maintain cache of blinded IDs

Right now Session can struggle a bit with dynamically calculating unblinded IDs*, but libsession-util ought to be able to computing the blindings of known contacts quite easily and maintain either a semi-persistent (calculated on startup) or fully persistent (dumped to DB) cache of them to provide fast looking to Session clients.

* - specifically, to figure out if a given blinded ID maps to a known contact. You can't go blinded -> session ID, but given all your known session IDs, you can go from them to their blinded versions for each server pubkey and see if anything matches.

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.