Encrypted Messaging with Zeq
This recipe shows how to build end-to-end encrypted messaging using the Zeq API. Every message is wrapped in a ZSP envelope before transmission.
Prerequisites
- A ZID (register at zeq.dev/auth)
- An API key or session key
Send a Message
curl -X POST https://www.zeq.dev/api/message/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "zid_recipient",
"body": "Hello from the Zeq API!",
"conversationId": "conv_..."
}'
The message is automatically encrypted with ZSP (K_spectral × K_temporal × K_chaos) before storage and delivery.
Real-Time Delivery
// Connect to WebSocket for real-time messages
const ws = new WebSocket('wss://www.zeq.dev/ws');
ws.onopen = () => ws.send(JSON.stringify({ type: 'auth', token: sessionKey }));
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'message') {
console.log('New message:', data.body);
}
};
Key Operators
KO42 (mandatory), CS47 (Shannon entropy for key strength), QM8 (tunneling for chaos kernel), QM4 (entanglement for key exchange), XI1 (information density), PSI96 (phase modulation).
Live Example
See Zeq Message for a full implementation with voice/video calls, file sharing, and ghost mode.