MeshCore Security and Encryption
MeshCore encryptsuses alla messagelayered payloadscryptographic usingsystem AES-256-CTR.verified Understandingfrom howthe project's source code. All claims on this workspage helpsare yousourced makefrom informedsrc/Utils.cpp, decisionssrc/MeshCore.h, aboutand whatsrc/Identity.h to transmit overin the meshofficial andMeshCore how to configure private channels.repository.
WhatSymmetric is encryptedEncryption
AllAlgorithm:direct messagesAES-128 (DMs):ECBEncrypted end-to-endmode withAES-256-CTR.zero-paddingOnlyfor thesenderfinal block)
CIPHER_KEY_SIZE = 16)
The shared AES key is derived via ECDH (see below)
Message Authentication
CIPHER_MAC_SIZE = 2)
Scheme: Encrypt-then-MAC — the ciphertext is MACed, not the plaintext
Functions: encryptThenMAC / MACThenDecrypt
Key Exchange
calcSharedSecret in Identity.h)
The resulting shared secret is used as the AES-128 key for the session
Identity and recipientSigning
PUB_KEY_SIZE = 32)
Private key size: 64 bytes (PRV_KEY_SIZE = 64)
Signature size: 64 bytes (SIGNATURE_SIZE = 64)
What isThis NOTMeans encryptedin (by design)Practice
Advertisements:MessagesBroadcastbetweenintwocleartextMeshCoresonodesanyusenodeacanuniquediscoverAES-128repeaters.keyContainsderivednodefromname,theirID,ECDHandexchangeoptionally—position.no shared secret needs to be pre-distributedRouteTherequests/replies:2-byteCleartextHMACtoprovidesenableintegrityroutingcheckingby(detectsintermediatetampering)nodeswiththatlowdon’t have the message key.overhead- Node
IDsidentitiesinarepacketcryptographicallyheaders:verifiedMust be visible to routers for forwarding.
This means: if— a node hascannot GPSimpersonate enabledanother and flood advertisements configured, its approximate location and identity are visible to anyone who can receive its radio transmissions. This is intentional — it’node's whatpublic makeskey
network
AES-256-CTR in practice
Counter (CTR) mode converts AES intouse a streamshared cipher.symmetric Each packet has a unique initialization vector (IV)key derived from the sender’schannel identity, sequence number, and timestamp. Key properties:
Key
Source: management for direct messages
MeshCore generates a unique keypair for each node during initial setup. The private key never leaves the device. The public key is shared via advertisements and is used by other nodes to encrypt messages specifically for that device.
This is an asymmetric key exchange model for key agreement, with AES-256 for the actual message encryption. The details of the key agreement protocol are documented in theOfficial MeshCore protocolrepository, specificationsrc/Utils.cpp, atsrc/MeshCore.h, github.com/meshcore-dev/MeshCore.src/Identity.h. Verified 2026-05-03.
Channel security model
Channel messages use a symmetric key (the channel PSK) shared among all channel members. Security properties:
Threat model: what MeshCore protects against
Security recommendations for sensitive use
Comparing to Meshtastic security
Both provide strong protection for practical threat models. The key difference is that MeshCore’s encryption is always active with no unencrypted fallback mode, while Meshtastic’s default channel uses a public key that provides confidentiality only against passive observers who don’t know the key (which is publicly documented).