Quick Encryption Method, Device, Equipment and Product for System Partition Data

By reducing and encrypting the system initrd startup stage and expanding the system in full startup stage, the problem of not being able to encrypt and protect the installed system data in the existing technology is solved, and the rapid encryption of system data is achieved to ensure the security of the data and not affect user operations.

CN120068129BActive Publication Date: 2025-08-01KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510564516.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-01
Estimated Expiration
2045-04-30

AI Technical Summary

Technical Problem

The existing technology can only encrypt and protect the system data during the system installation stage, and cannot effectively encrypt and protect the installed system data.

Method used

During the system initrd startup stage, the file system and physical partitions are reduced, and the reduced data is encrypted. During the system full startup stage, the decrypted data is expanded, and the LUKS data block-by-block encryption method or LUKS formatted migration data encryption method is used for encryption.

Benefits of technology

It realizes encryption protection of the data after the system is installed, improves the data encryption speed, and does not affect the user's data operation space requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068129B_ABST
    Figure CN120068129B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and product for quickly encrypting system partition data, including reducing the capacity of the file system and reducing the capacity of the physical partition during the system initrd startup phase, so that the set capacity of the physical partition is equal to the first used capacity; encrypting the data in the reduced-capacity physical partition; during the complete startup phase of the system, expanding the physical partition corresponding to the decrypted data so that the set capacity of the physical partition is equal to the first set capacity, and expanding the file system of the decrypted data. The present invention discloses a method, device, equipment and product for quickly encrypting system partition data, which can also implement encryption protection for the data after the system is installed, and through the capacity reduction processing in the system initrd startup phase and the capacity expansion processing in the complete startup phase of the system, effectively improve the data encryption speed while not affecting the later user's demand for the data usage operation space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of system data encryption, and particularly relates to a method, device, equipment and product for quickly encrypting system partition data. Background Art

[0002] With the continuous development of information technology, people have higher and higher requirements for data security, especially the growing demand for the security protection of system data. In a computer system, system data usually stores the operating system and important application software. If this data is leaked or tampered with, it will pose a serious security threat to the computer system.

[0003] Under the existing technical conditions, for the encryption protection of system data, usually at the system installation stage, the disk that needs to store system data is first formatted at the block device level such as LUKS, and then the system data to be encrypted is stored on this encrypted disk device, thus completing the encryption protection of system data. This commonly used encryption protection method can only complete the encryption protection of system data at the system installation stage, and for the system data that has been installed, effective data encryption protection cannot be carried out anymore. Summary of the Invention

[0004] In view of this, the present invention aims to overcome the defects in the prior art and proposes a method, device, equipment and product for quickly encrypting system partition data.

[0005] In a first aspect, the present invention discloses a method for quickly encrypting system partition data, including:

[0006] At the system initrd startup stage:

[0007] Obtain the first set capacity and the first used capacity of the physical partitions in the system;

[0008] Shrink the file system and shrink the physical partitions so that the set capacity of the physical partitions is equal to the first used capacity;

[0009] Encrypt the data in the shrunk physical partitions;

[0010] At the system full startup stage:

[0011] Expand the physical partitions corresponding to the decrypted data so that the set capacity of the physical partitions is equal to the first set capacity, and expand the file system of the decrypted data.

[0012] In an embodiment of the present invention, encrypting the data in the shrunk physical partitions includes:

[0013] If the ratio of the total used capacity to the total set capacity in the system partition is greater than the set threshold, then the LUKS data block-by-block encryption method is used for encryption;

[0014] If the ratio of the total used capacity to the total set capacity in the system partition is less than or equal to the set threshold, then the LUKS formatted migration data encryption method is used for encryption.

[0015] In an embodiment of the present invention, the method further includes: if the system uses the Logical Volume Manager (LVM) for partitioning, then before reducing the capacity of the physical partition so that the set capacity of the physical partition is equal to the first used capacity, it further includes; obtaining the second set capacity and the second used capacity of the logical volume, and reducing the capacity of the logical volume so that the set capacity of the logical volume is equal to the second used capacity;

[0016] If the system uses the Logical Volume Manager (LVM) for partitioning, then after expanding the physical partition corresponding to the decrypted data so that the set capacity of the physical partition is equal to the first set capacity, it further includes: expanding the logical volume so that the set capacity of the logical volume is equal to the second set capacity.

[0017] In an embodiment of the present invention, using the LUKS data block-by-block encryption method for encryption includes: creating a temporary space in the metadata area of the LUKS header, and storing in the temporary space the position of the data block currently being encrypted, for resuming the encryption of subsequent data blocks after an abnormal interruption during the encryption process.

[0018] In an embodiment of the present invention, using the LUKS formatted migration data encryption method for encryption includes: establishing a configuration table, and storing in the configuration table the position of the data block currently being encrypted, for resuming the encryption of subsequent data blocks after an abnormal interruption during the encryption process.

[0019] In an embodiment of the present invention, after encrypting the data in the reduced-capacity physical partition, it includes: updating the encryption configuration file, for decrypting the encrypted data after the system is fully started.

[0020] In a second aspect, the present invention discloses a fast encryption device for system partition data, and the device includes:

[0021] An initrd startup module, used in the system initrd startup stage: obtaining the first set capacity and the first used capacity of the physical partition in the system; reducing the capacity of the file system and reducing the capacity of the physical partition so that the set capacity of the physical partition is equal to the first used capacity; encrypting the data in the reduced-capacity physical partition;

[0022] A system full startup module, used in the system full startup stage: expand the physical partition corresponding to the decrypted data, so that the set capacity of the physical partition is equal to the first set capacity, and expand the file system of the decrypted data.

[0023] In a third aspect, the present invention discloses an electronic device, including: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the above method.

[0024] In a fourth aspect, the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0025] In a fifth aspect, the present invention discloses a computer program product, including a computer program, and when the computer program is executed by a processor, the above method is implemented.

[0026] To achieve the above object, the technical solution of the present invention is implemented as follows:

[0027] The present invention discloses a method, device, equipment and product for quickly encrypting system partition data, including, in the system initrd startup stage, reducing the capacity of the file system and reducing the capacity of the physical partition, so that the set capacity of the physical partition is equal to the first used capacity; encrypting the data in the reduced-capacity physical partition; in the system full startup stage, expanding the physical partition corresponding to the decrypted data, so that the set capacity of the physical partition is equal to the first set capacity, and expanding the file system of the decrypted data. The present invention discloses a method, device, equipment and product for quickly encrypting system partition data, which can also implement encryption protection for the data after system installation, and through the capacity reduction processing in the system initrd startup stage and the capacity expansion processing in the system full startup stage, effectively improve the data encryption speed while not affecting the later user's need for data usage operation space. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0029] In the drawings:

[0030] Figure 1 is a schematic diagram of an application scenario of a method for quickly encrypting system partition data according to an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of a method for quickly encrypting system partition data according to an embodiment of the present invention;

[0032] Figure 3 Schematic diagram of the overall logical structure of a fast encryption method for system partition data in an embodiment of the present invention;

[0033] Figure 4 Schematic diagram of the capacity reduction of a fast encryption method for system partition data in an embodiment of the present invention;

[0034] Figure 5 Schematic diagram of the capacity expansion of a fast encryption method for system partition data in an embodiment of the present invention;

[0035] Figure 6 Schematic diagram of the per-block encryption method of LUKS data for a fast encryption method for system partition data in an embodiment of the present invention;

[0036] Figure 7 Schematic diagram of the encryption method for LUKS formatted migrated data for a fast encryption method for system partition data in an embodiment of the present invention;

[0037] Figure 8 Schematic diagram of a fast encryption device for system partition data in an embodiment of the present invention;

[0038] Figure 9 Schematic diagram of an electronic device for fast encryption of system partition data in an embodiment of the present invention. Detailed implementation manners

[0039] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0040] In the description of the present invention, it should be further noted that the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise stated, the meaning of "a plurality of" is two or more.

[0041] The application scenarios of a fast encryption method, device, equipment and product for system partition data disclosed by the present invention are as Figure 1As shown, under the existing technical conditions, the commonly used encryption protection method can only complete the encryption protection of system data during the system installation stage. For the system data that has been installed, effective data encryption protection cannot be carried out anymore. A fast encryption method, device, equipment and product for system partition data disclosed by the present invention can also achieve encryption protection for the data after system installation, and through the capacity reduction processing in the system initrd startup stage and the capacity expansion processing in the system full startup stage, while effectively improving the data encryption speed, it does not affect the later user's demand for data operation space.

[0042] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0043] In an embodiment disclosed by the present invention, as Figure 2 and Figure 3 shown, a fast encryption method for system partition data includes:

[0044] Step S201, in the system initrd startup stage:

[0045] Obtain the first set capacity and the first used capacity of the physical partitions in the system;

[0046] Reduce the capacity of the file system and reduce the capacity of the physical partitions, so that the set capacity of the physical partitions is equal to the first used capacity;

[0047] Encrypt the data in the physical partitions after capacity reduction;

[0048] Step S202, in the system full startup stage:

[0049] Expand the physical partitions corresponding to the decrypted data, so that the set capacity of the physical partitions is equal to the first set capacity, and expand the file system of the decrypted data.

[0050] In this embodiment, the capacity reduction and expansion operations can be achieved by using the existing capacity reduction and expansion commands in the prior art.

[0051] Exemplarily, the capacity reduction operation mainly can include: cleaning up the garbage data of the file system, reducing the block data in the super block, releasing the inode free blocks, and updating the file system metadata, etc.

[0052] In this embodiment, during the system initrd startup phase, the data is encrypted and its volume is reduced; during the system full startup phase, decryption and volume expansion are performed to ensure that the later user's need for data usage operation space is not affected. This embodiment can perform block device-level fast encryption on the physical partition where the system data is located while retaining the system data, avoiding attacks and data tampering. The volume reduction process can effectively improve the efficiency of later data encryption, and the volume expansion operation can ensure that the later user's need for data usage operation space is not affected.

[0053] Based on the previous embodiment, in another embodiment of the present invention, encrypting the data in the physical partition after volume reduction includes:

[0054] If the ratio of the total used capacity to the total set capacity in the system partition is greater than the set threshold, then use the LUKS data block-by-block encryption method for encryption;

[0055] In this embodiment, by way of example, the set threshold is 0.3, that is, 30%.

[0056] As Figure 6 shown, the LUKS data block-by-block encryption method encrypts each data block of the system data in the system partition and replaces the encrypted data block after encryption back to the original data block. This encryption method is only performed on the existing disk device and has no obvious requirements for the free space of the existing disk device, nor does it require an additional storage device medium.

[0057] In this embodiment, using the LUKS data block-by-block encryption method for encryption includes: creating a temporary space in the metadata area of the LUKS header, and storing in the temporary space the position of the data block currently being encrypted, which is used to resume the encryption of subsequent data blocks after the encryption process is abnormally interrupted.

[0058] If the ratio of the total used capacity to the total set capacity in the system partition is less than or equal to the set threshold, then use the LUKS formatted migration data encryption method for encryption.

[0059] In this embodiment, by way of example, the set threshold is 0.3, that is, 30%.

[0060] As Figure 7As shown in the figure, in this embodiment, the process of using the LUKS formatting migration data encryption method is as follows: First, since the physical partition has been shrunk in advance, corresponding free storage space appears in the system partition. A LUKS partition is created in the free storage space, and the system data to be encrypted is copied to the mapped device decrypted and mapped by the newly created LUKS partition, and further synchronized to the newly created LUKS partition through the dm-crypt module to achieve encrypted storage of the system data. Finally, the original system data is deleted, and the encrypted data in the newly created LUKS partition is retained to achieve encryption of the original system data. This encryption method can achieve a relatively high data encryption speed and is performed on existing disk devices without the need to provide additional storage device media.

[0061] In this embodiment, a configuration table is established, and the position of the currently encrypted data block is stored in the configuration table for use in resuming the encryption of subsequent data blocks after an abnormal interruption during the encryption process.

[0062] Based on the previous embodiment, in another embodiment of the present invention, as Figure 4 shown, the method further includes: If the system uses the Logical Volume Manager (LVM) for partitioning, before shrinking the physical partition so that the set capacity of the physical partition is equal to the first used capacity, it further includes: obtaining the second set capacity and the second used capacity of the logical volume, and shrinking the logical volume so that the set capacity of the logical volume is equal to the second used capacity;

[0063] In this embodiment, the method further includes: Before shrinking the physical partition, if there are multiple logical volumes on the physical partition, move the physical segment position of the logical volume on the physical partition to cover the free physical segment between the two logical volumes on the physical partition, making the logical volumes more compact, so as to be able to shrink the capacity of the physical partition as much as possible later without losing the original system data.

[0064] As Figure 5 shown, if the system uses the Logical Volume Manager (LVM) for partitioning, after expanding the physical partition corresponding to the decrypted data so that the set capacity of the physical partition is equal to the first set capacity, it further includes: expanding the logical volume so that the set capacity of the logical volume is equal to the second set capacity.

[0065] In one implementation of the present invention, after encrypting the data in the shrunk physical partition, it includes: updating the encryption configuration file for decrypting the encrypted data after the system is fully started.

[0066] In one embodiment of the present invention, exemplarily, the system partitions to be encrypted are the ROOT root partition and the DATA data partition, and the process is as follows:

[0067] The system uses the Logical Volume Manager (LVM) for partitioning. The ROOT root partition and the DATA data partition both exist in the form of logical volumes. Exemplarily, the total set capacity of the two logical volumes is 100 GB. The set capacity of the ROOT logical volume is 70 GB, and the used capacity is 60 GB. The set capacity of the DATA logical volume is 30 GB, and the used capacity is 20 GB. Then, (60 GB + 20 GB) / 100 GB is greater than the set threshold, so the LUKS data block-by-block encryption method is used for encryption;

[0068] During the system initrd startup phase:

[0069] When shrinking the volume, first shrink the file systems on each physical partition, and then shrink the corresponding logical volumes. Shrink the ROOT logical volume to 60 GB and the DATA logical volume to 20 GB. Then move the logical volumes to make them more compact, and then try to shrink the corresponding physical partitions as much as possible.

[0070] Use the LUKS data block-by-block encryption method to encrypt the data after volume shrinking;

[0071] During the system full startup phase:

[0072] When expanding the volume, first expand the total capacity of the physical partition storing the LUKS-formatted encrypted data to 100 GB, remap the device. At this time, the total capacity of the mapped device is updated synchronously to 100 GB. After updating the physical partition on the mapped device, expand the capacity of the ROOT logical volume back to 70 GB and the capacity of the DATA logical volume back to 30 GB. Finally, expand and restore the file systems on each logical volume to complete all restorative volume expansion.

[0073] In another embodiment of the present invention, exemplarily, the system partitions to be encrypted are the ROOT root partition and the DATA data partition. The process is as follows:

[0074] When the system does not use the Logical Volume Manager (LVM) for partitioning, the ROOT root partition and the DATA data partition both exist in the form of physical partitions. For example, the set capacity of the ROOT physical partition is 150 GB, and the used capacity is 40 GB; the set capacity of the DATA physical partition is 50 GB, and the used capacity is 10 GB. Then, (40 GB + 10 GB) / 200 GB is less than the set threshold, so the LUKS formatting and migrating data encryption mode is used for encryption;

[0075] During the system initrd startup phase:

[0076] When shrinking the volume, first shrink the file systems on each physical partition, then shrink the ROOT physical partition to 40 GB and the DATA physical partition to 10 GB, and then perform LUKS formatting and migrating data encryption;

[0077] Encrypt the data after downsizing using the LUKS formatted migration data encryption mode method;

[0078] During the system's full startup phase:

[0079] During expansion, expand and restore two physical partitions storing LUKS-formatted encrypted data to 150GB and 50GB respectively, remap the devices. At this time, the capacities of the mapped devices are synchronously updated to 150GB and 50GB. Finally, expand and restore the file systems on the mapped devices to complete all restorative expansions.

[0080] As Figure 8 shown, the present invention also discloses a fast encryption device for system partition data, including:

[0081] The initrd startup module 601 is used to, during the system's initrd startup phase: obtain the first set capacity and the first used capacity of the physical partitions in the system; downsize the file system and downsize the physical partitions so that the set capacity of the physical partitions is equal to the first used capacity; encrypt the data in the downsized physical partitions;

[0082] The system full startup module 602 is used to, during the system's full startup phase: expand the physical partitions corresponding to the decrypted data so that the set capacity of the physical partitions is equal to the first set capacity, and expand the file systems of the decrypted data.

[0083] The present invention also discloses an electronic device. As Figure 9 shown, a block diagram of an embodiment of an electronic device applicable to the fast encryption of the above system partition data is disclosed.

[0084] The electronic device 90 in this embodiment includes a processor 901, which can perform various appropriate actions and processes according to the program stored in the ROM 902 or the program loaded from the storage section 9 to the RAM 903. The processor 901 can include, for example, a general microprocessor, an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor, etc. The processor 901 can also include on-board memory for caching purposes. The processor 901 can include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiments of the present invention.

[0085] In the RAM 903, various programs and data required for the operation of the electronic device 90 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present invention by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs can also be stored in one or more memories other than the ROM 902 and the RAM 903, and the processor 901 can also perform various operations of the method flow according to the embodiments of the present invention by executing the programs stored in one or more memories.

[0086] According to an embodiment of the present invention, the electronic device 90 may further include an I / O interface 905, and the I / O interface 905 is also connected to the bus 904. The electronic device 90 may further include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube, a liquid crystal display, a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A driver 9010 is also connected to the I / O interface 905 as needed. A removable medium 9011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the driver 9010 as needed so that a computer program read from it can be installed into the storage section 908 as needed.

[0087] The present invention also provides a computer-readable storage medium.

[0088] The computer-readable storage medium may be included in the electronic device / device system described in the above embodiments; or it may exist separately without being assembled into the electronic device / device. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of the present invention is implemented.

[0089] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory RAM, a read-only memory ROM, an erasable programmable read-only memory EPROM or a flash memory, a portable compact disk read-only memory CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.

[0090] An embodiment of the present invention further includes a computer program product.

[0091] The computer program product includes a computer program which contains program codes for executing the method provided by the embodiments of the present invention. When the computer program product runs on an electronic device, the program codes are used to enable the electronic device to implement the method provided by the embodiments of the present invention.

[0092] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium. The program codes included in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0093] According to the embodiments of the present invention, the program codes for executing the computer program provided by the embodiments of the present invention can be written by any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages. The programming languages include but are not limited to, such as Java, C++, python, C language or similar programming languages. The program codes can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network or a wide area network, or can be connected to an external computing device.

[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions. Those skilled in the art can understand that the features recited in various embodiments and / or claims of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly recited in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features recited in various embodiments and / or claims of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0095] The embodiments of the present invention have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present invention is defined by the appended claims and their equivalents, and without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. A fast encryption method for system partition data, characterized in that Including: During the system initrd startup phase: Obtain the first set capacity and the first used capacity of the physical partitions in the system; Shrink the file system and shrink the physical partition so that the set capacity of the physical partition is equal to the first used capacity; Encrypt the data in the shrunk physical partition; During the system full startup phase: Expand the physical partition corresponding to the decrypted data so that the set capacity of the physical partition is equal to the first set capacity, and expand the file system of the decrypted data.

2. The fast encryption method for system partition data according to claim 1, characterized in that The encrypting the data in the shrunk physical partition includes: If the ratio of the total used capacity to the total set capacity in the system partition is greater than the set threshold, use the LUKS data block-by-block encryption method for encryption; If the ratio of the total used capacity to the total set capacity in the system partition is less than or equal to the set threshold, use the LUKS formatted migration data encryption method for encryption.

3. The fast encryption method for system partition data according to claim 1, wherein, The method further includes: If the system uses the Logical Volume Manager (LVM) for partitioning, before shrinking the physical partition so that the set capacity of the physical partition is equal to the first used capacity, it further includes: obtaining the second set capacity and the second used capacity of the logical volume, and shrinking the logical volume so that the set capacity of the logical volume is equal to the second used capacity; If the system uses the Logical Volume Manager (LVM) for partitioning, after expanding the physical partition corresponding to the decrypted data so that the set capacity of the physical partition is equal to the first set capacity, it further includes: expanding the logical volume so that the set capacity of the logical volume is equal to the second set capacity.

4. The fast encryption method for system partition data according to claim 2, characterized in that, The using the LUKS data block-by-block encryption method for encryption includes: creating a temporary space in the metadata area of the LUKS header, and storing the position of the currently encrypted data block in the temporary space for resuming the encryption of subsequent data blocks after an abnormal interruption during the encryption process.

5. A method for quickly encrypting system partition data according to claim 2, characterized in that, The using the LUKS formatted migration data encryption method for encryption includes: establishing a configuration table, and storing the position of the currently encrypted data block in the configuration table for resuming the encryption of subsequent data blocks after an abnormal interruption during the encryption process.

6. The fast encryption method for system partition data according to claim 1, wherein After encrypting the data in the shrunk physical partition, it includes: updating the encryption configuration file for decrypting the encrypted data after the system fully starts up.

7. A fast encryption device for system partition data, characterized in that: The device includes: An initrd startup module, used during the system initrd startup phase: to obtain the first set capacity and the first used capacity of the physical partitions in the system; to shrink the file system and shrink the physical partition so that the set capacity of the physical partition is equal to the first used capacity; to encrypt the data in the shrunk physical partition; A system full startup module, which is used in the system full startup stage: expand the physical partition corresponding to the decrypted data so that the set capacity of the physical partition is equal to the first set capacity, and expand the file system of the decrypted data.

8. An electronic device, characterized in that, It includes: One or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that , when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, , when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Encryption expansion method and device of block equipment and intelligent terminal

    CN107358131A

  • Method, device and equipment for realizing secret key soft and hard switching and storage medium

    CN116208322A