Ask HN: Why hasn't x86 caught up with Apple M series?
Ask HN: Best codebases to study to learn software design?
Show HN: P2Party – Encrypted WebRTC Room URLs
I’ve been working for the past 10 months on p2party, a TypeScript/C/WASM library which you can find at https://github.com/p2party/p2party-js and demo at https://p2party.com , that lets you spin up an encrypted peer-to-peer mesh with nothing more than a shared URL.
Why I built it: I wanted something between https://file.pizza and “ephemeral Signal chat”, but with my custom cryptographic idea (I know I know... WebRTC is already encrypted and it is easy to go wrong etc.). The project started as a toy for sharing large DAW files with my bandmates (and to flex some applied crypto skills), then grew into a general toolkit. It is also a nice side project to test LLMs as companion coders and to know where the world is at right now regarding this subject (personal opinion - super small and well-defined tasks ok).
The cryptography: The messages, either strings or files, get split and included into isomorphic chunks of 64kb which are stored in IndexedDB until they are sent. Each chunk has some metadata like file hash, name, Merkle proof etc., the actual information and then padding left and right with noisy data. The real info starts at random positions on each chunk. The whole thing is then e2e encrypted with ChaChaPoly1305 with sender ephemeral keys and sent in random order.
Inspiration: To an observer of the message traffic, every chunk is isomorphic and contains a lot of useless info and some real ones. But to analyze it they need to store all the junk. The inspiration came from a principle of counter-surveillance that I learned from the adblock tool https://adnauseam.io .
Caveat: Before sending the message, all the chunks need to be created so that the Merkle proofs can be calculated and the browser can send the chunks in random ordering.
The p2p: I could not find a good example online of how to create a WebRTC mesh network so I built a tool for myself. It works acceptably now so that's why I uploaded it here after 10 months of working on it (on and off) :D
The WASM: I had experience with compiling C to WASM when I developed this project in the past https://github.com/deliberative/crypto and I wanted the same efficiency gains here.
Status: It works, but it is not security-audited yet → don’t trust it with your deepest secrets. API is stable enough to embed in your own apps. Open-source under AGPL-3.0.
Try it here: https://p2party.com (open in two browsers or devices). Code is here: https://github.com/p2party/p2party-js.
I'd love your feedback on everything! Enjoy!