User data recovery method, device, terminal and computer storage medium
By backing up key data and system version information in the terminal storage space, the problem of encryption key acquisition failure caused by system updates was solved, and user data decryption and recovery were realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2020-06-29
- Publication Date
- 2026-06-09
AI Technical Summary
Due to terminal system version updates or other factors, the encryption key for user data could not be obtained, resulting in the inability to decrypt user data and causing losses.
By backing up key data and system version information in the terminal storage space, if the current encryption key cannot be obtained, the system version at the time of backup is restored, and the encryption key is obtained and user data is decrypted using the backed-up key data.
In the absence of an encryption key, the key data was obtained by restoring a backup of the system version, thus enabling the decryption of user data and avoiding data loss due to system updates.
Smart Images

Figure CN113935045B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to, but are not limited to, the field of information security technology. Specifically, they relate to, but are not limited to, a user data recovery method, apparatus, terminal, and computer storage medium. Background Technology
[0002] Currently, user data on the terminal is encrypted by default. Users need to obtain the encryption key before using this data to decrypt it. For security reasons, the encryption key is not stored in plaintext; it is protected by encryption algorithms. Users need to obtain the encrypted key based on a pre-set password and the terminal's hardware and software parameters. However, sometimes system updates or other factors may prevent the encryption key from being obtained, making it impossible to decrypt the user data and causing data loss. Summary of the Invention
[0003] The user data recovery method, apparatus, terminal, and computer storage medium provided in this invention mainly solve the technical problem of being unable to obtain the encryption key of user data due to terminal system version updates or other factors.
[0004] To address the aforementioned technical problems, embodiments of the present invention provide a user data recovery method, comprising:
[0005] Obtain the terminal user data to be decrypted and the key data; based on the key data, obtain the encryption key for the terminal user data, wherein the key data includes an encryption factor and a key ciphertext.
[0006] If the encryption key for the end user data cannot be obtained, retrieve the key backup file previously backed up in the terminal storage space. The key backup file includes the terminal system version information and the corresponding key data at the time of backup.
[0007] The current terminal system version is restored to the terminal system version at the time of backup. Under the restored terminal system version, the encryption key of the terminal user data is obtained based on the corresponding key data, and then the terminal user data is decrypted based on the encryption key.
[0008] This invention also provides a user data recovery device, comprising:
[0009] The user data acquisition module is used to acquire terminal user data to be decrypted and key data, and based on the key data, to acquire the encryption key of the terminal user data. The key data includes encryption factors and key ciphertext.
[0010] The key backup acquisition module is used to retrieve the key backup file previously backed up in the terminal storage space if the encryption key of the terminal user data cannot be obtained. The key backup file includes the terminal system version information and the corresponding key data at the time of backup.
[0011] The user data recovery module is used to restore the current terminal system version to the terminal system version at the time of backup. Under the restored terminal system version, the encryption key of the terminal user data is obtained based on the corresponding key data, and then the terminal user data is decrypted based on the encryption key.
[0012] This invention also provides a terminal, which includes a processor, a memory, and a communication bus;
[0013] The communication bus is used to enable communication between the processor and the memory;
[0014] The processor is used to execute one or more computer programs stored in the memory to implement the steps of the user data recovery method described above.
[0015] This invention also provides a computer storage medium that stores one or more programs that can be executed by one or more processors to implement the steps of the user data recovery method described above.
[0016] According to the user data recovery method, apparatus, terminal, and computer storage medium provided in the embodiments of the present invention, when the encryption key of the terminal user data cannot be obtained, the encryption key of the terminal user data is obtained by retrieving the key backup file previously backed up in the terminal storage space, restoring the current terminal system version to the terminal system version at the time of backup, and then using the key data in the key backup file to obtain the encryption key of the terminal user data. The terminal user data is then decrypted based on the encryption key. In some implementations, this avoids the problem of not being able to obtain the encryption key of the user data due to terminal system version updates or other factors.
[0017] Other features and corresponding beneficial effects of the present invention will be described in the latter part of the specification, and it should be understood that at least some of the beneficial effects will become obvious from the description in the specification. Attached Figure Description
[0018] Figure 1 This is a flowchart of a user data recovery method according to Embodiment 1 of the present invention;
[0019] Figure 2 This is a schematic diagram of the backup file list according to an embodiment of the present invention;
[0020] Figure 3This is a flowchart of the decryption encryption key method according to an embodiment of the present invention;
[0021] Figure 4 This is a flowchart of another user data recovery method according to Embodiment 1 of the present invention;
[0022] Figure 5 This is a structural block diagram of a user data recovery device according to Embodiment 2 of the present invention;
[0023] Figure 6 This is a structural block diagram of another user data recovery device according to Embodiment 2 of the present invention;
[0024] Figure 7 This is a structural block diagram of a terminal according to Embodiment 3 of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the embodiments of this invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0026] Example 1:
[0027] To address the issue of being unable to obtain the encryption key for user data due to terminal system version updates or other factors, this invention provides a user data recovery method applicable to Android-based smart mobile terminals, such as smartphones and tablets.
[0028] Please see Figure 1 , Figure 1 This is a flowchart of a user data recovery method according to one embodiment, which includes steps S101 to S103, and is described in detail below:
[0029] Step S101: Obtain the terminal user data to be decrypted and the key data. Based on the key data, obtain the encryption key for the terminal user data. The key data includes the encryption factor and the key ciphertext.
[0030] Step S102: If the encryption key for the terminal user data cannot be obtained, retrieve the key backup file previously backed up in the terminal storage space. The key backup file includes the terminal system version information and the corresponding key data at the time of backup.
[0031] Step S103: Restore the current terminal system version to the terminal system version at the time of backup. Under the restored terminal system version, obtain the encryption key of the terminal user data based on the corresponding key data, and then decrypt the terminal user data based on the encryption key.
[0032] In one embodiment, the terminal storage space includes a backup file list, in which key backup files are stored sequentially from top to bottom according to the backup order, such as... Figure 2 As shown, each layer of the backup file list stores a key backup file corresponding to a terminal system version. Each key backup file includes the terminal system version information and key data at the time of backup. The key data consists of an encryption factor and a key ciphertext. Different terminal system versions correspond to different encryption factors and key ciphertexts, forming a one-to-one correspondence between the terminal system version information, encryption factor, and key ciphertext in the key backup file. In this embodiment, the terminal system version information includes at least the system version number.
[0033] In one embodiment, step S102, retrieving the key backup file previously backed up in the terminal storage space, includes: sequentially retrieving the stored key backup files in the backup file list in a bottom-up order until the terminal system version in the retrieved key backup file can obtain the encryption key for the terminal user data based on the corresponding key data. In this backup list, the key backup files at the top level correspond to key data backed up from earlier system versions, while those at the bottom level correspond to key data backed up from more recent system versions. Therefore, if the encryption key for the end-user data cannot be obtained, the system first retrieves the key backup file at the bottom of the backup file list. It then parses the system version information and corresponding key data from this file, restores the current terminal system version to the version corresponding to the retrieved key backup file, and obtains the encryption key based on the corresponding key data. If the encryption key can be obtained, the end-user data is decrypted using it. If the encryption key still cannot be obtained, the system then retrieves the key backup file at the level above the bottom of the backup file list, obtains the encryption key based on the system version information and corresponding key data from that file, and so on, until the encryption key can be obtained based on the key data. In this embodiment, any existing method for restoring a recoverable system version can be used to restore the terminal system version. After the user data is decrypted and restored, the terminal system version can be restored to the current version.
[0034] In this embodiment, the key data corresponds to the terminal system version. The key data in step S101 is the key data corresponding to the current terminal system version, and the key data in steps S102 and S103 is the key data corresponding to the terminal system version at the time of backup.
[0035] In this embodiment, an existing symmetric encryption algorithm, such as the symmetric AES encryption algorithm, is used to encrypt the end-user data. In this symmetric encryption algorithm, the encryption key used to encrypt the end-user data and the encryption key used to decrypt the end-user data are the same. That is, the same encryption key is used for both encryption and decryption. Therefore, for security reasons, the encryption key cannot be stored in plaintext and must also be encrypted. When a user needs to decrypt user data, they must first decrypt to obtain the encryption key before they can decrypt the user data. Please refer to [reference needed]. Figure 3 , Figure 3 This is a flowchart illustrating a method for decrypting an encryption key. The encryption factor and the key ciphertext together can decrypt the encrypted key. In other words, obtaining the encryption key requires first obtaining the encryption factor and key ciphertext. The encryption factor is a combination of the user's preset password and relevant terminal software and hardware parameters. The terminal software parameters include at least system version information, and the terminal hardware parameters include at least the terminal memory number. If the user's preset password or terminal software and hardware parameters change, the encryption factor will also change, and consequently, the key ciphertext will also change. However, regardless of how the encryption factor and key ciphertext change, as long as they match, the required encryption key can be uniquely decrypted. However, in some cases, due to uncontrollable factors causing update failures during terminal system version updates, or external malicious means damaging the encryption factor or key ciphertext, users cannot obtain the encryption key using the encryption factor and key ciphertext, thus preventing the decryption of user data.
[0036] Therefore, this embodiment of the invention backs up the encryption factors and key ciphertext for each system version of the terminal. When the above-mentioned situation occurs where the encryption key cannot be obtained through the encryption factors and key ciphertext, the encryption factors and key ciphertext corresponding to the previously backed-up system version are retrieved, and the current terminal system version is restored to the system version at the time of the backup. Under the restored system version, the encryption key is obtained based on the encryption factors and key ciphertext of the corresponding system version, thereby decrypting the terminal user data and restoring the user data.
[0037] To find out how to back up the key backup file corresponding to each updated terminal system version to the terminal storage space, please refer to [link to relevant documentation]. Figure 4 It also includes steps S104 and S105, which are explained in detail below:
[0038] Step S104: Monitor whether the terminal system version has been updated. This embodiment obtains the terminal system version information through periodic polling. This version information includes at least a version number. The system version is checked by comparing each obtained version number with the previously obtained version number. If the version number is different, the terminal system version has been updated; otherwise, the terminal system version has not been updated. In one implementation, data backup software installed on the terminal can monitor the system data storage area where the terminal system version information is stored and perform subsequent operations.
[0039] Step S105: If the terminal system version is updated, obtain the encryption factor and key ciphertext of the user data after the terminal system version update to obtain the updated key data; associate the updated terminal system version information with the key data to obtain the updated key backup file of the terminal system version, and back up the updated key backup file of the terminal system version to the terminal storage space.
[0040] In one embodiment, the key backup files are stored sequentially from top to bottom in a backup file list, according to the order of backup. For example... Figure 2 As shown, each layer in the backup file list stores a key backup file corresponding to a terminal system version. The key backup file includes the version information of the terminal system version at the time of backup and key data. The key data consists of encryption factors and key ciphertext. Different terminal system versions correspond to different encryption factors and key ciphertexts. In the key backup file, the version information of the terminal system version, encryption factors, and key ciphertext form a one-to-one correspondence. For example, version 1 -> encryption factor 1 -> key ciphertext 1 is the encryption factor 1 and key ciphertext 1 corresponding to the version number 1 of the terminal system version.
[0041] In one embodiment, step S105, which involves backing up the updated key backup file to the terminal storage space, includes: determining whether the number of key backup files stored in the backup file list exceeds a preset threshold; if it does, deleting the topmost key backup file in the backup file list, moving the remaining key backup files upwards sequentially, and storing the updated key backup file at the bottom of the backup file list; otherwise, directly storing the updated key backup file at the top of all empty layers in the backup file list. In this embodiment, the backup file list is optimally 3-5 layers, meaning it can store a maximum of 3-5 key backup files; therefore, the preset threshold in this embodiment is optimally 2 to 4 layers. When storing key backup files to the backup file list, if the number of key backup files in the list does not exceed the preset threshold, indicating that there are still free spaces in the list, the key backup files can be stored directly at the top of the free layer. For example, if the backup file list is empty, the key backup files are stored at the top. Or, if the backup file list contains only one key backup file, the newly backed-up key backup file is stored at the second layer from the top. If the number of key backup files in the backup file list exceeds the preset threshold, indicating that the list is full, the top-level key backup files need to be deleted, and the remaining key backup files are moved up sequentially. This will free up the bottom layer of the backup file list, where the newly backed-up key backup file is stored.
[0042] It should be noted that the terminal storage space in this embodiment can be a space in the terminal's own internal memory, or it can be a cloud backup space pre-set by the user.
[0043] This invention monitors whether the terminal system version is updated, associates the encryption factor and key ciphertext corresponding to the updated terminal system version with the updated version information, and backs up the associated updated system version information, encryption factor, and key ciphertext to the terminal storage space. This ensures that each system version of the terminal has a corresponding backup of key data, so that the backup key data and the corresponding system version information can be quickly retrieved when the user data is restored later.
[0044] Example 2:
[0045] Please refer to Figure 5 , Figure 5 This is a structural block diagram of a user data recovery device according to one embodiment, which includes a user data acquisition module 101, a key backup acquisition module 102, and a user data recovery module 103.
[0046] The user data acquisition module 101 is used to acquire the terminal user data to be decrypted and key data. Based on the key data, it acquires the encryption key for the terminal user data. The key data includes an encryption factor and a key ciphertext. This embodiment uses the existing symmetric AES encryption algorithm to encrypt and decrypt the terminal user data.
[0047] The key backup acquisition module 102 is used to retrieve a previously backed-up key backup file stored in the terminal storage space if the encryption key for the terminal user data cannot be obtained. The key backup file includes the terminal system version information at the time of backup and the corresponding key data, which is used to obtain the encryption key for the terminal user data. In one embodiment, the terminal storage space includes a backup file list, in which key backup files are stored sequentially from top to bottom according to the backup order.
[0048] The key backup acquisition module 102 retrieves previously backed-up key backup files stored in the terminal storage space by sequentially retrieving stored key backup files from the backup file list in ascending order, until the encryption key for the terminal user data can be obtained based on the corresponding key data under the terminal system version in the retrieved key backup file. Specifically, the key backup files at the top of the backup list correspond to key data backed up for an earlier system version, while those at the bottom correspond to key data backed up for a system version closer to the current system version. In this embodiment of the invention, any existing method for restoring a recoverable system version can be used to restore the terminal system version.
[0049] The user data recovery module 103 is used to restore the current terminal system version to the terminal system version at the time of backup. Under the restored terminal system version, the encryption key of the terminal user data is obtained based on the corresponding key data, and then the terminal user data is decrypted based on the encryption key.
[0050] Please refer to Figure 6 This embodiment also includes a version update monitoring module 104 and a key file backup module 105, which are used to complete the backup operation of the key backup file.
[0051] The version update monitoring module 104 is used to monitor whether the terminal system version has been updated.
[0052] The key file backup module 105 is used to obtain the encryption factor and key ciphertext of the user data after the terminal system version is updated, and obtain the updated key data if the terminal system version is updated; associate the updated terminal system version information with the key data to obtain the key backup file after the terminal system version is updated, and back up the key backup file after the terminal system version is updated to the terminal storage space.
[0053] In one embodiment, key backup files are stored sequentially from top to bottom in the backup file list according to the backup order. In the key backup files, the terminal system version information, encryption factor and key ciphertext form a one-to-one correspondence. The key backup files stored at the upper level in the backup file list correspond to the earlier terminal system version.
[0054] In one embodiment, the key file backup module 105 is used to back up the key backup file after the terminal system version update to the terminal storage space. This includes: the key file backup module 105 determining whether the number of key backup files stored in the backup file list is greater than a preset threshold. If it is greater than the preset threshold, the topmost key backup file in the backup file list is deleted, and the remaining key backup files are moved up sequentially, with the key backup file after the terminal system version update stored at the bottom of the backup file list; otherwise, the key backup file after the terminal system version update is directly stored at the top of all empty layers in the backup file list. In this embodiment, the backup file list is optimally 3-5 layers, meaning it can store a maximum of 3-5 key backup files. Therefore, the preset threshold in this embodiment is optimally 2 to 4 layers. It should be noted that the terminal storage space in this embodiment can be a space within the terminal's internal memory or a cloud backup space pre-set by the user. This embodiment monitors whether the terminal system version is updated, associates the encryption factor and key ciphertext corresponding to the updated terminal system version with the updated version information, and backs up the associated updated system version information, encryption factor, and key ciphertext to the terminal storage space. This ensures that each system version of the terminal has a corresponding backup of key data, so that the backup key data and the corresponding system version information can be quickly retrieved when the user data is restored later.
[0055] This invention backs up the encryption factors and key ciphertext for each system version of the terminal. When the encryption key cannot be obtained using the encryption factors and key ciphertext, the encryption factors and key ciphertext corresponding to the previously backed-up system version are retrieved, and the current terminal system version is restored to the system version at the time of the backup. Under the restored system version, the encryption key is obtained based on the encryption factors and key ciphertext of the corresponding system version, thereby decrypting the terminal user data and restoring the user data.
[0056] Example 4:
[0057] This embodiment also provides a terminal, see [link to example]. Figure 7 As shown, it includes a processor 201, a memory 202, and a communication bus 203, wherein:
[0058] Communication bus 203 is used to realize the connection and communication between processor 201 and memory 202;
[0059] The processor 201 is used to execute one or more computer programs stored in the memory 202 to implement at least one step in the user data recovery method of the above embodiment 1.
[0060] This embodiment also provides a computer-readable storage medium, which includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other memory technologies, CD-ROM (Compact Disc Read-Only Memory), DVD or other optical disc storage, magnetic cartridges, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible by a computer.
[0061] The computer-readable storage medium in this embodiment can be used to store one or more computer programs, which can be executed by a processor to implement at least one step of the user data recovery method in Embodiment 1 above.
[0062] Therefore, those skilled in the art should understand that all or some of the steps, systems, and apparatuses disclosed above, as well as the functional modules / units, can be implemented as software (which can be implemented using computer program code executable by a computing device), firmware, hardware, and suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as integrated circuits, such as application-specific integrated circuits (ASICs).
[0063] Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, computer program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. Therefore, this invention is not limited to any particular combination of hardware and software.
[0064] The above description, in conjunction with specific implementation methods, provides a further detailed explanation of the embodiments of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for recovering user data, characterized in that, include: Obtain the terminal user data to be decrypted and the key data; based on the key data, obtain the encryption key for the terminal user data, wherein the key data includes an encryption factor and a key ciphertext. If the encryption key for the end user data cannot be obtained, retrieve the key backup file previously backed up in the terminal storage space. The key backup file includes the terminal system version information and the corresponding key data at the time of backup. The current terminal system version is restored to the terminal system version at the time of backup. Under the restored terminal system version, the encryption key of the terminal user data is obtained based on the corresponding key data, and then the terminal user data is decrypted based on the encryption key.
2. The user data recovery method as described in claim 1, characterized in that, Also includes: Monitor whether the terminal system version has been updated; If the terminal system version is updated, obtain the encryption factor and key ciphertext of the user data after the terminal system version update, and obtain the updated key data; The updated terminal system version information is associated with the key data to obtain the updated key backup file, which is then backed up to the terminal storage space.
3. The user data recovery method as described in claim 2, characterized in that, The terminal storage space includes a list of backup files, and the key backup files are stored in the backup file list from top to bottom in the order of backup.
4. The user data recovery method as described in claim 3, characterized in that, The step of backing up the key backup file after the terminal system version update to the terminal storage space includes: Determine whether the number of key backup files stored in the backup file list is greater than a preset threshold. If it is greater than the preset threshold, delete the top key backup file in the backup file list, move the remaining key backup files up in sequence, and store the key backup file after the terminal system version update at the bottom of the backup file list; otherwise, directly store the key backup file after the terminal system version update at the top of all empty layers in the backup file list.
5. The user data recovery method as described in claim 3, characterized in that, The key backup file previously backed up in the terminal storage space includes: The stored key backup files are retrieved sequentially from bottom to top in the backup file list until the encryption key for the terminal user data can be obtained based on the corresponding key data under the terminal system version in the retrieved key backup file.
6. A user data recovery device, characterized in that, include: The user data acquisition module is used to acquire terminal user data to be decrypted and key data, and based on the key data, to acquire the encryption key of the terminal user data. The key data includes encryption factors and key ciphertext. The key backup acquisition module is used to retrieve the key backup file previously backed up in the terminal storage space if the encryption key of the terminal user data cannot be obtained. The key backup file includes the terminal system version information and the corresponding key data at the time of backup. The user data recovery module is used to restore the current terminal system version to the terminal system version at the time of backup. Under the restored terminal system version, the encryption key of the terminal user data is obtained based on the corresponding key data, and then the terminal user data is decrypted based on the encryption key.
7. The user data recovery device as described in claim 6, characterized in that, Also includes: The version update monitoring module is used to monitor whether the terminal system version has been updated; The key file backup module is used to obtain the encryption factor and key ciphertext of user data after the terminal system version is updated, and obtain the updated key data if the terminal system version is updated; associate the updated terminal system version information with the key data to obtain the updated key backup file, and back up the updated key backup file to the terminal storage space.
8. The user data recovery device as described in claim 7, characterized in that, The terminal storage space includes a list of backup files, and the key backup files are stored in the backup file list from top to bottom in the order of backup.
9. The user data recovery device as described in claim 8, characterized in that, The key file backup module is also used to determine whether the number of key backup files stored in the backup file list is greater than a preset threshold. If it is greater than the preset threshold, the top key backup file in the backup file list is deleted, the remaining key backup files are moved up in sequence, and the key backup file after the terminal system version is updated is stored at the bottom of the backup file list. Otherwise, store the updated key backup file of the terminal system version directly at the top of all free layers in the backup file list.
10. The user data recovery device as described in claim 8, characterized in that, The key backup acquisition module is also used to retrieve the stored key backup files in the backup file list in order from bottom to top, until the encryption key for the terminal user data can be obtained based on the corresponding key data under the terminal system version in the retrieved key backup file.
11. A terminal, characterized in that, The terminal includes a processor, a memory, and a communication bus; The communication bus is used to enable communication between the processor and the memory; The processor is used to execute one or more computer programs stored in the memory to implement the steps of the user data recovery method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium The system stores one or more computer programs, which can be executed by one or more processors to implement the steps of the user data recovery method as described in any one of claims 1 to 5.