Encryption control method for manufacturing solid state disk
By solidifying the key pair library in the solid state hard disk and using XOR operation to generate the decryption key, the problem of encrypted solid state hard disk in the prior art may leak other data encryption information when reading data, improving the security of the data and Key management efficiency.
Patent Information
- Application Number
- CN202411121308.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Existing encrypted solid-state drives may leak encrypted information from other data when reading data, which cannot ensure the true security of the data.
By solidifying the key pair library in a solid state hard disk, generating an encryption key based on the length and type of data to be encrypted, and dividing the data into multiple data groups for encryption, using XOR operation to generate a decryption key, ensuring that it is in the same sector Different data types store different encryption keys, and the data is decrypted through logical operations when reading, reducing the workload of key management.
Improves data security, prevents key leakage and attacks, reduces the workload of key management, and ensures that data does not leak other encrypted information when read.
Smart Images

Figure CN119004568A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and more specifically to an encryption control method for manufacturing solid state hard disks. Background Art
[0002] With the continuous advancement and innovation of technology, the encryption performance of encrypted solid-state hard drives will be further improved. At the same time, new encryption technologies and algorithms will continue to emerge, providing users with safer and more convenient data protection solutions. Similar prior art includes a Chinese patent with publication number CN118152306A, which proposes a hard disk data protection method, device, equipment and storage medium, which relates to the field of data storage technology and is applied to hard disks. The main control component of the hard disk includes a verification data generation and comparison component and a data encryption and decryption component, including: sending a connection request to a mobile storage device; when a successful connection response is received, reading the encryption and decryption mode information and password from the mobile storage device and verifying them; if the verification passes, the hard disk read and write function and the encryption and decryption function of the data encryption and decryption component are turned on; when a data write request is received, the encryption mode corresponding to the encryption and decryption mode information and password is determined by the data encryption and decryption component; according to the encryption mode and using the password to encrypt the data to be written, and the encrypted data is stored, which can encrypt the hard disk data, realize the protection of the hard disk data, improve the security of the hard disk data storage, and effectively prevent the hard disk data from being tampered with. In addition, similar prior art also includes a US patent with publication number US11644983B2, which proposes a storage device with encryption function, including a non-volatile memory, which is configured to store an encryption key and a data key encrypted with the encryption key, write data using the data key, and read data using the data key; a storage controller, wherein the storage controller is configured to receive a first security setting command, the first security setting command allows the use of a first password to access the data key, generate a first key based on the first password in response to the first security setting command, encrypt the first key with the first key to generate a first encryption key, encrypt the first key with the encryption key to generate an encrypted first key, and store the first encryption key and the encrypted first key in the non-volatile memory. Both of the above two technical solutions solve the problem of data security, but neither of them takes into account that when reading hard disk data, encryption information of other data will be leaked, so that the security of the data cannot be truly ensured. Summary of the invention
[0003] In order to better solve the above problem, the present invention provides an encryption control method for manufacturing a solid state hard disk, wherein the solid state hard disk includes a plurality of sectors, and the method includes the following steps:
[0004] Step S1: first fix the key pair library into the solid state drive, receive the data to be encrypted through the receiving unit, and obtain the data length and type of the data to be encrypted, and allocate a storage location for the data to be encrypted according to the data length of the data to be encrypted and the remaining space of the solid state drive;
[0005] Step S2: The key generation unit generates an encryption key based on the storage location, the type of data to be encrypted and the key pair library, divides the data to be encrypted into multiple data groups, and encrypts the data groups using the encryption key and encryption algorithm to generate first encrypted data;
[0006] Step S3: performing a logical operation on the decryption key corresponding to the encryption key to obtain a logical decryption key, generating related data of the first encrypted data based on the data length of the data group, the data length of the data to be encrypted, the check data of the data group and the logical decryption key, and saving the first encrypted data and the corresponding related data in the same sector of the storage location;
[0007] Step S4: using the encrypted data to be encrypted as data to be decrypted, setting access rights for the data to be decrypted, and generating an access password; after the user inputs the access password, according to the user's operation command, when the operation command is decryption, obtaining the initial reading position of the data to be decrypted through the position management unit;
[0008] Step S5: reading the data to be decrypted and the related data corresponding to the data to be decrypted based on the initial reading position, obtaining a decryption key through the related data, decrypting the data to be decrypted based on the decryption key, and obtaining decrypted data.
[0009] As a preferred technical solution of the present invention, step S1 comprises:
[0010] The key pair library includes multiple encryption key and decryption key pairs. The data types that can be stored in the solid state drive include text, audio, image, video and program. The type of the data to be encrypted is one of the data types.
[0011] As a preferred technical solution of the present invention, step S2 includes the following steps:
[0012] Step S21: sorting the sectors of the solid state hard disk according to the size of the storage address, and obtaining the sorting of each sector, and also numbering the data types that can be stored in the solid state hard disk, and obtaining the number of the data type to be encrypted, setting an intermediate number, using the number of the data type to be encrypted as the lower four bits of the intermediate number, and using the serial number of the sector where the initial storage position of the storage position is located as the upper four bits of the intermediate number, calculating the remainder of the intermediate number and the total number of key pairs in the key pair library, and using the key pair in the key pair library with the same serial number as the remainder as the encryption key and decryption key of the data to be encrypted;
[0013] Step S22: Divide the data to be encrypted into N data groups, wherein the data length of the first data group is S, S+K is less than or equal to the remaining space of the sector where the initial storage position is located, and is the maximum data amount of the data group that can be stored in the sector where the initial storage position is located, the data length of the i-th data group is MK, i is greater than or equal to 2 and less than N, M is the data capacity of the sector, K is the data length of the relevant data corresponding to the data group, and the length of the N-th data group is the amount of remaining data after removing the first N-1 data groups from the data to be encrypted;
[0014] Step S23: Encrypt each of the data groups using the encryption key and encryption algorithm to generate the first encrypted data corresponding to each of the data groups.
[0015] As a preferred technical solution of the present invention, the data length of the first encrypted data is equal to the data length of the data group corresponding to the first encrypted data.
[0016] As a preferred technical solution of the present invention, step S3 includes: performing a logical operation on the decryption key corresponding to the encryption key, the logical operation being an exclusive OR operation, to obtain the logical decryption key, using the logical decryption key, the data length of the data group, the data length of the data to be encrypted and the verification data of the data group as the ancillary data of the data group, adding preset separators between two adjacent items in the ancillary data, and using the ancillary data to which the preset separators have been added as the related data of the data group, wherein the related data and the data group are stored in the same sector, and the related data is stored in front of the corresponding data group.
[0017] As a preferred technical solution of the present invention, step S5 includes:
[0018] Step S51: according to the initial reading position of the data to be decrypted, the target sector where the initial reading position is located is obtained, all the data in the target sector is read out, and all the data is used as the second encrypted data;
[0019] Step S52: identifying the length of the data group, the data length of the data to be decrypted, and the logical decryption key corresponding to the first encrypted data based on the initial reading position and the preset delimiter in the relevant data;
[0020] Step S53: Obtain the first encrypted data from the second encrypted data based on the data length of the first encrypted data, perform a logical operation on the logical decryption key again to obtain the decryption key, decrypt the first encrypted data using the decryption key and the decryption algorithm, and obtain the data group corresponding to the first encrypted data.
[0021] As a preferred technical solution of the present invention, the step S53 further includes a step S54:
[0022] Take the next sector of the target sector as the new target sector, and repeat steps S51-S53 to read and decrypt the other data groups in the new target sector according to the method that the first encrypted data corresponds to the data group, add the data length of each decrypted data group to calculate the data length sum, and end when the data length sum is equal to the length of the data to be decrypted.
[0023] As a preferred technical solution of the present invention, step S5 also includes step S6: further calculating the verification result of each data group decrypted from the data to be decrypted, and comparing the verification result with the verification data in the related data corresponding to the data group; when the verification result and the verification data of each data group are consistent, each data group is spliced in the reading order to obtain the complete decrypted data; when the verification result and the verification data of at least one data group are inconsistent, repeating step S5 to re-read the first encrypted data corresponding to at least one data group, and decrypting it again.
[0024] As a preferred technical solution of the present invention, the encryption algorithm and decryption algorithm are symmetric key encryption algorithms of the Advanced Encryption Standard.
[0025] As a preferred technical solution of the present invention, multiple types of encrypted data can be stored in each sector.
[0026] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0027] The present invention receives data to be encrypted through a receiving unit, and obtains the data length and type of the data to be encrypted, allocates a storage location for the data to be encrypted according to the data length of the data to be encrypted and the remaining space of the solid state hard disk, uses the serial number of the sector where the initial storage location of the data to be encrypted is located as the high four bits of the intermediate number, and uses the type number of the data to be encrypted as the low four bits of the intermediate number, wherein the intermediate number is in octal system, and calculates the remainder of the intermediate number and the total number of key pairs in the key pair library, and uses the key pair with the key pair serial number in the key pair library equal to the remainder as the encryption key and decryption key of the data to be encrypted, so that different data types stored in the same sector have different encryption keys, and the same data type stored in different sectors also has different encryption keys, thereby increasing the security of the data, and by using the decryption key corresponding to the encryption key The key performs a logical operation, wherein the logical operation is an XOR operation, and the data length of the data group, the data length of the data to be encrypted, the verification data of the data group and the logical decryption key are used as the auxiliary data of the data group. When reading the content of the sector where the data group is located, all the data of the data group is obtained through the data length of the data group, and whether to continue reading the data of the next sector is determined by the data length of the data to be encrypted and the total length of the read data group, and the decryption key can be decrypted by performing an XOR operation on the logical decryption key again, thereby reducing the workload of managing the decryption key. At the same time, even if a security attack occurs, it is not known which one is the decryption key, let alone whether the decryption key has performed a logical operation. Through the mutual cooperation of the above technical solutions, not only the security of the data is improved, but also the workload of key management is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 The present invention is a flow chart of the encryption control method used in solid state hard disk manufacturing. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0030] The present invention provides an encryption control method for manufacturing a solid state hard disk, wherein the solid state hard disk includes a plurality of sectors, such as Figure 1 As shown, the method comprises the following steps:
[0031] Step S1: first fix the key pair library into the solid state drive, receive the data to be encrypted through the receiving unit, and obtain the data length and type of the data to be encrypted, and allocate a storage location for the data to be encrypted according to the data length of the data to be encrypted and the remaining space of the solid state drive;
[0032] Specifically, the encryption control method for manufacturing solid-state hard disks mainly involves software encryption and hardware encryption, wherein software encryption is to encrypt and decrypt data in the hard disk through a software program, thereby achieving the purpose of improving data security. After the production of the solid-state hard disk body is completed, the key pair library is now solidified into the solid-state hard disk, providing an encryption key for the data to be encrypted and a decryption key for the data to be decrypted. The data to be encrypted is then received through a receiving unit, and the data length and type of the data to be encrypted are obtained. The type of the data to be encrypted is one of text, audio, image, video and program. A storage location is allocated for the data to be encrypted according to the data length of the data to be encrypted and the remaining space of the solid-state hard disk. Through the technical solution, the data to be encrypted and its data length and type can be obtained, laying the foundation for further generating encryption keys according to the storage location, the type of the data to be encrypted and the key pair library.
[0033] Step S2: The key generation unit generates an encryption key based on the storage location, the type of data to be encrypted and the key pair library, divides the data to be encrypted into multiple data groups, and encrypts the data groups using the encryption key and encryption algorithm to generate first encrypted data;
[0034] Specifically, the serial number of the sector where the initial storage location of the data to be encrypted is located is used as the upper four bits of the intermediate number, and the type number of the data to be encrypted is used as the lower four bits of the intermediate number, wherein the intermediate number is in octal system, and the remainder of the intermediate number and the total number of key pairs in the key pair library is calculated, and the key pair with the key pair serial number in the key pair library equal to the remainder is used as the encryption key and decryption key of the data to be encrypted, wherein the serial number of the key pair is determined by the solidification order of the key pair in the solid state drive, and the earlier the serial number is solidified, the smaller the serial number. Through the technical solution, different data types stored in the same sector have different encryption keys, and the same data type stored in different sectors have different encryption keys, thereby increasing data security. The data to be encrypted is divided into N data groups. Since the smallest read and write unit of the solid state drive is a sector, in the data to be encrypted When the capacity of the data group is at least greater than that of a sector, when dividing the data groups, the first data group needs to be divided according to the remaining space of the written sector, and the division starts from the second data group according to the sector. The last data group is the last remaining data. Since the encryption algorithm of the above data group adopts a symmetric encryption algorithm, the data length of the above data group and the corresponding first encrypted data after encryption are consistent. The first N-1 data groups are integer multiples of the minimum encryption unit of the above encryption algorithm. When the Nth data group is not the minimum encryption unit, supplementary data is added to the Nth data group so that the data length of the Nth data group is an integer multiple of the minimum encryption unit. Each of the above data groups is encrypted by the encryption key and encryption algorithm to obtain the first encrypted data corresponding to each of the above data groups. Through the above technical solution, the first encrypted data corresponding to each of the above data groups can be obtained, thereby improving the security of the data.
[0035] Step S3: performing a logical operation on the decryption key corresponding to the encryption key to obtain a logical decryption key, generating related data of the first encrypted data based on the data length of the data group, the data length of the data to be encrypted, the check data of the data group and the logical decryption key, and saving the first encrypted data and the corresponding related data in the same sector of the storage location;
[0036] Specifically, by performing a logical operation on the decryption key corresponding to the encryption key, wherein the logical operation is an XOR operation, and taking the data length of the data group, the data length of the data to be encrypted, the verification data of the data group and the logical decryption key as the ancillary data of the data group, through the above technical scheme, when reading the content of the sector where the data group is located, all the data of the data group is obtained through the data length of the data group, and whether to continue reading the data of the next sector is determined by the data length of the data to be encrypted and the total length of the read data group, and the decryption key can be decrypted by performing an XOR operation on the logical decryption key again, thereby reducing the workload of managing the decryption key. At the same time, even if a security attack occurs, it is not known which one is the decryption key, let alone whether the decryption key has undergone a logical operation, thereby improving the security of the data and reducing the workload of key management.
[0037] Step S4: using the encrypted data to be encrypted as data to be decrypted, setting access rights for the data to be decrypted, and generating an access password; after the user inputs the access password, according to the user's operation command, when the operation command is decryption, obtaining the initial reading position of the data to be decrypted through the position management unit;
[0038] Specifically, by setting access rights for each data to be decrypted and allowing access only after the user enters the correct access password, the security of the data is further improved. When accessing the data to be decrypted, when the user's operation command is decryption, the initial reading position of the data to be decrypted is obtained through the position management unit, laying the foundation for accurately reading the data to be decrypted.
[0039] Step S5: reading the data to be decrypted and the related data corresponding to the data to be decrypted based on the initial reading position, obtaining a decryption key through the related data, decrypting the data to be decrypted based on the decryption key, and obtaining decrypted data.
[0040] Specifically, the above-mentioned initial reading position of the above-mentioned data to be decrypted is obtained through the position management unit, and the second encrypted data of the target sector is read according to the above-mentioned initial reading position. Since the above-mentioned target sector may include not only the above-mentioned data to be decrypted that is accessed, but also other data, therefore, the starting position of the above-mentioned data to be decrypted is obtained through the above-mentioned initial reading position, and the relevant data of the data group corresponding to the above-mentioned data to be decrypted is obtained from the starting position, and the data length of the data group is read from the above-mentioned relevant data, and the first encrypted data corresponding to the above-mentioned data group is read based on the data length of the above-mentioned data group, and the above-mentioned logical decryption key is obtained from the above-mentioned relevant data, and the above-mentioned logical decryption key is subjected to an XOR operation again to obtain the decryption key, and the above-mentioned first encrypted data is decrypted by the above-mentioned decryption key and the decryption algorithm to obtain the above-mentioned data group corresponding to the above-mentioned first encrypted data. Through the above-mentioned technical solution, since other data may be stored in the same sector and may be of different types, and their decryption passwords are also different, therefore, the above-mentioned data to be decrypted can be accurately decrypted from the above-mentioned solid-state hard disk without leaking other encrypted data in the same sector, thereby improving the security of the data.
[0041] Furthermore, the step S1 comprises:
[0042] The key pair library includes multiple encryption key and decryption key pairs. The data types that can be stored in the solid state drive include text, audio, image, video and program. The type of the data to be encrypted is one of the data types.
[0043] Furthermore, the step S2 comprises the following steps:
[0044] Step S21: sorting the sectors of the solid state hard disk according to the size of the storage address, and obtaining the sorting of each sector, and also numbering the data types that can be stored in the solid state hard disk, and obtaining the number of the data type to be encrypted, setting an intermediate number, using the number of the data type to be encrypted as the lower four bits of the intermediate number, and using the serial number of the sector where the initial storage position of the storage position is located as the upper four bits of the intermediate number, calculating the remainder of the intermediate data and the total number of key pairs in the key pair library, and using the key pair in the key pair library with the same serial number as the remainder as the encryption key and decryption key of the data to be encrypted;
[0045] Specifically, the solid-state hard disk includes a plurality of sectors, and the sectors are the smallest units for reading and writing data. The sectors of the solid-state hard disk are sorted according to the size of the storage address. Here, the sectors are at the bottom layer of the solid-state hard disk partition. Since each storage location corresponds to a storage address, for example: 0x1000ffff, the smaller the storage address in the sector, the smaller the serial number of the sector. The data types that can be stored in the solid-state hard disk are numbered. The data types that can be stored in the solid-state hard disk include at least text, audio, image, video and program. For example, the text is numbered 0x01, the audio is numbered 0x02, the image is numbered 0x03, the video is numbered 0x04, and the program is numbered 0x05. According to the type of the data to be encrypted, The type is used to obtain the corresponding number, the serial number of the sector where the initial storage location of the data storage location to be encrypted is used as the upper four bits of the intermediate number, and the type number of the data to be encrypted is used as the lower four bits of the intermediate number, wherein the intermediate number is in octal system, and the remainder of the intermediate number and the total number of key pairs in the key pair library is calculated, and the key pair with the key pair serial number in the key pair library equal to the remainder is used as the encryption key and decryption key of the data to be encrypted, wherein the serial number of the key pair is determined by the solidification order of the key pair in the solid state drive, and the earlier the serial number is solidified, the smaller the serial number. Through the above technical solution, different data types are stored in the same sector with different encryption keys, and the same data type is stored in different sectors with different encryption keys, thereby increasing the security of the data.
[0046] Step S22: Divide the data to be encrypted into N data groups, wherein the data length of the first data group is S, S+K is less than or equal to the remaining space of the sector where the initial storage position is located, and is the maximum data amount of the data group that can be stored in the sector where the initial storage position is located, the data length of the i-th data group is MK, i is greater than or equal to 2 and less than N, M is the data capacity of the sector, K is the data length of the relevant data corresponding to the data group, and the length of the N-th data group is the amount of remaining data after removing the first N-1 data groups from the data to be encrypted;
[0047] Step S23: Encrypt each of the data groups using the encryption key and encryption algorithm to generate the first encrypted data corresponding to each of the data groups.
[0048] Specifically, when the initial storage position of the storage position of the data to be encrypted is a new sector, that is, the starting position of a sector, the data to be encrypted is divided into N data groups. Since the minimum encryption unit of the solid-state hard disk is a sector, that is, in order to ensure the security of the data, each sector can have at most one encryption method. Therefore, when the data to be encrypted is at least larger than the capacity of a sector, when dividing the data groups, the first data group needs to be divided according to the remaining space of the written sector, and the data group is divided according to the sector starting from the second data group. The last data group is the last remaining data. Since the encryption algorithm of the data group adopts a symmetric encryption algorithm, the data The data length of the N-1 data groups is consistent with the data length of the first encrypted data corresponding to the encryption, and the number of the first N-1 data groups is an integer multiple of the minimum encryption unit of the encryption algorithm. For example, the minimum encryption unit is 32 bytes. When the N-th data group is not the minimum encryption unit, supplementary data is added to the N-th data group so that the data length of the N-th data group is an integer multiple of the minimum encryption unit. Each of the data groups is encrypted by the encryption key and the encryption algorithm to obtain the first encrypted data corresponding to each of the data groups. Through the technical solution, the first encrypted data corresponding to each of the data groups can be obtained, thereby improving the security of the data.
[0049] Furthermore, the data length of the first encrypted data is equal to the data length of the data group corresponding to the first encrypted data.
[0050] Specifically, since the encryption algorithm adopts a symmetric encryption algorithm and makes the data length of the data group before and after encryption consistent, the data length of the encrypted data group can be obtained before encryption, which is convenient for allocating storage space for storing the first encrypted data after the encryption of the data group.
[0051] Further, the step S3 includes: performing a logical operation on the decryption key corresponding to the encryption key, the logical operation being an exclusive OR operation, to obtain the logical decryption key, using the logical decryption key, the data length of the data group, the data length of the data to be encrypted and the verification data of the data group as the ancillary data of the data group, adding preset separators between two adjacent items in the ancillary data, and using the ancillary data with the preset separator added as the related data of the data group, wherein the related data and the data group are stored in the same sector, and the related data is stored in front of the corresponding data group.
[0052] Specifically, a logical operation is performed on the decryption key corresponding to the encryption key, wherein the logical operation is an XOR operation, and the data length of the data group, the data length of the data to be encrypted, the check data of the data group and the logical decryption key are used as the subsidiary data of the data group, wherein the first encrypted data and the subsidiary data corresponding to the data group are stored in the sector in binary format, therefore, the decryption key is also first converted into binary and then XORed, the XOR object of each bit of the decryption key is 1, and the subsidiary data are separated by a preset separator, for example: Related data format: @@array data length@@##data length to be encrypted The verification data of the data group is %%&&logical decryption key&&. Through the above technical solution, when reading the content of the sector where the data group is located, all the data of the data group is obtained through the data length of the data group, and whether to continue reading the data of the next sector is determined by the data length of the data to be encrypted and the total length of the data group that has been read out. The decryption key can be decrypted by performing an XOR operation on the logical decryption key again, which reduces the workload of managing the decryption key. At the same time, even if a security attack is suffered, it is not known which one is the decryption key, let alone whether the decryption key has undergone a logical operation, thereby improving the security of the data and reducing the workload of key management.
[0053] Furthermore, the step S5 comprises:
[0054] Step S51: according to the initial reading position of the data to be decrypted, the target sector where the initial reading position is located is obtained, all the data in the target sector is read out, and all the data is used as the second encrypted data;
[0055] Step S52: identifying the length of the data group, the data length of the data to be decrypted, and the logical decryption key corresponding to the first encrypted data based on the initial reading position and the preset separator in the relevant data;
[0056] Step S53: Obtain the first encrypted data from the second encrypted data based on the data length of the first encrypted data, perform a logical operation on the logical decryption key again to obtain the decryption key, decrypt the first encrypted data using the decryption key and the decryption algorithm, and obtain the data group corresponding to the first encrypted data.
[0057] Specifically, the above-mentioned initial reading position of the above-mentioned data to be decrypted is obtained through the position management unit, and the second encrypted data of the target sector is read according to the above-mentioned initial reading position. Since the above-mentioned target sector may include not only the above-mentioned data to be decrypted that is accessed, but also other data, therefore, the starting position of the above-mentioned data to be decrypted is obtained through the above-mentioned initial reading position, and the relevant data of the data group corresponding to the above-mentioned data to be decrypted is obtained from the starting position, and the data length of the data group is read from the above-mentioned relevant data, and the first encrypted data corresponding to the above-mentioned data group is read based on the data length of the above-mentioned data group, and the above-mentioned logical decryption key is obtained from the above-mentioned relevant data, and the above-mentioned logical decryption key is subjected to an XOR operation again to obtain the decryption key, and the above-mentioned first encrypted data is decrypted by the above-mentioned decryption key and the decryption algorithm to obtain the above-mentioned data group corresponding to the above-mentioned first encrypted data. Through the above-mentioned technical solution, since other data may be stored in the same sector and may be of different types, and their decryption passwords are also different, therefore, the above-mentioned data to be decrypted can be accurately decrypted from the above-mentioned solid-state hard disk without leaking other encrypted data in the same sector, thereby improving the security of the data.
[0058] Furthermore, the step S53 further includes a step S54:
[0059] Take the next sector of the target sector as the new target sector, and repeat steps S51-S53 to read and decrypt the other data groups in the new target sector according to the method that the first encrypted data corresponds to the data group, add the data length of each decrypted data group to calculate the data length sum, and end when the data length sum is equal to the length of the data to be decrypted.
[0060] Specifically, through the above technical solution, the above data to be decrypted can be decrypted to obtain corresponding decrypted data, which not only reduces the management workload of encryption keys, but also improves data security.
[0061] Furthermore, step S5 is followed by step S6: calculating the verification result of each data group decrypted from the data to be decrypted, and comparing the verification result with the verification data in the related data corresponding to the data group; when the verification result and the verification data of each data group are consistent, splicing each data group in the reading order to obtain the complete decrypted data; when the verification result and the verification data of at least one data group are inconsistent, repeating step S5 to re-read the first encrypted data corresponding to at least one data group, and decrypting it again.
[0062] Specifically, by comparing the verification result of each of the above data groups with the verification data, it can be determined whether the decrypted data group is correct. When the two are consistent, the decryption of the data group is correct. Each of the above data groups can be spliced in the reading order to obtain the decrypted data of the data to be decrypted. When the verification result of at least one data group in the above data groups is inconsistent with the verification data, it is necessary to re-read the first encrypted data and related data corresponding to the above data group and re-decrypt the above data group. Through the above technical solution, it can be verified whether the decrypted data group is correct, which not only ensures the security of the data, but also improves the correctness of the decrypted data.
[0063] Furthermore, it is characterized in that the encryption algorithm and the decryption algorithm are symmetric key encryption algorithms of the Advanced Encryption Standard.
[0064] Furthermore, each of the sectors may store multiple types of encrypted data.
[0065] Specifically, since different types of encrypted data have corresponding encryption keys different in the same sector, when one type of encrypted data is read, the keys of other types of data will not be leaked, thereby improving data security.
[0066] In summary, the present invention receives the data to be encrypted through a receiving unit, and obtains the data length and type of the data to be encrypted, allocates a storage location for the data to be encrypted according to the data length of the data to be encrypted and the remaining space of the solid state hard disk, uses the serial number of the sector where the initial storage location of the data storage location to be encrypted is located as the upper four bits of the intermediate number, and uses the type number of the data to be encrypted as the lower four bits of the intermediate number, wherein the intermediate number is in octal, and calculates the remainder of the intermediate number and the total number of key pairs in the key pair library, and uses the key pair with the key pair serial number in the key pair library equal to the remainder as the encryption key and decryption key of the data to be encrypted, so that different data types are stored in the same sector with different encryption keys, and the same data type is stored in different sectors with different encryption keys, thereby increasing the security of the data, and by The encryption key is subjected to a logical operation, wherein the logical operation is an XOR operation, and the data length of the data group, the data length of the data to be encrypted, the verification data of the data group and the logical decryption key are used as the auxiliary data of the data group. When reading the content of the sector where the data group is located, all the data of the data group is obtained through the data length of the data group, and whether to continue reading the data of the next sector is determined by the data length of the data to be encrypted and the total length of the read data group, and the decryption key can be decrypted by performing an XOR operation on the logical decryption key again, thereby reducing the workload of managing the decryption key. At the same time, even if a security attack occurs, it is not known which one is the decryption key, let alone whether the decryption key has undergone a logical operation. Through the mutual cooperation of the above technical solutions, not only the security of the data is improved, but also the workload of key management is reduced.
[0067] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0068] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0069] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An encryption control method for manufacturing a solid state hard disk, wherein the solid state hard disk comprises a plurality of sectors, characterized in that: The method comprises the following steps: Step S1: first fix the key pair library into the solid state drive, receive the data to be encrypted through the receiving unit, and obtain the data length and type of the data to be encrypted, and allocate a storage location for the data to be encrypted according to the data length of the data to be encrypted and the remaining space of the solid state drive; Step S2: the key generation unit generates an encryption key based on the storage location, the type of the data to be encrypted and the key pair library, divides the data to be encrypted into multiple data groups, and encrypts the data groups using the encryption key and encryption algorithm to generate first encrypted data; Step S3: performing a logical operation on the decryption key corresponding to the encryption key to obtain a logical decryption key, generating related data of the first encrypted data based on the data length of the data group, the data length of the data to be encrypted, the check data of the data group and the logical decryption key, and saving the first encrypted data and the corresponding related data in the same sector of the storage location; Step S4: using the encrypted data to be encrypted as data to be decrypted, setting access rights for the data to be decrypted, and generating an access password; after the user inputs the access password, according to the user's operation command, when the operation command is decryption, obtaining the initial reading position of the data to be decrypted through the position management unit; Step S5: reading the data to be decrypted and the related data corresponding to the data to be decrypted based on the initial reading position, obtaining a decryption key through the related data, decrypting the data to be decrypted based on the decryption key, and obtaining decrypted data.
2. The method according to claim 1, characterized in that The step S1 comprises: The key pair library includes multiple encryption key and decryption key pairs. The data types that can be stored in the solid state drive include text, audio, image, video and program. The type of the data to be encrypted is one of the data types.
3. The method according to claim 1, characterized in that The step S2 comprises the following steps: Step S21: sorting the sectors of the solid state hard disk according to the size of the storage address, and obtaining the sorting of each sector, and also numbering the data types that can be stored in the solid state hard disk, and obtaining the number of the data type to be encrypted, setting an intermediate number, using the number of the data type to be encrypted as the lower four bits of the intermediate number, and using the serial number of the sector where the initial storage position of the storage position is located as the upper four bits of the intermediate number, calculating the remainder of the intermediate number and the total number of key pairs in the key pair library, and using the key pair in the key pair library with the same serial number as the remainder as the encryption key and decryption key of the data to be encrypted; Step S22: Divide the data to be encrypted into N data groups, wherein the data length of the first data group is S, S+K is less than or equal to the remaining space of the sector where the initial storage position is located, and is the maximum data amount of the data group that can be stored in the sector where the initial storage position is located, the data length of the i-th data group is MK, i is greater than or equal to 2 and less than N, M is the data capacity of the sector, K is the data length of the relevant data corresponding to the data group, and the length of the N-th data group is the amount of remaining data after removing the first N-1 data groups from the data to be encrypted; Step S23: Encrypt each of the data groups using the encryption key and encryption algorithm to generate the first encrypted data corresponding to each of the data groups.
4. The method according to claim 3, characterized in that The data length of the first encrypted data is equal to the data length of the data group corresponding to the first encrypted data.
5. The method according to claim 1, characterized in that The step S3 includes: performing a logical operation on the decryption key corresponding to the encryption key, wherein the logical operation is an exclusive OR operation, to obtain the logical decryption key, and using the logical decryption key, the data length of the data group, the data length of the data to be encrypted, and the verification data of the data group as the ancillary data of the data group, adding preset separators between two adjacent items in the ancillary data, and using the ancillary data with the preset separators added as the related data of the data group, wherein the related data and the data group are stored in the same sector, and the related data is stored in front of the corresponding data group.
6. The method according to claim 1, characterized in that The step S5 comprises: Step S51: according to the initial reading position of the data to be decrypted, the target sector where the initial reading position is located is obtained, all the data in the target sector is read out, and all the data is used as the second encrypted data; Step S52: identifying the length of the data group, the data length of the data to be decrypted, and the logical decryption key corresponding to the first encrypted data based on the initial reading position and the preset delimiter in the relevant data; Step S53: Obtain the first encrypted data from the second encrypted data based on the data length of the first encrypted data, perform a logical operation on the logical decryption key again to obtain the decryption key, decrypt the first encrypted data using the decryption key and the decryption algorithm, and obtain the data group corresponding to the first encrypted data.
7. The method according to claim 6, characterized in that The step S53 further includes a step S54: Take the next sector of the target sector as the new target sector, and repeat steps S51-S53 to read and decrypt the other data groups in the new target sector according to the method that the first encrypted data corresponds to the data group, add the data length of each decrypted data group to calculate the data length sum, and end when the data length sum is equal to the length of the data to be decrypted.
8. The method according to claim 1, characterized in that The step S5 also includes a step S6: calculating the verification result of each data group decrypted from the data to be decrypted, and comparing the verification result with the verification data in the related data corresponding to the data group; when the verification result and the verification data of each data group are consistent, splicing each data group in the reading order to obtain the complete decrypted data; when the verification result and the verification data of at least one data group are inconsistent, repeating the step S5 to re-read the first encrypted data corresponding to at least one data group, and decrypting it again.
9. The method according to claim 1, characterized in that: The encryption algorithm and decryption algorithm are symmetric key encryption algorithms of the Advanced Encryption Standard.
10. The method according to claim 1, characterized in that Multiple types of encrypted data can be stored in each of the sectors.
Citation Information
Patent Citations
Hard disk data protection method and device, equipment and storage medium
CN118152306A
Storage device having encryption
US11644983B2
Hard drive data write / read method and device
CN102930224A
Encrypted data reading method and device for solid state disk and readable storage medium
CN117892319A
Information recording medium, method and apparatus for recording and regenerating information using said medium
CN1300068A
Cited By
Construction method, device, storage device and electronic device for storing data in hard disk
CN119781698A
Method and apparatus for constructing a hard disk to store data, storage device, and electronic device
CN119781698B
Solid state disk main control chip security key generation system
CN120030612A
