A data encryption system in an electronic storage chip
By designing the key management unit in the memory chip and using the DES algorithm and HMAC-SHA256 algorithm, the problem of vulnerability of memory chip encryption systems in the prior art is solved, and higher data security and reliability are achieved.
Patent Information
- Application Number
- CN202410440157.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-04-12
AI Technical Summary
Encryption systems within existing memory chips are vulnerable to side channel attacks, physical attacks, backdoor risks, weak random number generation, firmware vulnerabilities and hardware vulnerabilities, resulting in insufficient data security.
A data encryption system in an electronic storage chip is designed, including a key management unit, including a random number generator, a key generator, a key memory, a key exchange mechanism and a hierarchical key management system. DES algorithm and HMAC-SHA256 algorithm are used to ensure the security of the key and the integrity of the data.
By using the DES algorithm to obtain the 56-bit length of the file key and the message authentication code of the HMAC-SHA256 algorithm, the security of the file key during use is ensured, and illegal elements can use weak random number generation algorithms to crack the key, thereby improving the security and reliability of the data encryption system.
Smart Images

Figure CN118353607B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of encryption systems, and in particular is a data encryption system in an electronic storage chip. Background Art
[0002] With the development of information technology, data security is becoming more and more important; storage encryption system chips, as a hardware-level security solution, can provide reliable data encryption and protection; the encryption principle is to safely transplant the key code and data of the internal application software to the chip hardware for protection; when needed, the application software can run the key code and data in the hardware through the function call engine instruction and return the result, so that all the functions of the entire software can still be completed; the encryption system in the conventional chip may be threatened by side channel attacks, by monitoring power consumption, electromagnetic radiation or clock frequency and other information, to guess the key and data, thereby cracking the encryption system; in addition, the storage chip may also be attacked by the following means:
[0003] Physical attack: The encryption system in a conventional chip may be subject to physical attacks, such as probe attacks, light attacks, freezing attacks, etc., which can obtain key information by directly contacting or acting on the chip;
[0004] Backdoor risk: The encryption system in conventional chips may have a backdoor risk, that is, the manufacturer or attacker implants a backdoor or weakness during the design or production process in order to bypass encryption protection or steal information;
[0005] Weak random number generation: The encryption system in conventional chips may be vulnerable to attacks due to the use of weak pseudo-random number generation algorithms, which may lead to predictability or guessability of keys or initialization vectors;
[0006] Firmware vulnerabilities: The encryption system in conventional chips may be affected by firmware vulnerabilities. For example, firmware that has not been fully tested or verified may have vulnerabilities that can be exploited by attackers to bypass encryption protection;
[0007] Hardware vulnerabilities: The encryption system in conventional chips may be affected by hardware vulnerabilities, such as hardware design defects, manufacturing defects or integrated unit failures, which may make the system vulnerable to attack or fail to work properly. Summary of the invention
[0008] In order to make up for the deficiencies of the prior art and solve the above-mentioned technical problems, the present invention proposes a data encryption system in an electronic storage chip.
[0009] The technical solution adopted by the present invention to solve the technical problem is: the present invention proposes a data encryption system in an electronic storage chip, the data encryption system includes a key management unit, and the key management unit includes:
[0010] Random number generator: used to generate random numbers required by encryption algorithms;
[0011] Key generator: generates the key of the encryption algorithm and the key pair of the public key encryption algorithm;
[0012] Key storage: stores keys and key pairs, using hardware-level protection at the physical storage layer;
[0013] Key exchange mechanism: used to securely transmit keys, using an asymmetric encryption algorithm;
[0014] Hierarchical key management system: The first layer is the password key, which is derived from the user password through the key; the second layer is the master key, which is generated by a pseudo-random number generator; the third layer is the file key used to encrypt files.
[0015] Preferably, the password key is a pair of RSA keys, one of which is a confidential key, which is saved by the user; the other is a public key, which is obtained by registering in a network server; the master key is a message authentication code, which is constructed by the HMAC algorithm based on the hash function; the file key is obtained by the DES algorithm, and its input parameters are three: key, data and mode; key is the key used for encryption and decryption, data is the encrypted and decrypted data, and mode is its working mode; when the mode is encryption mode, the plaintext is grouped according to 64 bits to form a plaintext group, and key is used to encrypt the data; when the mode is decryption mode, key is used to decrypt the data.
[0016] Preferably, the data encryption system includes a data encryption and decryption unit, and the data encryption and decryption unit is composed of an encryption and decryption module, a syntax analysis module and a database interface module; the encryption and decryption module performs encryption and decryption on the data according to the encryption dictionary, the syntax analysis module is responsible for converting the user's database access commands into SQL commands that can be recognized by the database management system, and the database interface module is mainly responsible for shielding the differences between the database management systems.
[0017] Preferably, an encryption dictionary module is embedded in the data encryption and decryption unit, and the encryption dictionary includes functions of dictionary design, management program, configuration, definition modification, table information retrieval, ciphertext table configuration and data conversion.
[0018] Preferably, the data encryption and decryption unit performs the following identification steps on the data before encryption and decryption:
[0019] S1: Syntax analysis of the SQL command. If the syntax is correct, go to the next step for further processing. If the syntax is incorrect, go to S6 and directly hand over the SQL command to the database server for processing.
[0020] S2: Is it an internal control command of the data encryption and decryption unit? If yes, process the internal control command and then go to S7; if not, go to the next step;
[0021] S3: Check whether the encryption and decryption module is in the closed state or whether the SOL command only needs to be compiled; if so, go to S6; otherwise, go to the next step;
[0022] S4: Retrieve the encryption dictionary and perform encryption and decryption semantic analysis on the SOL command according to the encryption definition;
[0023] S5: Whether the SOL command needs to be encrypted; if so, encrypt the SQL command, replace the original SOL command, and then go to the next step; otherwise, go directly to the next step;
[0024] S6: forwarding the SOL command to the database server for processing;
[0025] S7: After the SQL command is executed, the SQL command buffer is cleared.
[0026] The beneficial effects of the present invention are as follows:
[0027] 1. In the data encryption system in an electronic storage chip described in the present invention, the length of the file key obtained by using the DES algorithm can be 56 bits, and can be any 56-bit number, and can be changed at any time, thereby ensuring the security of the file key during use and preventing criminals from using a weak pseudo-random number generation algorithm, which leads to the predictability or guessability of the key or initialization vector, causing the file key to be disordered after being attacked and the user cannot use it or the data in the chip to be stolen.
[0028] 2. In the data encryption system in an electronic storage chip described in the present invention, both parties agree on a consistent Key at both ends of the communication network, and use the Key to perform DES encryption on the core data at the source of the communication, and then transmit the data in a cryptographic form through the public communication network to the end point of the communication network. After the data reaches the destination, the same Key is used to decrypt the cryptographic data to reproduce the core data in plain text form; this ensures the security and reliability of the core data transmission in the public communication network; and by periodically changing to a new Key at both the source and destination ends of the communication network, the confidentiality of the data can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The present invention will be further described below in conjunction with the accompanying drawings.
[0030] Figure 1 is a flow chart in the data encryption system of the present invention; DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] Embodiment 1:
[0033] With the development of information technology, data security is becoming more and more important; storage encryption system chips, as a hardware-level security solution, can provide reliable data encryption and protection; the encryption principle is to safely transplant the key code and data of the internal application software to the chip hardware for protection; when needed, the application software can run the key code and data in the hardware through the function call engine instruction and return the result, so that all the functions of the entire software can still be completed; the encryption system in the conventional chip may be threatened by side channel attacks, by monitoring power consumption, electromagnetic radiation or clock frequency and other information, to guess the key and data, thereby cracking the encryption system; in addition, the storage chip may also be attacked by the following means:
[0034] Physical attack: The encryption system in a conventional chip may be subject to physical attacks, such as probe attacks, light attacks, freezing attacks, etc., which can obtain key information by directly contacting or acting on the chip;
[0035] Backdoor risk: The encryption system in conventional chips may have a backdoor risk, that is, the manufacturer or attacker implants a backdoor or weakness during the design or production process in order to bypass encryption protection or steal information;
[0036] Weak random number generation: The encryption system in conventional chips may be vulnerable to attacks due to the use of weak pseudo-random number generation algorithms, which may lead to predictability or guessability of keys or initialization vectors;
[0037] Firmware vulnerabilities: The encryption system in conventional chips may be affected by firmware vulnerabilities. For example, firmware that has not been fully tested or verified may have vulnerabilities that can be exploited by attackers to bypass encryption protection;
[0038] Hardware vulnerabilities: The encryption system in conventional chips may be affected by hardware vulnerabilities, such as hardware design defects, manufacturing defects or integrated unit failures, which may make the system vulnerable to attack or fail to work properly;
[0039] In order to effectively solve the above problems, a data encryption system in an electronic storage chip is proposed, as shown in the accompanying drawings of the specification. Figure 1 As shown in , the data encryption system includes a key management unit, and the key management unit includes:
[0040] Random number generator: used to generate random numbers required by encryption algorithms;
[0041] Key generator: generates the key of the encryption algorithm and the key pair of the public key encryption algorithm;
[0042] Key storage: stores keys and key pairs, using hardware-level protection at the physical storage layer;
[0043] Key exchange mechanism: used to securely transmit keys, using an asymmetric encryption algorithm;
[0044] Hierarchical key management system: The first layer is the password key, which is derived from the user password through the key; the second layer is the master key, which is generated by a pseudo-random number generator; the third layer is the file key used to encrypt files.
[0045] The password key is a pair of RSA keys, one of which is a confidential key, which is saved by the user; the other is a public key, which is obtained by registering in the network server; the master key is a message authentication code, which is constructed by the HMAC algorithm based on the hash function; the file key is obtained by the DES algorithm, and its input parameters are three: key, data and mode; key is the key used for encryption and decryption, data is the encrypted and decrypted data, and mode is its working mode; when the mode is encryption mode, the plaintext is grouped according to 64 bits to form a plaintext group, and key is used to encrypt data; when the mode is decryption mode, key is used to decrypt data;
[0046] Specifically, the system divides key management into three layers; the first layer is the password key, which is obtained by encrypting the user password through the key derivation algorithm; the second layer is the master key. This paper generates two master keys when generating the master key, one is the encryption master key used for encryption, and the other is the authentication master key used for message authentication. Because this paper takes data integrity into consideration when designing the data encryption system, and uses the HMAC-SHA256 algorithm to obtain the message authentication code, and the HMAC-SHA256 algorithm requires a key when processing data, so when the system generates the master key, it will generate a master key for authentication; the third layer is the file key, which is used to encrypt the file content; the password key encrypts the two master keys, the encryption master key is used to encrypt the file key, the file key is used to encrypt the file content, and the authentication master key is used for message authentication; the user's password key encrypts the master key, and the master key encrypts the file key. Through this method of encrypting the lower key with the upper key, the difficulty of key management for users is simplified from the key generation, storage and distribution process, and the key management process does not involve a third party, which also reduces the complexity of management;
[0047] The RSA algorithm uses two completely different but completely matching pairs of keys - a public key and a private key. When using the RSA algorithm to encrypt files, only a matching pair of public and private keys can be used to complete the encryption and decryption process of plain text (original data). Public key encryption is used to encrypt plain text, and private key is used to decrypt ciphertext. Moreover, the sender (encryptor) knows the receiver's public key, and only the receiver (decryptor) knows his or her private key. The basic principle of the RSA algorithm is that if the sender wants to send encrypted information that only the receiver can decipher, the sender must first know the receiver's public key, and then use the receiver's public key to encrypt the original text. After the receiver receives the encrypted ciphertext, he or she can use his or her own private key to decrypt the ciphertext. Obviously, when using the RSA algorithm, before the sender and receiver communicate, the receiver must send his or her randomly generated public key to the sender, and keep the private key for himself or herself. Since the asymmetric algorithm has two keys, it is particularly suitable for data encryption in distributed systems.
[0048] In the DES algorithm, the data sender processes the plaintext (original data) and the encryption key together through a special encryption algorithm, and then turns it into a complex encrypted ciphertext and sends it out. After the recipient receives the ciphertext, if he wants to interpret the original text, he needs to use the encryption key and the inverse algorithm of the same algorithm to decrypt the ciphertext to restore it to readable plaintext. In the symmetric encryption algorithm, there is only one key used, and both the sender and the receiver use this key to encrypt and decrypt the data, which requires the decryption party to know the encryption key in advance. Its characteristics are open algorithm, small calculation amount, and fast encryption. A group of 64-bit plaintext is input from one end of the DES algorithm, and a 64-bit ciphertext is output from the other end, and the encryption and decryption of the file key use the same algorithm. In addition, the length of the file key obtained by the DES algorithm can be 56 bits, and can be any 56-bit number, and can be changed at any time, ensuring the security of the file key during use, and preventing criminals from using weak pseudo-random number generation algorithms, resulting in predictability or guessability of keys or initialization vectors, causing the file key to be confused after being attacked and unable to be used by users or data in the chip to be stolen.
[0049] The DES algorithm has three entry parameters: Key, Data, and Mode. Key is 8 bytes and 64 bits in total, which is the working key of the DES algorithm. Data is also 8 bytes and 64 bits, which is the data to be encrypted or decrypted. Mode is the working mode of DES, which has two types: encryption or decryption.
[0050] The working process of DES algorithm: if the Mode is encryption, the data Data is encrypted with Key, and the encrypted form of Data is generated as the output result of DES; if the Mode is decryption, the encrypted form of Data is decrypted with Key, and restored to the plain text form of Data as the output result of DES; at both ends of the communication network, both parties agree on a consistent Key, and use Key to encrypt the core data with DES at the source of the communication, and then transmit it to the end point of the communication network in encrypted form through the public communication network. After the data reaches the destination, the encrypted data is decrypted with the same Key, and the core data in plain text form is reproduced; this ensures the security and reliability of the transmission of core data in the public communication network; by regularly changing to a new Key at both the source and destination of the communication network, the confidentiality of the data can be further improved;
[0051] Assume that the plaintext m is a 64-bit string of 0s and 1s, and the key K is also a 64-bit string of 0s and 1s; let m = m1m2…m 64 ; K = K (1) K (2) …K (64) ; then m i ,K (i) =0 or 1, i=1,2,…64;
[0052] The encryption process is expressed as follows:
[0053]
[0054] IP stands for initial permutation in the DES algorithm. -1 Represents the inverse permutation in the DES algorithm. After iteration, the file key can be obtained through the DES algorithm;
[0055] Since the DES algorithm is a symmetric algorithm, the decryption process is exactly the same as the encryption process, except that the 16-round subkey sequence K (1) ,K (2) ,…,K (16) The order is reversed, that is, the first round uses the 16th word key K (16) , use K in the second round (15) , and so on, the decryption process is expressed as follows:
[0056]
[0057] Through exclusive possession of the file key and the use of the DES algorithm, the number of bits in the file key can be changed at any time, further ensuring the security of the file key during use, thereby improving the security of the data encryption system in the electronic storage chip;
[0058] Message authentication refers to verifying the integrity of a message. Its main purpose is to enable the recipient of the message to confirm the reliability of the message source and the accuracy of the content, and to verify the timeliness and sequence of the message. A message authentication code is a public function of plaintext and key. MAC maps a message of any length to a short fixed-length data packet under the control of a key and appends it to the message. Let M be a variable-length message and K be a key shared only by the sender and receiver of the message. Then MAC is generated by the following function:
[0059] MAC=C k (M) Formula 3;
[0060] Each time the sender of a message attaches a MAC to a message, the receiver authenticates the message by recalculating the MAC. If the received MAC is the same as the calculated MAC, it proves that the message has not been altered and that the message came from the sender of the shared key, because any change to the message without changing the MAC will cause the received MAC to be different from the calculated MAC after the change, and the key is only known to the sender and receiver of the message, and no one else can change the MAC to correspond to the altered message;
[0061] The message sender is set as P, the message receiver is set as Q, and the data of the message is set as M; the message sender P sends a message M to Q. First, P uses the MAC algorithm to process the message to be sent to obtain a message digest, where the shared key is K, and then concatenates the message digest with the message, and then encrypts it. The obtained ciphertext is sent to the receiver Q. Q decrypts the received ciphertext to obtain the concatenation of the message and the message digest, and then uses the same MAC algorithm to operate the message to obtain the message digest. Finally, it is compared with P's message digest to verify the integrity of the data and the identity of the sender.
[0062] HMAC is a MAC algorithm that constructs a message authentication code based on a hash function. The message authentication code generated by the HMAC algorithm can verify the identity and message integrity between two parties with a shared key. The HMAC algorithm defines a secure hash function and a shared key to generate a message authentication code. Its design features are as follows:
[0063] 1. Some existing hash functions can be used directly without any modification. The source code of many hash functions is public, such as SHA-1 and SHA-2, which is very convenient for the design of HMAC;
[0064] 2. When designing the HMAC algorithm, the Hash function is generally used as an independent module. If you want to replace it with a more efficient Hash function, you can replace it directly;
[0065] 3. The processing and use of shared keys should not be overly complicated;
[0066] The HMAC algorithm designed based on the hash function further introduces the key. The HMAC with the key has higher security than the independent use of the hash function, because only the individual holding the correct key can calculate the correct message digest. People without the key or holding the wrong key cannot obtain the correct message digest, thereby ensuring the security of the file key during use, and thus improving the security of the use of the data encryption system in the electronic storage chip.
[0067] The data encryption system includes a data encryption and decryption unit, and the data encryption and decryption unit is composed of an encryption and decryption module, a syntax analysis module and a database interface module; the encryption and decryption module performs encryption and decryption processing on the data according to the encryption dictionary, the syntax analysis module is responsible for converting the user's command to access the database into an SQL command that can be recognized by the database management system, and the database interface module is mainly responsible for shielding the differences between various database management systems to achieve transparent access to data by users;
[0068] The data encryption and decryption unit is embedded with an encryption dictionary module, which includes functions of dictionary design, management program, configuration, definition modification, table information retrieval, ciphertext table configuration and data conversion;
[0069] The data encryption and decryption unit performs the following identification steps on the data before encryption and decryption:
[0070] S1: Syntax analysis of the SQL command. If the syntax is correct, go to the next step for further processing. If the syntax is incorrect, go to S6 and directly hand over the SQL command to the database server for processing.
[0071] S2: Is it an internal control command of the data encryption and decryption unit? If yes, process the internal control command and then go to S7; if not, go to the next step;
[0072] S3: Check whether the encryption and decryption module is in the closed state or whether the SOL command only needs to be compiled; if so, go to S6; otherwise, go to the next step;
[0073] S4: Retrieve the encryption dictionary and perform encryption and decryption semantic analysis on the SOL command according to the encryption definition;
[0074] S5: Whether the SOL command needs to be encrypted; if so, encrypt the SQL command, replace the original SOL command, and then go to the next step; otherwise, go directly to the next step;
[0075] S6: forwarding the SOL command to the database server for processing;
[0076] S7: After the SQL command is executed, the SQL command buffer is cleared;
[0077] Specifically, the encryption and decryption processing module is the core module of the database encryption and decryption engine, including the initialization of the database encryption and decryption engine, the processing of internal special commands, the retrieval of encryption dictionary information, the management of encryption dictionary buffer, the encryption transformation of SQL commands, the decryption processing of query results, and the implementation of encryption and decryption algorithms, as well as some common auxiliary functions;
[0078] The syntax analysis module converts SQL commands into an easily processable tree form; this module consists of submodules such as lexical analyzer, syntax analyzer, syntax error handling, and syntax tree conversion into SQL commands;
[0079] Usually, the syntax analysis module is only called by the encryption and decryption module. The input parameter is the SQL command, and the output parameter is the analysis result in the form of a binary tree. The syntax analysis does not need to be able to recognize all types of SQL commands. It can ignore those SQL commands that are not related to encryption and decryption. If an unknown SQL command is encountered, an empty syntax tree is returned.
[0080] When performing syntax analysis, the syntax analysis module first performs lexical analysis on the SQL command, splits it into lexical units, and then inputs it into the syntax analyzer to obtain a syntax tree;
[0081] The syntax analyzer is generated by the utility program yacc provided by the Unix operating system. Yacc can recognize SQL commands that conform to the LALR grammar. In addition, the "syntax analysis module" also includes a function to generate SQL commands from the syntax tree in reverse, which is used to convert the encrypted syntax tree into a new SQL command.
[0082] The "database interface module" encapsulates all operations for accessing the database, shielding the characteristics of various databases, so that the "encryption and decryption processing module" does not need to care about which database is actually used; this module contains two parts of the interface: one is the interface function for the front-end database client to access the database encryption and decryption alarm; the other is the interface function for the database encryption and decryption engine to access the back-end database server; the entry point for users to access the database encryption and decryption engine is the "database interface module", and users call the user interface function provided by the "database interface module" through parameters such as SQLLink and SQL commands. For different database application programming interfaces, the definition of the user interface function is different;
[0083] The encryption dictionary is the basis for data encryption, which defines the encryption requirements of each table in detail. For any data table in the database that needs to be encrypted, the corresponding encryption dictionary must be established before encryption and decryption. The only user who has the right to establish and manage the encryption dictionary is the database administrator. No other user has the right to establish and process the encryption dictionary. The encryption dictionary is actually a data table. The fields it includes mainly include field number, field name, field type, field size, field precision, number of decimal places, encryption and security type. The encryption dictionary structure definition table is shown in Table 1 below.
[0084] Field Name type size Is this field required? Is it a primary key? Field Number tinyint 1 yes yes Field Type tinyint 1 yes no Field Name varchar 20 yes yes Field size smallint 2 yes no Field precision tinyint 1 no no Decimal Places tinyint 1 no no Security Type tinyint 1 yes no
[0085] Table 1
[0086] The field number uniquely identifies each field of an encryption dictionary, so it is a required field and must be the primary key. Since the number of fields usually does not exceed 200, a byte space is allocated, that is, it can count up to 255 fields;
[0087] In the following discussion, we will learn that any database management system, or DBMS, contains more than a dozen data types. Different data types use different methods for encryption and decryption. The data type value becomes the basis for different processing methods. Therefore, the "field type" field is a required field and is allocated a byte of storage space. The field type can be the same, so this field should not be the primary key;
[0088] Field names usually have different lengths, so the "Field Name" field data type is varchar, and a length of 20 bytes means that it can accommodate a field name of up to 10 Chinese characters in length; because a field must have a name and cannot have the same name, the "Field Name" field is a required field and is the primary key;
[0089] The "field size" field is a very important field, because it determines how much storage space should be allocated in the ciphertext table for the ciphertext field corresponding to the plaintext field to be encrypted, and any type of data requires storage space, so it is a required field: since the storage space required for different fields can be the same, it is not the primary key; giving the "field size" field two bytes of storage space means that its maximum can reach 65535, which is enough for any field value of any DBMS; "field precision" and "decimal places" are mainly for floating-point data; when decrypting floating-point data, these two data must be provided to accurately obtain the original floating-point data; the above data can only be obtained by executing a subroutine called "table information acquisition module", about which, the next section gives a detailed description;
[0090] The "security type" field is the most important field for encryption and decryption, because its value indicates the security data type to which the corresponding field value belongs; data classification is completed by the central authority CA; after CA completes the data classification, it sends the data classification information to the database administrator; when establishing a database encryption dictionary, the database administrator can assign security type values to each field of the data table according to the data classification information and the requirements of the superior department, that is, classify the data; after the encryption field is established, the database administrator can "decompose" the key of the required data type from its user key according to the "security type value", and then use these data class keys to encrypt the data table for which the encryption dictionary has just been established; when other approved users read a field value within their access rights in the data table , the system "decomposes" the data class key corresponding to the field value from the user's key according to the "security type value", and the "data encryption and decryption unit" decrypts the field value according to the data class key, and the user program is responsible for displaying it in plain text; there are dozens of data classifications at most, and one byte is enough to store the "security type value". Obviously, this field should be a required field but not the primary key; this method protects data confidentiality from two aspects. First, the data must be encrypted before being uploaded to the cloud, and then the ciphertext is uploaded to the cloud to ensure that the data is stored in the cloud in the form of ciphertext; second, the key used for data encryption should also be encrypted to ensure the security of the key; as long as the key is secure, the data security can be protected. Even if the ciphertext is stolen, the plaintext cannot be restored without the key;
[0091] Moreover, when users use the system to encrypt data, they do not need to perform manual operations step by step, including key management, encryption and decryption processes, etc., which are transparent to users. Most users are generally people with low technical levels and cannot accept complex operations. They do not understand key generation, storage, and the selection of encryption algorithms, and may make misoperations. Therefore, the transparency of the encryption system is particularly important. In addition, the system should be fast and efficient when encrypting data. If the encryption efficiency is very low, a lot of time will be wasted when processing large amounts of data. The encryption algorithm and its working mode are fixed, so the system should process the data before encrypting it, and use the advantages of multi-core and multi-threaded computers to improve encryption efficiency.
[0092] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A data encryption system in an electronic storage chip, the data encryption system comprising a key management unit, characterized in that: The key management unit comprises: Random number generator: used to generate random numbers required by encryption algorithms; Key generator: generates the key of the encryption algorithm and the key pair of the public key encryption algorithm; Key storage: stores keys and key pairs, using hardware-level protection at the physical storage layer; Key exchange mechanism: used to securely transmit keys, using an asymmetric encryption algorithm; Hierarchical key management system: the first layer is the password key, which is derived from the user password through the key; the second layer is the master key key, generated by a pseudo-random number generator; the third layer is the file key used to encrypt files; The password key is a pair of RSA keys, one of which is a confidential key, which is saved by the user; the other is a public key, which is obtained by registering in the network server; the master key is a message authentication code, which is constructed by the HMAC algorithm based on the hash function; the file key is obtained by the DES algorithm, and its input parameters are three: key, data and mode; key is the key used for encryption and decryption, data is the encrypted and decrypted data, and mode is its working mode; when the mode is encryption mode, the plaintext is grouped according to 64 bits to form a plaintext group, and key is used to encrypt data; when the mode is decryption mode, key is used to decrypt data; The data sender processes the plaintext and encryption key together through a special encryption algorithm, and then turns it into a complex encrypted ciphertext and sends it out. After the recipient receives the ciphertext, if he wants to interpret the original text, he needs to use the encryption key and the inverse algorithm of the same algorithm to decrypt the ciphertext to restore it to readable plaintext. In the symmetric encryption algorithm, there is only one key used, and both the sender and the receiver use this key to encrypt and decrypt the data, which requires the decryptor to know the encryption key in advance. A 64-bit plaintext is input from one end of the DES algorithm, and a 64-bit ciphertext is output from the other end, and the encryption and decryption of the file key use the same algorithm. In addition, the length of the file key obtained using the DES algorithm can be 56 bits, and can be any 56-bit number, and can be changed at any time, ensuring the security of the file key during use and preventing criminals from using weak pseudo-random number generation algorithms, which can lead to predictability or guessability of the key or initialization vector, causing the file key to be confused after being attacked and the user cannot use it or the data in the chip to be stolen.
2. The data encryption system in an electronic storage chip according to claim 1, characterized in that: The data encryption system includes a data encryption and decryption unit, and the data encryption and decryption unit is composed of an encryption and decryption module, a syntax analysis module and a database interface module; the encryption and decryption module performs encryption and decryption processing on the data according to the encryption dictionary, the syntax analysis module is responsible for converting the user's database access command into an SQL command that can be recognized by the database management system, and the database interface module is mainly responsible for shielding the differences between the database management systems.
3. The data encryption system in an electronic storage chip according to claim 2, characterized in that: The data encryption and decryption unit is embedded with an encryption dictionary module, and the encryption dictionary includes functions of dictionary design, management program, configuration, definition modification, table information retrieval, ciphertext table configuration and data conversion.
4. The data encryption system in an electronic storage chip according to claim 3, characterized in that: The data encryption and decryption unit performs the following identification steps on the data before encryption and decryption: S1: Syntax analysis of the SQL command. If the syntax is correct, go to the next step for further processing. If the syntax is incorrect, go to S6 and directly hand over the SQL command to the database server for processing. S2: Whether it is an internal control command of the data encryption and decryption unit; If yes, process the internal control command and then go to S7; if no, go to the next step; S3: Check whether the encryption and decryption module is in the closed state or whether the SOL command only needs to be compiled; If yes, go to S6; otherwise go to the next step; S4: Retrieve the encryption dictionary and perform encryption and decryption semantic analysis on the SOL command according to the encryption definition; S5: Whether the SOL command needs to be encrypted; If yes, encrypt the SQL command, replace the original SOL command, and then go to the next step; otherwise, go directly to the next step; S6: forwarding the SOL command to the database server for processing; S7: After the SQL command is executed, the SQL command buffer is cleared.
Citation Information
Patent Citations
Data transmission method for grid mobile terminal based on improved DES encryption algorithm
CN108737070A