lazynton 0.0.1
lazynton: ^0.0.1 copied to clipboard
E2EE HTTP client for lazynton servers: rhttp transport, X25519 handshake, XChaCha20-Poly1305 binary bodies.
lazynton #
E2EE HTTP client for lazynton (axum) servers. rhttp transport, X25519 handshake, XChaCha20-Poly1305 binary bodies via lazyxchacha.
- Binary wire format:
application/octet-streambody = rawnonce(24) || ciphertext || tag(16) - Per-session keys: X25519 handshake (
POST /handshake), session addressed by theX-Session-Idheader; auto re-handshake + one retry on 401 - Pre-shared key mode: pass
sharedKeyto skip the handshake (server fallback-key mode)
Usage #
import 'package:lazynton/lazynton.dart';
await Rhttp.init(); // once at app startup
final client = await LazyntonClient.create(baseUrl: 'https://api.example.com');
// Handshakes lazily on first call; encrypts request, decrypts response.
final data = await client.post('/data', {'msg': 'hi'});
Pre-shared key (no handshake):
final client = await LazyntonClient.create(
baseUrl: 'https://api.example.com',
sharedKey: 'edf9d004edae8335f095bb8e01975c42cf693ea60322b75cb7c6667dc836fd7e',
);
Non-2xx responses throw RhttpStatusCodeException (server errors pass through
unencrypted). Tune the transport with settings: ClientSettings(...).