Updated Security Implementation
PSK for Channels, PKC for Direct Messages and Admin Messages
Up to version 2.4.x of the firmware, Meshtastic relied entirely on Pre-Shared KeyPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. (PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel.) cryptography for all messaging. Starting with firmware version 2.5.0, Meshtastic introduced Public Key CryptographyPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. (PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions.) for Direct Messages (DMs) and added Session IDs for Admin Messages. Together, these enhancements bring the security architecture of Meshtastic to a new level of robustness.
Below is a detailed overview of how PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel., PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions., and Session IDs are integrated into your system to secure Channels, Direct Messages, and Admin Messages.
1. Chat Channels Using PSK
-
PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. Overview:
- Chat Channels continue to utilize a PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. for encrypting communications.
- All participants share the same PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. for their Channels, which is used for both encryption and decryption within the channel.
-
Security Considerations:
- Confidentiality: Only participants with the correct PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. can access messages within the Chat Channel.
- Key Management: Secure distribution and regular rotation of the PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. are essential to maintaining the channel's security.
2. DMs Now Using PKC
-
PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. Implementation for DMs:
- Public/Private Key Pairs: Each node is equipped with a unique public/private key pair. The private key is securely stored on the node, and the public key is shared with other nodes, allowing for secure, authenticated communication.
- Encryption and Signature:
- Encryption: DMs are encrypted using the recipient’s public key, ensuring only the recipient with the corresponding private key can decrypt the message.
- Digital Signatures: DMs are signed with the sender’s private key before encryption, allowing the recipient to verify the sender’s identity and the message’s integrity using the sender’s public key.
-
Security Enhancements with PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions.:
- Message Confidentiality and Integrity: With PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions., each DM is encrypted and signed, ensuring that only the intended recipient can read the message, and verifying that it has not been tampered with.
3. Admin Messages: Enhanced Security with PKC and Session IDs
-
Key Exchange with DH Curve25519:
-
Initial Key Exchange Setup:
- Key Generation: A Diffie-Hellman (DH) key exchange occurs using Curve25519 upon first communication between nodes. This generates a shared secret for establishing a symmetric encryption key.
- Hardware Support: Curve25519 is supported in hardware, ensuring efficient and secure key exchanges.
- Shared Secret: The derived shared secret is used for all subsequent communications between the nodes.
-
Use of Shared Secret for Encryption:
- Symmetric Encryption: Following the key exchange, messages are encrypted and decrypted using the shared secret with symmetric encryption algorithms like AES-CTR or AES-CCM.
- Efficiency: Symmetric encryption, especially when based on a secure DH exchange, balances security and performance, making it ideal for real-time applications.
-
-
Session ID for Admin Messages:
-
Session ID Usage: Session IDs are generated for each admin session and used as an additional value inside the encrypted packet. This ensures that each session is secure and unique.
-
Session Duration: The session ID is valid only for a short duration (e.g., 300 seconds) and is discarded once the session ends or after the next control message is sent.
-
Security Enhancements with PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. and Session ID:
- Replay Attack Mitigation: By utilizing session IDs, replay attacks are effectively mitigated. Old session IDs cannot be reused, ensuring that intercepted packets are invalidated.
- Isolated Impact: The use of session IDs confines any issues related to session management to admin messages, without affecting broader communication functions like DMs or Chat Channels.
-
4. Overall Security Architecture
-
Integration of PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. with Existing Systems:
- Direct Messages: PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. enhances the security of DMs by providing encryption, authentication, and integrity through the use of asymmetric encryption and digital signatures.
- Admin Messages: The combination of PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. and session IDs secures admin-related operations, providing an additional layer of protection for critical functions.
-
Use of PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. with Existing Systems:
- Channels: PSKsPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. continue to be used for group communication, ensuring secure message exchanges within the channel.
-
Scalability and Performance:
- Efficient Use of Resources: PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. for DMs leverages asymmetric encryption for secure communication, while PSKsPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. for Chat Channels and session IDs for admin messages optimize resource consumption on the platform.
- Memory Management: The selective use of PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions., PSKsPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel., and session IDs ensures that memory and computational resources are effectively managed, allowing the system to scale while maintaining high security.
Trust Model and Operational Security
The cryptographic protections described above (PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel., PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions., Session IDs) defend messages as they traverse the LoRaLoRaA low-power, long-range wireless communication technology used by Meshtastic devices to enable communication over distances of several kilometers without the need for cellular, Wi-Fi, or other traditional network infrastructures. mesh. They sit on top of two assumptions that operators should understand: the link between a node and a directly connected client is trusted, and node identity is established via Trust On First Use rather than a signing authority.
Local Trust Boundary
A client connected to a node over Bluetooth, USBUSB (Universal Serial Bus). The wired connection used to power a device, flash firmware onto it, and communicate with it over serial. serial, Wi-Fi, or Ethernet has full local API access. From that local connection, a client can read decrypted channel traffic, send messages as the node, change configuration (subject to managed mode), and read the node's private key for backup. The on-air cryptography does not extend below this boundary. Anything inside scope of the local trust relationship (a shared LAN, a USBUSB (Universal Serial Bus). The wired connection used to power a device, flash firmware onto it, and communicate with it over serial. cable to an untrusted host, a phone paired over Bluetooth) should be treated as an extension of the node itself.
Node Identity: Trust On First Use (TOFU)
Meshtastic uses a Trust On First Use (TOFU) model for node identity. There is no central authority that signs node keys, so the first public key a node hears for a given NodeNum is the one it binds to that NodeNum going forward. This is a hard requirement of operating as a decentralized ad-hoc mesh.
Client applications and the firmware include mitigations for the consequences of TOFU, such as favoriting nodes to prevent NodeDB rolloff and surfacing public-key changes in the UI. Firmware 2.8.X further strengthens node identity claims and message authenticity by adding XEdDSA packet signing, which reuses each node's existing X25519 key pair to sign User packets and other short packets so receivers can verify that a packet came from the holder of the bound public key. For the detailed discussion of NodeDB limits, spoofing edge cases, and the XEdDSA design, see Known Limitations and Future Plans of Meshtastic's Encryption.
Local Administration Over Wi-Fi
Administering a Meshtastic node over an untrusted Wi-Fi network, including setting Wi-Fi credentials on an ESP32ESP32A chipset of microcontroller made/designed by Espressif, used by a number of devices. Higher power usage than nRF52, but often cheaper and supports Wi-Fi if desired., is not recommended. All local admin traffic, not just the initial credential write, is exposed to that network.
When a client reaches a node over Wi-Fi or Ethernet, that connection is part of the trust boundary described above. If the underlying network is untrusted (open Wi-Fi, a network shared with parties you do not control), config writes, key reads, decrypted message traffic, and the Wi-Fi PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. itself during provisioning are all exposed on that network. Setting network.wifi_ssid and network.wifi_psk over an untrusted Wi-Fi connection is a common case of this exposure but not the only one.
The recommended pattern is to provision and administer nodes over a trusted channel: Bluetooth from a phone, USBUSB (Universal Serial Bus). The wired connection used to power a device, flash firmware onto it, and communicate with it over serial. serial to a trusted host, or Remote Administration over the mesh itself. There is no current roadmap item to secure local administration over untrusted Wi-Fi; it may be addressed in a future release.
Conclusion
Meshtastic layers three mechanisms: PSKPSK (Pre-Shared Key). A secret code or passphrase used in Meshtastic channels for encryption, ensuring that only devices with the matching PSK can communicate within that specific channel. encryption for channels, PKCPKC (Public Key Cryptography). A cryptographic method introduced in Meshtastic v2.5 for Direct Messages and Admin Messages, where each device uses a unique public and private key pair. The public key, shared with other devices, enables secure message encryption, while the private key allows only the intended recipient to decrypt and authenticate the message. This approach enhances privacy and integrity for both direct device-to-device communication and sensitive admin functions. for direct and admin messages, and session IDs for replay protection on admin sessions. These choices are shaped by hard platform constraints, chiefly the 256 byte LoRaLoRaA low-power, long-range wireless communication technology used by Meshtastic devices to enable communication over distances of several kilometers without the need for cellular, Wi-Fi, or other traditional network infrastructures. packet limit and the limited memory of the supported MCUsMCU (Microcontroller Unit). The microcontroller that runs the firmware on a device. The hardware tables list the MCU for each supported board., which bound how much cryptographic overhead each packet and each node can carry. These mechanisms operate within the trust and identity model described above: protections on the air do not extend to the local API surface, and node identity rests on TOFU rather than a signing authority.