
ZigBee security
Implementing security on the XBee/XBee-PRO ZigBee RF Module
XBee/XBee-PRO® S2C ZigBee® RF Module
106
Enabling security
To enable security on a device, the Encryption Enable (
EE
) parameter must be set to 1. When the
parameter value changes, the XBee module leaves the network (PAN ID and channel) it was operating
on and attempt to form or join a new network.
If you set
EE
to 1, all data transmissions are encrypted with the network key. When you enable
security, the maximum number of bytes in a single RF transmission will be reduced. For more
information, see
NP (Maximum Packet Payload Bytes)
.
Note
The
EE
parameter must be set the same on all devices in a network. Changes to the
EE
command should be written to non-volatile memory (to be preserved through power cycle or reset
events) using the
WR
command.
Setting the network security key
The coordinator selects the network security key for the network using the Network Encryption Key
(
NK
) parameter (write-only). If
NK
=
0
(default), the coordinator will selects a random network key.
Otherwise, you set
NK
to a non-zero value, it uses this value as network security key.
NK
is only supported on the coordinator. Routers and end devices with security enabled (
EE
= 1)
acquire the network key when they join a network. They receive the network key encrypted with the
link key if they share a preconfigured link key with the coordinator.
Note
In ZigBee, if
EE
and
EO
are set to 0x01, then the device sends the network key in the clear
(unencrypted) with the link key at association time. This may be a useful setting in development
environments, but we discourage it for product deployment for security reasons.
Set the APS trust center link key
The coordinator must also select the trust center link key, using
. If
KY
=
0
(default), the
coordinator selects a random trust center link key (not recommended). Otherwise, if
KY
is set greater
than 0, the device uses this value as the pre-configured trust center link key.
KY
is write-only and
cannot be read.
Note
Application link keys sent between two devices where neither device is the coordinator are not
supported in ZigBee firmware.
Random trust center link keys
If the coordinator selects a random trust center link key (
KY
=
0
, default), then it allows devices to join
the network without having a pre-configured link key. However, this sends the network key
unencrypted over-the-air to joining devices and is not recommended.
Pre-configured trust center link keys
If the coordinator uses a pre-configured link key (
KY
> 0), then it will not send the network key
unencrypted to joining devices. Only devices with the correct pre-configured link key can to join and
communicate on the network.
Enable APS encryption
APS encryption is an optional layer of security that uses the link key to encrypt the data payload.
Unlike network encryption that is decrypted and encrypted on a hop-by-hop basis, APS encryption is