mirror of
https://github.com/schollz/croc.git
synced 2024-12-24 22:33:14 +03:00
move to websockets
This commit is contained in:
parent
ffebb472b9
commit
6f1e6f3da8
50
README.md
50
README.md
@ -87,4 +87,52 @@ https://medium.com/@simplyianm/why-gos-structs-are-superior-to-class-based-inher
|
||||
croc.New()
|
||||
croc.SetX().... Set parameters
|
||||
croc.Send(file)
|
||||
croc.Receive()
|
||||
croc.Receive()
|
||||
|
||||
|
||||
# Conditions of state
|
||||
|
||||
## Sender
|
||||
|
||||
*Initialize*
|
||||
|
||||
- Requests to join.
|
||||
- Generates X from pw.
|
||||
- Sender sends X to relay.
|
||||
|
||||
*Is Y available?*
|
||||
|
||||
- Use *Y* to generate its session key *k_A* and *H(k_A)*, and checks *H(H(k_A))*==*H(H(k_B))*. Abort here if it is incorrect.
|
||||
- Encrypts data using *k_A*.
|
||||
- Connect to TCP ports of Relay.
|
||||
- Send the Relay authentication *H(k_A)*.
|
||||
|
||||
*Are ports stapled?*
|
||||
|
||||
- Send data over TCP
|
||||
|
||||
|
||||
## Recipient
|
||||
|
||||
*Initialize*
|
||||
|
||||
- Request to join
|
||||
|
||||
*Is X available?*
|
||||
|
||||
- Generate *Y*, session key *k_B*, and hashed session key *H(k_B)* using PAKE from secret *pw*.
|
||||
- Send the Relay *H(H(k_B))*
|
||||
|
||||
*Is H(k_A) available?*
|
||||
|
||||
- Verify that *H(k_A)* equals *H(k_B)*
|
||||
- Connect to TCP ports of Relay and listen.
|
||||
- Once file is received, Send close signal to Relay.
|
||||
|
||||
|
||||
## Relay
|
||||
|
||||
*Is there a listener for sender and recipient?*
|
||||
|
||||
- Staple connections.
|
||||
- Send out to all parties that connections are stapled.
|
@ -12,6 +12,10 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (c *Croc) updateChannel(p payloadChannel) (r response, err error) {
|
||||
|
||||
}
|
||||
|
||||
func (c *Croc) startServer(tcpPorts []string, port string) (err error) {
|
||||
// start cleanup on dangling channels
|
||||
go c.channelCleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user