# A Framework for Constructing a Secure Domain of Sensor Nodes
## 3 The Concept of a Security Domain of Sensor Nodes
### Procedures in a Secure Domain  
The necessary condition for building a secure system is to design security solutions for the software and hardware components of such a system. A crucial element is also the development of safe procedures for creating and using such a system and withdrawing it from an operation. For the needs of the secure domain of sensor nodes, several procedures have been prepared that cover all stages of the lifecycle of each sensor node as well as all stages of the life of the entire secure domain. These include the pre-preparation phase, the deployment phase, and the phase of regular domain work. The node pre-preparation phase aims to create a local trust structure in the resources of such a node, generate symmetric keys used only by this node and transfer from the B node transmission parameters of the wireless link used by the domain nodes. For this purpose, the node being prepared must be directly connected to node B using the serial link. Symmetric keys (i.e., NK to protect data stored in node resources, NSK to secure data exchange in the domain, and the One Time Key (OTK) key for cryptographic protection of data transfer only during the node preparation procedure) and the first two elements of the trust structure (i.e., EK and SRK) are created locally by the node. The remaining data must be obtained from the B node. In order to obtain the DK to the B node, the public part of the SRK key of the node being prepared is sent first. This part of the SRK is used by the TPM of the B node to create a migration blob containing the protected DK. In response, the migration blob is sent to the node being prepared, and on this basis, the DK is added to the local trust structure of this sensor node. In the next step, the public part of the DK is used to pass the symmetric OTK to the B node. This key is used to protect the transfer of wireless link parameters from the B node. If the node being prepared is to serve as a Master, additionally from node B, the initial contents of the domain description and node description are sent. This exchange is also protected by the use of the OTK. The purpose of the deployment phase is to initiate a node that will act as a Master and register of subsequent R nodes in the domain. The first nodes registered will play the Gateway role in the domain. The completion of M node initialization is tantamount to the constitution of a secure domain. During the initiation of the M node in its resources, an NTK is generated to protect sensor data transmission to the G node and NDK to protect data transmission during diagnostic procedures. The NTK and NDK are common to all registered nodes in the domain. To protect the data transmission between the M node and the given R node, the NSK of the R node is used. This key is known only for the M node and a given R node. In the first step of registering the R node in the domain, its NSK bound with the public part of the DK is sent to the M node. The M node in its resources stores this key in the description of the registered node. In the next steps, the M node sends the NTK and NDK, the G node address, and a copy of the domain description and descriptions of the domain nodes to the node being registered. During these activities, a wireless link is used, and the NSK of the R node is used to protect data exchange. After registration, the node is ready for regular operation in the domain. In the regular phase of domain operation, a symmetric NTK key is used to protect sensor data sent to the G node. In the course of performing diagnostic procedures, which aim to assess the integrity of a secure domain and the suitability and reliability of domain nodes, the symmetric NDK key is used to protect transmission. Diagnostics procedures are initiated by the M node at fixed time intervals or by other domain nodes after detecting a lack of communication with a node acting as a Master or Gateway.