UDP-based Socket Manager for secure communication using asymmetric and symmetric encryption is a wrapper over UDP. It uses Protocol Buffers for message encoding and supports DTLS for secure communication.
- Client Fetches Server Public Key – The client retrieves the server’s public key.
- Client Hello – The client sends a
hello
message containing a random value and an AES-CBC key, encrypted with the server’s public key. - Server Hello Verify – The server responds with a
helloverify
message containing a cookie HMAC, using the AES-CBC key from the client. - Client Verification – The client resends the
hello
message with the cookie HMAC, AES-CBC key, and a verification token. - Server Hello – The server completes the handshake by sending a session ID.
- Session Maintenance – The client continues communication while maintaining heartbeat messages; otherwise, the session expires.
Field | Description |
---|---|
Message Type | 1 byte |
Payload | ... rest of the message |
ClientHelloRecordType = 1
HelloVerifyRecordType = 2
ServerHelloRecordType = 3
PingRecordType = 4
PongRecordType = 5
UnAuthenticated = 6
Any value greater than these can be used as a custom message type.