How Is LoRaWAN Security Guaranteed? A Layer-by-Layer Breakdown From Keys to the Air Interface

Introduction

LoRaWAN signals travel through the air, which theoretically means anyone with a receiver can "eavesdrop" on the data. So why are enterprise projects and government tenders still willing to adopt it with full confidence? The answer is that LoRaWAN builds security directly into the protocol itself. Unlike traditional solutions that rely on the false assumption of "hard-to-intercept signals" as a deceptive safeguard, it uses a complete set of encryption and authentication mechanisms to make intercepted over-the-air data completely useless. This article breaks down the LoRaWAN security system in full detail.



1. Core Security Objectives of LoRaWAN

LoRaWAN security is designed to address four critical requirements:

  • ‌Confidentiality‌: Even if data is intercepted over the air, the interceptor cannot decipher its content.
  • ‌Integrity‌: If data is tampered with during transmission, the receiving end can immediately detect the anomaly.
  • ‌Authentication‌: The system can confirm that the data is indeed sent from the claimed device.
  • ‌Replay Protection‌: Old intercepted messages cannot be forged and retransmitted maliciously.

All four capabilities are jointly implemented in the LoRaWAN protocol through ‌AES-128 encryption + Frame Counter mechanism‌.



2. Three Core Keys: AppKey / NwkSKey / AppSKey

The core of LoRaWAN security lies in three dedicated AES-128 keys, each with independent responsibilities:

  • ‌AppKey (Application Root Key)‌: Used exclusively during OTAA network activation. It is pre-burned into devices at the factory and shared with the network server. During the network join handshake, AppKey is used to derive the two subsequent session keys. In ABP mode, it is permanently written into the device at production.
  • ‌NwkSKey (Network Session Key)‌: Responsible for network layer security — it verifies message integrity via MIC (Message Integrity Code) and authenticates device identity. The network server uses this key to confirm "the device communicating is indeed authorized" after successful network access.
  • ‌AppSKey (Application Session Key)‌: Handles encryption and decryption of application-layer payloads. The network server cannot decrypt application data and only performs forwarding; only the application server with AppSKey can read the plaintext payload.

The clear separation of duties among the three keys brings a critical advantage: network layer and application layer permissions are completely isolated. Teams managing the network cannot access business data, while teams managing applications cannot interfere with network operations. Even if the network side is compromised, business data remains fully encrypted.



3. OTAA Dynamic Keys vs. ABP Static Keys

The difference between OTAA and ABP, which was introduced in the previous article, becomes far more distinct from a security perspective:

  • ‌OTAA‌: New NwkSKey and AppSKey are re-derived every time the device joins the network. Session keys are refreshed after each network access, so even if one session key is leaked, it only compromises that single session. This is the officially recommended deployment mode.
  • ‌ABP‌: Keys are permanently written into the device at the factory and remain unchanged for the entire lifecycle. Once the key is leaked, attackers can forge the device for a long period. For all mission-critical projects, OTAA is almost a mandatory requirement.


4. Replay Protection: The Frame Counter Mechanism

Beyond encryption, every uplink and downlink message in LoRaWAN carries a dedicated Frame Counter (FCnt). The network server verifies that the counter value is strictly incrementing:

  • Any message with a counter value less than or equal to the historical recorded value will be directly discarded.
    This means that even if an attacker intercepts an old message and attempts to replay it, the frame counter mechanism will immediately identify and block the malicious behavior. This simple but highly effective design is the standard anti-replay measure for over-the-air IoT protocols.


5. Practical Recommendations for Product Design and Deployment

  • ‌Ship devices with OTAA enabled by default‌: Burn a unique DevEUI and corresponding AppKey into each device, and deliver the key inventory to customers in a standardized manner. This is the non-negotiable security baseline for OEM products.
  • ‌Avoid mismanagement of keys‌: AppKey is the root of device identity. Strictly prevent key leakage during mass production, warehousing and logistics; never burn the same AppKey into an entire batch of devices.
  • ‌Select compliant network servers‌: Mainstream LNS platforms (ChirpStack, The Things Stack, etc.) have fully implemented all the above security mechanisms. When customers build self-hosted platforms, confirm that all features — especially frame counter validation and key management — are completely implemented.
  • ‌Add an extra application-layer encryption layer‌: For sensitive use cases such as payment and personnel safety alerts, add an additional layer of application-layer encryption or signature on top of LoRaWAN to build a defense-in-depth architecture.
  • ‌Clearly communicate security value to customers‌: B2B and government projects almost always list "secure data transmission" as a hard requirement. Document the OTAA dynamic key mechanism, three-layer key separation and anti-replay features in technical whitepapers, which will be a major advantage to win customer trust.


Conclusion

LoRaWAN security is not an add-on feature, but a native capability built deep into the protocol. The AES-128 three-layer key separation ensures confidentiality and permission isolation, OTAA dynamic derivation guarantees session-level security, and the frame counter mechanism blocks replay attacks. For OEMs and system integrators serving enterprise and government projects, properly implementing these mechanisms and clearly explaining them to customers is the key to passing project audits and building long-term trust. Security is never a marketing gimmick — it is a hard threshold that determines whether such IoT projects can be successfully deployed.