# The Improved Hill Encryption Algorithm towards the Unmanned Surface Vessel Video Monitoring System Based on Internet of Things Technology

Authors: Tingting Yang; Yangyang Li; Chengzhe Lai; Jie Dong; Minghua Xia
Journal: Wireless Communications and Mobile Computing
 (2018)

---

## Abstract

Depending on the actual demand of maritime security, this paper analyzes the specific requirements of video encryption algorithm for maritime monitoring system. Based on the technology of Internet of things, the intelligent monitoring system of unmanned surface vessels (USV) is designed and realized, and the security technology and network technology of the Internet of things are adopted. The USV are utilized to monitor and collect information on the sea, which is critical to maritime security. Once the video data were captured by pirates and criminals during the transmission, the security of the sea will be affected awfully. The shortcomings of traditional algorithms are as follows: the encryption degree is not high, computing cost is expensive, and video data is intercepted and captured easily during the transmission process. In order to overcome the disadvantages, a novel encryption algorithm, i.e., the improved Hill encryption algorithm, is proposed to deal with the security problems of the unmanned video monitoring system in this paper. Specifically, the Hill algorithm of classical cryptography is transplanted into image encryption, using an invertible matrix as the key to realize the encryption of image matrix. The improved Hill encryption algorithm combines with the process of video compression and regulates the parameters of the encryption process according to the content of the video image and overcomes the disadvantages that exist in the traditional encryption algorithm and decreases the computation time of the inverse matrix so that the comprehensive performance of the algorithm is optimal with different image information. Experiments results validate the favorable performance of the proposed improved encryption algorithm.


---

## Body

## 1. Introduction

The Internet of things is widely used in intelligent transportation, environmental protection, government work, public safety, safe home, intelligent fire protection, industrial monitoring, environmental monitoring, street lighting control, landscape lighting control, building lighting control, square lighting control, square lighting control, elderly care, personal health, flower cultivation, water system monitoring, food traceability, enemy detection, and intelligence gathering. Based on the technology of Internet of things, the intelligent monitoring system of USV is designed and realized, and the security technology and network technology of the Internet of things are adopted. The intelligent perception of the self and environment information of the unmanned ship is realized by a variety of sensors. It is envisaged that developing an USV video monitoring system will greatly contribute to the maritime distress, urgency, safety, and general communications. The threat of maritime [1] piracy has mushroomed enormously in the past few years, especially in the detailed sea area below are piracy affected areas where the terror and threat of sea pirates have reached looming proportions: the strait of Malacca, the South China Sea, Gulf of Aden, and so on. The news channels on a daily basis have several incidents to report about pirates attacking crew and looting the vessel or hijacking a ship, and even causing harm to the crew when their ransom demands are not met by the authorities. The maritime cloud server monitors the sea and collects a large amount of data [2–5] by USV video monitoring system; we will take timely and effective measures to deal with different situations by analyzing data. At the same time, it can collect information of a special area and obtain important information by this system, and experts can use these information to study whether the area can be expanded and whether there are available resources further. Video may be stolen and changed by pirates and other terrorists in the process of transmission that will pose a serious threat to information security of the sea; it is inconvenient to sea navigation, transportation, and any other activities of the sea. The encryption of video data has become priority, which is beneficial to the security of the sea and reducing losses and casualties.With the development of information technology and the continuous progress of the society, there are more and more demands for information. Communication becomes convenient, quick and flexible by voice, data, image, and video in many ways at anytime and anywhere. In the past, the interaction of image and video information is a kind of extravagant demand for people, because of the limitation of network transmission technology and image compression ability. In recent years, with the increase of network bandwidth and the development of video image compression technology, people can carry out transmission of image and video through a variety of ways. In particular, with the progress of wireless transmission technology, the communication technology is affecting people’s production and life in an unprecedented scale and degree [6]. The transmission of video and image information by wireless channels has become an urgent demand of application and the rapid improvement of network transmission technology; especially the wireless transmission technology could bring convenience to us, but it also brings hidden danger that sensitive image information may be stolen easily and spread illegally. Therefore, the security problem of image information has become a very important and crucial problem. Although the research of video encryption technology has been carried out for nearly 20 years, the existing secret strategy is not perfect and there is a large space for improvement, the encryption strategy of images transmitted under wireless conditions, whose degree of security is low. There are many different encryption methods and their respective systems have been formed but no performance of encryption strategy is satisfactory for all users. There are huge differences between various encryption strategies and the debates are hot. Video information security is an interdisciplinary subject spanning mathematics, cryptography, information theory, probability theory, computational complexity theory, and so on; it is related to video compression, network transmission, and application standards closely, which makes video encryption technology becomes a problem that has not been completely dealt with.In this paper, a novel video encryption algorithm (i.e., Improved Hill encryption algorithm) is proposed, according to specific requirements of the wireless video monitoring system and combining with the research progress of video encryption technology. The algorithm combines with the process of video compression and regulates the parameters of the encryption process according to the content of the video image [4], so that the comprehensive performance of the algorithm is optimal for different image information. The results of the experiment are that the algorithm has good performance in the influence of adjacent pixels, and the information entropy of images is smaller than other algorithms. This work targets to investigate the security issues in maritime communication system, which is featured by protecting important data. Specifically, the contribution of this paper is threefold:( 1 ) We propose a novel video monitoring system of the USV to monitor the situation over sea, so that the authorities on the shore could obtain the video data in time and implement countermeasures for specific situations.( 2 ) A novel algorithm, namely, improved Hill encryption algorithm, is proposed, which has optimal comprehensive performance with respect to the security issue.( 3 ) It has been proved from the experimental results that the superior performance of the proposed improved Hill encryption algorithm.The remainder of this paper is organized as follows. In Section2, we discuss some related works. System model is presented in Section 3. The improved encryption algorithm is proposed, and the performance analysis is corroborated in Sections 4 and 5, respectively. In Section 6, we summarize the flow and indicate how the performance of the algorithm is improved.


## 2. Related Work

In recent years, driverless cars and UAV are becoming ever more popular among the public. Google Corporation is a pioneer in the field of research and development of driverless vehicles; the company announced that its unmanned vehicle project was developing to automated direction that is exclusion of human intervention at the end of May 2015 year. The prototype test of the automatic driverless vehicle will be carried out; it is expected that test of driving on the road can be carried out in a few years. At present, Google is making about 100 automatic vehicle models; UAV are striving to enter into people’s lives, too. According to foreign media reports, online shopping giant Amazon is seeking permission from the US government to launch UAV flight test in the US. In fact, the research and exploration of USV are in progress in the field of unmanned technology, and ships floating on the sea will probably enter the unmanned era in the future. British Rolls Royce company (Luo Luo) is optimistic to this, as one of the [7] world’s largest engine makers and shipbuilders who are determined to develop unmanned vehicles and offshore USV. There are slender difficulties in improving the unmanned craft at the technical level, and now there are many ships equipped with automatic equipment. The era of USV is seen in the future. Oscar Levand think that “In the near future, the USV will keep pace with the unmanned drones, the submarines and the unmanned vehicles that are being tested by Google”. As far as water is concerned, the demand of USV is strong. For example, while working on cruise and search, driverless technology can increase the number of ships that because it does not have to be manned and the size is small, its reaction is more responsive. To monitor the condition of the sea and collect important information by USV, once ships were attacked by pirate or the terrorist during the voyage, using video to capture the locations, numbers, features of the pirates, use of weapons equipment, and other important information, the information is transmitted to shore with unmanned vessel monitoring system. It should set a fixed time to transfer the collected information to the shore, it is convenience for shore personnel access to valid information in good time. Video should be sent to shore forcibly and take action in time in an emergency. The video data must be secure enough, once the data were intercepted and tampered that not only miss the best time to rescue and lose strong evidence.In the multimedia computer technology application system, there are two research directions of video image processing. One is the compression encoding of the video image; the other is real-time processing of video image and protection of video information. In the video image compression algorithm, H.264 compression [8] algorithm as an international standard, because it has higher compression and it is able to provide a high quality image and supported by most of the operating platform, it also has good compatibility. H.264 has the following advantages: (1) coding efficiency: H.264 saves nearly 0.5 of its bandwidth compared with its predecessor H.263 and MPEG-4. (2) Superior quality images: H.264 can provide video images of high quality in low bit rate and image transmission of high quality on lower bandwidth is the highlight of H.264 application. (3) Improving network adaptability: H.264 can work in low delay mode under the real-time communication applications (such as video conferencing) and can also work in video storage or video streaming server that without delay. (4) Using hybrid coding structure: H.264 like previous H.261, H.263 use the hybrid coding structure, which is DCT transform coding and DPCM differential coding. At the same time, in order to improve the efficiency of compression coding, H.264 introduces a new coding methods under the structure of mixed coding, which adds new encoding methods, such as multimode motion estimation, intraprediction, and multiframe prediction, its content is based on variable length coding and 4x4 two-dimensional integer transform and improves the efficiency of coding. (5) H.264 has less coding options: a considerable number of options are often required to encode in H.263 that adds difficulty of coding, while H.264 achieves a concise “regression base” that reduces the complexity of the coding. (6) H.264 can be applied in different situations: H.264 can use different transmission and playback rates according to different environments and provide a rich tool of error handling that can control or eliminate the packet loss and bit error. (7) Error recovery function: H.264 provides a tool to solve the problem of network transmission packet loss, which is adapted for transmitting video data in a wireless network with transmission of high bit error rate. (8) Higher complexity: performance boost of H.264 is achieved at the expense of increasing complexity; it is estimated that the computational complexity of H.264 encoding is three times more than H.263 and the decoding complexity is twice as much as H.263.The protection of video image information is to prevent sensitive information from being stolen and altered easily, copied, and disseminated illegally, including information encryption technology and information hiding. The encryption algorithm is built on the design of text data, the implementation of encryption that converts meaningful cleartext into meaningless ciphertext that is to prevent the information obtained during the process of data transmission by illegal interceptors. Video file has the characteristics of large data volume and require extraordinary real-time requirements, so it is difficult to gratify the requirements of video information on encryption efficiency that use traditional encryption algorithms sometimes. Spatial image encryption is encrypting the gray [9] scale of the image, because the gray scale (pixel value) of the image is the byte data that can be encrypted by means of data encryption. Therefore, the data encryption algorithm can be transplanted into gray scale encryption algorithm, which includes data encryption standard, simple Hill matrix encryption, and sequence encryption algorithm. In this paper a new image encryption algorithm is proposed that is based on the traditional Hill algorithm; we use an invertible matrix as a key to encrypt the image matrix and then transpose the encrypted image. Besides, the final step is double-layer encryption of matrix.


## 3. System Model

In this paper, we propose to use the LAN technology of Internet of things to construct the unmanned video monitoring system, the video node is connected with the different monitors of the USV through the local area network, and the control center can communicate with the maritime cloud service center that achieve the effect of information sharing. Compared with other methods, it has an advantage that it can be applied to USV of different sizes, so that we can design the USV video monitoring system according to the USVs size and structure, it just only to change the number of video monitoring nodes and location on the base of different requirements. The unmanned video monitoring system focuses on the security of ship navigation and cargo transportation. Monitoring the different locations over surface by configuring a certain number of cameras and other technological means, the information will be compressed and encrypted by SecurCore processor of DSP core and transmitted with three ways Figure1. When the distance is far, the communication will be achieved by satellite and cloud platform and other shore-based or air-based facilities. We can select the corresponding schemes according to the distance, which saves the cost, decreases the time of communication, and avoids the waste of resources. The specific information transmission paradigms are shown in Figure 2.Figure 1
Information transmission diagram.Figure 2
Flowchart of information processes.


### 3.1. Video Acquisition Module

The acquisition module of the video data is the input stage of information and its performance is very important to the whole system; the quality of the original video and image will determine the final image clarity of the maritime cloud server; the marine environment can be detected by sensors at sea, such as temperature sensors and thermosensitive components, light sensors and photosensitive elements, gas sensors and gas sensors, magnetic sensor, and subsensitive element. In this paper the module includes camera and corresponding control parts. The monitoring contents include the travel records of the ships and the meteorology of the sea as well as the transportation security of the goods and so on, it can also store and print pictures as the important evidence.


### 3.2. Video Compression and Encryption Module

The compression and encryption module of the video are the core of the unmanned video monitor system and its performance affects the overall performance of the system directly. The compression of video data is limited by various conditions, such as the transmission bandwidth, image resolution, frame rate, maximum delay of coding, and performance of processor. Therefore, the video compression module has to be coordinated with the transmission module, the encryption is integrated into the compression, and their relationship is very close. The module of compression and encryption can be implemented by SecurCore processor of DSP core.


### 3.3. Video Transmission Module

While the video data is completed by the hardware compression and it needs to be sent to the service platform through the network. However, there will be a few problems in the processing of sending, such as the simultaneous transmission of multiple monitoring nodes or the blockage of the network; it may occur that data is lose. In the process [10] of data transmission the network will judge the size of the packet, when the size is more than or less than the certain limit the packet will be discarded, the exact scope is (64-1500) bytes. RTP protocol is used to transmit video files because it is a real-time network transmission protocol that is often used for single point data transmission and it is very suitable for the transmission of audio and video data.


### 3.4. Video Playback Module

In the system, the shipboard service center needs to play video and image; according to their different purposes, the implementation is adopted by different ways. The purpose of the video broadcast of the VSV adjusts the camera easily, so that it can make tracking the target better. On the maritime cloud server, the purpose of the playing video is to have a clear understanding of the experiment site and analysis things what happened after that. Therefore, the image definition must be distinguished and should be enhanced before playing.


### 3.5. Video Storage Module

It is a part of the important functions of the system that the storage of video data during the experiment process, to analyze the situation of the experimental field after the experiment is possible. The maritime cloud server center is analysis and disposing center of the experimental data that has intense computing power and large storage space; it is appropriate to backup and long-term archival of experimental data. The transmission of data can be reduced by using the mode of maritime cloud server center storage. However, the data obtained by USV are transmitted by the wireless channel, and the noise and interference are unavoidable. After being processed a few steps, the data will increase the corresponding noise of process. The definition of video image is the most important index of the system, in order to archive the data of high quality and remove unnecessary noise and interference, the video data will be stored in the USV board monitoring platform.


## 3.1. Video Acquisition Module

The acquisition module of the video data is the input stage of information and its performance is very important to the whole system; the quality of the original video and image will determine the final image clarity of the maritime cloud server; the marine environment can be detected by sensors at sea, such as temperature sensors and thermosensitive components, light sensors and photosensitive elements, gas sensors and gas sensors, magnetic sensor, and subsensitive element. In this paper the module includes camera and corresponding control parts. The monitoring contents include the travel records of the ships and the meteorology of the sea as well as the transportation security of the goods and so on, it can also store and print pictures as the important evidence.


## 3.2. Video Compression and Encryption Module

The compression and encryption module of the video are the core of the unmanned video monitor system and its performance affects the overall performance of the system directly. The compression of video data is limited by various conditions, such as the transmission bandwidth, image resolution, frame rate, maximum delay of coding, and performance of processor. Therefore, the video compression module has to be coordinated with the transmission module, the encryption is integrated into the compression, and their relationship is very close. The module of compression and encryption can be implemented by SecurCore processor of DSP core.


## 3.3. Video Transmission Module

While the video data is completed by the hardware compression and it needs to be sent to the service platform through the network. However, there will be a few problems in the processing of sending, such as the simultaneous transmission of multiple monitoring nodes or the blockage of the network; it may occur that data is lose. In the process [10] of data transmission the network will judge the size of the packet, when the size is more than or less than the certain limit the packet will be discarded, the exact scope is (64-1500) bytes. RTP protocol is used to transmit video files because it is a real-time network transmission protocol that is often used for single point data transmission and it is very suitable for the transmission of audio and video data.


## 3.4. Video Playback Module

In the system, the shipboard service center needs to play video and image; according to their different purposes, the implementation is adopted by different ways. The purpose of the video broadcast of the VSV adjusts the camera easily, so that it can make tracking the target better. On the maritime cloud server, the purpose of the playing video is to have a clear understanding of the experiment site and analysis things what happened after that. Therefore, the image definition must be distinguished and should be enhanced before playing.


## 3.5. Video Storage Module

It is a part of the important functions of the system that the storage of video data during the experiment process, to analyze the situation of the experimental field after the experiment is possible. The maritime cloud server center is analysis and disposing center of the experimental data that has intense computing power and large storage space; it is appropriate to backup and long-term archival of experimental data. The transmission of data can be reduced by using the mode of maritime cloud server center storage. However, the data obtained by USV are transmitted by the wireless channel, and the noise and interference are unavoidable. After being processed a few steps, the data will increase the corresponding noise of process. The definition of video image is the most important index of the system, in order to archive the data of high quality and remove unnecessary noise and interference, the video data will be stored in the USV board monitoring platform.


## 4. Improved Hill Encryption Algorithm

The idea of Hill algorithm is to convertl cleartext letters into l ciphertext letters by a series of linear transformations, the decryption only requires one inverse transformation [11], and the key is the transformation matrix itself. Hill password is a part of the multiple-letter substitution codes and it is also called the matrix transformation password. The vector of cryptograph is C=KM(modN)(1)C=c1c2⋮cl(2)M=m1m2⋮ml(3)Ex=1N∑i=1Nxi(4)K=kijl×l=k11k12…k1lk21k21…k2l⋮⋮⋮kl1kl2…kllIn the formula,C is ciphertext and M is cleartext and the key K is an invertible matrix. The decryption formula is M=K-1C(modN). All the arithmetic operators are performed under the mode of N=26.Example 1.
Suppose the keyK=6738; while the encryption comes true by using the Hill password, according to the above calculation we can get a result that K-1=819236. Suppose that the “good” is cleartext to be encrypted, then the cleartext is divided into two groups that (6,14) is “go" and (14,3) is “od”. The process of encryption is(5)c1c2=Km1m2=6738•614mod26=134130mod26=40c3c4=Km3m4=6738•143mod26=10566mod26=114The result of encryption is “EABO”. The process of decryption is(6)m1m2=K-1c1c2=819236•40mod26=3292mod26=614m3m4=K-1c3c4=819236•114mod26=274107mod26=143Get the correct cleartext in the last.


### 4.1. Self-Invertible Matrix

In the encryption formula,K has inverse matrix K-1 and (K-1K)M=M=K-1C(mod26), which is possible to realize the decryption. Essentially, using the invertible matrix K is important when you encrypt/decrypt. How do you see a matrix can be invertible? It depends on the determinant that is [12] nonzero (all of the above operations are performed under mode N=26). So we know that the invertible matrix K has the inverse of the mode of N=26, only if GCD(detK,26)=1. Here, we use the GCD(x,y) to denote the largest common divisor of the integer x and the integer y, using detK or |K| to represent the determinant of the matrix K. The Hill encryption algorithm is applied to the image matrix P to get the corresponding Hill image encryption algorithm; the encryption process is C=EkP=K•P, and decryption process is P=DkC=K-1•C=K-1•K•P=P.The basis of the algorithm is as follows.If matrixA satisfies A=A-1, then A is called a self-invertible matrix. Assumptions(7)A=a11a12…a1na21a22…a2n⋮⋮⋮⋮an1an2⋮annIt is n×n self-invertible matrix, n is even, and suppose n=2, then it is written as(8)A=A11A12A21A22In the formula, A11,A12,A21,A22 are (n/2)×(n/2) matrices. Result from the self-reversibility of A are(9)A•A=A•A-1=A11A12A21A22A11A12A21A22=IResult from formula (8) is(10)A12A21=I-A112=I-A11I+A11According to formula (9), A12 is a factor of |I-A112| and |A21| is another factor. Suppose there is a constant k(11)A12=kI-A11Then(12)A21=I+A11kFrom formula (11) we can get second matrix equations(13)A11A12+A12A22=0When formula (10) is established, |A11| and |A12| will be exchanged(14)A11A12=A11•kI-A11=kI-A11•A11=A12A11Formulae (13) to (12) obtain(15)A12A11+A12A22=A12•A11+A22=0while A12≠0 get the result(16)A11+A22=0The self-reversible matrix algorithm is obtained.The algorithm steps are as follows:( 1 ) Choose (n/2)×(n/2) matrix A22 arbitrarily.( 2 ) Get the result by a series of calculations that A11=-A22.( 3 ) Take A12=k(I-A11) or k(I+A11) and k is a prime number.( 4 ) Count A21=(I-A11)/k or A21=(I+A11)/k.( 5 ) Merge into a complete matrix.


### 4.2. Improved Hill Encryption Scheme

The steps of improved Hill encryption algorithm are as follows.Step 1.
m × m self-reversible matrix is generated as the key matrix of this algorithm.Step 2.
Divide the original image intom×m block image.Step 3.
Thei pixels of each image block will be grouped together and made up m×m temporary image block, it is convenient for future encryption operation.( 1 ) The temporary image matrix is encrypted with the key matrix A.( 2 )Transpose the encrypted image matrix and double-layer encrypting the matrix.Step 4.
Putting the obtained matrix into theith position of the final encryption matrix.
The process of decryption is the reverse process of encryption; the block diagram of the specific encryption algorithm is shown in Figure3.Figure 3
Flowchart of encryption.


### 4.3. Security Analysis of Hill Algorithm

The key conditions of Hill encryption algorithm are character information and digital correspondence table and encryption matrix. Character information and number correspondence table representation: the larger the order of the encryption matrix is, the more difficult it is to decipher and the amount of calculation. The definition of the encryption matrix and the solution of the matrix are also very important to [13] encryption and decoding of the algorithm. From the point of cryptanalysis code, using traditional passwords to encrypt video has a lot of drawbacks; the broken translator can sum up the analogous rules from the statistical string frequency and find out the exit of cryptanalysis. With the rapid development of science and technology, the deciphering time is less than before. But Hill encryption algorithm [14] uses matrix multiplication and inversion in linear algebra, it is better to resist frequency analysis, and it is difficult realizing the decoding. Hill encryption algorithm has set up three handicaps for the translator, which is incomprehensible to decipher. Because you do not know anything about that dimension variables of the text conversion, order of the corresponding letters, access method of the encryption matrix, if you want to decipher the code you should guess the three things correctly at least. But it is difficult to guess correctly at the same time. There is no password that can not be broken completely, and the Hill algorithm is no exception. Generally speaking, it is difficult decoding that only knows the attack of ciphertext, but it is easy to be broken by using attack of cleartext. Assume that the opponent already knows the value L and it also mastered l different tuples L at least. Mi=m1im2i⋮mli, Ci=c1ic2i⋮cli, 1≤i≤l The conditions were fulfilled that Ci=E(Mi,K)=eK(Mi)(1≤i≤l). Defining two matrices that are M=(mij)l×l and C=(cij)l×l, then has a matrix equation C=K•M(mod26). In the formula, l×l matrix K is an unknown key. If the M is reversible that can be calculated, K=C•M-1(mod26). Thus the encryption algorithm is broken (if M is not reversible, we must try another cleartext-ciphertext pair). From the overall result Hill algorithm is still a simple and efficient algorithm.


## 4.1. Self-Invertible Matrix

In the encryption formula,K has inverse matrix K-1 and (K-1K)M=M=K-1C(mod26), which is possible to realize the decryption. Essentially, using the invertible matrix K is important when you encrypt/decrypt. How do you see a matrix can be invertible? It depends on the determinant that is [12] nonzero (all of the above operations are performed under mode N=26). So we know that the invertible matrix K has the inverse of the mode of N=26, only if GCD(detK,26)=1. Here, we use the GCD(x,y) to denote the largest common divisor of the integer x and the integer y, using detK or |K| to represent the determinant of the matrix K. The Hill encryption algorithm is applied to the image matrix P to get the corresponding Hill image encryption algorithm; the encryption process is C=EkP=K•P, and decryption process is P=DkC=K-1•C=K-1•K•P=P.The basis of the algorithm is as follows.If matrixA satisfies A=A-1, then A is called a self-invertible matrix. Assumptions(7)A=a11a12…a1na21a22…a2n⋮⋮⋮⋮an1an2⋮annIt is n×n self-invertible matrix, n is even, and suppose n=2, then it is written as(8)A=A11A12A21A22In the formula, A11,A12,A21,A22 are (n/2)×(n/2) matrices. Result from the self-reversibility of A are(9)A•A=A•A-1=A11A12A21A22A11A12A21A22=IResult from formula (8) is(10)A12A21=I-A112=I-A11I+A11According to formula (9), A12 is a factor of |I-A112| and |A21| is another factor. Suppose there is a constant k(11)A12=kI-A11Then(12)A21=I+A11kFrom formula (11) we can get second matrix equations(13)A11A12+A12A22=0When formula (10) is established, |A11| and |A12| will be exchanged(14)A11A12=A11•kI-A11=kI-A11•A11=A12A11Formulae (13) to (12) obtain(15)A12A11+A12A22=A12•A11+A22=0while A12≠0 get the result(16)A11+A22=0The self-reversible matrix algorithm is obtained.The algorithm steps are as follows:( 1 ) Choose (n/2)×(n/2) matrix A22 arbitrarily.( 2 ) Get the result by a series of calculations that A11=-A22.( 3 ) Take A12=k(I-A11) or k(I+A11) and k is a prime number.( 4 ) Count A21=(I-A11)/k or A21=(I+A11)/k.( 5 ) Merge into a complete matrix.


## 4.2. Improved Hill Encryption Scheme

The steps of improved Hill encryption algorithm are as follows.Step 1.
m × m self-reversible matrix is generated as the key matrix of this algorithm.Step 2.
Divide the original image intom×m block image.Step 3.
Thei pixels of each image block will be grouped together and made up m×m temporary image block, it is convenient for future encryption operation.( 1 ) The temporary image matrix is encrypted with the key matrix A.( 2 )Transpose the encrypted image matrix and double-layer encrypting the matrix.Step 4.
Putting the obtained matrix into theith position of the final encryption matrix.
The process of decryption is the reverse process of encryption; the block diagram of the specific encryption algorithm is shown in Figure3.Figure 3
Flowchart of encryption.


## 4.3. Security Analysis of Hill Algorithm

The key conditions of Hill encryption algorithm are character information and digital correspondence table and encryption matrix. Character information and number correspondence table representation: the larger the order of the encryption matrix is, the more difficult it is to decipher and the amount of calculation. The definition of the encryption matrix and the solution of the matrix are also very important to [13] encryption and decoding of the algorithm. From the point of cryptanalysis code, using traditional passwords to encrypt video has a lot of drawbacks; the broken translator can sum up the analogous rules from the statistical string frequency and find out the exit of cryptanalysis. With the rapid development of science and technology, the deciphering time is less than before. But Hill encryption algorithm [14] uses matrix multiplication and inversion in linear algebra, it is better to resist frequency analysis, and it is difficult realizing the decoding. Hill encryption algorithm has set up three handicaps for the translator, which is incomprehensible to decipher. Because you do not know anything about that dimension variables of the text conversion, order of the corresponding letters, access method of the encryption matrix, if you want to decipher the code you should guess the three things correctly at least. But it is difficult to guess correctly at the same time. There is no password that can not be broken completely, and the Hill algorithm is no exception. Generally speaking, it is difficult decoding that only knows the attack of ciphertext, but it is easy to be broken by using attack of cleartext. Assume that the opponent already knows the value L and it also mastered l different tuples L at least. Mi=m1im2i⋮mli, Ci=c1ic2i⋮cli, 1≤i≤l The conditions were fulfilled that Ci=E(Mi,K)=eK(Mi)(1≤i≤l). Defining two matrices that are M=(mij)l×l and C=(cij)l×l, then has a matrix equation C=K•M(mod26). In the formula, l×l matrix K is an unknown key. If the M is reversible that can be calculated, K=C•M-1(mod26). Thus the encryption algorithm is broken (if M is not reversible, we must try another cleartext-ciphertext pair). From the overall result Hill algorithm is still a simple and efficient algorithm.


## 5. Experimental Results and Analysis

In order to test the correlation between the two pixels adjacent to the vertical, adjacent, horizontal, the following tests are performed. Firstly, 1000-3000 pairs of pixels adjacent to the horizontal, vertical, and diagonal direction are randomly selected from the graph, and the correlation formula is used to calculate the correlation [15].(17)rxy=covx,yDyDx(18)Dx=1N∑i=1Nxi-Ex2(19)covx,y=1N∑i=1Nxi-Ex(yi-ExIn the formula,x and y are the gray values of two adjacent pixels in the image. E(.), D(.), and cov(.)are the expectation, variance, and covariance, respectively, and r is the correlation [14] coefficient of adjacent two pixels. The higher the value of its value is close to 1, the higher the correlation of adjacent pixels is. If images were encrypted by Hill self-invertible matrix encryption algorithm and improved algorithm, respectively, then compare the correlation between adjacent pixels in 3 directions.(20)UACI=∑i=0M-1∑j=0N-1C1i,j-C1i,j255×M×N×100%The related data of Table1 show that the adjacent pixels of the original image are large data, the correlation coefficient is close to 1 that can be seen, the adjacent pixels are highly correlated, the pixels correlation of traditional Hill encryption algorithm is around 0.2, but improved algorithm is more precise in reducing the correlation of adjacent pixels, making the size of data close to 0. From the correlation of adjacent pixels that improved encryption algorithm is much better than traditional Hill encryption algorithm.Table 1
Adjacent pixel.
direction Artwork Hill encryption Article encryption level 0.902985 0.329121 -0.005825 vertical 0.874309 0.227804 0.008831 diagonal 0.856915 0.173428 -0.030353Figures4 and 5 represent the correlation distribution diagrams of two horizontal adjacent pixels in the original and traditional Hill encryption images, and the correlation distribution of Figure 5 is more diffuse than Figure 4, but the correlation distribution between the original image and the traditional Hill encryption image is not obvious enough. Figure 6 shows the improved algorithm encryption image, the comparison [16] between Figure 6 and Figure 5 shows that the correlation distribution is separate completely. From the analysis of the distribution degree of correlation graph, it is shown that the improved encryption algorithm is better than traditional Hill encryption algorithm.Figure 4
Correlation distribution diagram of original image.Figure 5
Correlation distribution of Hill encryption algorithm.Figure 6
Correlation distribution of improved encryption algorithm.


### 5.1. Histogram Analysis of Encrypted Image

The variance is used to evaluate the consistency of histogram distribution and indicate the degree of dispersion between the histogram and its average value; the consistency of the distribution is expressed by the size of variance value. The smaller the variance the more uniform the distribution. The histogram of image is represented byhisti, and the formula of variance is(21)S=1256∑i=0255histi-aver2and the aver is(22)aver=1256∑i=0255histiThe pixel value can be distributed evenly that, in the range of (0-255) after encryption, the uniform distribution of gray histogram will be regarded as the ideal state. From the above three images, it is found that the histogram (Figure8) of the original image (Figure 7) is uneven, the uniformity of distribution is not ideal, the distribution effect (Figure 10) of the traditional Hill encryption image (Figure 9) has not been improved obviously, which has poor performance, and the pixels correlation of the image is not weakened. Compared with the traditional Hill encryption histogram, the histogram (Figure 12) of the improved algorithm encryption image (Figure 11) is more concentrated and more gentle. The value of the variance is obviously smaller than variance of the traditional Hill encryption algorithm, which weakens the correlation greatly and its result is ideal.Figure 7
Original image.Figure 8
Histogram of original image.Figure 9
Hill encryption image.Figure 10
Histogram of Hill encryption image.Figure 11
Improved Hill encryption image.Figure 12
Histogram of improved Hill encryption image.


### 5.2. Information Entropy and Diffusivity Test

Information entropy is a concept used to measure the amount of information in information theory, which contains information content of an image, the system is more orderly that information entropy is more low. The information entropy of the image is(23)Hm=-∑i=0L-1pmilog2⁡pmi,∑i=0L-1pmi=0L and mi in the formula indicate that gray value is mi and description is L; Pmi indicates the probability of the appearance of gray value. When the probability that gray value appears in the image is equal, information entropy of the image is the largest, and its gray distribution is identical. When information entropy is equal to 8, that proved the fact that the random distribution of images is more ideal.Diffusion is an important nature in the encryption algorithm that is proposed by Shannon in a document; an excellent encryption system must have good diffusivity. The meaning is that when a bit is changed in the original image, the encryption image will be changed in an unpredictable way. The diffusivity of the image encryption algorithm indicates that the output pixels of the encrypted image [17] should be dependent on the input pixels of the original image in a very complicated way, which can resist the attacker’s analysis of the algorithm. Attackers usually make small changes to the original image and then use the algorithms used as attackers to encrypt the original and modified images and compare the relationship between the original and the encrypted images by comparing two images. This kind of attack becomes a difference attack [18]. One pixel of the original image is modified by the attacker; looking at the changes in the result, it is possible for attacker to find a relationship between the original image and the encrypted image. If a small change in the original image can cause significant changes in the effects of diffusion and chaos, the efficiency of the differential attack is very low and the attack is invalid. In order to verify the influence of a pixel change in the entire encrypted image, two measurement methods are commonly used: one is pixel change rate and the other is uniform average change intensity. Two encrypted images are represented by C1 and C2, respectively, only one pixel is different in their corresponding original images, and the gray values of images C1 and C2 at coordinates (i,j) are represented by C1(i,j) and C2(i,j), respectively.(24)Di,j=Di,j=0,C1i,j=C2i,jDi,j=1,C1i,j=C2i,jThe pixel change rate (NPCR) is defined as(25)NPCR=∑i=0M-1∑j=0N-1Di,jM×N×100%In the formula, M is width and N is height of images C1 and C2. The meaning of NPCR is to calculate the percentage of different pixels in two images. The uniform average change intensity UACI is defined as(26)UACI=∑i=0M-1∑j=0N-1C1i,j-C1i,j255×M×N×100%From Table2, we can know that the information entropy of the original image is equal to 6; the entropy of the traditional Hill encryption image is about 6. It is shown that the traditional Hill encryption algorithm does not make a significant change in the probability of the random distribution of the image, and there is no more agreement on the gray distribution. Information entropy is more small that the image is more orderly and the probability of the image random distribution is more small. Using the improved encryption algorithm to encrypt image, the information entropy is increased from the original data to 8, the information entropy is more great, random distribution of the image is more ideal, the more consistent in the gray distribution and the encryption effect is more ideal. From the pixel change rate, we can learn that the results of the improved algorithm are more large than the traditional Hill algorithm on the numerical value, and the results of the uniform average change intensity have a little difference [19].Table 2
Analysis of test results.
information Artwork Hill encryption Article encryption entropy 6.234655 6.234655 7.997266 NPCR 0.00 0.00001526 0.00024424 UACI 0.00 0.000015019 0.001794146


## 5.1. Histogram Analysis of Encrypted Image

The variance is used to evaluate the consistency of histogram distribution and indicate the degree of dispersion between the histogram and its average value; the consistency of the distribution is expressed by the size of variance value. The smaller the variance the more uniform the distribution. The histogram of image is represented byhisti, and the formula of variance is(21)S=1256∑i=0255histi-aver2and the aver is(22)aver=1256∑i=0255histiThe pixel value can be distributed evenly that, in the range of (0-255) after encryption, the uniform distribution of gray histogram will be regarded as the ideal state. From the above three images, it is found that the histogram (Figure8) of the original image (Figure 7) is uneven, the uniformity of distribution is not ideal, the distribution effect (Figure 10) of the traditional Hill encryption image (Figure 9) has not been improved obviously, which has poor performance, and the pixels correlation of the image is not weakened. Compared with the traditional Hill encryption histogram, the histogram (Figure 12) of the improved algorithm encryption image (Figure 11) is more concentrated and more gentle. The value of the variance is obviously smaller than variance of the traditional Hill encryption algorithm, which weakens the correlation greatly and its result is ideal.Figure 7
Original image.Figure 8
Histogram of original image.Figure 9
Hill encryption image.Figure 10
Histogram of Hill encryption image.Figure 11
Improved Hill encryption image.Figure 12
Histogram of improved Hill encryption image.


## 5.2. Information Entropy and Diffusivity Test

Information entropy is a concept used to measure the amount of information in information theory, which contains information content of an image, the system is more orderly that information entropy is more low. The information entropy of the image is(23)Hm=-∑i=0L-1pmilog2⁡pmi,∑i=0L-1pmi=0L and mi in the formula indicate that gray value is mi and description is L; Pmi indicates the probability of the appearance of gray value. When the probability that gray value appears in the image is equal, information entropy of the image is the largest, and its gray distribution is identical. When information entropy is equal to 8, that proved the fact that the random distribution of images is more ideal.Diffusion is an important nature in the encryption algorithm that is proposed by Shannon in a document; an excellent encryption system must have good diffusivity. The meaning is that when a bit is changed in the original image, the encryption image will be changed in an unpredictable way. The diffusivity of the image encryption algorithm indicates that the output pixels of the encrypted image [17] should be dependent on the input pixels of the original image in a very complicated way, which can resist the attacker’s analysis of the algorithm. Attackers usually make small changes to the original image and then use the algorithms used as attackers to encrypt the original and modified images and compare the relationship between the original and the encrypted images by comparing two images. This kind of attack becomes a difference attack [18]. One pixel of the original image is modified by the attacker; looking at the changes in the result, it is possible for attacker to find a relationship between the original image and the encrypted image. If a small change in the original image can cause significant changes in the effects of diffusion and chaos, the efficiency of the differential attack is very low and the attack is invalid. In order to verify the influence of a pixel change in the entire encrypted image, two measurement methods are commonly used: one is pixel change rate and the other is uniform average change intensity. Two encrypted images are represented by C1 and C2, respectively, only one pixel is different in their corresponding original images, and the gray values of images C1 and C2 at coordinates (i,j) are represented by C1(i,j) and C2(i,j), respectively.(24)Di,j=Di,j=0,C1i,j=C2i,jDi,j=1,C1i,j=C2i,jThe pixel change rate (NPCR) is defined as(25)NPCR=∑i=0M-1∑j=0N-1Di,jM×N×100%In the formula, M is width and N is height of images C1 and C2. The meaning of NPCR is to calculate the percentage of different pixels in two images. The uniform average change intensity UACI is defined as(26)UACI=∑i=0M-1∑j=0N-1C1i,j-C1i,j255×M×N×100%From Table2, we can know that the information entropy of the original image is equal to 6; the entropy of the traditional Hill encryption image is about 6. It is shown that the traditional Hill encryption algorithm does not make a significant change in the probability of the random distribution of the image, and there is no more agreement on the gray distribution. Information entropy is more small that the image is more orderly and the probability of the image random distribution is more small. Using the improved encryption algorithm to encrypt image, the information entropy is increased from the original data to 8, the information entropy is more great, random distribution of the image is more ideal, the more consistent in the gray distribution and the encryption effect is more ideal. From the pixel change rate, we can learn that the results of the improved algorithm are more large than the traditional Hill algorithm on the numerical value, and the results of the uniform average change intensity have a little difference [19].Table 2
Analysis of test results.
information Artwork Hill encryption Article encryption entropy 6.234655 6.234655 7.997266 NPCR 0.00 0.00001526 0.00024424 UACI 0.00 0.000015019 0.001794146


## 6. Conclusion

In this paper, the tool used in this experiment is Visual Studio 2015, using thec#.NET language. We introduced the video monitoring system of the USV and the module of the system briefly, aiming at the favorable security and efficient efficiency of traditional image encryption technology; an improved algorithm is proposed based on Hill encryption algorithm. The algorithm is that a m×m self-invertible matrix is generated as the key matrix of this algorithm, then dividing the original image into m×m block image. The ith pixels of each image block will be grouped together and make up a temporary m×m image block, it is convenient for future encryption operation [20–23]. The temporary image matrix is encrypted with the key matrix A, transposing the encryption image matrix and double- layer encrypting the matrix and putting the obtained matrix into the ith position of the final encryption matrix. We use double-layer encryption strategy to decide the degree of scrambling and enhance the security of the encryption system. Results of experiments show that the algorithm has high efficiency of scrambling and the disorderly effect is uniform and the correlation of adjacent pixels is small, which changes the statistical information of the image and that is more ideal in the random distribution of the image and gray level. Through the analysis of its performance theory and experimental results, it has been shown that the improved algorithm is more successful than traditional Hill encryption algorithm and has great developmental potentialities. From the influence of pixel change rate and uniform average change intensity of encrypted image, the algorithm has not greatly improved the pixel change rate and value is too small that does not reach more than 0.9, they can improve by changing the length and width of the image. Therefore, considering the improvement in these two aspects will be a direction for the future.



---

*Source: 5183451-2018-10-03.xml*