Information management method and apparatus, and electronic device
By storing the key-related information in the playback protection memory block RPMB and calling the RPMB erase function, the physical erasure problem of full disk overwriting is difficult to achieve when electronic devices are lost or stolen, and the rapid and secure deletion of user data is achieved. , reducing the risk of data breaches.
Patent Information
- Application Number
- PCT/CN2024/096147
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-30
- Filing Date
- 2024-05-29
- Publication Date
- 2024-12-05
AI Technical Summary
In the prior art, when electronic devices are lost or stolen, the success rate of physical erasing of flash memory through remote control is relatively small. It is limited by factors such as time, power and equipment control, resulting in a higher risk of user data leakage. high.
Store the key-related information in the playback protection memory block RPMB, and when receiving the instruction to delete user data, the RPMB erase function is called for physical erasing to achieve rapid and secure deletion of user data.
By storing the key-related information in the RPMB, it can quickly physically erase when needed, reducing the possibility of user data leakage, and improving the success rate of safe deletion of user data when electronic devices are lost or stolen.
Smart Images

Figure CN2024096147_05122024_PF_FP_ABST
Abstract
Description
Information management method, device and electronic equipment
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on May 30, 2023, with application number 202310619851.3 and title “Information Management Method, Device and Electronic Device,” the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application belongs to the field of communication technology, and specifically relates to an information management method, device and electronic equipment. Background Art
[0004] Nowadays, people often use mobile electronic devices such as mobile phones to handle daily affairs. Therefore, electronic devices usually store a large amount of user-related information and data. When an electronic device is lost or stolen, the user information and data on it also poses a great risk of leakage. In the existing technology, a full disk overwrite method is often used, forcing the internal controller of the flash memory to immediately invoke the physical erase mechanism to completely delete user data to prevent user privacy leakage. For example, for a 128GB flash memory, the entire flash memory can be overwritten by writing approximately 128GB of random numbers to achieve the purpose of physical erasure. However, this physical erase method has strict requirements on time, power consumption, and whether interruptions are allowed during the operation. For example, completely overwriting a 128GB flash memory takes at least 10 minutes, and the device must be connected to a power source, and no interruptions are allowed during the full disk overwrite. Therefore, when it is necessary to delete user data on electronic devices such as mobile phones, it is easily limited by factors such as time, power consumption, and uncontrolled devices, resulting in a low success rate for achieving a physical erase of the flash memory through remote control.
[0005] Summary of the Invention
[0006] The purpose of the embodiments of the present application is to provide an information management method, device and electronic device, which can solve the problem in the prior art that when user data on an electronic device needs to be deleted, the success rate of physical erasure by completely overwriting is low.
[0007] In a first aspect, an embodiment of the present application provides an information management method, including:
[0008] Storing the key-related information in a replay-protected memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter being used to encrypt the composite key, and the first ciphertext being the ciphertext obtained by encrypting the composite key;
[0009] In the case of receiving an instruction for deleting user data, calling the RPMB erase function to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
[0010] In a second aspect, an embodiment of the present application provides an information management device, including:
[0011] a storage module, configured to store key-related information in a replay-protected memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter being used to encrypt a synthetic key, and the first ciphertext being a ciphertext obtained by encrypting the synthetic key;
[0012] An erasure module is used to call the RPMB erasure function upon receiving an instruction to delete user data, and to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
[0013] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the information management method described in the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the information management method described in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the information management method as described in the first aspect.
[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the information management method as described in the first aspect.
[0017] In a seventh aspect, an embodiment of the present application provides an electronic device, which is configured to execute the method described in the first aspect.
[0018] In an embodiment of the present application, key-related information is stored in a replay protection memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter is used to encrypt a synthetic key, and the first ciphertext is a ciphertext obtained by encrypting the synthetic key; when an instruction for instructing to delete user data is received, the RPMB erase function is called to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data. In this way, by changing the key-related information related to user data to be stored in the RPMB, when it is necessary to delete user data on an electronic device, it is possible to control the call of the RPMB erase function to quickly physically erase the key-related information stored in the RPMB, thereby achieving the purpose of quickly and securely deleting user data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] FIG1 is a schematic diagram of an existing CE key protection method;
[0020] FIG2 is a schematic diagram of the functional framework of obtaining a CE key in the prior art;
[0021] FIG3 is a flow chart of an information management method provided in an embodiment of the present application;
[0022] FIG4 is a schematic diagram of an improved CE key protection method provided in an embodiment of the present application;
[0023] FIG5 is a schematic diagram of a functional framework for obtaining a CE key according to an improved embodiment of the present application;
[0024] FIG6 is a second schematic diagram of the improved functional framework for obtaining a CE key provided in an embodiment of the present application;
[0025] FIG7 is a schematic diagram of the structure of an information management device provided in an embodiment of the present application;
[0026] FIG8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0027] FIG9 is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. Specific embodiments
[0028] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0029] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0030] To make the embodiments of the present application clearer, the following first introduces the relevant background technology knowledge involved in the embodiments of the present application:
[0031] Android 7.0 and higher support file-based encryption (FBE), which can generate a key for each file, that is, generate a per-file key, and then use the key to encrypt and decrypt the specified file to achieve the purpose of file protection.
[0032] The unique key for each file, or per-file key, is ultimately derived from the user's credential encrypted (CE) key through multiple layers of transformation. Therefore, to ensure data security on the terminal, the security of the CE key must be ensured first. In the prior art, the protection method for the CE key is shown in Figure 1 and is as follows:
[0033] 1. When the terminal is powered on for the first time, perform the following operations:
[0034] 1) The key management (Keymaster) trusted application (TA) of the terminal's Trusted Execution Environment (TEE) automatically generates the Disk Encrypted (DE) key and CE key;
[0035] 2) When the lock screen password is not set, the Keymaster TA generates keymaster_key_blob, encrypts the CE key, obtains the CE key ciphertext EN_blob, and stores the ciphertext in the user data area (UDA) of the flash memory.
[0036] 2. When setting a lock screen password for the first time, perform the following operations:
[0037] 1) Obtain user credentials entered by the user, i.e., Personal Identification Number (PIN) / Password / Pattern;
[0038] 2) Encrypt and protect the CE key as follows:
[0039] The application framework in the mobile device's Rich Execution Environment (REE) calls the main central processing unit (CPU) to generate two random numbers, P0 and P1, and derives the synthetic key (Synthetic Password) through a hash function.
[0040] REE sends the synthetic key, CE key ciphertext EN_blob, keymaster_key_blob, etc. to TEE;
[0041] The Keymaster TA in the TEE uses the keymaster_key_blob to decrypt the CE key ciphertext EN_blob to obtain the plaintext CE key. It then re-encrypts the CE key with the synthesized key to obtain the CE key ciphertext EN_sp and deletes the keymaster_key_blob.
[0042] Store the CE key ciphertext EN_sp in the user data area UDA of the flash memory;
[0043] 3) The synthetic key is encrypted and protected as follows:
[0044] First, the synthetic key is encrypted for the first time, including the following operations:
[0045] The application framework in the REE calls the main CPU to generate a random number, namely secdis. The gatekeeper module in the REE generates a password token (PasswordToken) based on the user credentials entered by the user through the Key Derivation Function (KDF). The gatekeeperd in the REE sends a message to the gatekeeper TA in the TEE, which contains the PasswordToken, secdis, and user identifier (UID).
[0046] After receiving the message, the gatekeeper TA in the TEE generates a secure identifier (SID), which is a 64-bit random number used to identify the user credential type; it derives key 1 (key1) through a hash function based on PasswordToken and secdis; the Keymaster TA in the TEE uses key1 to encrypt the composite key for the first time, obtaining the composite key ciphertext EN_key1, which is spblob_key1.
[0047] The synthesized key is then encrypted a second time, including the following operations:
[0048] The TEE obtains the Hardware Unique Key (HUK); generates other parameters 1 and 2, which include random numbers and device information; the Keymaster TA derives the Keymaster's root key KM based on the HUK and other parameters 1 using the key generation function KDF; the Keymaster TA derives the security key (secretKey), namely key 2 (key2), based on the KM, the security identifier SID, and other parameters 2 using the key generation function KDF. The security identifier SID and other parameters 2 are stored in the user data area UDA of the flash memory through the keystore; the Keymaster uses key2 to encrypt the composite key a second time to obtain the ciphertext EN_key2 of EN_key1 / spblob_key1, namely spblob; the security identifier SID and spblob are stored in the user data area UDA of the flash memory.
[0049] 3. When verifying the lock screen password, install the CE key into the kernel keyring, as shown in Figure 2, and perform the following operations:
[0050] 1) Obtain the input user credentials (i.e. PIN / Password / Pattern);
[0051] 2) gatekeeperd in REE generates a PasswordToken based on the user credentials entered by the user;
[0052] 3) Gatekeeperd in REE sends PasswordToken to gatekeeper TA in TEE. Gatekeeper TA verifies PasswordToken. After successful verification, gatekeeper TA generates an authentication token (AuthToken) and returns AuthToken to gatekeeperd in REE.
[0053] 4) gatekeeperd in REE sends the token AuthToken and security identifier SID to the keystore;
[0054] 5) Keystore obtains the composite key ciphertext spblob and CE key ciphertext EN_sp from the flash user data area UDA according to the SID;
[0055] 6) Keystore sends the AuthToken, security identifier SID, synthetic key ciphertext spblob and CE key ciphertext EN_sp to the Keymaster TA in the TEE;
[0056] 7) The Keymaster TA verifies the AuthToken. After successful verification, it performs the following operations:
[0057] The keymaster TA obtains the hardware unique key HUK, other parameters 1, other parameters 2, and security identifier SID. The keymaster TA derives the keymaster root key KM based on the HUK and other parameters 1 through the key derivation function KDF. The keymaster TA derives the secretKey, i.e., key2*, based on the KM, security identifier SID, and other parameters 2 through the key derivation function KDF.
[0058] 8) The Keymaster TA uses the key key2* to decrypt the synthesized key ciphertext spblob (i.e., EN_key2) to obtain spblob*;
[0059] 9) Keymaster TA derives key key1* based on PasswordToken;
[0060] 10) Keymaster TA uses key key1* to decrypt spblob* to obtain the composite key;
[0061] 11) The Keymaster TA uses the synthesized key to decrypt the CE key ciphertext EN_sp to obtain the CE key;
[0062] 12) The Keymaster TA uses a temporary key (TK) (TEE regenerates a TK each time the device is powered on) to encrypt the CE key, obtaining the CE key ciphertext EN_tk, and then installs the CE key ciphertext EN_tk into the Kernel keyring. Alternatively, the Keymaster TA directly installs the plaintext CE key into the Kernel keyring. In this case, the CE key is at risk of being leaked.
[0063] 4. When reading or writing a file, the hardware encryption engine (Inline Crypto Engine, ICE) encrypts and decrypts the file based on the file key, performing the following operations:
[0064] 1) As shown in Figure 2, when a disk read or write (Block IO) actually occurs, a series of callback functions are used to find the key information stored in the file system index node (inode), such as the CE key ciphertext EN_tk and file information, before the read or write operation is initiated. This key information is then sent to the Keymaster TA.
[0065] 2) The Keymaster TA decrypts the CE key ciphertext EN_tk using the temporary key TK and derives the file key based on the file information. The Keymaster TA then sets the plaintext file key to the ICE hardware register via the functional modules in Figure 2, including the Universal Flash Storage (UFS), UFS driver, ICE driver, Per-File-Encryption (PFE) driver, and Keymaster key management.
[0066] 3) After the file key is set to the ICE hardware register, the storage controller will initiate the actual read and write operations, and the file content data can be correctly decrypted or encrypted based on the file key.
[0067] 5. When changing the lock screen password, the CE key remains unchanged and the synthetic key is not regenerated. Instead, the synthetic key is re-encrypted using the key generated by the new lock screen password. Perform the following operations:
[0068] 1) Decrypt the original user credentials to obtain the synthesized key plaintext:
[0069] First, decrypt the synthetic key ciphertext spblob for the first time through the following operations:
[0070] Obtain the hardware unique key HUK, other parameters 1, other parameters 2, and security identifier SID; the keymaster TA derives the keymaster root key KM based on the HUK and other parameters 1 using the key derivation function KDF; the keymaster TA derives the secretKey, i.e., key2*, based on the KM, security identifier SID, and other parameters 2 using the key derivation function KDF; and uses the key key2* to decrypt the composite key ciphertext spblob (i.e., ciphertext EN_key2) to obtain spblob*.
[0071] Then decrypt the synthetic key ciphertext spblob for the second time through the following operations:
[0072] PasswordToken_o is generated based on the original user credentials through the key generation function KDF; gatekeeperd in the REE sends a message to the gatekeeper TA in the TEE, which contains PasswordToken_o, secdis, user identifier UID, etc.; gatekeeper TA derives the key key1_o based on PasswordToken_o and secdis through a hash function; the key key1_o is used to decrypt spblob* to obtain the plaintext synthetic key.
[0073] 2) Re-encrypt the synthesized key based on the newly entered user credentials:
[0074] First, encrypt the synthesized key for the first time by doing the following:
[0075] In the REE, gatekeeperd generates PasswordToken_n using the key derivation function (KDF) based on the new user credentials entered by the user. Gatekeeperd in the REE sends a message containing PasswordToken_n, secdis, and the user ID (UID) to the gatekeeper TA in the TEE. The gatekeeper TA uses a hash function to derive the key key1_n based on PasswordToken_n and secdis. The composite key is encrypted using key1_n to obtain the composite key ciphertext EN_key1_n, which is spblob_key1_n.
[0076] Next, encrypt the synthesized key a second time by doing the following:
[0077] The keymaster uses the key key2* obtained in the previous step of "decrypting the synthetic key ciphertext spblob for the first time" to encrypt the synthetic key for the second time, obtaining the ciphertext EN_key2*, which is spblob_n.
[0078] As can be seen, in the prior art, the ciphertext of the CE key and the ciphertext of the synthetic key used to encrypt the CE key are both stored in the UDA of the flash memory. If the electronic device is stolen or lost, the user's important information may be leaked. Because the security strength of 4-digit or 6-digit PIN / Password / Pattern and fingerprint is limited, an attacker can obtain the CE key and then obtain user information by brute force cracking the PIN / Password / Pattern or fingerprint, resulting in user information leakage.
[0079] Currently, electronic devices all use flash memory to store user data. A characteristic of flash memory is that when writing data, the storage space must be erased before writing the data, a process known as off-site updating. This means that the updated data is written to a free memory page, rather than the memory page where the original data resides. Therefore, overwriting the data (except for a full disk overwrite) does not invalidate the original data. Instead, the original data persists for a period of time until the flash memory controller physically erases it using a related algorithm, rendering the original data inaccessible.
[0080] Because flash memory is updated remotely, it's unlikely that remote control can physically delete the CE key ciphertext and / or synthetic key ciphertext to prevent user data leakage if the electronic device is stolen or lost. This is because the CE key ciphertext and synthetic key ciphertext are stored in the flash memory's UDA, and flash memory doesn't support physical erasure of specific data. Of course, a full disk overwrite is also possible. For example, for a 128GB flash memory, this can be achieved by writing approximately 128GB of random numbers to the entire flash memory, thereby achieving a physical erase. However, this physical erase method has strict requirements on time (for example, a full overwrite of a 128GB flash memory takes at least 10 minutes), device power (for example, the device must be connected to a power source), and whether interruptions are allowed during the operation (for example, interruptions are not allowed during a full disk overwrite). Therefore, when an electronic device is stolen or lost, the likelihood of successfully physically erasing the flash memory through remote control is low due to the small time window, limited device power, and lack of device control.
[0081] In order to increase the possibility of successful secure deletion of user data when an electronic device is stolen or lost, it is necessary to physically erase specified data such as CE key ciphertext and synthetic key ciphertext within a short period of time to prevent user data leakage.
[0082] Normally, UFS flash memory is divided into 4 partitions, and there are two main partitions related to this application, namely the user data area UDA and the replay protected memory block (RPMB). In order to extend the service life of UFS flash memory, the command for physical erasure of flash memory is limited to the flash memory controller's internal self-calling based on relevant algorithms such as wear leveling algorithm, and is not provided for external calls. However, starting with UFS 4.0 (released in December 2022), the RPMB partition of the flash memory can provide an RPMB erase (Purge) application programming interface (API) to the outside world, supporting external calls to the API to physically erase the data in the RPMB.
[0083] Currently, both the CE key ciphertext and the synthetic key ciphertext are stored in the UDA of the flash memory. However, the UDA does not provide a physical erase API. Therefore, you can consider storing the CE key ciphertext and the synthetic key ciphertext in the RPMB partition. When needed, you can call the RPMB Purge API to physically erase them, thereby achieving the purpose of securely deleting user data.
[0084] However, shifting the storage of CE key ciphertext and composite key ciphertext from the UDA partition to the RPMB partition requires significant changes to the existing system. Specifically, storing CE key ciphertext in the RPMB partition requires modifications to functional modules such as the keystore in the REE and the keymaster in the TEE, as well as modifications to messages between functional modules. Furthermore, the RPMB partition is relatively small, and the same user can have multiple CE keys, and different users can have different CE keys and composite keys. Therefore, their ciphertexts will occupy more space in the RPMB partition.
[0085] In order to reduce the implementation cost, it is necessary to be as compatible as possible with the original implementation method, that is, to achieve secure deletion of user data with minimal changes to the original implementation method. Therefore, the present application improves the key management of the file system by generating a new parameter, which is stored in the RPMB partition; the encryption key of the synthetic key is derived based on the newly generated parameter. When user data needs to be deleted in scenarios such as when an electronic device is lost or stolen, it is only necessary to remotely control the call to the RPMB Purge API to physically erase the newly generated parameter, making it impossible to decrypt the synthetic key, and then unable to decrypt the CE key, and ultimately unable to access the user data, reducing the possibility of user data leakage. Since only a newly generated parameter needs to be physically erased, the implementation efficiency is very high, which can fully meet the user's need to immediately and securely delete user data when the electronic device is lost or stolen. In addition, the present application also designs an optional solution to store the ciphertext of the synthetic key in the RPMB partition, and immediately and remotely and physically erase the ciphertext of the synthetic key when the electronic device is lost or stolen. However, if the same terminal has multiple user accounts, it is necessary to store the ciphertext of multiple synthetic keys, and when physically erasing, it is necessary to erase the ciphertext of all synthetic keys in the RPMB.
[0086] The information management method provided by the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0087] Please refer to FIG3 , which is a flow chart of an information management method provided in an embodiment of the present application. As shown in FIG3 , the method includes the following steps:
[0088] Step 301: Store key-related information in a replay protection memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter is used to encrypt a synthetic key, and the first ciphertext is a ciphertext obtained by encrypting the synthetic key.
[0089] In an embodiment of the present application, RPMB can be used to provide an RPMB Purge API to the outside world, supporting the function of externally calling the API to physically erase the data in RPMB, so as to achieve the purpose of safely and quickly deleting user data by physically erasing key-related information related to the user data when user data needs to be deleted in scenarios such as electronic equipment being stolen or lost.
[0090] To this end, the embodiments of the present application provide two solutions, one of which is to improve the key management of the file system, that is, by generating a new parameter, namely the first parameter, which can also be called the synthetic key protection factor, using the parameter to participate in the encryption process of the synthetic key, and then storing the parameter in the RPMB partition. When user data needs to be deleted in scenarios such as the loss or theft of an electronic device, the first parameter is remotely and physically erased so that the key for decrypting the synthetic key cannot be derived. The second is to store the ciphertext of the synthetic key, that is, the first ciphertext, in the RPMB partition, and immediately remotely and physically erase the ciphertext of the synthetic key when user data needs to be deleted in scenarios such as the loss or theft of an electronic device.
[0091] The key-related information is the first parameter, ie, the synthetic key protection factor, or the first ciphertext, ie, the synthetic key ciphertext.
[0092] When using the first parameter to participate in the encryption process of the synthetic key, that is, on the basis of the existing synthetic key encryption method (that is, the step of encrypting the synthetic key when setting the lock screen password for the first time as introduced above), a new parameter is introduced to participate in the encryption calculation of the synthetic key. After encryption, the parameter can be stored in RPMB, and the synthetic key ciphertext is stored in UDA according to the existing storage method.
[0093] Optionally, the first parameter is an M-bit random number, where M is a positive integer.
[0094] That is, the first parameter can be a random number generated by the TEE. To ensure higher security, the number of bits of this random number can be much larger than the 4 or 6-digit user credential, i.e., PIN / Password / Pattern. For example, a 256-bit random number is much more secure than a 4 or 6-digit user credential, i.e., PIN / Password / Pattern. This can completely resist brute force attacks in scenarios such as electronic device loss or theft.
[0095] When using the existing synthetic key encryption method, the synthetic key ciphertext obtained after encryption can be stored in the RPMB, that is, the storage method of the synthetic key ciphertext is changed from being stored in the UDA partition to being stored in the RPMB partition that supports physical erasure.
[0096] Step 302: Upon receiving an instruction to delete user data, call the RPMB erase function to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
[0097] When it is necessary to delete user data in an electronic device, for example, when the electronic device is lost or stolen, the key-related information in the RPMB can be immediately erased by sending relevant instructions, such as sending a remote control instruction instructing the deletion of user data. That is, the user can use other electronic devices to send instructions for instructing the deletion of user data to the stolen or lost electronic device, so that the electronic device can call the RPMB erasure function based on the instruction and immediately physically erase the key-related information stored in the RPMB.
[0098] When the key-related information is the first parameter, i.e., the synthetic key protection factor, in scenarios such as when the electronic device is lost or stolen, the first parameter in the RPMB partition can be physically erased immediately by calling the RPMB erase function based on the user data deletion instruction to achieve the purpose of secure deletion of user data.
[0099] When the key-related information is the first ciphertext, i.e., the synthetic key ciphertext, in scenarios such as when the electronic device is lost or stolen, the first ciphertext in the RPMB partition can be physically erased immediately by calling the RPMB erase function based on the user data deletion instruction to achieve the purpose of secure deletion of user data.
[0100] Optionally, the key-related information includes the first parameter;
[0101] Before step 301, the method further includes:
[0102] encrypting the synthetic key according to the first parameter;
[0103] The step 301 includes:
[0104] The first parameter is stored in the RPMB.
[0105] In one embodiment, the key-related information includes the first parameter, namely the synthetic key protection factor, that is, a scheme of generating a new parameter to participate in the encryption calculation of the synthetic key and storing the parameter in the RPMB can be adopted.
[0106] Furthermore, storing the first parameter in the RPMB includes:
[0107] The first parameter is associated with the key identifier of the synthetic key and stored in the RPMB.
[0108] That is, the first parameter and the key identifier associated with the synthetic key can be stored in the RPMB in association. The key identifier can be a security identifier SID that participates in the encryption of the synthetic key. The key identifier is used to identify the first parameter so that the corresponding first parameter can be retrieved based on the key identifier. In this way, when necessary, the specified first parameter can be erased based on the key identifier, achieving fine-grained physical erasure.
[0109] In this implementation, since the first parameter occupies less storage space than the synthetic key ciphertext, the use of this solution will not cause excessive occupation of RPMB storage space. By erasing this parameter, it can effectively prevent the decryption key of the synthetic key from being obtained by derivation, and thus the CE key cannot be decrypted, and ultimately the user data cannot be accessed, which greatly reduces the possibility of user data leakage.
[0110] Optionally, encrypting the synthetic key according to the first parameter includes any of the following:
[0111] Encrypting the synthesized key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a third key to obtain a third ciphertext, wherein the third key is determined according to a root key, and the root key is determined according to the first parameter;
[0112] Encrypting the synthesized key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a fourth key to obtain a fourth ciphertext, wherein the fourth key is determined according to the first parameter;
[0113] The synthetic key is encrypted according to the first key to obtain a second ciphertext; the second ciphertext is encrypted according to the first parameter and the second key to obtain a fifth ciphertext, wherein the first key and the second key are determined using different methods.
[0114] That is, the first parameter can be applied to three different methods to encrypt the synthetic key to protect the synthetic key. They are as follows:
[0115] Method 1: Add the first parameter, i.e., the composite key protection factor, to the calculation of the keymaster root key KM.
[0116] Method 2: Add the first parameter, i.e., the synthetic key protection factor, to the calculation of secretKey, i.e., key2;
[0117] Method 3: Add the first parameter, ie, the synthetic key protection factor, to the second encryption calculation of the synthetic key.
[0118] As shown in Method 1 in Figure 4, the first parameter, the synthetic key protection factor, is added to the calculation of the root key KM. That is, the Keymaster TA derives the root key KM using the key derivation function KDF based on the other parameters 1, HUK, and the first parameter. The Keymaster TA then derives the secretKey, key2, using the key derivation function KDF based on KM, the security identifier SID, and the other parameters 2. In the TEE, the Keymaster TA uses the first key, key1, to encrypt the synthetic key for the first time, obtaining the ciphertext EN_key1, also known as spblob_key1. The Keymaster TA then uses key2 to encrypt the synthetic key for the second time, encrypting the first encrypted ciphertext EN_key1 of the synthetic key to obtain the ciphertext EN_key2, also known as spblob. It should be noted that the corresponding step of decrypting the synthetic key ciphertext, spblob, using the first parameter is the same.
[0119] As shown in Method 2 in Figure 4, the first parameter, the synthetic key protection factor, is added to the calculation of secretKey (key2). Specifically, the Keymaster TA derives KM from the other parameter 1 and the HUK using the key derivation function KDF. The Keymaster TA then derives secretKey (key2) from KM, the security identifier SID, the other parameter 2, and the first parameter using the key derivation function KDF. In the TEE, the Keymaster TA uses the first key (key1) to encrypt the synthetic key for the first time, obtaining the ciphertext EN_key1 (spblob_key1). The Keymaster TA then uses key2 to encrypt the synthetic key for the second time, encrypting the first encrypted ciphertext EN_key1 of the synthetic key to obtain the ciphertext EN_key2 (spblob). Note that the corresponding step of decrypting the synthetic key ciphertext (spblob) using the first parameter corresponds to this.
[0120] As shown in Method 3 in Figure 4 , the first parameter, the synthetic key protection factor, is added to the second encryption calculation of the synthetic key. That is, the Keymaster TA derives KM from the other parameter 1 and the HUK using the key derivation function KDF. The Keymaster TA then derives secretKey, or key2, from KM, the security identifier SID, and the other parameter 2 using the key derivation function KDF. In the TEE, the Keymaster TA uses the first key, or key1, to perform a first encryption on the synthetic key, obtaining the ciphertext EN_key1, or spblob_key1. The Keymaster TA then uses key2 and the first parameter to perform a second encryption on the synthetic key, encrypting the first encrypted ciphertext EN_key1 to obtain the ciphertext EN_key2, or spblob. It should be noted that the corresponding step of decrypting the synthetic key ciphertext, or spblob, using the first parameter corresponds to this step.
[0121] In this way, this embodiment supports three different ways to apply the first parameter, namely the synthetic key protection factor, to the encryption calculation process of the synthetic key, all of which can achieve protection of the synthetic key.
[0122] Optionally, the key-related information includes a first ciphertext;
[0123] Before step 301, the method further includes:
[0124] encrypting the synthesized key using a first key to obtain a second ciphertext, and encrypting the second ciphertext using a second key to obtain the first ciphertext, wherein the first key and the second key are determined using different methods;
[0125] The step 301 includes:
[0126] The first ciphertext is stored in the RPMB.
[0127] In another embodiment, the key-related information includes a first ciphertext, namely, a synthetic key ciphertext. That is, the existing encryption method for the synthetic key can be used, that is, the Keymaster TA in the TEE uses the first key, namely key1, to encrypt the synthetic key for the first time to obtain the ciphertext EN_key1, namely spblob_key1, and then uses key2 to encrypt the synthetic key for the second time, that is, encrypting the first encrypted ciphertext EN_key1 of the synthetic key to obtain the ciphertext EN_key2, namely spblob. However, the storage method of the synthetic key ciphertext is changed, as shown in Figure 4, and the encrypted synthetic key ciphertext is stored in the RPMB.
[0128] Furthermore, storing the first ciphertext in the RPMB includes:
[0129] The first ciphertext is associated with the key identifier of the synthetic key and stored in the RPMB.
[0130] That is, the synthetic key ciphertext and the key identifier associated with the synthetic key can be stored in the RPMB in association. The key identifier can be a security identifier SID that participates in the encryption of the synthetic key. The key identifier is used to identify the synthetic key ciphertext so that the corresponding synthetic key ciphertext can be retrieved based on the key identifier. In this way, when necessary, the specified synthetic key ciphertext can be erased based on the key identifier, achieving fine-grained physical erasure.
[0131] In this way, there is no need to generate new parameters or change the synthetic key encryption method. You only need to store the synthetic key ciphertext in the RPMB. By erasing the synthetic key ciphertext, others cannot obtain the synthetic key ciphertext, and thus cannot obtain the synthetic key by decrypting the synthetic key ciphertext, and then cannot decrypt to obtain the CE key, and ultimately cannot access user data, greatly reducing the possibility of user data leakage.
[0132] Optionally, step 301 includes:
[0133] The key-related information is sent to the UFS driver through the key management trusted application, RPMB trusted application, RPMB kernel driver, REE file operation interface and RPMB monitoring module in sequence;
[0134] The UFS driver calls the RPMB storage function provided by the UFS controller to write the key-related information into the RPMB.
[0135] In one embodiment, in order to support the storage of the key-related information in the RPMB, it is necessary to improve the relevant modules, including adding communication functions and message processing functions between relevant modules.
[0136] Specifically, a corresponding key information management module needs to be added to the RPMB trusted application TA to support functions such as writing the key-related information in the RMPB; the message processing capability for the key-related information is added to functional modules such as the RPMB kernel driver (RPMB kernel driver), the REE file operation interface (REE file operation interface), and the RPMB listener module (RPMB listener) to support receiving, processing, and forwarding related messages such as writing the key-related information; and related messages are added between the key management trusted application (Keymaster TA), RPMB TA, RPMB kernel driver, REE file operation interface, RPMB listener and other modules to support functions such as writing the key-related information.
[0137] In addition, a communication function between the Keymaster TA and the RPMB TA needs to be added to support the Keymaster TA sending the key-related information to the RPMB TA.
[0138] In this way, when the key-related information needs to be stored in the RPMB, the key-related information can be sent to the key information management module in the RPMB TA through the Keymaster TA, and then the key information management module in the RPMB TA sends the key-related information to the RPMB kernel driver, and the RPMB kernel driver then sends the key-related information to the REE file operation interface, and the REE file operation interface continues to send the key-related information to the RPMB listener, and the RPMB listener further sends the key-related information to the UFS driver (UFSDriver), and finally the RPMB storage function provided by the UFS controller (UFS Controller) is called by the UFSDriver to write the key-related information into the RPMB.
[0139] Optionally, calling a replay protection memory block RPMB erasing function to physically erase the key-related information stored in the RPMB includes:
[0140] Send RPMB erase message to the universal flash storage UFS driver through the key management trusted application, RPMB trusted application, RPMB kernel driver, REE file operation interface and RPMB monitoring module in sequence;
[0141] The UFS driver calls the RPMB erase function provided by the UFS controller to physically erase the key-related information stored in the RPMB.
[0142] In one embodiment, in order to support calling the RPMB erase function to physically erase the key-related information in the RPMB, it is necessary to improve the relevant modules, including adding communication functions and message processing functions between relevant modules.
[0143] Specifically, a corresponding key information management module needs to be added to the RPMB trusted application TA to support functions such as writing and physically erasing the key-related information in the RMPB; message processing capabilities for the key-related information are added to functional modules such as the RPMB kernel driver, REE file operation interface, and RPMB listener to support receiving, processing, and forwarding messages related to physical erasure of the key-related information; and related messages are added between the Keymaster TA, RPMB TA, RPMB kernel driver, REE file operation interface, and RPMB listener to support functions such as physical erasure of the key-related information.
[0144] In addition, a communication function between the Keymaster TA and the RPMB TA needs to be added to support the Keymaster TA sending an erasure message of the key-related information to the RPMB TA.
[0145] It should be noted that in the embodiment of the present application, the physical erase function of the flash memory RPMB partition is supported in hardware, and the RPMB Purge API is provided externally in the firmware.
[0146] In this way, when it is necessary to erase the key-related information in the RPMB, an RPMB erasure message can be sent to the key information management module in the RPMB TA through the Keymaster TA, and then the key information management module in the RPMB TA sends the RPMB erasure message to the RPMB kernel driver, and the RPMB kernel driver then sends the RPMB erasure message to the REE file operation interface, and the REE file operation interface continues to send the RPMB erasure message to the RPMB listener, and the RPMB listener further sends the RPMB erasure message to the UFS driver (UFSDriver), and finally, the RPMB erasure function provided by the UFS controller (UFS Controller) is called through the UFSDriver, that is, the RPMB Purge API is accessed to physically erase the key-related information in the RPMB.
[0147] Optionally, after step 301 and before receiving an instruction for instructing to delete user data, the method further includes:
[0148] Send key read messages to the UFS driver through the key management trusted application, RPMB trusted application, RPMB kernel driver, REE file operation interface and RPMB monitoring module in sequence;
[0149] Calling the RPMB reading function provided by the UFS controller through the UFS driver to read the key-related information from the RPMB;
[0150] The key-related information is sent to the key management trusted application through the UFS driver, the RPMB monitoring module, the REE file operation interface, the RPMB kernel driver and the RPMB trusted application in sequence;
[0151] Determine the plaintext of the synthetic key according to the key-related information;
[0152] The user credential encryption key CE key is decrypted according to the plain text of the synthetic key.
[0153] In one embodiment, in order to support reading the key-related information in the RPMB to decrypt the synthetic key ciphertext, it is necessary to improve the relevant modules, including adding communication functions and message processing functions between relevant modules.
[0154] Specifically, a corresponding key information acquisition module needs to be added to the key management trusted application (Keymaster TA) to support the acquisition of the key-related information from the RPMB through the RPMB trusted application TA; a corresponding key information management module needs to be added to the RPMB trusted application TA to support functions such as reading the key-related information in the RMPB.
[0155] The message processing capability for the key-related information is added to functional modules such as the RPMB kernel driver, REE file operation interface, and RPMB listener to support the reception, processing, and forwarding of messages related to the reading of the key-related information; and related messages are added between the Keymaster TA, RPMB TA, RPMB kernel driver, REE file operation interface, and RPMB listener to support functions such as the reading of the key-related information.
[0156] In addition, a communication function between the Keymaster TA and the RPMB TA needs to be added to support the Keymaster TA to obtain the key-related information from the RPMB TA.
[0157] It should be noted that in the embodiment of the present application, the physical erase function of the flash memory RPMB partition is supported in hardware, and the RPMB Purge API is provided externally in the firmware.
[0158] In this way, when it is necessary to decrypt the relevant encrypted files in the electronic device, the key-related information in the RPMB can be read. Specifically, the key information acquisition module in the Keymaster TA can send a key reading message to the key information management module in the RPMB TA, and then the key information management module in the RPMB TA sends the key reading message to the RPMB kernel driver, and the RPMB kernel driver then sends the key reading message to the REE file operation interface, and the REE file operation interface continues to send the key reading message to the RPMB listener, and the RPMB listener further sends the key reading message to the UFS driver (UFSDriver), and finally the RPMB reading function provided by the UFS controller (UFS Controller) is called by the UFSDriver to read the key-related information from the RPMB.
[0159] The read key-related information is then passed by the UFS driver to the RPMB listener, the REE file operation interface, the RPMB kernel driver and the key information management module in the RPMB TA in sequence. Finally, the key information management module in the RPMB TA sends the key-related information to the key information acquisition module in the Keymaster TA.
[0160] When the key-related information is the first parameter, i.e., the synthetic key protection factor, the keystore in the REE obtains the synthetic key ciphertext, i.e., the second encrypted ciphertext of the synthetic key, from the UDA. The Keymaster TA decrypts the second encrypted ciphertext of the synthetic key using the first parameter, i.e., the synthetic key protection factor, to obtain the first encrypted ciphertext of the synthetic key. The first encrypted ciphertext of the synthetic key is then decrypted using the first key, i.e., key1, to obtain the plaintext of the synthetic key. Finally, the plaintext of the synthetic key is used to decrypt the user credential encryption key CE key. Subsequently, the encrypted file can be decrypted using the CE key plaintext.
[0161] When the key-related information is the first ciphertext, i.e., the synthetic key ciphertext, which is also the second encrypted ciphertext of the synthetic key, the Keymaster TA derives the root key KM based on the HUK and other parameter 1, and then derives the second key, i.e., key2, based on the KM, the SID, and other parameters 2. The Keymaster TA then uses the second key, i.e., key2, to decrypt the first ciphertext, i.e., the second encrypted ciphertext of the synthetic key to obtain the first encrypted ciphertext of the synthetic key. The Keymaster TA then uses the first key, i.e., key1, to decrypt the first encrypted ciphertext of the synthetic key to obtain the plaintext of the synthetic key. Finally, the plaintext of the synthetic key is used to decrypt the user credential encryption key CE key. Subsequently, the encrypted file can be decrypted using the CE key plaintext.
[0162] The following describes the functional frameworks that need to be improved in two different solutions:
[0163] When the key-related information includes the first parameter, ie, the synthetic key protection factor, it is necessary to improve the functional framework for obtaining the CE key in FIG2 . The improved functional framework is shown in FIG5 .
[0164] Specifically, a synthetic key protection factor acquisition module is added to the Keymaster TA to support obtaining the synthetic key protection factor from the RPMB through the RPMB TA when necessary, and the key generation module is improved to support the participation of the synthetic key protection factor in the encryption calculation of the synthetic key.
[0165] A synthetic key protection factor management module is added to the RPMB TA to support writing, reading, and physical erasure of the synthetic key protection factor in the RMPB;
[0166] Added message processing capabilities for synthetic key protection factors to functional modules such as the RPMB kernel driver, REE file operation interface, and RPMB listener to support receiving, processing, and forwarding messages related to writing, reading, and physically erasing synthetic key protection factors. Related messages were added between functional modules to support functions such as writing, reading, and physically erasing synthetic key protection factors.
[0167] Improvements to the communication between the Keymaster TA and the RPMB TA. Messages are added to support the Keymaster TA obtaining the composite key protection factor from the RPMB TA.
[0168] When the key-related information includes a synthetic key ciphertext, it is necessary to improve the functional framework for obtaining the CE key in FIG2 . The improved functional framework is shown in FIG6 .
[0169] Specifically, a synthetic key ciphertext acquisition module is added to the Keymaster TA to support obtaining the synthetic key ciphertext from the RPMB through the RPMB TA when necessary.
[0170] A synthetic key ciphertext management module is added to the RPMB TA to support writing, reading, and physical erasure of synthetic key ciphertext in the RMPB;
[0171] Added message processing capabilities for synthetic key ciphertext in functional modules such as the RPMB kernel driver, REE file operation interface, and RPMB listener to support receiving, processing, and forwarding messages related to writing, reading, and physically erasing synthetic key ciphertext. Related messages were added between functional modules to support functions such as writing, reading, and physically erasing synthetic key ciphertext.
[0172] Improvements to the communication between the Keymaster TA and the RPMB TA. Messages are added to support the Keymaster TA obtaining the composite key ciphertext from the RPMB TA.
[0173] Through the embodiments of the present application, in scenarios where an electronic device is lost, stolen, abandoned or transferred, the user can proactively and securely delete sensitive data on the electronic device quickly, efficiently and safely, so that even if an attacker obtains the user's electronic device, the deleted data cannot be recovered, thereby preventing the leakage of user sensitive information.
[0174] The information management method in the embodiment of the present application stores key-related information in a replay protection memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter is used to encrypt a synthetic key, and the first ciphertext is a ciphertext obtained by encrypting the synthetic key; when an instruction for instructing to delete user data is received, the RPMB erase function is called to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data. In this way, by changing the key-related information related to user data to be stored in the RPMB, when it is necessary to delete user data on an electronic device, it is possible to control the call of the RPMB erase interface to quickly physically erase the key-related information stored in the RPMB, thereby achieving the purpose of quickly and safely deleting user data.
[0175] The information management method provided in the embodiment of the present application can be executed by an information management device. In the embodiment of the present application, the information management device provided in the embodiment of the present application is described by taking the information management device executing the information management method as an example.
[0176] Please refer to FIG. 7 , which is a schematic diagram of the structure of an information management device provided in an embodiment of the present application. As shown in FIG. 7 , the information management device 700 includes:
[0177] A storage module 701 is configured to store key-related information in a replay-protected memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter being used to encrypt a synthetic key, and the first ciphertext being the ciphertext obtained by encrypting the synthetic key;
[0178] The erasure module 702 is used to call the RPMB erasure function upon receiving an instruction to instruct the deletion of user data, and physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
[0179] Optionally, the key-related information includes the first parameter;
[0180] The information management device 700 further includes:
[0181] a first encryption module, encrypting the synthetic key according to the first parameter;
[0182] The storage module 701 is used to store the first parameter in the RPMB.
[0183] Optionally, the first encryption module is used for any of the following:
[0184] Encrypting the synthesized key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a third key to obtain a third ciphertext, wherein the third key is determined according to a root key, and the root key is determined according to the first parameter;
[0185] Encrypting the synthesized key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a fourth key to obtain a fourth ciphertext, wherein the fourth key is determined according to the first parameter;
[0186] The synthetic key is encrypted according to the first key to obtain a second ciphertext; the second ciphertext is encrypted according to the first parameter and the second key to obtain a fifth ciphertext, wherein the first key and the second key are determined using different methods.
[0187] Optionally, the key-related information includes the first ciphertext;
[0188] The information management device 700 includes:
[0189] a second encryption module, configured to encrypt the synthesized key using a first key to obtain a second ciphertext, and to encrypt the second ciphertext using a second key to obtain the first ciphertext, wherein the first key and the second key are determined using different methods;
[0190] The storage module 701 is used to store the first ciphertext in the RPMB.
[0191] Optionally, the erasing module 702 includes:
[0192] The first sending unit is used to send an RPMB erase message to the universal flash storage UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface and the RPMB monitoring module in sequence;
[0193] An erasing unit is used to call the RPMB erasing function provided by the UFS controller through the UFS driver to physically erase the key-related information stored in the RPMB.
[0194] Optionally, the storage module 701 includes:
[0195] The second sending unit is used to send the key related information to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface and the RPMB monitoring module in sequence;
[0196] A writing unit is used to call the RPMB storage function provided by the UFS controller through the UFS driver to write the key-related information into the RPMB.
[0197] Optionally, the information management device 700 further includes:
[0198] The sending module is used to send key read messages to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface and the RPMB monitoring module in sequence;
[0199] A reading module is configured to call the RPMB reading function provided by the UFS controller through the UFS driver to read the key-related information from the RPMB;
[0200] A transmission module, configured to send the read key-related information to the key management trusted application through the UFS driver, the RPMB monitoring module, the REE file operation interface, the RPMB kernel driver, and the RPMB trusted application in sequence;
[0201] A determination module, configured to determine the plaintext of the synthetic key based on the key-related information;
[0202] The decryption module is used to decrypt the user credential encryption key CE key according to the plain text of the synthetic key.
[0203] The information management device in the embodiment of the present application stores key-related information in a replay protection memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter is used to encrypt a synthetic key, and the first ciphertext is a ciphertext obtained by encrypting the synthetic key; when an instruction for instructing to delete user data is received, the RPMB erase function is called to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data. In this way, by changing the key-related information related to user data to be stored in the RPMB, when it is necessary to delete user data on an electronic device, it is possible to control the call of the RPMB erase interface to quickly physically erase the key-related information stored in the RPMB, thereby achieving the purpose of quickly and securely deleting user data.
[0204] The information management device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, an in-vehicle electronic device, a mobile internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (Television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0205] The information management device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0206] The information management device provided in the embodiment of the present application can implement each process implemented in the method embodiment of Figure 3. To avoid repetition, they will not be described here.
[0207] Optionally, as shown in Figure 8, an embodiment of the present application also provides an electronic device 800, including a processor 801 and a memory 802, and the memory 802 stores a program or instruction that can be run on the processor 801. When the program or instruction is executed by the processor 801, the various steps of the above-mentioned information management method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0208] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0209] FIG9 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0210] The electronic device 900 includes but is not limited to components such as a radio frequency unit 901 , a network module 902 , an audio output unit 903 , an input unit 904 , a sensor 905 , a display unit 906 , a user input unit 907 , an interface unit 908 , a memory 909 , and a processor 910 .
[0211] Those skilled in the art will appreciate that the electronic device 900 may further include a power source (e.g., a battery) to power various components. The power source may be logically connected to the processor 910 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG9 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently, which will not be described in detail here.
[0212] The processor 910 is configured to store key-related information in a replay-protected memory block RPMB, where the key-related information includes a first parameter or a first ciphertext, the first parameter being used to encrypt a composite key, and the first ciphertext being ciphertext obtained by encrypting the composite key;
[0213] In the case of receiving an instruction for deleting user data, calling the RPMB erase function to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
[0214] Optionally, the key-related information includes the first parameter;
[0215] Processor 910 is also used to encrypt the synthetic key according to the first parameter; and store the first parameter in the RPMB.
[0216] Optionally, the processor 910 is further configured to perform any of the following:
[0217] Encrypting the synthesized key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a third key to obtain a third ciphertext, wherein the third key is determined according to a root key, and the root key is determined according to the first parameter;
[0218] Encrypting the synthesized key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a fourth key to obtain a fourth ciphertext, wherein the fourth key is determined according to the first parameter;
[0219] The synthetic key is encrypted according to the first key to obtain a second ciphertext; the second ciphertext is encrypted according to the first parameter and the second key to obtain a fifth ciphertext, wherein the first key and the second key are determined using different methods.
[0220] Optionally, the key-related information includes the first ciphertext;
[0221] Processor 910 is also used to encrypt the synthetic key according to the first key to obtain a second ciphertext, and to encrypt the second ciphertext according to the second key to obtain the first ciphertext, where the first key and the second key are determined using different methods; and store the first ciphertext in the RPMB.
[0222] Optionally, the processor 910 is further configured to send an RPMB erase message to the universal flash storage UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface, and the RPMB monitor in sequence;
[0223] The UFS driver calls the RPMB erase function provided by the UFS controller to physically erase the key-related information stored in the RPMB.
[0224] Optionally, the processor 910 is further configured to send the key-related information to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface, and the RPMB monitoring module in sequence;
[0225] The UFS driver calls the RPMB storage function provided by the UFS controller to write the key-related information into the RPMB.
[0226] Optionally, the processor 910 is further configured to send a key read message to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface, and the RPMB monitoring module in sequence;
[0227] Calling the RPMB reading function provided by the UFS controller through the UFS driver to read the key-related information from the RPMB;
[0228] The key-related information is sent to the key management trusted application through the UFS driver, the RPMB monitoring module, the REE file operation interface, the RPMB kernel driver and the RPMB trusted application in sequence;
[0229] Determine the plaintext of the synthetic key according to the key-related information;
[0230] The user credential encryption key CE key is decrypted according to the plain text of the synthetic key.
[0231] It should be understood that in an embodiment of the present application, the input unit 904 may include a graphics processing unit (GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and at least one of other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0232] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 909 may include a volatile memory or a non-volatile memory, or the memory 909 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 909 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0233] Processor 910 may include one or more processing units. Optionally, processor 910 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 910.
[0234] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned information management method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0235] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0236] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned information management method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0237] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0238] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned information management method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0239] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0240] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0241] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. An information management method, include: The key-related information is stored in a replay protection memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter is used to encrypt the synthetic key, and the first ciphertext is the ciphertext obtained by encrypting the synthetic key; In case of receiving an instruction for deleting user data, the RPMB erase function is called to physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
2. The method according to claim 1, in, The key related information includes the first parameter; Before storing the key related information in the RPMB, the method further includes: encrypting the synthetic key according to the first parameter; The storing of key-related information in the RPMB includes: Storing the first parameter in the RPMB; or, The key-related information includes the first ciphertext; Before storing the key related information in the RPMB, the method further includes: Encrypting the synthetic key according to the first key to obtain a second ciphertext, and encrypting the second ciphertext according to the second key to obtain the first ciphertext, wherein the first key and the second key are determined in different ways; The storing of key-related information in the RPMB includes: The first ciphertext is stored in the RPMB.
3. The method according to claim 2, in, The encrypting the synthetic key according to the first parameter includes any of the following: Encrypting the synthetic key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to the third key to obtain a third ciphertext, wherein the third key is determined according to the root key, and the root key is determined according to the first parameter; Encrypting the synthetic key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a fourth key to obtain a fourth ciphertext, wherein the fourth key is determined according to the first parameter; The synthetic key is encrypted according to the first key to obtain a second ciphertext; the second ciphertext is encrypted according to the first parameter and the second key to obtain a fifth ciphertext, wherein the first key and the second key are determined in different ways.
4. The method according to claim 1, in, The calling of the RPMB erasure function to physically erase the key-related information stored in the RPMB includes: Sending RPMB erase message to the universal flash storage UFS driver through the key management trusted application, RPMB trusted application, RPMB kernel driver, REE file operation interface and RPMB monitoring module in sequence; The UFS driver calls the RPMB erasing function provided by the UFS controller to physically erase the key-related information stored in the RPMB.
5. The method according to claim 1, in, The storing of key-related information in the RPMB includes: The key-related information is sent to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface and the RPMB monitoring module in sequence; The UFS driver calls the RPMB storage function provided by the UFS controller to write the key-related information into the RPMB.
6. The method according to claim 1, in, After storing the key related information in the RPMB and before receiving an instruction for instructing to delete the user data, the method further includes: Send a key read message to the UFS driver through the key management trusted application, RPMB trusted application, RPMB kernel driver, REE file operation interface and RPMB monitoring module in sequence; Calling the RPMB reading function provided by the UFS controller through the UFS driver to read the key related information from the RPMB; The key-related information read is sent to the key management trusted application through the UFS driver, the RPMB monitoring module, the REE file operation interface, the RPMB kernel driver and the RPMB trusted application in sequence; Determine the plaintext of the synthetic key according to the key-related information; The user credential encryption key CE key is decrypted according to the plain text of the synthetic key.
7. An information management device, include: A storage module, configured to store key-related information in a replay protection memory block RPMB, wherein the key-related information includes a first parameter or a first ciphertext, the first parameter is used to encrypt a synthetic key, and the first ciphertext is a ciphertext encrypted from the synthetic key; An erasure module is used to call the RPMB erasure function upon receiving an instruction to delete user data, and physically erase the key-related information stored in the RPMB, wherein the key-related information is used to determine the key for encrypting the user data.
8. The information management device according to claim 7, in, The key related information includes the first parameter; The information management device also includes: A first encryption module, encrypting the synthetic key according to the first parameter; The storage module is used to store the first parameter in the RPMB; or, The key-related information includes the first ciphertext; The information management device comprises: a second encryption module, configured to encrypt the synthetic key according to the first key to obtain a second ciphertext, and to encrypt the second ciphertext according to the second key to obtain the first ciphertext, wherein the first key and the second key are determined in different ways; The storage module is used to store the first ciphertext in the RPMB.
9. The information management device according to claim 8, in, The first encryption module is used for any of the following: Encrypting the synthetic key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to the third key to obtain a third ciphertext, wherein the third key is determined according to the root key, and the root key is determined according to the first parameter; Encrypting the synthetic key according to the first key to obtain a second ciphertext; encrypting the second ciphertext according to a fourth key to obtain a fourth ciphertext, wherein the fourth key is determined according to the first parameter; The synthetic key is encrypted according to the first key to obtain a second ciphertext; the second ciphertext is encrypted according to the first parameter and the second key to obtain a fifth ciphertext, wherein the first key and the second key are determined in different ways.
10. The information management device according to claim 7, in, The erasing module comprises: A first sending unit is used to send an RPMB erase message to the UFS driver through a key management trusted application, an RPMB trusted application, an RPMB kernel driver, a REE file operation interface, and an RPMB monitoring module in sequence; An erasing unit is used to call the RPMB erasing function provided by the UFS controller through the UFS driver to physically erase the key-related information stored in the RPMB.
11. The information management device according to claim 7, in, The storage module comprises: A second sending unit is used to send the key-related information to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface and the RPMB monitoring module in sequence; The writing unit is used to call the RPMB storage function provided by the UFS controller through the UFS driver to write the key related information into the RPMB.
12. The information management device according to claim 7, in, The information management device also includes: A sending module, used to send a key reading message to the UFS driver through the key management trusted application, the RPMB trusted application, the RPMB kernel driver, the REE file operation interface and the RPMB monitoring module in sequence; A reading module, configured to call an RPMB reading function provided by a UFS controller through the UFS driver to read the key-related information from the RPMB; A transmission module, configured to send the read key-related information to the key management trusted application through the UFS driver, the RPMB listening module, the REE file operation interface, the RPMB kernel driver and the RPMB trusted application in sequence; A determination module, used to determine the plaintext of the synthetic key according to the key-related information; The decryption module is used to decrypt the CE key according to the plain text of the synthetic key.
13. An electronic device comprising a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the information management method according to any one of claims 1 to 6 are implemented.
14. A readable storage medium storing a program or an instruction, wherein the program or the instruction, when executed by a processor, implements the steps of the information management method according to any one of claims 1 to 6.
15. A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the information management method according to any one of claims 1 to 6.
16. A computer program product, wherein the computer program product is executed by at least one processor to implement the steps of the information management method according to any one of claims 1 to 6.
17. An electronic device, configured to execute the steps of the information management method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data deletion method and electronic equipment
CN115357930A
Information management method and device and electronic equipment
CN116594567A
Purging data at a memory device
US20220164487A1
Cited By
Apparatus and method to revoke memory device replay protected memory block (RPMB) authentication key
WO2026137218A1
