LoRaWAN
The network and security layer above LoRa. Two AES-128 keys stand in for TLS, so LoRaWAN security is a key-management problem: reused AppKeys, static ABP keys, and replayable joins.
LoRaWAN is the network and security layer that most deployments run on top of the LoRa radio. Keep the split straight: LoRa is the physical layer (the chirp modulation), LoRaWAN is the MAC, the roles, and the AES-128 key hierarchy that stands in for TLS. Because RF secrecy is no defense (a cheap SDR hears every frame for kilometres), LoRaWAN security is entirely a key-management problem.
What it is
LoRaWAN defines four roles. Note that the gateway holds no per-device secrets: it is a dumb forwarder that bridges the air to the servers over IP.
| Role | Example | Holds |
|---|---|---|
| End device | a water meter, a sensor | root key(s) + derived session keys |
| Gateway | a rooftop antenna | nothing per-device (packet forwarder) |
| Network server | ChirpStack NS | NwkSKey, checks the frame MIC, routes |
| Application server | ChirpStack AS | AppSKey, decrypts the payload |
Devices are identified by a 64-bit DevEUI, join a network under an AppEUI/JoinEUI, and get a DevAddr once active. LoRaWAN 1.0.x has exactly two session keys, both AES-128: the NwkSKey protects frame integrity (the MIC over the whole frame), and the AppSKey protects payload confidentiality (FRMPayload). Every uplink and downlink carries a frame counter (FCntUp/FCntDown) that is the anti-replay guard for a session.
Why it matters
There are two ways a device gets its session keys, and each has a distinct weakness:
- OTAA (Over The Air Activation) derives fresh
NwkSKey/AppSKeyfrom a join exchange (aJoinRequestanswered by aJoinAccept) rooted in the AppKey. The join carries a DevNonce; if the network server does not track it, a capturedJoinRequestcan be replayed to force a re-key or deny service. And if the AppKey is reused across a fleet or shipped in plaintext firmware, one teardown compromises every device. - ABP (Activation By Personalization) burns static session keys straight into the device, with no join at all. If those keys leak or are reused, an attacker can decrypt and forge that device indefinitely.
LoRaWAN 1.1 hardens this (it splits the root into NwkKey/AppKey, adds a JoinNonce, and introduces separate network integrity keys), but 1.0.x is still the fleet in the field. Leak the session keys (or the root key they derive from) and both layers fall: you read payloads and forge frames with a valid MIC.
How to work it
Capture happens on the radio; the crypto work happens on the keys. Match the LoRa PHY first (see the lora entry), then:
- Receive frames with an SDR and a LoRa decoder:
# RTL-SDR receive around 868 MHz (EU), demodulate with gr-lora / SDRangel
- Inspect joins and uplinks. A
JoinRequestexposes DevEUI/JoinEUI/DevNonce; an uplink exposes DevAddr and the frame counter. Wireshark has a LoRaWAN dissector. - With a key, decrypt. Load a
NwkSKey+AppSKey(or an ABP device's static keys, or keys derived from a recoveredAppKey) into the dissector orlorawan-parserto read the plaintext payload. - Replay or forge. Where the server does not track the DevNonce, replay a captured
JoinRequest; a stand-in for the air (a ChirpStack lab over an MQTT transport) lets you push frames without a real radio.
Pitfalls
- LoRaWAN is not LoRa. A Flipper or CC1101 can replay a dumb sub-GHz remote but cannot demodulate LoRa CSS, and neither touches the LoRaWAN key layer. Attacking the crypto needs captured frames plus the keys.
- The frame counter is the anti-replay control. A compliant server rejects a repeated or lower
FCntUp; replay works only where counters are unchecked or reset (a known ABP failure mode). - DevNonce replay only works against a server that does not track it. LoRaWAN 1.0.4 / 1.1 servers track it and reject the replay.
- Regional duty-cycle limits (notably 1% in EU868) constrain legal transmit time; jamming and flooding cross legal lines fast. The lab replaces the air, so nothing you do there transmits.