Crate loco_protocol[][src]

Expand description

Loco protocol implemention

An opensource loco protocol implemention written in Rust. Provides command, secure layer and crypto used in networking.

Specification

Command

namesize
header(Header) 18 bytes
data_size4 bytes
datadata_size
namesize
id4 bytes
status2 bytes
name11 bytes
data_type1 bytes

Secure data

namesize
header(Header) 20 bytes
encrypted dataheader.size - 16

Header

namesize
size4 bytes
iv16 bytes

Handshake

namesize
key size4 bytes
key_encrypt_type4 bytes
encrypt_type4 bytes
key256 bytes

Note: current implemention only supports RSA-AES

Networking

Command

Stream: Command #0 | Response command #0 | Broadcast command #1

Client -> Command #0
Server <- Command #0
Server -> Response command #0
Client <- Response command #0
Server -> Broadcast command #1
Client <- Broadcast command #1

Command is likely unordered. To match response and request, use header id.

Secure data

Stream: Handshake | Secure data #0 | Secure data #1

Client -> Handshake
Client -> Secure data #0
Server <- Secure data #0
Server -> Secure data #1
Client <- Secure data #1

Modules