Open source · MIT license ·
Discover what real privacy means.
LANMess is an end-to-end encrypted messenger for the terminal. It runs on your LAN or routed overlay with no cloud servers, no accounts, and no telemetry.
Built on
- AES-256-GCM
- X25519
- Ed25519
- Argon2id
- HKDF-SHA256
- HMAC-SHA256
- PBKDF2 (600K)
- TOTP
Why LANMess
Most messengers depend on central servers and external accounts. LANMess keeps discovery, sessions, and storage under your control.
| Requirement | LANMess | Typical cloud messengers |
|---|---|---|
| Internet connection required | No (LAN or overlay) | Yes |
| Where data travels | Your network or overlay only | Provider servers |
| Account or phone number | None | Usually |
| End-to-end encryption | X25519 + AES-256-GCM | Varies by product |
| Terminal interface | Native (Textual) | Rarely |
| Source code | Auditable, MIT licensed | Varies |
| Panic password and auto-lock | Built in | Rarely |
| Key rotation and persistent blocking | Yes | Varies |
| Local database encryption | AES-256-GCM + Argon2id | Varies |
How it works
From vault creation to ratcheted, encrypted messages.
Vault creation
On first launch, you enter your display name, a shared group code (12–256 chars), and a strong PIN (min 12 chars with lower, upper, digit, and symbol). LANMess generates a random 32-byte master key and wraps it with Argon2id (time=3, memory=64 MiB, parallelism=4).
Peer discovery
Instances broadcast UDP beacons on port 50505 every 2 seconds carrying current and previous TOTP-derived code tags and public keys. Peers expire after 15 seconds without a beacon, or you can add directly by IP and TCP port (50510–50600).
Secure adding
To add a peer, you enter their rotating 8-digit TOTP code (60s window). Your request includes a 32-byte challenge and an HMAC-SHA256 proof over the code, verified against the current and previous 60-second window without exposing the code itself.
Encrypted chat
Starting a chat runs an ephemeral X25519 exchange and derives independent send and receive hash chains via HKDF-SHA256. Each message is padded to 256-byte blocks, encrypted with AES-256-GCM, and signed with Ed25519.
Cryptographic architecture
Standard cryptographic primitives across session setup, message ratcheting, control frames, and local storage.
X25519 ephemeral exchange
Each chat session generates fresh ephemeral X25519 keys to compute a shared secret, while control frames are authenticated by your Ed25519 identity key.
HKDF-SHA256 chain derivation
The shared secret and sorted ephemeral public keys derive a 64-byte key material split into directional send and receive ratchet chains.
AES-256-GCM and hash ratchet
Each message derives a per-message key, pads the plaintext to a 256-byte block, encrypts with AES-GCM bound to sender and counter AAD, and advances the chain key via HMAC-SHA256.
Ed25519 signatures and audit chain
Messages (including reply and reaction targets) and control frames are Ed25519-signed, while local security events are recorded in an HMAC-SHA256 chained audit log.
async def send_chat_message(
self, contact_name, text,
reply_to=0, react_to=0, from_outbox=False
):
async with self._get_contact_lock(contact_name):
contact = self.db.get_contact(contact_name)
send_chain = bytes.fromhex(
contact.get("send_chain_key_hex", "")
)
counter = contact.get("send_counter", 0) + 1
msg_key = chain_message_key(send_chain)
padded = pad_message(text.encode("utf-8"))
nonce = os.urandom(12)
aad = f"{self.user_name}:{counter}".encode("utf-8")
ct = aes_gcm_encrypt(msg_key, padded, nonce, aad)
signed_data = (
self.user_name.encode("utf-8")
+ counter.to_bytes(8, "big")
+ nonce + ct
+ reply_to.to_bytes(8, "big")
+ react_to.to_bytes(8, "big")
)
sig = sign_bytes(self.ed_private, signed_data)
new_chain = chain_advance(send_chain)
self.db.set_contact_state(
contact_name,
send_chain_key_hex=new_chain.hex(),
send_counter=counter,
)
Features
A complete suite of security and usability features built into the terminal interface.
Frequently asked questions
Technical details drawn directly from the LANMess source code.
No questions match your search.
Install LANMess
Free and open source. No accounts, no subscriptions, no telemetry.
curl -sSL https://raw.githubusercontent.com/virensahti-nl/lanmess-install/main/macos.sh | bashcurl -sSL https://raw.githubusercontent.com/virensahti-nl/lanmess-install/main/linux.sh | bashcurl -sSL https://raw.githubusercontent.com/virensahti-nl/lanmess-install/main/termux.sh | bashpip install lanmesspip install lanmess or install from source.