A client-side secure P2P file sharing using WebRTC.
Accept Answer
.Zero share client will get ICE Candidate from STUN/TURN server and make a connections between peers.
Thanks to the Interactive Connectivity Establishment (ICE) protocol, Two peers will have the shortest path to travel between them without caring the Network address translation (NAT).
WebRTC protocol will secure by DTLS (Datagram Transport Layer Security) But DTLS can be vulnerable to man-in-the-middle (MITM), So we provide a second layer encryption using PGP (RSA-OAEP-1024, AES-128).
C4Context
Component(stun, "STUN Server")
Boundary(b, "", "") {
Person(bob, "Bob", "Bob Zero Share")
Person(alice, "Alice", "Alice Zero Share")
}
Rel(alice, stun, "get ice candidates")
UpdateRelStyle(alice, stun, $offsetX="-90", $offsetY="-40")
Rel(bob, stun, "get ice candidates")
UpdateRelStyle(bob, stun, $offsetX="-90", $offsetY="-40")
BiRel(alice, bob, "file transfer")
UpdateRelStyle(alice, bob, $offsetX="-30")
Example sequence, Alice want to send a file to Bob.
sequenceDiagram
actor Alice
actor Bob
Alice-->>Alice: generate offer sdp
Alice->>Bob: send offer link
Bob-->>Bob: generate RSA keypair
Bob-->>Bob: generate answer sdp
Bob->>Alice: send answer sdp + RSA pub key
Alice-->>Alice: encrypt file with AES key
Alice-->>Alice: encrypt AES key with RSA pub key
Alice->>Bob: send encrypted file + encrypted AES key
Bob-->>Bob: decrypt file with decrypted AES key
Requirements
Installation
npm install
Run development (hot reload)
npm run dev
Test (playwright)
npm run test
The deployment will using this Github Workflow to trigger the Github Action to build the Github Pages.
For self-host, you can run npm run build
to build the static files. This no need the server side of svelte.
We welcome contributions from the community! If you'd like to contribute to the project, follow these steps:
npm run test
.npm run lint
and npm run format
.For feature requests, please open an issue on the GitHub repository to discuss your ideas with the maintainers.
This project is 100% open-source. MIT License - Copyright © 2023 Jirawat Boonkumnerd.