When a project review asks whether LoRaWAN is secure, the reflexive answer is usually one line: "It uses AES-128 encryption." That statement is true, yet dangerously incomplete. In real deployments, security failures almost never come from breaking AES-128; they come from key reuse, broken frame-counter persistence, or unencrypted backhaul paths that quietly undo the protections the protocol built in.
In LoRaWAN Activation: OTAA vs ABP and Key Management we covered join mechanics, and in From PoC to Production we addressed factory key governance. This article goes one layer deeper into the protocol's security architecture: who can read what, who can tamper with what, how replay attacks are stopped, and why LoRaWAN 1.1 reshaped the key hierarchy.
The defining security idea in LoRaWAN is not merely encryption—it is separation of duties. Every radio frame travels from the end device through one or more gateways to the Network Server (NS), and finally to the Application Server (AS). Infrastructure operators frequently run the gateways and NS, while business payloads belong to the application owner.
LoRaWAN therefore splits cryptographic responsibilities across two independent layers, both built on AES-128 primitives:
| Security Function | LoRaWAN 1.0.4 Key | LoRaWAN 1.1 Key | Scope and Responsibility |
|---|---|---|---|
| Message Integrity Code (MIC) | NwkSKey | FNwkSIntKey / SNwkSIntKey | 4-byte AES-128-CMAC over MHDR, FHDR, FPort, and encrypted FRMPayload; blocks tampering and spoofing |
| MAC command encryption (FPort=0 / FOpts) | NwkSKey | NwkSEncKey | Protects network control commands (ADR, channel plans); 1.1 extends encryption to FOpts |
| Application payload encryption (FPort 1–223) | AppSKey | AppSKey | End-to-end AES-128-CTR encryption shared only between end device and AS; opaque to the NS |
| Root key(s) for OTAA | AppKey (single root) | NwkKey + AppKey (dual root) | Long-lived secrets stored on the device and Join Server to derive session keys during join |
Notice the order of operations: LoRaWAN uses Encrypt-then-MAC. The header fields (DevAddr, FCtrl, FCnt) travel in cleartext so the NS can route frames, yet they are authenticated inside the CMAC MIC. A passive eavesdropper can observe transmit cadence for a DevAddr, but cannot decrypt application payloads or modify header counters without failing integrity verification.
Equally important is recognizing the trust boundary in LoRaWAN 1.0.x: because a single AppKey derives both NwkSKey and AppSKey, whichever entity holds AppKey can compute both session keys. LoRaWAN 1.1 introduces a dedicated Join Server and dual root keys (NwkKey for network keys, AppKey for application keys) so neither the network operator nor the NS can decrypt application traffic.
Field teams often ask what happens if someone steals a gateway off a pole. On the LoRa RF side, a standard packet-forwarding gateway (such as GD61 or GD62, which connect to an external platform) stores neither root keys nor session keys. It demodulates frames and forwards ciphertext.
However, security posture diverges sharply between two deployment architectures:
Replay protection relies on strictly increasing frame counters: FCntUp for uplinks and FCntDown for downlinks (split into NFCntDown and AFCntDown in 1.1). The NS tracks the highest valid counter seen and drops any frame whose counter does not advance.
Three engineering traps routinely turn this safeguard into a field outage:
To save airtime, only the lower 16 bits of FCnt (0–65535) travel over the air, while both device and NS must track the full 32-bit counter and feed all 32 bits into AES-CTR keystream blocks and CMAC calculation. A sensor reporting every 10 minutes wraps 16 bits roughly every 455 days. Any mismatch in handling the upper 16-bit rollover between firmware and server causes silent fleet drop-off more than a year after commissioning.
OTAA devices renew session keys and legally reset counters on rejoin. ABP devices do not. If an ABP node fails to persist FCntUp in non-volatile memory, a battery swap or brownout resets FCntUp to zero and the NS drops every subsequent uplink as a replay. Worse, under AES-CTR, reusing the same AppSKey and FCnt produces the exact same keystream: XORing two ciphertexts cancels the keystream and leaks plaintext differences. That is why disabling frame-counter checks in production is a severe compromise—it opens replay windows and undermines CTR confidentiality.
LoRaWAN 1.0.4 and 1.1 require DevNonce to be a strictly monotonic 16-bit counter rather than a random number. If firmware keeps DevNonce only in RAM, every reboot restarts from 0 or 1 and the NS rejects every JoinRequest as a replay. The classic symptom is a device that joins smoothly on the bench, then refuses to rejoin after its first power cycle in the field.
Strong radio cryptography does not protect adjacent layers:
AppKey across a production batch turns one stolen sensor into a fleet-wide compromise.Before moving a deployment to production on ThinkLink or any LoRaWAN network server, verify eight controls:
DevNonce (1.0.4/1.1) and join state in non-volatile memory, and lock SWD/JTAG interfaces after factory flashing;FCntUp reliably and keep strict frame-counter validation enabled on the NS;FCnt rollover behavior before rollout;DevEUI promptly when anomalous join storms appear.LoRaWAN's cryptographic foundation—AES-128 dual-layer isolation paired with monotonic counters—has proven resilient across a decade of industrial deployments. Real-world security depends on carrying that discipline across non-volatile firmware state, gateway backhaul, and northbound pipelines. Putting these eight checks into acceptance testing protects far more than a slide claiming "AES-128 encrypted."
Prepared from LoRaWAN 1.0.4/1.1 specifications and public security engineering practices. Confirm product interfaces and deployment requirements against official ManThink and ThinkLink documentation.