Keywords

19.1 Introduction

With the rapid development of the Internet of things, more and more smart home are connecting various kinds of household electrical appliances or sensing devices together through local family networks, and easily and efficiently controlling them by technologies such as computer, communication, measurement, and control for a more comfortable living environment [1]. Smart home brings people much convenience while it faces many potential risks of malicious attacks, such as injecting unauthorized control instructions into system or eavesdropping information of monitoring and so on, which will further threaten safe and reliable operations of smart home or users’ privacy [2].

The current smart home industry in China is still in its infancy. There are no unified national standards or technical specifications, and its standards in safety are blank. Security problems of smart home based on the Internet of things technology need to be urgently solved to improve people’s experience of living [3].

A building method of security-focused smart home embedded domestic SM4 cipher algorithm is proposed in this paper, which is helpful to deal with the potential risks in information security for smart home.

19.2 The System Model of Secure Smart Home

19.2.1 The Composition of Secure Measuring and Controlling System

The composition of secure measuring and controlling system in smart home is illustrated in Fig. 19.1.

Fig. 19.1
figure 1

The composition of secure measuring and controlling system in smart home

The secure measuring and controlling system mainly includes a WiFi gateway, primary or secondary routing nodes, measuring and controlling nodes, and household appliances and devices. Measuring and controlling nodes are the fundamental part of smart home, their main tasks are to sense the environment of home, or to receive commands so as to control corresponding appliances or devices such as air conditioner, digital TV set, refrigerator, curtain, lighter, monitor, alarm, etc. The secure algorithm is stored in nodes, and all communications within the smart home systems are protected by SM4 block encryption algorithm. Moreover, when intrusion detection finds an illegal node or abnormal case, the alarm node will be activated and the host or hostess will receive a notice of alarm about the incident [4].

19.2.2 Security Mechanism

In order to ensure safe and reliable operation of smart home system and to protect users’ privacy, here a secure measuring and controlling method embedded SM4 algorithm for smart home is proposed. The involved security mechanism is as follows: First of all, an access authentication is necessary to login system by the authorized user identity and password; Secondly, any node will be examined and verified based on the physical address and the preset key before they can access the network, and the unverified nodes will be excluded; Thirdly, each measuring and controlling instruction or message transmitted between nodes will be encrypted by SM4 cipher algorithm to improve the confidentiality of smart home system [5]; Finally, further security can be reached along with intrusion detection and alarm mechanism.

19.3 Implementation of Secure Measuring and Controlling System and Performance Evaluation

19.3.1 Hardware Implementation of the System

In order to verify the feasibility of smart home characterized in secure measuring and controlling, CC2530 chip is chosen as the core unit and a star topology structure is adopted to set up a simulation platform of secure smart home shown in Fig. 19.2 [6, 7].

Fig. 19.2
figure 2

Secure smart home system

As the human–machine interface of secure smart home system, the smartphone terminal based on Android4.0 is mainly responsible for sending measuring and controlling commands and receiving information from nodes including controlling and sensing ones. The WiFi gateway is responsible for two-way Zigbee signal conversion between the smartphone terminal and routing nodes. The routing node is responsible for establishing Zigbee network. The terminal node is used for connecting and controlling various kinds of household equipments. In addition, a simulated malicious terminal mainly acts as illegal invasion node to simulate intrusion behavior [8, 9].

19.3.2 Secure Measuring and Controlling Process

The secure measuring and controlling method is designed into APK (Android Package) software based on Android 4.0 smartphone terminal by dedicated Eclipse V22.3 development tools. The domestic SM4 cipher algorithm is embedded into the control software to compare with the original AES one. The secure measuring and controlling process of smart home is divided into two paths based on different functions of nodes: data acquisition and object controlling, as illustrated in Fig. 19.3.

Fig. 19.3
figure 3

Secure measuring and controlling process for smart home

To create a new SM4 function in Java file under Android platform, the statement of SM4 algorithm is: SMS4 sm4 = new SMS4 ().

An example of key used in SM4 is:

  • byte[] key = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd,0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54,0x32, 0x10}.

An example of the plain text of instruction used in temperature measurement is as follows:

  • byte [] temp = {0xF, 0xC2, 0x01, 0x01, 0xC4, 0xFE}.

The statements used in calling the SM4 cryptographic algorithm and sending commands are as follows:

  • sm4.sms4 (temp, inLen, key, outTemp, ENCRYPT);

  • SendCmd(outTemp);

19.3.3 The Performance Test of System

The performance of secure smart home system has been tested by adopting SM4 algorithm, and compared with the embedded AES one.

Secure measuring and controlling instructions in the smart home are similar to such format of data as “EF C1 02 01 C3 FE”. The instruction means to open lamp 2. EF and FE are used as check digit. C1 is the serial number of equipment. 02 is No.2 lamp. 01 means that the lamp will be lighted on. C3 is checksum. The whole instruction is encrypted into 128-bit hexadecimal data by SM4 cipher algorithm. SM4 encryption function used in the smart home system is as follows:

  • SM4. SMS4 (in, inLen, key, out, ENCRYPT)

Correspondingly, SM4 decryption function is:

  • SM4. SMS4 (out, inLen, key, in, DECRYPT)

As a contrast, a smart home system embedded AES algorithm is realized in the same way. AES encryption functions: out = Encrypt_Byte (in, key), and AES decryption function is: in = Decrypt_Byte(out, key).

The above two algorithms are called to evaluate the performance of the proposed based on monitoring nodes and controlling ones. The results of test show each of them can protect the system and find abnormal behaviors from nodes, but the time to finish an instruction is different. A detailed evaluation is carried out as follows.

The test is divided into three cases: unencrypted, encrypted based on SM4, and encrypted based on AES. Smartphone terminal sends unencrypted sensing or controlling instruction to nodes every 4 s, and receives the feedback message from nodes which has finished the instruction, all records are stored in LogCat logs. Assuming the timestamp of sending unencrypted instruction as S i , the timestamp of feedback is R i , therefore, the delay between sending and receiving operations for an unencrypted instruction can be expressed as T i :

$$ T_{i} = R_{i} - S_{i} $$
(19.1)

Similarly, the encrypted test by SM4 or AES algorithm can be done. Let the timestamp of sending encrypted instruction be S i , the timestamp of feedback is r i , therefore, the delay between sending and receiving operations for an encrypted instruction can be expressed as t i :

$$ t_{i} = r_{i} - s_{i} $$
(19.2)

So one can get the ratio of time delay of encrypted instruction compared to unencrypted one:

$$ d_{i} = \frac{{t_{i} - T_{i} }}{{T_{i} }} $$
(19.3)

The average ratio of time delay for m–times test can be obtained according to the following formula [10, 11]:

$$ \overline{d} = \sum\limits_{i = 1}^{m} {\frac{{d_{i} }}{m}} $$
(19.4)

The impact of secure mechanism on time delay is plotted in Fig. 19.4 by sampling 50 times. Figure 19.4a, b show the impact of secure mechanism on controlling instruction or sensing one, respectively. They are classified into three kinds of situations: unencrypted case without security mechanism, encrypted case embedded SM4 algorithm, and encrypted case with AES algorithm.

Fig. 19.4
figure 4

The impact of secure mechanisms on time delay. a Control nodes, b sensing nodes

According to Fig. 19.4, the average values of time delay of secure mechanisms is illustrated in Table 19.1 based on 50 sampling values. Table 19.1 shows that the average ratios of time delay are 2.61 and 6.25 % for sensing instructions with a secure mechanism based on SM4 and AES algorithms, respectively. The corresponding results are 2.28 and 7.91 % for controlling instructions. Although the secure mechanisms have little impact on time delay of system, while a secure guarantee is in prospect. Furthermore, the secure mechanism embedded SM4 algorithms have less time delay than one embedded AES algorithm, that is, one can get that the advantages of SM4 algorithm in time delay are 3.64 and 5.63 % for data acquisition and node controlling than the AES in Table 19.1.

Table 19.1 The average impact of secure mechanisms on time delay

Although AES cryptographic algorithm is built in such Zigbee nodes as CC2530, which is convenient for secure communications between those nodes with the same configuration, it is hard for non-Zigbee nodes such as smartphone terminal, WiFi gateway, and so on. However, the proposed scheme embedded SM4 algorithm could solve this problem by distributing SM4 algorithm in all nodes of smart home, this is helpful to earn its flexibility in realizing the secure measuring and controlling system.

19.4 Conclusions

Smart home brings much convenience to people while it faces some potential risk from malicious attacks. Research on secure smart home is necessary for application and popularization. Secure measuring and controlling methods are proposed for smart home based on nodes embedded SM4 cryptographic algorithm. The secure mechanisms such as access control, encryption of instructions, authentication of devices, intrusion detection, and alarm are helpful to improve information security of smart home and to protect users’ privacy. The results of simulation proved that the proposed method is effective and feasible to enhance the security of smart home system. The extra mechanism of security only brings about 2.5 % time delay in processing of instruction. The results show that the proposed methods embedded SM4 algorithm have about 4 % less time-consuming advantage in delay and flexibility of implementation compared to the typical AES scheme, and it does not involve the use of foreign intellectual property rights. This research provides a theoretical path and technical exploration for realization of secure smart home based on the Internet of things.