HiveMind Core secures communication between the server and its satellites with the poorman_handshake library as its cryptographic foundation.
HiveMind Core uses the poorman_handshake protocol for initial authentication and session key setup, managed by HiveMindClientConnection in hivemind_core.protocol.
- Identity: every client has an
Access Keyand aPasswordstored throughhivemind_core.database.ClientDatabase. - Session Key: during connection, the server derives a temporary session key with PBKDF2, using
poorman_handshake.PasswordHandShakeorpoorman_handshake.HandShake. - Cipher: the client proposes ciphers and the server picks the first one its
allowed_cipherslist also holds. The default order prefersCHACHA20-POLY1305, thenAES-GCM. - Encryption: this session key encrypts all later traffic.
- Protocol v3: a client that supports the Noise handshake (XXpsk2/KKpsk0) gets an authenticated, forward-secret transport instead of the session-key layer.
- ChaCha20-Poly1305 and AES-256-GCM: used for transport layer encryption. Both are AEAD ciphers, so both give confidentiality and data integrity.
- PBKDF2: used for deriving keys from passwords, resisting brute-force attacks.
- RSA: used for
INTERCOMmessages, so nodes can exchange end-to-end encrypted messages that a relay node cannot read. The server verifies the origin signature and pins the sender's public key on first sighting. Whilerequire_cryptois true, the server drops an unsignedINTERCOMframe instead of relaying it.
The server enforces access control through ClientDatabase and HiveMindClientConnection:
-
Message whitelist:
MessageTypeACLPolicychecks each client'sallowed_typeswhitelist during routing. See Policy Admission Chain. -
Skill/intent blacklisting: restrict which AI skills a specific satellite can trigger with
hivemind-core blacklist-skillandblacklist-intent(hivemind_core.scripts). -
Node-level isolation: clients only receive messages meant for them, or broadcast to their permission level, as defined by
HiveMindNodeTypeinhivemind_core.protocol. -
QUERY/CASCADE response routing:
is_responsemetadata on a QUERY or CASCADE message is checked against the samecan_escalate/can_propagatepermission as an original request, and checked before the response is routed._route_query_responsetrustsmetadata.originator_peeras a bare delivery address, with no proof the sender ever took part in thatquery_id; without the permission gate, a client with no escalate/propagate rights could forge{"is_response": true, "originator_peer": <victim>}around an arbitrary payload and have it delivered to the victim's connection.This closes the unprivileged forgery path, not every forgery path: a client that does hold escalate/propagate permission can still address a response at a peer for a query it never participated in, because the server keeps no per-query record of who actually asked, and routing trusts the sender's own claimed
originator_peer. A privileged sender is still bounded by whatever the message-type ACL and its own permission scope allow, but response addressing itself is not verified against the query.