Published: June 12 2025
Recently it was brought to our attention that some of our Meshtastic devices had public keys that were common with other devices. We have been investigating this and working together with the Meshtastic developers to better understand the nature of this issue and to find the best resolution for everyone.
Some background on security and encryption in Meshtastic
Meshtastic starting with firmware version 2.5.0 introduced Public Key Cryptography (PKC) for Direct Messages (DMs) in September 2024.
Source: meshtastic.org
This encryption scheme relies a public-private key pair for each device – where the public key is shared across the mesh and allows anyone to encrypt a message. Only the owner of the private key is able to decrypt the message. In this way the private key should only be known to the device owner and no one else (it is physically stored inside the device's flash memory). The public key however is shared amongst everyone on the mesh.
More details about encryption and its implementation in Meshtastic can be found here, here and here.
What's the issue?
Since there is a one to one mapping between public keys and private keys, if two devices are using the same public key they can also be assumed to be using the same private key. This of course breaks the security and privacy of direct messages sent to any device that has a private key that is known by others.
Are my keys compromised?
This depends, if your device (or board):
- was received without Meshtastic firmware and you flashed it yourself then your keys are likely unique as they are randomly generated upon first boot.
- is an H1 or H2T device then your keys are likely unique as we flashed these devices manually via the official web flasher and the keys were randomly generated at first boot.
- is an R1 device (internal or external antenna) shipped on or after June 4 2025 we manually regenerated the keys randomly so your keys are likely unique.
For all other devices purchased from us, the firmware was flashed outside of muzi ᴡᴏʀᴋs so the short answer is we don't know (but you can test for yourself in the next section). Even on devices which we upgraded the firmware, the keys were set after the original firmware flash.
For all devices where the keys were not set by yourself we strongly recommend you to wipe and regenerate them. We explain why at the bottom.
Testing for duplicate keys
We have been working with the Meshtastic developers on a firmware level solution that was released today in version 2.6.11 (read the release notes). This firmware will automatically perform a check when you send a DM. It compares your public key against a hash of know duplicates. You will receive an instant notification on the mobile app as well as the serial log if there is a match to the known list.
We have no way of knowing if this list is complete so we still recommend wiping and regenerating your keys if you are relying on private encrypted messaging.
How to wipe my current encryption keys?
Perform a factory erase via:
- On the official Meshtastic Web Flasher select Full Erase and Install for supported devices.
- On nRF52 (or RP2040) based devices click the trash icon in the official Meshtastic Web Flasher and follow the instructions in the dialogue box.
- Using the Meshtastic CLI command:
meshtastic --factory-reset-device
- Choose a new private key manually in your Meshtastic phone app in [Settings > Security > Private Key]
What we have learnt and improving upon Meshtastic's encryption
Investigating this issue
From the very beginning we leaned upon the Meshtastic developers (thank you!) to quickly and comprehensively understand the root cause of this issue and to work on a solution for all of our customers and the Meshtastic community as a whole. After extracting the public keys from a few hundred devices in our inventory we found some patterns that helped us piece together the situation and we shared all our findings with the developers to help them work quickly on a solution.
How we (most likely) got here
The source of the duplicate keys we believe comes from a combination of how the firmware is flashed to devices and how the keys are generated. Up until now, all keys were generated upon first boot. If the firmware is transferred to the device via a JTAG/SWD programmer from an image of a master device then both program memory and data memory is transferred. The initial code execution on a master device would have generated the keys (now stored in data memory) which are then duplicated or cloned onto other devices. This is a common way of flashing firmware in mass production.
Going forward from here
From our learnings, we had an idea to move the key generation from (until now) first boot to when the user first sets the LoRa region. This was implemented by @jp-bennett in PR7003 and released in firmware version 2.6.11 (release notes).
Meshtastic devices that are flashed with 2.6.11 or later will no longer ship with keys pre-generated which means no one in the distribution chain has access to the keys. This increases security in two important ways:
- Preventing the possibility of accidentally duplicating keys
- Making it impossible for deliberately storing user keys
As long as new devices are freshly flashed with 2.6.11 or later, there should no longer be an opportunity for duplicate keys going forward. In addition the entropy (or randomness) of key generation was improved.
Also coming later in a future firmware release is the ability to automatically wipe keys if it matches a known key hash, this feature was merged in PR7018. For our R1 users, we have an early preview of this feature enabled in our official firmware version 2.6.11, you can download it in the R1 Firmware section here (note: this will overwrite your old keys automatically so be aware of that if you are using remote admin, you may need to re-authenticate).
Final thoughts
We should all remember that Meshtastic is still in beta and features are being added and improved at lightning speed. Please consider contributing to the community knowledge, codebase and the documentation if you are able. Together we will continue make Meshtastic better and better!