ai newsFr., 4. Dez.
EilmeldungAlibaba Releases Qwen4-35B-A3B: Open-Weight MoE Model With 1M Context

Adding post-quantum encryption (X-Wing) to an open-source AI agent chat network

People put far more sensitive data into AI agent chats than they ever put into normal messaging apps. Private codebases, API keys, financial documents, personal notes, and half-baked ideas all flow through agent conversations every day. Most of those chats sit in plaintext on vendor servers. Telegr

dev.toDonnerstag 16:15 · 03.12.2 Min. Lesezeit
Bild: dev.to

People put far more sensitive data into AI agent chats than they ever put into normal messaging apps. Private codebases, API keys, financial documents, personal notes, and half-baked ideas all flow through agent conversations every day.

Most of those chats sit in plaintext on vendor servers. Telegram bots cannot use end-to-end encryption at all, and WhatsApp Business API terminates encryption on the business server. Even when an agent chat is encrypted with classical RSA or elliptic curves, any recorded ciphertext is still vulnerable to "harvest now, decrypt later" if someone stores traffic today and breaks classical key exchange later.

In Alice&Bot, an open-source chat network where humans and AI agents across different harnesses share encrypted group chats, we just added hybrid post-quantum encryption using X-Wing ( ML-KEM-768 + X25519 ) across the protocol, mobile/desktop PWA, push notifications, webhooks, and MCP server.

X-Wing combines ML-KEM-768 (NIST FIPS 203 lattice KEM) with classical X25519 into one hybrid key encapsulation mechanism. If a mathematical flaw ever shows up in ML-KEM, you still have X25519. If quantum computers break X25519, ML-KEM holds.

From an implementation standpoint it is surprisingly compact. Using @noble/post-quantum:

Every message, file, and interactive canvas in Alice&Bot is already encrypted client-side with a per-conversation AES-256-GCM symmetric key. The asymmetric layer wraps that conversation key once per participant. Switching that key-wrapping layer to X-Wing keeps per-message overhead at zero while upgrading every new conversation key exchange to hybrid post-quantum security.

Hard cutovers break running bots and old devices. Instead of replacing existing RSA keys, each identity now carries an optional publicPqEncryptKey ( pq1:<base64> ) alongside its legacy publicEncryptKey.

When wrapping a conversation key for a participant ( wrapConversationKey in protocol/src/clientApi.ts ):

On the receiving side, unwrapConversationKey checks the pq1: prefix and routes to decryptPq or legacy RSA decryption automatically. That same helper runs everywhere: browser and mobile PWA, the Service Worker that decrypts encrypted push previews ( sw.js ), Ed25519-signed webhook handlers ( handleWebhookUpdate ), and the MCP server ( npx -y alice-and-bot-mcp ).

You can read the full 124-line X-Wing module directly in protocol/src/pqCrypto.ts.

Crypto writeups lose credibility fast when they overstate what they do. Here is the exact scope:

Everything is MIT open source and works in Node, Deno, Bun, Cloudflare Workers, and browsers:

Quelle: dev.to (dev.to). Original öffnen