# Application of Symmetric Encryption Algorithm Sensor in the Research of College Student Security Management System

Authors: Kexu Wu; Chaolin Li
Journal: Journal of Sensors
 (2022)

---

## Abstract

In order to solve the problem of information leakage in the process of college students’ information security management, this paper proposes a design of college students’ security management system based on a symmetric encryption algorithm. The system is based on the principle of the symmetric encryption algorithm and follows the principle of encryption independence to ensure the security and reliability of the system. The general framework of the system is analyzed in detail. Secondly, the security and database of system function modules are designed, and finally, the performance of the system is tested. The results are as follows: the safety management system designed in this paper has obtained satisfactory evaluation in the trial universities, accounting for 93% of the trial population. It is proved that this system has clear authority design, high efficiency, and security. Managers can query students’ basic information, students’ real-time location, alarm data information, and so on in real time, which can ensure students’ safety to the greatest extent.


---

## Body

## 1. Introduction

At present, people pay more and more attention to the security of computer mass data storage and the antitheft and antitampering of sensitive data [1]. The database system is the core component of the computer information system, and database file is the aggregate of information. Its security will be the top priority of information industry [2].The core of information security is database security, and database encryption is one of the core issues of database security. Compared with other security means, database encryption is the security means with the highest performance price ratio from the comprehensive consideration of security degree, price, use, and maintenance cost and upgrade cost [3]. Aiming at the security of database, this paper discusses the relevant database security strategy and encryption technology, encryption algorithm and encryption method, and the application of data encryption technology in university archives database.According to statistics, a computer virus intrusion occurs in an average of 20 seconds around the world. About 1/4 of the firewalls on the Internet were broken. The incidents of stealing business information increased at an average rate of 260% per month. About 70% of network executives report losses due to disclosure of confidential information [4, 5]. The teaching of many school systems can only be used as a carrier through the Internet, but in this online education system, there are many precious teaching resources facing the risk of disclosure. In addition to taking various preventive measures, there is also a line of defense is the encryption of university archives data base, which starts the discussion of database encryption [6].The security of university archives database is not isolated, but a complete system. According to the current security needs of university archives database, this paper designs a complete system for university archives information management system, that is, the whole database security system is a three-tier security model: outer defense, middle layer intrusion detection, and inner data security defense, and database encryption is one of the core issues of inner database security defense.


## 2. Literature Review

Database encryption is to use the existing database encryption technology to study how to encrypt and decrypt the data in the database, so as to improve the security of the database system [7]. Generally speaking, the security control measures provided by the database system can meet the application of general databases, but for the application of some important departments or sensitive fields, such as financial data, military data, and state secrets, naturally including university archives database, only these are difficult to fully ensure the security of data [8]. Therefore, it is necessary to encrypt the important data stored in the database on the basis of access management and security management, so as to strengthen the security protection of data storage.The basic idea of encryption is to transform the original data (plaintext) into an unrecognizable format (ciphertext) according to a certain algorithm, so that people who do not know the decryption algorithm cannot know the specific content of the data [9]. There are two main encryption methods: one is the replacement method, which uses the key to convert each character in the plaintext into a character in the ciphertext, such as replacing a with F, b with X, c with Q, so lurk may become NMWJ [10]. The other is the replacement method, which only rearranges the characters of plaintext in different order. Using either of these two methods alone is not safe enough, but the combination of these two methods can improve the degree of safety.Since data encryption and decryption are also time-consuming operations, and the higher the degree of data encryption and decryption, the greater the system resources occupied. Therefore, generally, only highly confidential data are encrypted. The traditional encryption takes the message as the unit, and the encryption and decryption are carried out from beginning to end [11]. The use of database data determines that it is impossible to encrypt the whole database file. When the records that meet the search conditions are retrieved, the records must be declassified quickly [12]. However, the record is a random section in the database file, and it cannot be declassified from the middle, unless it is declassified from beginning to end, and then find the corresponding record. Obviously, this is inappropriate. We must solve the problem of random declassification from a certain section of data in the database file. In the traditional cryptosystem, the key is secret, and the fewer people know, the better [13]. Once you get the key and cryptosystem, you can break the password and unlock the ciphertext.Database encryption is to enhance the security of ordinary relational database management system and effectively protect the contents stored in the database [14, 15]. It realizes the confidentiality and integrity requirements of database data storage through security methods such as database storage encryption, so that the database is stored in ciphertext and works in secret mode, ensuring data security.The basic process of data encryption includes the translation of plaintext (i.e., read information) into the code form of ciphertext or password. The reverse process of this process is decryption, that is, the process of transforming the encoded information into its original form. Encryption can not only provide confidentiality for data but also provide confidentiality for communication service flow information [16].Encryption algorithm is some formulas and rules, which stipulates the transformation method between plaintext and ciphertext. Key is the key information to control encryption algorithm and decryption algorithm. Its generation, transmission, and storage are very important.Database encryption belongs to data encryption, which is just a special data encryption. There is not much fixed data relationship between encrypted data, but there is a certain data relationship between the data in the database [17]. When encrypting the database, we should consider the database system itself. We should first consider the three encryption levels, three encryption methods, and choice of encryption granularity. The three encryption levels of the database are the encryption forms implemented on the 0 s layer, the DBMS inner layer, and the DBNS outer layer. The three encryption methods are external encryption, internal encryption, and hardware encryption; Encryption granularity refers to the smallest unit of database encryption. The data in the database can be divided into the data table, data record, field, and data item according to the hierarchy, so the encryption granularity of database data encryption usually includes file level, field level, record level, and data item level. For example, the wider the scope of encryption technology for students, the smaller the flexibility of the encryption-based system. In practical application, different encryption granularities are selected according to different security requirements to achieve the goal of ensuring data security and easy operation [18, 19]. Therefore, database encryption is to consider the more complex data encryption of database system, rather than simply considering encryption algorithm and encryption and decryption. Figure 1 is the campus student security management system based on encryption technology.Figure 1
Campus student security management system based on encryption technology.Based on the current research, through the comparison of various algorithms, this paper selects the CBC mode of 128 bit AES encryption algorithm to encrypt data and adopts the complete database field encryption and decryption mechanism, so as to design a set of practical data encryption system. In this system, the characteristics of demand analysis, analysis design, coding, testing, and deployment of the university archive database encryption project are discussed, with emphasis on the protection provided by the password system for university database, the potential caused by the password system itself, and the preparation for this risk. The key to the security of cryptographic algorithm is how to ensure the confidentiality of the key and how to manage the key to withstand all levels of attacks. Based on the database structure defined by SQL, the coding of each main module of the system is realized.


## 3. Research Methods

### 3.1. Establishment of Database Encryption Key Generation Function

Generally speaking, the database system running on a single machine has no data sharing problem, and its confidentiality and authenticity can be guaranteed at the same time. Therefore, the security of the database system can be realized by controlling the access to the database files [20]. For the database system running in the network environment, its remarkable feature is data sharing. Therefore, the function of data encryption technology is to ensure the authenticity of data without affecting data sharing. Its main encryption technology is based on the encryption of records and fields. In order to ensure that the system is not attacked, it is best to use different keys for the same field of different records, so the number of keys is very large [21]. If there are M records in a table and each record has N fields, the number of keys required is M∗N, and the number of keys of the whole system is more. Obviously, such a large number of keys cannot be stored and managed for a long time and can only be generated dynamically when needed. The key generation function satisfies at least three conditions: first, the probability that the keys of different data items are the same is very small. Second, it is difficult to obtain other data item keys from one data item key. Third, some information of a data item (such as value range and probability distribution) is known, and other information of the data item cannot be obtained from ciphertext. Then, the key functions that can meet the above three items are shown in
(1)kij=ki⨁kj,(2)ki=ETK,Ri,(3)kj=ETK,Cj.In the formula,kis the data item key generation function, TK is the table key, Ri is the encrypted field row flag, and Cj is the encrypted field column flag [22]. For the data item key generation function, an effective implementation method is to use an algorithm to encrypt Ri and Cj with table key TK as the key to obtain keys Ki and Kj and then perform logical operation on Ki and Kj to obtain the data item key. Here, TK is the key, R is the row ID, and C is the field ID. Encrypt Cj and Ri, respectively, through key TK, generate field key kj and record key ki, and then generate key kij after XOR operation of kj and ki [23].The comparison of various encryption algorithms is shown in Table1:Table 1
Comparison of various algorithms.
Password typeSymmetric cryptosystemAsymmetric cryptosystemHash algorithmName of comparison itemDESAESIDEARC5RC6RSAMD5Development time1977200119911995199619771993Is it protected by patentNoNoNoNoNoNoNoKey length56 b (double DES112b, triple DES168b)128 b or 192 b or 256 b128 bVariable length key up to 256 bVariable length key up to 256 b512 b is selected, and the longest is 1024 b238 bNumber of bits of processing block during encryption64 b128 b64 b128 b128 bMost of 110 b128 bEncryption speedFastVery fastFastFastFastVery slowSlow


### 3.2. System General Framework Design

Based on the B/s and C/S frameworks, through comprehensive consideration, the student safety management system is designed in the integration mode of the two [24]. Taking the C/S framework as the carrier, the server receives the data of portable devices and uses the worker man architecture to receive and store the data. With the B/S framework as the carrier, managers monitor students’ daily safety in real time through the management platform based on think PHP architecture [25]. This design mode only needs to take the server-side as the auxiliary development system and compile the socket server-side code, which can save the system development cost, and the requirements for the client are relatively low. Students only need to carry portable devices, and managers can monitor students’ security in real time through the browser. The combination of worker man architecture and think PHP architecture can not only ensure the data authenticity of student safety management system but also ensure that managers supervise student safety in the whole process.


### 3.3. Management Platform

The background server management platform selects HTML+CSS+JS to realize the page. The background chooses PHP language to realize development. The PHP language has unique advantages in web development server-side scripting language. It is open source, and the source code can be downloaded and browsed in real time. The use is free, which can effectively save the development cost. It has good platform transfer characteristics and can support Linux. Windows, etc. There are various mainstream frameworks for PHP, that is, Laravel and ThinkPHP. This paper chooses ThinkPHP architecture to design the system.


### 3.4. Authority and Function

The system is divided into three types of different permissions, corresponding to different functions. When the user logs in to the page, enters the account and password, and verifies that the information is correct, the background will independently evaluate the user authority to jump to different pages and realize different functions. High-level permissions can manage low-level permissions. Low-level permissions only have basic operation functions. There are three kinds of system design permissions, namely, super manager, college head, and head teacher, as shown in Figure2.Figure 2
Background management platform permissions.First, the super administrator and developer manage their account. Their task is to assign the initial account password to the person in charge of the college, manage the person in charge of the school level, add or delete equipment, and monitor the operation status of equipment in real time. Second, the person in charge of the college is responsible for compiling the basic information of the university, assigning the initial account and password to the head teacher, applying for facilities and equipment, and querying the operation status of the equipment, as well as the basic information of students and the student security information transmitted by the person in charge of the class. Third, the head teacher is directly responsible for the safety of students, that is, students are bound with equipment and query students’ attendance time, movement track, and alarm information.


### 3.5. Safety Design

(1)
SQL injection attackSQL injection attack belongs to the form of Web attack. This attack exists because the system background program does not strictly verify the user’s input data, resulting in illegal elements to conduct destructive manipulation after obtaining the user’s data information in the database in a malicious way. In terms of SQL injection attack, the background system queries statements in the form of array and selects the preprocessing mechanism to filter dangerous data for a few string query conditions.(2)
URL encryption algorithmBecause security problems are easy to occur during data transmission, encryption is a necessary link in the system design. The system design encryption work is mainly carried out based on URL. For important parameters, users are prompted to browse the data information in the encrypted state in the form of encryption. Developers independently compile the encryption algorithm and decryption algorithm.Commonly used encryption algorithms in PHP include MD5, SHA1 and Base64. MD5 encryption algorithm belongs to one-way hash encryption technology, and Base64 belongs to symmetric encryption algorithm. However, due to its frequent use, it has certain security risks. In addition, in the third-party website, the traditional encryption algorithm can be decoded in the form of payment. In short, the encryption algorithm of this system is independently compiled by the developer, with the best security and economy.The system design encapsulates encryption and decryption into two functions. The implementation of encryption is to connect the user’s character information with a string to obtain a new string; For the new string, Base64 encryption function is used to complete the encryption, and the encrypted string is divided into an array based on the string segmentation function. We splice the elements of the array in the form of array loop to obtain a new array and turn back the string and replace the special characters of the string to obtain the final result after encryption.The specific effect of encryption is to asynchronously transmit the user form data in the background, strictly encrypt the important parameters in the background, and transmit the encryption results to the foreground. The foreground jumps the encryption parameters and other parameters to the specified interface based on the URL splicing mode, and the background decrypts with the decryption algorithm to recover the data and process the business logic, so as to improve the security and stability of the system.(3)
Socket designThe specific process of socket data receiving of the system is to select JSON format to transmit data, open the port on the server side to receive the client data, and analyze it. Feedback error information to the client for abnormal data and abnormal operation, and stop the operation in time. When the data is correctly programmed into the database, return the normal description to the client, terminate the connection with it, and resupervise in real time. The socket data receiving process is shown in Figure3.
(4)
Database designFigure 3
Data receiving process.The college student safety management system is realized by the entity relational database design. Based on demand analysis, the E-R diagram is used to build a model that can effectively reflect the actual things and relations and explain the data framework of the database which is too abstract. The entity relationship is used to abstract the processing data information, realize the transformation from entity geometry to entity type, and reflect the internal correlation of actual things through entity relationship. We build the local E-R model, integrate the local model into the overall model, and optimize and improve it. The system E-R diagram is shown in Figure4 (1 and N are interentity relations, that is 1 : n or N : 1, one college corresponds to multiple counselors, one counselor corresponds to multiple students, and multiple students correspond to one behavior; 1 represents a single, N represents multiple).Figure 4
E-R diagram.


## 3.1. Establishment of Database Encryption Key Generation Function

Generally speaking, the database system running on a single machine has no data sharing problem, and its confidentiality and authenticity can be guaranteed at the same time. Therefore, the security of the database system can be realized by controlling the access to the database files [20]. For the database system running in the network environment, its remarkable feature is data sharing. Therefore, the function of data encryption technology is to ensure the authenticity of data without affecting data sharing. Its main encryption technology is based on the encryption of records and fields. In order to ensure that the system is not attacked, it is best to use different keys for the same field of different records, so the number of keys is very large [21]. If there are M records in a table and each record has N fields, the number of keys required is M∗N, and the number of keys of the whole system is more. Obviously, such a large number of keys cannot be stored and managed for a long time and can only be generated dynamically when needed. The key generation function satisfies at least three conditions: first, the probability that the keys of different data items are the same is very small. Second, it is difficult to obtain other data item keys from one data item key. Third, some information of a data item (such as value range and probability distribution) is known, and other information of the data item cannot be obtained from ciphertext. Then, the key functions that can meet the above three items are shown in
(1)kij=ki⨁kj,(2)ki=ETK,Ri,(3)kj=ETK,Cj.In the formula,kis the data item key generation function, TK is the table key, Ri is the encrypted field row flag, and Cj is the encrypted field column flag [22]. For the data item key generation function, an effective implementation method is to use an algorithm to encrypt Ri and Cj with table key TK as the key to obtain keys Ki and Kj and then perform logical operation on Ki and Kj to obtain the data item key. Here, TK is the key, R is the row ID, and C is the field ID. Encrypt Cj and Ri, respectively, through key TK, generate field key kj and record key ki, and then generate key kij after XOR operation of kj and ki [23].The comparison of various encryption algorithms is shown in Table1:Table 1
Comparison of various algorithms.
Password typeSymmetric cryptosystemAsymmetric cryptosystemHash algorithmName of comparison itemDESAESIDEARC5RC6RSAMD5Development time1977200119911995199619771993Is it protected by patentNoNoNoNoNoNoNoKey length56 b (double DES112b, triple DES168b)128 b or 192 b or 256 b128 bVariable length key up to 256 bVariable length key up to 256 b512 b is selected, and the longest is 1024 b238 bNumber of bits of processing block during encryption64 b128 b64 b128 b128 bMost of 110 b128 bEncryption speedFastVery fastFastFastFastVery slowSlow


## 3.2. System General Framework Design

Based on the B/s and C/S frameworks, through comprehensive consideration, the student safety management system is designed in the integration mode of the two [24]. Taking the C/S framework as the carrier, the server receives the data of portable devices and uses the worker man architecture to receive and store the data. With the B/S framework as the carrier, managers monitor students’ daily safety in real time through the management platform based on think PHP architecture [25]. This design mode only needs to take the server-side as the auxiliary development system and compile the socket server-side code, which can save the system development cost, and the requirements for the client are relatively low. Students only need to carry portable devices, and managers can monitor students’ security in real time through the browser. The combination of worker man architecture and think PHP architecture can not only ensure the data authenticity of student safety management system but also ensure that managers supervise student safety in the whole process.


## 3.3. Management Platform

The background server management platform selects HTML+CSS+JS to realize the page. The background chooses PHP language to realize development. The PHP language has unique advantages in web development server-side scripting language. It is open source, and the source code can be downloaded and browsed in real time. The use is free, which can effectively save the development cost. It has good platform transfer characteristics and can support Linux. Windows, etc. There are various mainstream frameworks for PHP, that is, Laravel and ThinkPHP. This paper chooses ThinkPHP architecture to design the system.


## 3.4. Authority and Function

The system is divided into three types of different permissions, corresponding to different functions. When the user logs in to the page, enters the account and password, and verifies that the information is correct, the background will independently evaluate the user authority to jump to different pages and realize different functions. High-level permissions can manage low-level permissions. Low-level permissions only have basic operation functions. There are three kinds of system design permissions, namely, super manager, college head, and head teacher, as shown in Figure2.Figure 2
Background management platform permissions.First, the super administrator and developer manage their account. Their task is to assign the initial account password to the person in charge of the college, manage the person in charge of the school level, add or delete equipment, and monitor the operation status of equipment in real time. Second, the person in charge of the college is responsible for compiling the basic information of the university, assigning the initial account and password to the head teacher, applying for facilities and equipment, and querying the operation status of the equipment, as well as the basic information of students and the student security information transmitted by the person in charge of the class. Third, the head teacher is directly responsible for the safety of students, that is, students are bound with equipment and query students’ attendance time, movement track, and alarm information.


## 3.5. Safety Design

(1)
SQL injection attackSQL injection attack belongs to the form of Web attack. This attack exists because the system background program does not strictly verify the user’s input data, resulting in illegal elements to conduct destructive manipulation after obtaining the user’s data information in the database in a malicious way. In terms of SQL injection attack, the background system queries statements in the form of array and selects the preprocessing mechanism to filter dangerous data for a few string query conditions.(2)
URL encryption algorithmBecause security problems are easy to occur during data transmission, encryption is a necessary link in the system design. The system design encryption work is mainly carried out based on URL. For important parameters, users are prompted to browse the data information in the encrypted state in the form of encryption. Developers independently compile the encryption algorithm and decryption algorithm.Commonly used encryption algorithms in PHP include MD5, SHA1 and Base64. MD5 encryption algorithm belongs to one-way hash encryption technology, and Base64 belongs to symmetric encryption algorithm. However, due to its frequent use, it has certain security risks. In addition, in the third-party website, the traditional encryption algorithm can be decoded in the form of payment. In short, the encryption algorithm of this system is independently compiled by the developer, with the best security and economy.The system design encapsulates encryption and decryption into two functions. The implementation of encryption is to connect the user’s character information with a string to obtain a new string; For the new string, Base64 encryption function is used to complete the encryption, and the encrypted string is divided into an array based on the string segmentation function. We splice the elements of the array in the form of array loop to obtain a new array and turn back the string and replace the special characters of the string to obtain the final result after encryption.The specific effect of encryption is to asynchronously transmit the user form data in the background, strictly encrypt the important parameters in the background, and transmit the encryption results to the foreground. The foreground jumps the encryption parameters and other parameters to the specified interface based on the URL splicing mode, and the background decrypts with the decryption algorithm to recover the data and process the business logic, so as to improve the security and stability of the system.(3)
Socket designThe specific process of socket data receiving of the system is to select JSON format to transmit data, open the port on the server side to receive the client data, and analyze it. Feedback error information to the client for abnormal data and abnormal operation, and stop the operation in time. When the data is correctly programmed into the database, return the normal description to the client, terminate the connection with it, and resupervise in real time. The socket data receiving process is shown in Figure3.
(4)
Database designFigure 3
Data receiving process.The college student safety management system is realized by the entity relational database design. Based on demand analysis, the E-R diagram is used to build a model that can effectively reflect the actual things and relations and explain the data framework of the database which is too abstract. The entity relationship is used to abstract the processing data information, realize the transformation from entity geometry to entity type, and reflect the internal correlation of actual things through entity relationship. We build the local E-R model, integrate the local model into the overall model, and optimize and improve it. The system E-R diagram is shown in Figure4 (1 and N are interentity relations, that is 1 : n or N : 1, one college corresponds to multiple counselors, one counselor corresponds to multiple students, and multiple students correspond to one behavior; 1 represents a single, N represents multiple).Figure 4
E-R diagram.


## 4. Result Analysis

In actual use evaluation of the system, the safety management system designed in this paper is tried in a university, and the students who have used the knowledge sharing system evaluate the system. The evaluation of the system is carried out from six aspects: system resource richness (E), system use convenience (F), system security (G), information transmission speed (H), system fluency (J), and overall evaluation (L). Each aspect is scored in the percentage system. The calculation formula of the overall score (T) is as follows:
(4)T=E∗0.1+F∗0.1+G∗0.4+H∗0.15+J∗0.15+L∗0.1∗100%.The collected scores are summarized and analyzed, and the results are shown in Figure5.Figure 5
System usage evaluation.As can be seen from Figure5, the safety management system designed in this paper has obtained satisfactory evaluation in the trial universities, accounting for 93% of the trial population. According to the collected improvement opinions, this paper will focus on the analysis and further improve the system, so as to put it into use on a large scale and improve the management efficiency of university information.


## 5. Conclusion

With the rapid increase of electronic archives data in colleges and universities, the requirements for the authenticity, reliability, and permanence of electronic data are increasing day by day. Based on the discussion of the key technology of database encryption, this paper focuses on the implementation of the method of encryption technology in the management of archives in colleges and universities. According to the security needs of the current university archives database, this paper designs a set of practical system for the university archive information management system to realize the data encryption in the database application system without affecting the ciphertext encryption under the normal operation of the database. The system can also manage the encrypted computer files (including title encryption); realize that all the encrypted data and its derivative parts in the database are encrypted according to the encryption requirements (there is no unclassified channel of ciphertext); realize the requirements of “can’t understand, can’t steal, and it’s useless to steal” in the confidentiality work; and realize the storage, modification, deletion, indexing, printing and retrieval of encrypted data. Combined with the specific requirements of the system and through the comparison of various algorithms, this paper selects the CBC mode of the 128-bit AES encryption algorithm to encrypt the data and realizes the demand analysis, analysis and design, coding, testing, and deployment of the whole university archive database encryption project. It focuses on the key to the security of cryptographic algorithm, which is how to ensure the confidentiality of the key, and uses Java programming language. Based on the database structure defined by SQL, the coding of the main modules of the system is realized. The use of this project proves that the design of the whole system is reasonable, and the scheme is feasible, meets the needs of operation, and puts forward a solution with practical value and market significance for the current data security.



---

*Source: 3323547-2022-07-07.xml*