@trap_stevo/verilink
Version:
Encrypted from the start. Trusted to the end. This client-side protocol redefines secure communication โ forging a direct bridge to zero-trust architecture through encrypted sessions, intelligent attestation, and seamless claim validation. Engineered for
140 lines (98 loc) โข 6.53 kB
Markdown
# ๐ VeriLink ยท Legendary End-toEnd Encrypted Client Protocol
> **Encrypted from the start. Trusted to the end.** This client-side protocol redefines secure communication โ forging a direct bridge to zero-trust architecture through encrypted sessions, intelligent attestation, and seamless claim validation.
> Engineered for the future of connectivity, it enables real-time payload exchange, persistent identity, and adaptive trust โ all in an ultra-light format built to empower encrypted APIs and modern edge environments.
## ๐ Features
- ๐ Encrypted payload delivery from browser and edge clients
- ๐ง Identity claims backed by attestation
- ๐ Session-based communication with optional persistence
- โ๏ธ Customizable mutation and storage handling
- ๐ Native browser compatibility
- ๐งฉ Seamless integration with VeriPath-secured routes
- ๐ก Drop-in secure request mechanism for the modern web
## ๐ฆ Installation
```bash
npm install @trap_stevo/verilink
```
## ๐ง Quick Start
```js
import { VeriLink } from "@trap_stevo/verilink";
const client = new VeriLink({
serverURL : "https://api.example.com",
deviceID : "my-device-id",
persistSessionKey : true,
persistSessionID : true,
mutator : "vlk"
});
// Pair once per session
await client.pair("/device/pair");
// Send secure request
const result = await client.send("POST", "/create-user", {
username : "legend",
email : "legend@example.com"
});
console.log(result);
```
## ๐ Configuration Options
| Property | Type | Description |
|------------------------|-------------------------|--------------------------------------------------------------------------|
| `serverURL` | `string` | Base URL for encrypted API server. |
| `deviceID` | `string` | Optional identifier for the calling device. |
| `userAgent` | `string` | The client identifier used for request validation. |
| `mutator` | `string` or `Uint8Array`| Key used for XOR-based local obfuscation. Default: `"vlk"` |
| `vaultSGN` | `string` | Storage key for session key. Default: `"vlx"` |
| `linkSGN` | `string` | Storage key for session ID. Default: `"vli"` |
| `persistSessionKey` | `boolean` | If `true`, stores the session key locally. |
| `persistSessionID` | `boolean` | If `true`, stores the session ID locally. |
| `sessionKey` | `ArrayBuffer \| string` | (Optional) Provide a pre-generated session key. |
| `sessionID` | `string` | (Optional) Provide a custom session ID. |
## ๐ API Overview
### ๐ Instance Methods
| Method | Description |
|---------------------------------------------|-----------------------------------------------------------------------------|
| `constructor(options)` | Creates a new encrypted client instance with optional persistence and device identity. |
| `pair(path = "/device/pair")` | Pairs the client with the server, submitting the session key securely. |
| `paired()` | Checks the pair status of the client device. |
| `send(method, path, data, headers, options)`| Sends an encrypted request to the server and returns the decrypted response. |
| `setServer(url)` | Updates the server URL for future requests. |
| `setKey(key)` | Sets the session key manually (ArrayBuffer or base64 string). |
### ๐ง Request Parameters (for `.send()`)
| Parameter | Type | Description |
|-------------|------------|------------------------------------------------------------|
| `method` | `string` | HTTP method (e.g., `"GET"`, `"POST"`) |
| `path` | `string` | Endpoint path (e.g., `"/create-user"`) |
| `data` | `object` | Payload to send (will be encrypted) |
| `headers` | `object` | Optional custom headers |
| `options` | `object` | Optional flags (e.g., `{ fullResponse: true }`) |
## ๐ง Identity and Trust
Every request includes session-bound claims with attested identity information and a cryptographically signed trust token. This allows the server to verify that the request originated from a known session, device, and environment โ without relying on traditional token chains.
When `persistSessionKey` and `persistSessionID` are enabled, session state can be retained across reloads or reboots, creating long-lived secure interactions without re-pairing.
## ๐ Designed For
| Environment | Use Case |
|-------------|----------------------------------------------|
| Browser | Secure frontend-to-server requests |
| Edge Apps | Lightweight encrypted API clients |
| Kiosks/IoT | Session-persistent command and control flows |
## ๐ค Companion APIs
| Package | Role |
|-------------|-------------------------------------------------------|
| `VeriPath` | Receives, decrypts, and verifies incoming client data |
| `VeriAuth` | Pairs session keys and manages session trust |
## ๐งฑ Use Cases
- Secure data transmission from frontend apps
- Encrypted micro-clients for embedded systems
- Stateless yet secure request flows
- Lightweight trust enforcement across client tiers
## ๐ License
See [LICENSE.md](./LICENSE.md)
_Forged for trust. Optimized for the edge. Delivered with precision._ ๐