WO2024046418A1 - 一种数据保护方法及电子设备 - Google Patents

一种数据保护方法及电子设备 Download PDF

Info

Publication number
WO2024046418A1
WO2024046418A1 PCT/CN2023/116087 CN2023116087W WO2024046418A1 WO 2024046418 A1 WO2024046418 A1 WO 2024046418A1 CN 2023116087 W CN2023116087 W CN 2023116087W WO 2024046418 A1 WO2024046418 A1 WO 2024046418A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
authentication information
secret value
identity authentication
user
Prior art date
Application number
PCT/CN2023/116087
Other languages
English (en)
French (fr)
Inventor
李昂
郑亮
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024046418A1 publication Critical patent/WO2024046418A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/72Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information in cryptographic circuits

Definitions

  • This application relates to the field of data security technology, and in particular to a data protection method and electronic equipment.
  • security chips As a hardware-level high-security and trusted environment, security chips have security strength against physical attacks and are widely used in mobile devices, Internet of Things (IOT) devices and other devices with high security requirements.
  • IOT Internet of Things
  • security chips in devices are mainly used to store information related to user identity authentication.
  • the security chip is highly secure, there are cases where information related to user identity authentication stored in the security chip is stolen through illegal means, leading to user data leakage. How to further improve the security of the information related to user identity authentication stored in the security chip requires further research.
  • This application provides a data protection method and electronic device, which can encrypt and store secret values based on the registration identity authentication information input by the user, further protecting the security of the secret values.
  • this application provides a data protection method.
  • the method includes: an electronic device receives registration identity authentication information input by a user; the electronic device generates a first secret value, and the first secret value is used to encrypt and protect the root key.
  • the key is used to protect user data on the electronic device; the electronic device encrypts the first secret value based on the registered identity authentication information to obtain the encrypted first secret value; the electronic device stores the registered identity authentication information and the encrypted first secret value.
  • the first secret value can be directly used to encrypt and protect the root key, and the first secret value can also participate in encrypting and protecting the root key together with other factors.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the root key can be directly used to encrypt and protect user data on electronic devices.
  • the root key can also be derived from the data key, and user data on the electronic device is encrypted and protected based on the data key.
  • the root key can be derived from one or more levels to obtain the data key.
  • the secret value can be encrypted and stored based on the registration identity authentication information entered by the user, further protecting the security of the secret value.
  • the electronic device receives the registration identity authentication information input by the user, which specifically includes: the electronic device receives the registration identity authentication information input by the user through the operating system; After the identity authentication information, before the electronic device generates the first secret value, the method also includes: the electronic device sends the registered identity authentication information to the security chip through the operating system; the electronic device generates the first secret value, specifically including: the electronic device passes the security chip Generate a first secret value; the electronic device encrypts the first secret value based on the registered identity authentication information to obtain the encrypted first secret value, which specifically includes: the electronic device encrypts the first secret value based on the registered identity authentication information through the security chip to obtain the encrypted first secret value.
  • a secret value; the electronic device stores the registered identity authentication information and the encrypted first secret value which specifically includes: the electronic device stores the registered identity authentication information and the encrypted first secret value in the security chip.
  • the electronic device when the electronic device has a security chip, the electronic device can generate a secret value within the security chip to avoid generating a secret value outside the security chip and causing an attacker to tamper with the secret value and cause user data to be leaked.
  • the encrypted first secret value and the registered identity authentication information are stored in the security chip.
  • the security chip has a high security factor, which further protects the security of the encrypted first secret value and the registered identity authentication information.
  • the method before the electronic device generates the first secret value, the method further includes: the electronic device generates a second secret value through the operating system; and the electronic device sends the second secret value through the operating system. to the security chip; the electronic device generates the third secret value through the security chip; the electronic device generates the first secret value, specifically including: the electronic device generates the first secret value based on the second secret value and the third secret value through the security chip.
  • This application also provides another method of generating the first secret value. That is, the first secret value is jointly generated based on the third secret value generated within the security chip and the second secret value generated outside the security chip. Even if an attacker can tamper with the second secret value generated outside the security chip, he cannot tamper with the third secret value generated within the security chip. This can also prevent the first secret value from being tampered with by the attacker.
  • the method further includes: when the first condition is met, the electronic device receives verification input by the user. Identity authentication information; when verifying the identity authentication information When the information and registered identity authentication information meet the preset conditions, the electronic device decrypts the encrypted first secret value based on the verification identity authentication information to obtain the first secret value; the electronic device decrypts the encrypted root key based on the first secret value to obtain Root key; the electronic device decrypts the encrypted user data based on the root key to obtain unencrypted user data.
  • the first secret value can be directly used to decrypt the encryption root key to obtain the root key, or the first secret value can also participate in other factors to decrypt the encryption root key to obtain the root key.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the root key After obtaining the root key, the root key can be directly used to decrypt the encrypted user data to obtain unencrypted user data.
  • the data key can also be derived based on the root key, and the encrypted user data can be decrypted based on the data key to obtain unencrypted user data.
  • the root key can be derived from one or more levels to obtain the data key.
  • the security chip When verifying the identity authentication information input by the user, the security chip can decrypt the encrypted first secret value based on the identity authentication information only if the identity authentication information and registration identity authentication information input by the user meet the preset conditions. Get the unencrypted first secret value. In this way, the attacker can be prevented from tampering with the verification logic if the first secret value is not encrypted. A situation leading to the leakage of the first secret value occurs.
  • the electronic device sends the registration identity authentication information to the security chip through the operating system, which specifically includes: the electronic device desensitizes the registration identity authentication information through the operating system to obtain the desensitized registration identity. Authentication information; the electronic device sends desensitized registration identity authentication information to the security chip through the operating system; the electronic device encrypts the first secret value based on the registration identity authentication information through the security chip, specifically including: the electronic device uses the security chip to register the identity based on desensitization The authentication information encrypts the first secret value to obtain the encrypted first secret value.
  • the electronic device can directly encrypt the first secret value based on the desensitized registration identity authentication information through the security chip to obtain the encrypted first secret value.
  • the electronic device may also perform key derivation on the desensitized registration identity authentication information, or perform hash calculation on the desensitized registration identity authentication information, and use the derived key or hash calculated value to A secret value is encrypted to obtain the encrypted first secret value.
  • the embodiments of the present application do not limit this.
  • the electronic device registration identity authentication information is desensitized to avoid the leakage of the registration identity authentication information caused by being transmitted in plain text during the transmission process.
  • the method further includes: the electronic device The identity verification information is desensitized through the operating system to obtain the desensitization verification identity authentication information; the electronic device sends the desensitization verification identity authentication information to the security chip through the operating system; the electronic device decrypts the encrypted first secret value based on the identity authentication information.
  • the electronic device decrypts the encrypted first secret value based on the desensitization verification identity authentication information through the security chip to obtain the first secret value.
  • the electronic device can directly decrypt and decrypt the encrypted first secret value based on the desensitized registration identity authentication information through the security chip to obtain the unencrypted first secret value.
  • the electronic device can also decrypt and decrypt the encrypted first secret value based on the key derived from the desensitized registration identity authentication information or the hash value of the desensitized registration identity authentication information to obtain the unencrypted first secret value. Secret value.
  • the embodiments of the present application do not limit this.
  • the electronic device when the desensitized registration authentication information is stored in the security chip, when verifying the user's ID card, the electronic device also needs to desensitize the verification identity authentication information and compare it with the desensitized registration authentication information.
  • the registration identity authentication information includes the registration lock screen identity authentication information of the electronic device and/or the registration opening authentication information of the first application on the electronic device; wherein, the registration lock screen identity information Used to unlock the electronic device when the verification lock screen identity authentication information and registered lock screen identity information input by the user meet the preset conditions;
  • the registration opening authentication information is used to open the first application when the verification registration opening authentication information and the registration opening authentication information input by the user meet the preset conditions.
  • the electronic device receives the registration identity authentication information input by the user, which specifically includes: the electronic device receives the registration lock screen identity information input by the user, and the registration lock screen identity information is used when the user inputs When the verification lock screen identity authentication information and the registered lock screen identity information meet the preset conditions, the electronic device is unlocked; the electronic device generates a first secret value, and the first secret value is used to encrypt and protect the root key, and the root key is To protect user data on electronic devices, it specifically includes: the electronic device generates a first secret value, the first The secret value is used to encrypt and protect the first root key, and the first root key is used to protect user data on the electronic device; the electronic device encrypts the first secret value based on the registered identity authentication information to obtain the encrypted first secret value, which specifically includes : The electronic device encrypts the first secret value based on the registered lock screen identity information to obtain the encrypted first secret value; the electronic device stores the registered identity authentication information and the encrypted first secret
  • the user can set the lock screen identity information for unlocking the electronic device, and store the lock screen identity information and the first secret value in the security chip.
  • multiple different user accounts can be logged into the electronic device. Users can also set lock screen identity information corresponding to multiple different user accounts.
  • the root keys corresponding to multiple different user accounts may be different or the same, which is not limited in the embodiments of this application.
  • the first secret value can be directly used to encrypt and protect the first root key, and the first secret value can also participate in encryption and protection of the first root key together with other factors.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the first root key can be directly used to encrypt and protect user data on the electronic device.
  • the data key can also be derived based on the first root key, and the user data on the electronic device is encrypted and protected based on the data key.
  • the first root key can be derived through one or more levels to obtain the data key.
  • the method further includes: the electronic device receives the registration opening authentication information input by the user, and the registration opening authentication information Used to open the first application when the verification registration opening authentication information and the registration opening authentication information input by the user meet the preset conditions; the electronic device generates a fourth secret value, and the fourth secret value is used to encrypt and protect the second root key. , the second root key is used to protect the application data in the first application; the electronic device encrypts the fourth secret value based on the registration opening authentication information to obtain the encrypted fourth secret value.
  • the electronic device stores the registration opening authentication information and the encrypted fourth secret value. .
  • the fourth secret value can be directly used to encrypt and protect the second root key, and the fourth secret value can also participate in encryption and protection of the second root key together with other factors.
  • Other factors include but are not limited to one or more of registration opening authentication information, hardware unique key, device unique ID, and application identification.
  • the second root key can be directly used to encrypt and protect application data within the first application.
  • the data key may also be derived based on the second root key, and the application data decryption in the first application may be encrypted and protected based on the data key.
  • the root key can be derived from one or more levels to obtain the data key.
  • the user can set the opening authentication information of multiple applications on the electronic device, and store the opening authentication information and the fourth secret value in the security chip.
  • the opening authentication information of the same application may be different or the same, which is not limited in the embodiments of this application.
  • the second root key is different from the first root key.
  • the second root key and the first root key may also be the same, which is not limited in the embodiments of the present application.
  • this application provides an electronic device.
  • the electronic device includes: one or more processors, one or more memories, and a display screen; one or more memories and display screens are coupled to one or more processors, One or more memories are used to store computer program codes.
  • the computer program codes include computer instructions.
  • One or more processors call the computer instructions to cause the electronic device to perform a data protection provided in any possible implementation of the first aspect. method.
  • the present application provides a computer-readable storage medium for storing computer instructions.
  • the computer instructions When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute one of the possible implementation methods in the first aspect. method of data protection.
  • this application provides a computer program product.
  • the computer program product When the computer program product is run on an electronic device, it causes the electronic device to execute a data protection method provided in any possible implementation manner in the first aspect.
  • FIGS 1-3 are schematic diagrams of the display forms of several security chips provided by embodiments of the present application.
  • Figure 4 is a schematic flow chart of a method for generating and saving secret values provided by an embodiment of the present application
  • Figure 5 is a flow chart of a method for authenticating identity authentication information on an electronic device 100 provided by an embodiment of the present application
  • Figure 6 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of the software structure of an electronic device 100 provided by an embodiment of the present application.
  • 8A to 8F are schematic diagrams of a group of electronic devices 100 provided by an embodiment of the present application receiving and responding to user operations, and receiving registered lock screen identity information of the electronic devices 100 registered by the user;
  • 8G to 8J are schematic diagrams of a group of electronic devices 100 provided by an embodiment of the present application receiving lock screen identity information corresponding to different user accounts set by a user on the electronic device 100;
  • Figures 9A-9E are schematic diagrams of a group of electronic devices 100 provided by an embodiment of the present application receiving and responding to user operations, and receiving the activation password for application one registered by the user;
  • Figure 10 is a schematic flowchart of another method for registering identity authentication information provided by an embodiment of the present application.
  • Figure 11 is a schematic flow chart of another method for registering identity authentication information provided by an embodiment of the present application.
  • Figure 12 is a schematic flow chart of a method for comparing and verifying registration identity authentication information and registration identity authentication information provided by an embodiment of the present application
  • Figures 13A-13F are UI diagrams provided by embodiments of the present application.
  • Figure 14 is a schematic flow chart of another method for comparing and verifying registration identity authentication information and registration identity authentication information provided by the embodiment of the present application;
  • Figure 15 is a schematic flow chart of a data protection method provided by an embodiment of the present application.
  • Figure 16 is a schematic flowchart of a data storage device provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only and shall not be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, “plurality” The meaning is two or more.
  • GUI graphical user interface
  • the identity authentication information may be the lock screen identity information of the electronic device 100 , and the lock screen identity information of the electronic device 100 may be a pin code, face image, fingerprint, voiceprint, etc.
  • the lock screen identity information is used to compare the identity information input by the user with the lock screen identity information stored in the electronic device after the electronic device closes the screen to see whether the two meet the preset conditions.
  • the preset condition may be that the lock screen identity information input by the user is completely consistent with the lock screen identity information stored in the electronic device, or that the lock screen identity information input by the user is completely consistent with the lock screen identity information stored in the electronic device after transformation. consistent. After determining that both of them meet the preset conditions, the electronic device can perform an unlocking operation.
  • the identity authentication information may also be the opening authentication information of the application on the electronic device 100, and the opening authentication information of the application may also be a pin code, face image, fingerprint, voiceprint, etc.
  • the opening authentication information of the application is used to compare the opening authentication information input by the user with the opening authentication information stored in the electronic device when the user opens the application to see whether the two meet the preset conditions.
  • the preset condition can be that the user enters the
  • the activation authentication information is completely consistent with the activation authentication information stored in the electronic device, or the activation authentication information input by the user is completely consistent with the activation authentication information stored in the electronic device after being transformed. After determining that the two meet the preset conditions, the electronic device can perform the operation of opening the application.
  • the identity authentication information is generally stored in a security chip in the electronic device to prevent the identity authentication information stored in the electronic device from being leaked.
  • Form 1 As shown in Figure 1, the security chip is located in the built-in security core in the main chip (SOC chip) of the electronic device.
  • SOC chip main chip
  • Form 2 As shown in Figure 2, the security chip is located in the secure element (SE) of the external SOC chip.
  • SE is an electronic component that resists physical attacks. It contains a microprocessor, storage, and encryption and decryption hardware. Can be used independently.
  • Form 3 As shown in Figure 3, the security chip is composed of a SOC chip and an SE with an external SOC chip. It completes some high-security services and ensures the high security of the equipment.
  • the security chip can also be in other forms, which is not limited in the embodiments of this application.
  • the electronic device After the user registers the lock screen identity information, the electronic device generates a secret value. Among them, the electronic device can generate a secret value based on the lock screen identity information. The electronic device can also generate a secret value randomly, or the secret value is a preset fixed value. After determining that the user has completed the registration of the lock screen identity information, the electronic device obtains the secret value. Default secret value.
  • the secret value and lock screen identity information can be used together to protect the root key.
  • the secret value can be used alone to protect the root key.
  • the lock screen identity information can also be used alone to protect the root key.
  • the secret value together with the lock screen identity information and other derivation factors can be used to protect the root key.
  • the secret value and other derivation factors can be used to jointly protect the root key.
  • lock screen identity information and other derivation factors can be used to jointly protect the root key.
  • the root key can also be protected in other ways, which is not limited in the embodiments of this application.
  • the root key is used by the electronic device to derive a data key, and the user data on the electronic device is encrypted based on the data key to prevent user data on the electronic device from being leaked.
  • User data may include but is not limited to: pictures, text, videos, files, audio, etc.
  • the electronic device can derive different data keys based on the root key, and the electronic device can encrypt different types of user data based on the different data keys.
  • user data can also be classified according to applications.
  • the electronic device can derive different data keys based on the root key, and the electronic device can encrypt user data generated by different applications based on different data keys.
  • the electronic device may no longer distinguish the type of user data, and all user data on the electronic device may be encrypted using the same data key.
  • Encrypting user data on electronic devices based on data keys is to prevent user data leakage. For example, when the electronic device is turned off, the electronic device may encrypt user data on the electronic device based on the data key. After the electronic device is turned on for the first time, the user needs to enter the correct lock screen identity information. The electronic device will only perform the execution when the electronic device confirms that the lock screen identity information entered by the user and the lock screen identity information stored in the security chip meet the preset conditions. Unlocking operation, and decrypting the user data on the electronic device based on the data key, so that the user can normally view and use the user data on the electronic device.
  • the risk of user data stored on the phone being leaked can be avoided.
  • other users do not know the lock screen identity information of the electronic device.
  • Other users can remove the chip of the electronic device and use professional tools to read data from the chip. If the electronic device After the user data on the device is encrypted with the data key, even if other users use professional tools to read data from the chip, the read data will be encrypted user data and the real user data cannot be obtained. If the user data on the electronic device is not encrypted with a data key, other users will use professional tools to read the data from the chip and read unencrypted user data, resulting in user data leakage.
  • the data key is derived based on the root key to protect the security of the number of users on the electronic device, and the focus is on protecting the security of the root key.
  • a secret value may be used to protect the root key, or a secret value and identity authentication information may be used to protect the root key. key. That is, protecting the root key requires the participation of a secret value.
  • Figure 4 shows a schematic flow chart of a method for generating and saving secret values.
  • the operating system of the electronic device 100 receives the registration identity authentication information input by the user.
  • Registration identity authentication information includes but is not limited to: pin code, face image information, fingerprint information, voiceprint information, etc.
  • the following embodiments of this application take the registration of identity authentication information as a pin code as an example for explanation.
  • the operating system of the electronic device 100 receives the registration identity authentication information input by the user.
  • the operating system of the electronic device 100 After receiving the registration identity authentication information input by the user, the operating system of the electronic device 100 randomly generates a secret value.
  • the secret value is used to participate in protecting the root key.
  • the secret value is generated outside the security chip.
  • the operating system of the electronic device 100 sends the registered identity authentication information and secret value to the security chip.
  • the security chip on the electronic device 100 saves the registered identity authentication information and secret value.
  • the secret value is generated within the security chip. After the secret value is generated, the operating system of the electronic device 100 sends the registration identity authentication information and the secret value to the security chip, so that the registration identity authentication information and the secret value are stored in the security chip to avoid leakage of the registration identity authentication information and secrets.
  • the security chip on the electronic device 100 saves and sends a registration success notification to the operating system of the electronic device 100.
  • the security chip After the registration identity authentication information and the secret value are stored in the security chip, the security chip sends a registration success notification to the operating system of the electronic device 100 .
  • the operating system of the electronic device 100 encrypts the root key based on the registered identity authentication information and the secret value.
  • the root key can be protected based on the registration authentication information and the secret value.
  • the secret value is generated by the operating system of the electronic device and then stored in the security chip. Before being stored in the security chip, there may be a risk of being tampered with by an attacker.
  • the electronic device 100 is installed with malicious code.
  • the malicious code can tamper with a randomly generated secret value, and then store the tampered secret value in the security chip. In this way, when the root key is encrypted, it is also encrypted based on the tampered secret value.
  • the attacker tampered with the secret value, that is, there is no need to verify the correctness of the identity authentication information entered by the user, and the attacker can know the tampering.
  • the root key is thereby decrypted based on the tampered secret value, thereby obtaining the root key. Then the data key is obtained based on the root key, and then the user data is decrypted based on the data key to obtain the real user data, resulting in user data leakage.
  • FIG. 5 is a flow chart of a method for authenticating identity authentication information on the electronic device 100 provided by an embodiment of the present application.
  • the operating system of the electronic device 100 receives the identity authentication information input by the user.
  • the electronic device 100 may receive the identity verification information input by the user.
  • the operating system of the electronic device 100 sends the identity authentication information to the security chip.
  • the security chip of the electronic device 100 confirms that the verification identity authentication information and the registration identity authentication information meet the preset conditions.
  • the security chip of the electronic device 100 confirms that the verification identity authentication information and the registration identity authentication information meet the preset conditions, it means that the verification is passed.
  • the preset condition may be that the verification identity authentication information input by the user is completely consistent with the registration identity authentication information stored in the security chip, or that the verification identity authentication information input by the user is transformed and is consistent with the registration identity authentication information stored in the electronic device. Totally consistent. The embodiments of the present application do not limit this.
  • the security chip on the electronic device 100 After the verification is successful, the security chip on the electronic device 100 returns the secret value to the operating system on the electronic device 100.
  • the security chip on the electronic device 100 After the verification is successful, the security chip on the electronic device 100 returns the secret value stored in the security chip to the operating system.
  • the operating system of the electronic device 100 decrypts the root key based on the verification identity authentication information and the secret value to obtain the root key, and then obtains the data key based on the root key. Based on the data key pair User data is decrypted.
  • the comparison logic is relatively simple. If the comparison logic is tampered with, in some embodiments, regardless of the value of the identity authentication information input by the user, the comparison can be successful, and the secret value can be successfully obtained. In some scenarios, if the root key is encrypted based only on the secret value, then in this case, the attacker can decrypt the root key based on the obtained secret value, thereby obtaining the root key. Then the data key is obtained based on the root key, and then the user data is decrypted based on the data key to obtain the real user data, resulting in user data leakage.
  • this application provides a data protection method, which only aims at protecting the security of secret values.
  • the step of generating the secret value is performed in the security chip. Because the security of the security chip is much higher than the security of the operating system. Therefore, generating a secret value in the security chip can prevent the secret value from being tampered with.
  • the secret value is stored in the security chip and relies on the participation of identity authentication information. That is, after the security chip generates a secret value, it encrypts the secret value based on the registered identity authentication information and then stores it in the security chip. In this way, even if the attacker tampered with the comparison logic of the identity authentication information, the attacker cannot decrypt the secret value encrypted based on the registration identity authentication information without obtaining the registration identity authentication information, that is, it cannot obtain the Secret value to avoid leakage of secret value.
  • This application can be applied to device-level user data protection.
  • the security chip of the electronic device 100 when the electronic device receives the user's registered lock screen authentication information, after the operating system of the electronic device 100 sends the registered lock screen authentication information to the security chip, the security chip of the electronic device 100 will randomly generate a lock screen secret value. Before storing the lock screen secret value on the security chip, the security chip of the electronic device 100 encrypts the lock screen secret value based on the registered lock screen authentication information to obtain the encrypted lock screen secret value, and saves the encrypted lock screen secret value in the security chip Inside.
  • This application can be applied to application-level user data protection.
  • the security chip of the electronic device 100 when the electronic device receives the activation authentication information for the user to register the first application, after the operating system of the electronic device 100 sends the registration activation authentication information to the security chip, the security chip of the electronic device 100 will randomly generate an activation secret value. Before storing the opening secret value on the security chip, the security chip of the electronic device 100 encrypts the opening secret value based on the registered opening authentication information, obtains the encrypted opening secret value, and stores the encrypted opening secret value in the security chip.
  • the user can set different opening authentication information for different applications on the electronic device.
  • applications with a higher degree of privacy such as address books, text messages and other applications
  • the opening authentication information of different applications may also be the same, and this is not limited in the embodiments of this application.
  • FIG. 6 shows a schematic structural diagram of the electronic device 100.
  • the electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant) digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, vehicle-mounted device, smart home device and/or Smart city equipment, the embodiment of this application does not place special restrictions on the specific type of electronic equipment.
  • PDA personal digital assistant
  • AR augmented reality
  • VR virtual reality
  • AI artificial intelligence
  • wearable device wearable device
  • vehicle-mounted device smart home device and/or Smart city equipment
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (SIM) card interface 195, etc.
  • a processor 110 an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the electronic device 100 may also include one or more security chips.
  • one or more security chips are used to store identity authentication information and an encrypted secret value based on the identity authentication information. If there are multiple security chips on the electronic device 100, the identity authentication information and the secret value encrypted based on the identity authentication information can be stored on different security chips, and the identity authentication information and the secret value encrypted based on the identity authentication information can also be stored in On the same security chip, the embodiment of the present application does not limit this.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • Interfaces may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver and transmitter (universal asynchronous receiver/transmitter (UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and /or universal serial bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous receiver and transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can separately couple the touch sensor 180K, charger, flash, camera 193, etc. through different I2C bus interfaces.
  • the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • processor 110 may include multiple sets of I2S buses.
  • the processor 110 can be coupled with the audio module 170 through the I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100 .
  • the processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, display screen 194, wireless communication module 160, audio module 170, sensor module 180, etc.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through them. This interface can also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationships between the modules illustrated in the embodiment of the present invention are only schematic illustrations and do not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charging device.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142, it can also provide power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like.
  • the power management module 141 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide solutions for wireless communication including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194.
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110 and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellites.
  • WLAN wireless local area networks
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi) -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like.
  • GPU is a microprocessor for image processing. Connect the display 194 to the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 194 is used to display images, videos, etc.
  • Display 194 includes a display panel.
  • the display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light emitting diode (QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the optical signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise and brightness. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
  • Camera 193 is used to capture still images or video.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other format image signals.
  • the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • Electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • Intelligent cognitive applications of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
  • the internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
  • Random access memory can include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, for example, the fifth generation DDR SDRAM is generally called DDR5SDRAM), etc.
  • non-volatile memory can include disk storage devices and flash memory (flash memory). Flash memory can be divided according to the operating principle to include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.
  • the storage unit potential level it can include single-level storage cells (single-level cell, SLC), multi-level storage cells (multi-level cell, MLC), third-level storage unit (triple-level cell, TLC), fourth-level storage unit (quad-level cell, QLC), etc., which can include universal flash storage (English: universal flash storage, UFS) according to storage specifications. , embedded multi media card (embedded multi media Card, eMMC), etc.
  • the random access memory can be directly read and written by the processor 110, can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data, etc.
  • the non-volatile memory can also store executable programs and user and application program data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
  • the external memory interface 120 can be used to connect an external non-volatile memory to expand the storage capacity of the electronic device 100 .
  • the external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, save music, video and other files in external non-volatile memory.
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or a voice message, the voice can be heard by bringing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 170C with the human mouth and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
  • the headphone interface 170D is used to connect wired headphones.
  • the headphone interface 170D may be a USB interface 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA Cellular Telecommunications Industry Association of the USA
  • the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A there are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
  • a capacitive pressure sensor may include at least two parallel plates of conductive material.
  • the electronic device 100 determines the intensity of the pressure based on the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position based on the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch location but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion posture of the electronic device 100 .
  • the angular velocity of electronic device 100 about three axes may be determined by gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyro sensor 180B detects the angle at which the electronic device 100 shakes, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory gaming scenarios.
  • Air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • Magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may utilize the magnetic sensor 180D to detect opening and closing of the flip holster.
  • the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. Then, based on the detected opening and closing status of the leather case or the opening and closing status of the flip cover, features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices and be used in horizontal and vertical screen switching, pedometer and other applications.
  • Distance sensor 180F for measuring distance.
  • Electronic device 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may utilize the distance sensor 180F to measure distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light outwardly through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect when the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in holster mode, and pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touching.
  • Fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
  • Temperature sensor 180J is used to detect temperature.
  • the electronic device 100 utilizes the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the low temperature from causing the electronic device 100 to shut down abnormally. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also known as "touch device”.
  • the touch sensor 180K can be disposed on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Visual output related to the touch operation may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a location different from that of the display screen 194 .
  • Bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human body's vocal part.
  • the bone conduction sensor 180M can also contact the human body's pulse and receive blood pressure beating signals.
  • the bone conduction sensor 180M can also be provided in an earphone and combined into a bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibrating bone obtained by the bone conduction sensor 180M to implement the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to implement the heart rate detection function.
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
  • touch operations for different applications can correspond to different vibration feedback effects.
  • the motor 191 can also respond to different vibration feedback effects for touch operations in different areas of the display screen 194 .
  • Different application scenarios such as time reminders, receiving information, alarm clocks, games, etc.
  • the touch vibration feedback effect can also be customized.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be connected to or separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.
  • the electronic device 100 uses an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • FIG. 7 shows a schematic diagram of the software structure of the electronic device 100 .
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • This embodiment of the present invention takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
  • the system of the electronic device 100 may also be an IOS system, a Hongmeng system, etc., which are not limited in the embodiments of this application. Depending on the type of electronic device 100 , the system of the electronic device 100 may also be different.
  • the system of the electronic device 100 is the Android system as an example for description.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system libraries, and kernel layer.
  • the embodiments of the present application do not limit the layering of the software structure of the electronic device.
  • the Android runtime, system library, and kernel layer can be regarded as one layer, called the system layer. It should be understood that Figure 7 also adds a hardware layer in the electronic device based on the Android system.
  • the modules included in each layer shown in Figure 7 are modules involved in the embodiments of the present application.
  • the modules included in the following layers do not constitute the structure and module deployment level of the electronic device (example description). ) limit.
  • the identity authentication information registration module can be deployed at the application layer or at the application framework layer.
  • the modules shown in Figure 7 can be deployed individually, or several modules can be deployed together.
  • the division of modules in Figure 7 is an example.
  • the names of the modules shown in Figure 7 are examples.
  • the application layer can include a series of application packages.
  • the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, SMS and other applications.
  • the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a phone manager, a resource manager, an identity authentication information registration module, an identity authentication information verification module, etc.
  • a window manager is used to manage window programs.
  • the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen identity authentication information verification module, etc.
  • Content providers are used to store and retrieve data and make this data accessible to applications.
  • Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the phone manager is used to provide communication functions of the electronic device 100 .
  • call status management including connected, hung up, etc.
  • the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
  • the identity authentication information registration module is used to provide an interface for users to set identity authentication information. In some embodiments, the identity authentication information registration module can also provide an interface to allow users to set identity authentication information for different user accounts. In some embodiments, the identity authentication information registration module can also provide an interface to allow users to set identity authentication information for different applications on the electronic device.
  • the identity authentication information verification module is used to compare the identity authentication information input by the user with the registered identity authentication information stored in the electronic device to see if they are consistent. If they are consistent, perform the unlocking operation or start the application. If they are inconsistent and the number of errors entered by the user to verify the identity authentication information reaches the threshold, the identity authentication information self-destruction module will be triggered to clear the identity authentication information stored in the electronic device. The electronic device cannot be unlocked or the application cannot be opened, thereby avoiding the leakage of user data or application data.
  • the system layer may include the Android runtime, system library, and functional modules in the kernel layer.
  • the system layer may include a security chip, and the number of security chips may be one or more.
  • the identity authentication information may be the lock screen identity information of the electronic device 100 , and the lock screen identity information of the electronic device 100 may be a pin code, face image, fingerprint, voiceprint, etc.
  • the identity authentication information may also be the opening authentication information of the application on the electronic device 100, and the opening authentication information of the application may also be a pin code, face image, fingerprint, voiceprint, etc.
  • the user can operate on the electronic device 100 to set the lock screen identity information of the electronic device 100, which is also called registering the lock screen identity information.
  • the following embodiments of this application take the registration lock screen identity information as a pin code as an example for description.
  • the pin code may also be called a registered lock screen password.
  • the user can also operate on the electronic device 100 to set the registered lock screen identity information of different user accounts on the electronic device 100 .
  • the user can also operate on the electronic device 100 to set the opening identity information of the application on the electronic device 100, which is also called registering the opening identity information.
  • the following embodiments of this application take the registration activation identity information as a pin code as an example for description.
  • the pin code may also be called a registration activation password.
  • 8A to 8F illustrate a schematic diagram in which the electronic device 100 receives and responds to the user's operation and receives the registered lock screen identity information of the electronic device 100 registered by the user.
  • the registered lock screen identity information of the electronic device 100 may be a pin code.
  • FIG. 8A exemplarily shows the main interface of the electronic device 100.
  • Figure 8A shows icons of multiple applications, such as file management application icons, email application icons, music application icons, smart life application icons, sports and health application icons, settings application icons, and camera application icons. Icons, icons for the Contacts app, icons for the Phone app, icons for the Messages app, etc.
  • Figure 8A also shows page indicators, weather indicators, calendar indicators, power indicators, time indicators, signal indicators, and the like.
  • the electronic device 100 receives a user's input operation (eg, click) on the icon of the setting application, and in response to the user's input operation, the electronic device 100 displays a user interface 701 as shown in FIG. 8B .
  • the user interface 701 shows multiple setting items, such as airplane mode setting items (the current airplane mode is turned off), Wi-Fi setting items (the current Wi-Fi is turned off), Bluetooth setting items (the current Bluetooth function is turned off), personal Hotspot settings, mobile network settings, Do Not Disturb mode settings, display and brightness settings, Huawei account settings, biometric and password options, etc.
  • the electronic device 100 receives a user's input operation (eg, click) for biometric identification and password options, etc., and in response to the user's input operation, the electronic device 100 displays a user interface 702 as shown in FIG. 8C .
  • a user's input operation eg, click
  • the electronic device 100 displays a user interface 702 as shown in FIG. 8C .
  • the user interface 702 shows multiple setting options, such as biometric setting options.
  • the biometric setting options include but are not limited to fingerprint setting options, face recognition setting options, bone voice setting options, etc.
  • the user interface 702 also shows a password setting option.
  • the password setting option Items include but are not limited to setting the lock screen password option, turning off the lock screen password option, and so on.
  • Other setting options are also shown in the user interface 702, such as lock screen password self-destruct setting options, security lock device setting options, etc.
  • the electronic device 100 can receive user operations in the user interface 702 and set an unlocking password.
  • the unlock code may also be called a pin code.
  • the electronic device 100 receives the user's input operation (eg, click) for setting the lock screen password option in the user interface 702 .
  • the electronic device 100 may display the user interface as shown in FIG. 8D 703.
  • the user interface 703 may be a screen lock password setting interface of the electronic device 100 .
  • the electronic device 100 can receive the user's operation in the user interface 703 and set a lock screen password.
  • the electronic device 100 may display the user interface 704.
  • the electronic device 100 can prompt the user to enter the same lock screen password multiple times.
  • the electronic device 100 can display the user interface 704 as shown in Figure 8E.
  • the electronic device 100 may receive a user's input operation (such as a click) for a determined option in the user interface 704 , and in response to the user's input operation, the electronic device 100 may use the input password as the lock screen of the electronic device 100 password.
  • a user's input operation such as a click
  • the lock screen password can be 6 digits, more or less numbers, or one or more combinations of letters, symbols, and numbers, which are not limited in the embodiments of this application. .
  • the electronic device 100 can also receive the user's operation and set the lock screen password for each user respectively.
  • Different user accounts on the electronic device 100 mean that after logging in to a certain user account, the electronic device 100 can display content corresponding to the user account. Different user accounts correspond to different contents. For example, the corresponding application types and application data generated by the applications are different under different user accounts.
  • 8G-8J illustrate a schematic diagram of the electronic device 100 receiving the lock screen identity information corresponding to different user accounts set by the user on the electronic device 100.
  • the electronic device 100 receives the user's input operation (such as click) for setting the lock screen password option in the user interface 702 .
  • the electronic device 100 may display the user interface as shown in FIG. 8H 705.
  • the user interface 705 shows multiple different user accounts, such as user “Lisa” and user “Wangzai Dairy’s iphone”.
  • the user can select a certain user account in the user interface 705 and set the lock screen password of the certain account.
  • the electronic device 100 may receive a user's input operation (eg, click) for the user "Lisa" option in the user interface 705 , and in response to the user's input operation, the electronic device 100 may display the user's input operation as shown in FIG. 8I Interface 706.
  • a user's input operation eg, click
  • the electronic device 100 may display the user's input operation as shown in FIG. 8I Interface 706.
  • the user interface 706 may be a lock screen password setting interface for the user “Lisa” in the electronic device 100 .
  • the electronic device 100 can receive the user's operation in the user interface 706 and set the lock screen password of the user "Lisa”.
  • the electronic device 100 may display the user interface 707.
  • the electronic device 100 can prompt the user to enter the same lock screen password multiple times.
  • the electronic device 100 can display the user interface 707 as shown in Figure 8J.
  • 9A to 9E illustrate a schematic diagram in which the electronic device 100 receives and responds to the user's operation and receives the activation password of application one registered by the user.
  • application one can be an address book application, and the opening password of application one can also be a pin code.
  • the electronic device 100 receives a user's input operation (eg, click) on the address book application icon.
  • a user's input operation eg, click
  • the electronic device 100 may display a user interface 801 as shown in FIG. 9B .
  • the user interface 801 shows recent call records, for example, at 19:38 today, a call was made with my mother. At 19:20 today, I called my dad. Yesterday, I had a phone call with Xiao Zhao. Yesterday, I had a phone call with Xiao Zhang. Yesterday, I also had a phone call with my brother.
  • the electronic device 100 receives the user's input operation (for example, click) for setting options in the user interface 801 .
  • the electronic device 100 may display the setting interface of the address book application, for example, as shown in FIG. User interface 802 shown in 9C.
  • the password setting options include setting the enable password option, turning off the enable password option, etc.
  • Other setting options are also shown in the user interface 802, such as enabling the password self-destruct option and so on.
  • the electronic device 100 can receive user operations in the user interface 802 and set an opening password.
  • the activation password may also be called a pin code.
  • the electronic device 100 may receive a user's input operation for setting an enable password option in the user interface 802 (for example, click), in response to the user's input operation, the electronic device 100 may display the user interface 803 as shown in FIG. 9D .
  • the user interface 803 may be an opening password setting interface of the electronic device 100 .
  • the electronic device 100 can receive the user's operation in the user interface 803 and set an opening password for the address book application.
  • the user enters the password to open the address book application in the user interface 803.
  • the electronic device 100 may display the user interface 804.
  • the electronic device 100 can prompt the user to enter the same opening password multiple times. If the opening passwords entered by the user multiple times are the same, the electronic device 100 can display the user interface 804 as shown in Figure 9E.
  • the electronic device 100 may receive a user's input operation (eg, click) for a certain option in the user interface 804, and in response to the user's input operation, the electronic device 100 may use the input password as an opening password for the address book application.
  • a user's input operation eg, click
  • the electronic device 100 may use the input password as an opening password for the address book application.
  • the opening password can be 6 digits, more or less numbers, or one or more combinations of letters, symbols, and numbers, which are not limited in the embodiments of the present application.
  • the maximum number of input opening times for the application is not limited to being set within the application.
  • the maximum number of input opening times for the application can also be set within the settings application. This is not limited in the embodiment of the present application.
  • Figure 10 is a schematic flowchart of another method for registering identity authentication information provided by an embodiment of the present application.
  • the operating system of the electronic device 100 receives the registration identity authentication information input by the user.
  • the identity authentication information may be the lock screen identity information of the electronic device 100 , and the lock screen identity information of the electronic device 100 may be a pin code, face image, fingerprint, voiceprint, etc.
  • the identity authentication information may also be the opening authentication information of the application on the electronic device 100, and the opening authentication information of the application may also be a pin code, face image, fingerprint, voiceprint, etc.
  • the user can operate on the electronic device 100 to set the lock screen identity information of the electronic device 100 .
  • the user can also operate on the electronic device 100 to set the registered lock screen identity information of different user accounts on the electronic device 100 .
  • the user can also operate on the electronic device 100 to set the opening identity information of the application on the electronic device 100 .
  • the electronic device 100 sends the registered identity authentication information to the security chip through the operating system.
  • the electronic device 100 can desensitize the registration identity authentication information through the operating system and send the desensitized registration identity authentication information. to the security chip. In this way, information leakage caused by clear text transmission during the sending process can be avoided.
  • Desensitization methods include but are not limited to: one-way hash (HASH) algorithm, Scrypt iterative hash algorithm or PBKDF2 iterative hash algorithm, etc.
  • HASH one-way hash
  • Scrypt iterative hash algorithm Scrypt iterative hash algorithm
  • PBKDF2 iterative hash algorithm etc.
  • the embodiments of this application do not limit the method of desensitization.
  • the electronic device 100 generates the secret value four through the security chip.
  • the secret value four is used to participate in protecting the root key on the electronic device 100 .
  • a secret value is generated in the security chip, which can prevent the secret value from being tampered with.
  • the electronic device 100 encrypts the secret value four based on the registered identity authentication information through the security chip to obtain the encrypted secret value four.
  • the electronic device 100 can also encrypt the secret value 4 based on the desensitized registration identity authentication information through the security chip.
  • Encrypting the secret value based on the registered identity authentication information may be byte encryption, XOR operation, HMAC or other methods, which are not limited in the embodiments of this application.
  • the security chip After the security chip generates a secret value, it encrypts the secret value based on the registered identity authentication information and then stores it in the security chip. In this way, even if the attacker tampered with the comparison logic of the identity authentication information, the attacker cannot decrypt the secret value encrypted based on the registration identity authentication information without obtaining the registration identity authentication information, that is, it cannot obtain the Secret value to avoid leakage of secret value.
  • the electronic device 100 stores the encrypted secret value and the registered identity authentication information through the security chip.
  • the electronic device 100 can also store the encrypted secret value and the desensitized registration identity authentication information through the security chip.
  • the security chip Since the security chip has high security, storing the encryption secret value and identity authentication information in the security chip can prevent the encryption secret value and identity authentication information from being leaked.
  • the security chip stores the encrypted secret values and identity authentication information corresponding to the multiple different user accounts.
  • the electronic device 100 can receive the user's operation to set the registration identity authentication information corresponding to the different user accounts. And store the registration identity authentication information and encryption secret values corresponding to different user accounts in the security chip.
  • the user can set the registration identity authentication information of the user account Lisa, and store the registration identity authentication information of the user account Lisa and the encryption secret value four in the security chip.
  • the secret value four is used to encrypt and protect the user account.
  • User data corresponding to Lisa For the user account Lucy, the user can set the registration identity authentication information of the user account Lucy, and store the registration identity authentication information of the user account Lucy and the encryption secret value five in the security chip.
  • the secret value five is used to encrypt and protect the user corresponding to the user account Lucy. data.
  • the user can set the registration identity authentication information of the user account Tom, and store the registration identity authentication information and the encryption secret value six of the user account Tom in the security chip.
  • the secret value six is used to encrypt and protect the user corresponding to the user account Tom. data.
  • the electronic device 100 may also include more or fewer user accounts, which is not limited in the embodiments of the present application.
  • the security chip is not the user account shown in Table 1. What is stored in the security chip may be the ID of the user account.
  • the ID of the user account corresponding to the user account “Lisa” may be "0123”.
  • the ID of the user account corresponding to the user account “Lucy” may be "0124”.
  • the ID of the user account corresponding to the user account “Tom” can be "0125” and so on.
  • the ID of the user account may also be in other forms, which is not limited in the embodiments of this application.
  • what is stored in the security chip may not be the ID of the user account, but may be an ID that is mapped to the ID of the user account, etc.
  • the ID of the user account can be found based on the ID that has a mapping relationship with the ID of the user account. The embodiments of the present application do not limit this.
  • the user downloads and installs multiple applications, such as a first application, a second application, and a third application.
  • Users can set the opening authentication information for multiple applications under the user account Lisa. That is, before opening the application, the user needs to enter the correct opening authentication information so that the application can be opened. Otherwise, the application will not be opened.
  • the user can device the registration opening authentication information of the first application, and store the registration opening authentication information and the encryption secret value seven of the first application in the security chip. The secret value seven is used to encrypt and protect the information in the first application. application data.
  • the user can device the registration opening authentication information of the second application, and store the registration opening authentication information and the encryption secret value eight of the second application in the security chip.
  • the secret value eight is used to encrypt and protect the application data in the second application.
  • the user can device the registration opening authentication information of the third application, and store the registration opening authentication information and the encryption secret value nine of the third application in the security chip.
  • the secret value nine is used to encrypt and protect the application data in the third application.
  • the user can also set the opening authentication information of multiple applications under the user account Lisa to be the same.
  • setting the opening authentication information of multiple applications under the user account Lisa with one click can reduce the user's operations.
  • the opening authentication information of the same application may be different or the same, which is not limited in the embodiments of this application.
  • the security chip is not the application identifier shown in Table 2. What is stored in the security chip may be the ID of the application identifier.
  • the ID of the application identifier corresponding to the application identifier "first application” may be "0X01".
  • the ID of the application identifier corresponding to the application identifier "second application” may be "0X02".
  • the ID of the application identifier corresponding to the application identifier "third application” may be "0X03".
  • the ID of the application identifier may also be in other forms, which is not limited in the embodiments of this application.
  • what is stored in the security chip may not be the ID of the application identifier, but may be an ID that has a mapping relationship with the ID of the application identifier, etc.
  • the ID of the application identifier can be found based on the ID that has a mapping relationship with the ID of the application identifier. The embodiments of the present application do not limit this.
  • the electronic device 100 sends the secret value four to the operating system through the security chip.
  • the secret value 4 may be desensitized and then sent to the operating system, or the encrypted secret value 4 may be sent to the operating system.
  • the security chip can be prevented from sending secret values to the operating system, causing information leakage during the sending process.
  • the electronic device 100 encrypts the root key based on the secret value 4 through the operating system.
  • the electronic device 100 may encrypt the root key based only on the secret value 4.
  • the electronic device 100 can also encrypt the root key using the secret value 4 and the registered identity authentication information.
  • the electronic device 100 may also encrypt the root key using the secret value 4 and the desensitized registration identity authentication information.
  • the electronic device 100 can also encrypt the root key through a secret value, registered identity authentication information and other factors.
  • the embodiment of this application does not limit the encryption method of the root key.
  • the electronic device 100 can also encrypt the root key using a secret value, desensitized registration identity authentication information and other factors.
  • the embodiment of this application does not limit the encryption method of the root key.
  • S1006 and S1007 may also be executed within the security chip. That is, S1006 and S1007 can be replaced by S1008.
  • the electronic device 100 encrypts the root key based on the secret value 4 through the security chip.
  • the security chip can be prevented from sending secret values to the operating system, causing information leakage during the sending process.
  • the electronic device 100 when the registered identity authentication information is the registered lock screen identity authentication information, when the first condition is met, the electronic device 100 can derive the data key based on the root key, and use the data key to electronically User data on the device 100 is encrypted and protected. Only when the user inputs correct lock screen identity authentication information, the electronic device 100 can decrypt the user data on the electronic device 100 based on the data key to obtain the real user data.
  • the first condition can be any one or more of the following:
  • the electronic device 100 After the electronic device 100 is turned off and turned on for the first time, the electronic device 100 can encrypt and protect the user data on the electronic device 100 based on the data key.
  • the electronic device 100 is powered on and the screen is locked, but the screen lock time of the electronic device 100 exceeds a certain time, the electronic device 100 can encrypt and protect the user data on the electronic device 100 based on the data key.
  • the electronic device 100 is powered on and the screen is locked, but the electronic device 100 fails to verify the user's identity based on the lock screen identity information for a certain number of consecutive times. Then the electronic device 100 can perform verification on the user data on the electronic device 100 based on the data key. Encrypted protection.
  • the first type of lock screen identity information may be face images, fingerprint images, voiceprint features, etc.
  • the second type of lock screen identity information may be a pin code.
  • the security of the second type of lock screen identity information is higher than the security of the first type of lock screen identity information.
  • the electronic device 100 is turned on and the screen is locked, and the user uses a face image to unlock. If the unlocking fails for 5 consecutive times, the electronic device 100 can encrypt the user data on the electronic device 100 based on the data key. Protect.
  • the first condition may also be other conditions, which are not limited in the embodiments of this application.
  • the electronic device 100 when registering identity authentication information to enable identity authentication information for registration, when the first condition is met, the electronic device 100 may derive the data key based on the root key, and apply a data key pair based on the data key.
  • the application data inside is encrypted and protected. Only when the user inputs correct verification information to turn on the identity authentication information, can the electronic device 100 decrypt the application data in application one based on the data key to obtain the real application data.
  • the first condition can be any one or more of the following:
  • the electronic device 100 After the electronic device 100 is turned off, when it is turned on for the first time, the electronic device 100 can encrypt and protect the application data in application one based on the root key.
  • the electronic device 100 can encrypt and protect the application data in application one based on the root key.
  • the electronic device 100 fails to verify the user identity for a certain number of consecutive times based on the opening authentication information.
  • the electronic device 100 can encrypt and protect the application data in Application 1 based on the root key.
  • the electronic device 100 can encrypt and protect the application data in Application 1 based on the root key.
  • the first condition may also be other conditions, which are not limited in the embodiments of this application.
  • the device-level root key and the application-level update key can be different or the same.
  • the data key derived based on the root key at the device level and the data key derived based on the root key at the application level may be different or the same, and are not limited in this embodiment of the present application.
  • Figure 11 is a schematic flowchart of another method for registering identity authentication information provided by an embodiment of the present application.
  • the embodiment of Fig. 11 is similar to the embodiment of Fig. 10. The difference lies in that the method of generating the secret value in the embodiment of Fig. 11 is different from that of the embodiment of Fig. 10.
  • the electronic device 100 receives the registration identity authentication information input by the user through the operating system.
  • the electronic device 100 After receiving the registration identity authentication information input by the user through the operating system, the electronic device 100 randomly generates a secret value one.
  • the electronic device 100 sends the registered identity authentication information and secret value to the security chip through the operating system.
  • the electronic device 100 can also desensitize the registered identity authentication information and then send it to the security chip.
  • the electronic device 100 can send the desensitized registration identity authentication information and secret value to the security chip through the operating system.
  • the electronic device 100 generates secret value two through the security chip.
  • the electronic device 100 obtains the secret value three based on the secret value one and the secret value two.
  • the electronic device 100 can also obtain the secret value three through the secret value one, the secret value two and other factors, which is not limited in the embodiment of the present application.
  • secret value two is generated in the security chip, and secret value three is obtained based on secret value one and secret value two, which can prevent secret value three from being tampered with.
  • the electronic device 100 encrypts the secret value three based on the identity authentication information through the security chip to obtain the encrypted secret value three.
  • the electronic device 100 stores the encrypted secret value and identity authentication information through the security chip.
  • the electronic device 100 sends the secret value three to the operating system through the security chip.
  • the electronic device 100 encrypts the root key based on the secret value three through the operating system.
  • Figure 12 is a schematic flowchart of a method for comparing and verifying registration identity authentication information and registration identity authentication information provided by an embodiment of the present application.
  • the method of comparing and verifying the registered identity authentication information and the registered identity authentication information shown in Figure 12 is a verification method provided based on the method of registering the identity authentication information shown in Figure 10 .
  • the electronic device 100 receives the identity authentication information input by the user through the operating system.
  • the identity authentication information may be the lock screen authentication information of the user account "Lisa”.
  • the electronic device 100 may display a user interface 1501.
  • the user interface 1501 is used to prompt the user to enter the lock screen authentication information of the user account "Lisa”.
  • the electronic device 100 displays a prompt message as shown in FIG. 13B .
  • the prompt message may be "The device cannot be unlocked.” Or the prompt message can be "Please wait until how long to unlock.” As the number of incorrect inputs of lock screen authentication information increases, the time that users can unlock increases accordingly.
  • the electronic device 100 can receive the user's operation in the user interface 1502 to switch to log in to other Ade user accounts. For example, the electronic device 100 may receive a user's input operation (eg, click) for option 1503 in the user interface 1502, and in response to the user's input operation, the electronic device 100 may display a prompt bar 1504 as shown in FIG. 13C. The user can select the logged-in user account in the prompt bar 1504.
  • the electronic device 100 can receive the user's input operation (such as clicking) on the user account "Lucy” option in the prompt bar 1504.
  • the electronic device 100 can log in to the user account "Lucy”.
  • the electronic device 100 may display the user interface 1505 as shown in FIG. 13D.
  • User interface 1505 is the unlocking interface for user account "Lucy”.
  • the electronic device 100 can receive the lock screen authentication information corresponding to the user account "Lucy” input by the user into the user interface 1505.
  • the electronic device 100 can perform an unlocking operation and display user data corresponding to the user account "Lucy”.
  • the identity authentication information may be the opening authentication information of a certain application on the electronic device 100 .
  • the application may be an address book application.
  • FIG. 13E shows the main interface 1506 of the electronic device 100.
  • the main interface 1506 shows icons of multiple applications, such as icons of file management applications, icons of email applications, icons of music applications, icons of smart life applications, and sports. Health app icon, Settings app icon, Camera app icon, Contacts app icon, Phone app icon, Messages app icon, etc.
  • Figure 13E also shows page indicators, weather indicators, calendar indicators, power indicators, time indicators, signal indicators, and so on.
  • the electronic device 100 receives a user's input operation (eg, click) on the icon of the address book application.
  • the electronic device 100 may display a user interface 1507 as shown in FIG. 13F .
  • the user interface 1507 is used to prompt the user to enter an opening password for the address book application.
  • the electronic device 100 can perform the operation of opening the address book application and display the application data in the address book application.
  • the opening password for the same application can be different for different user accounts.
  • the electronic device 100 sends the identity authentication information to the security chip through the operating system.
  • the electronic device 100 can desensitize the identity verification information through the operating system, and then send the desensitized identity verification information to the security chip.
  • the electronic device 100 confirms through the security chip that the verification identity authentication information and the registration identity authentication information meet the preset conditions.
  • the security chip of the electronic device 100 confirms that the verification identity authentication information and the registration identity authentication information meet the preset conditions, it means that the verification is passed.
  • the preset condition may be that the verification identity authentication information input by the user is completely consistent with the registration identity authentication information stored in the security chip, or that the verification identity authentication information input by the user is completely consistent with the registration identity authentication information stored in the electronic device after transformation. consistent.
  • the preset condition can also be other conditions, which are not limited in the embodiments of this application.
  • the electronic device 100 decrypts the encrypted secret value four through the security chip based on the verification of the identity authentication information, and obtains the secret value four.
  • the encryption secret value 4 is encrypted based on the identity authentication information of the registered identity.
  • the security chip determines that the verification of the identity authentication information has passed, the encrypted secret value four can be decrypted based on the verification of the identity authentication information to obtain the secret value four.
  • the user data can then be decrypted to obtain the real user data.
  • the secret value is encrypted based on other factors in addition to the authentication information of the registered identity, then other factors may be used during decryption.
  • the electronic device 100 confirms through the security chip that the verification identity authentication information and the registration identity authentication information do not meet the preset conditions, it means that the verification identity authentication information has not been verified, then the electronic device 100 will not execute S1204, and will not be able to The secret value four is obtained, and the root key cannot be obtained. In this way, the security of encrypted user data is guaranteed.
  • the electronic device 100 sends the secret value four to the operating system through the security chip.
  • the security chip After the security chip confirms that the verification identity authentication information and the registration identity authentication information meet the preset conditions, and the verification is successful, the security chip decrypts the encrypted secret value four based on the verification identity authentication information, obtains the secret value four, and sends the secret value four to The operating system enables the operating system to decrypt the encrypted root key based on the secret value to obtain the root key.
  • the electronic device 100 decrypts the root key based on the secret value 4 through the operating system to obtain the root key, obtains the data key based on the root key, and decrypts the user data based on the data key.
  • the electronic device 100 can decrypt the previously encrypted root key based on the secret value four to obtain the root key.
  • the data key is then obtained based on the root key.
  • the user data encrypted based on the data key is decrypted to obtain unencrypted user data. Allows users to view real user data.
  • the root key is encrypted based on other factors during encryption, then other factors need to be involved in decryption to obtain the unencrypted root key.
  • Figure 14 is a schematic flowchart of another method for comparing and verifying registration identity authentication information and registration identity authentication information provided by an embodiment of the present application.
  • the method of comparing and verifying the registered identity authentication information and the registered identity authentication information shown in Figure 14 is a verification method provided based on the method of registering the identity authentication information shown in Figure 11 .
  • the electronic device 100 receives the identity authentication information input by the user through the operating system.
  • the electronic device 100 sends the identity authentication information to the security chip through the operating system.
  • the electronic device 100 can desensitize the identity verification information through the operating system, and then send the desensitized identity verification information to the security chip.
  • the electronic device 100 confirms through the security chip that the verification identity authentication information and the registration identity authentication information meet the preset conditions.
  • the security chip of the electronic device 100 confirms that the verification identity authentication information and the registration identity authentication information meet the preset conditions, it means that the verification is passed.
  • the preset condition may be that the verification identity authentication information input by the user is completely consistent with the registration identity authentication information stored in the security chip, or that the verification identity authentication information input by the user is transformed and is consistent with the registration identity authentication information stored in the electronic device. Totally consistent.
  • the preset condition may also be other conditions, which are not limited in the embodiments of this application.
  • the electronic device 100 decrypts the encrypted secret value three based on the identity authentication information through the security chip to obtain the secret value three.
  • the encryption secret value three is encryption of identity authentication information based on the registered identity.
  • the security chip determines that the verification of the identity authentication information has passed, the encrypted secret value three can be decrypted based on the verification of the identity authentication information to obtain the secret value three.
  • the user data can then be decrypted to obtain the real user data.
  • the secret value three is encrypted based on other factors in addition to the authentication information of the registered identity, then other factors may be used during decryption.
  • the electronic device 100 confirms through the security chip that the verification identity authentication information and the registration identity authentication information do not meet the preset conditions, it means that the verification identity authentication information has not been verified, then the electronic device 100 will not execute S1304, and will not be able to The secret value three is obtained, and the root key cannot be obtained. In this way, the security of encrypted user data is guaranteed.
  • the electronic device 100 sends the secret value three to the operating system through the security chip.
  • the security chip After the security chip confirms that the verification identity authentication information and registration identity authentication information meet the preset conditions, and the verification is successful, the security chip decrypts the encrypted secret value three based on the verification identity authentication information, obtains the secret value three, and sends the secret value three to The operating system enables the operating system to decrypt the encrypted root key based on the secret value to obtain the root key.
  • the electronic device 100 decrypts the root key based on the secret value three through the operating system to obtain the root key, obtains the data key based on the root key, and decrypts the user data based on the data key.
  • the electronic device 100 can decrypt the previously encrypted root key based on the secret value three to obtain the root key.
  • the data key is then obtained based on the root key.
  • the user data encrypted based on the data key is decrypted to obtain unencrypted user data. Allows users to view real user data.
  • the root key is encrypted based on other factors during encryption, then other factors need to be involved in decryption to obtain the unencrypted root key.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • Figure 15 is a schematic flowchart of a data protection method provided by an embodiment of the present application.
  • the electronic device receives the registration identity authentication information input by the user.
  • the registration identity authentication information includes the registration lock screen identity authentication information of the electronic device and/or the registration opening authentication information of the first application on the electronic device; wherein the registration lock screen identity information is used when the user inputs Unlock the electronic device when the verification lock screen identity authentication information and registered lock screen identity information meet the preset conditions;
  • the registration opening authentication information is used to open the first application when the verification registration opening authentication information and the registration opening authentication information input by the user meet the preset conditions.
  • the electronic device generates a first secret value.
  • the first secret value is used to encrypt and protect the root key.
  • the root key is used to protect the electronic device. User data.
  • the first secret value can be directly used to encrypt and protect the root key, and the first secret value can also participate in encrypting and protecting the root key together with other factors.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the root key can be directly used to encrypt and protect user data on electronic devices.
  • the root key can also be derived from the data key, and user data on the electronic device is encrypted and protected based on the data key.
  • the root key can be derived from one or more levels to obtain the data key.
  • the electronic device encrypts the first secret value based on the registered identity authentication information to obtain the encrypted first secret value.
  • the electronic device stores the registered identity authentication information and the encrypted first secret value.
  • the secret value can be encrypted and stored based on the registration identity authentication information entered by the user, further protecting the security of the secret value.
  • the electronic device receives the registration identity authentication information input by the user, which specifically includes: the electronic device receives the registration identity authentication information input by the user through the operating system; after the electronic device receives the registration identity authentication information input by the user, Before the electronic device generates the first secret value, the method also includes: the electronic device sends the registration identity authentication information to the security chip through the operating system; the electronic device generates the first secret value, specifically including: the electronic device generates the first secret value through the security chip ; The electronic device encrypts the first secret value based on the registered identity authentication information to obtain the encrypted first secret value, which specifically includes: the electronic device encrypts the first secret value based on the registered identity authentication information through the security chip to obtain the encrypted first secret value; electronic device The device stores the registered identity authentication information and the encrypted first secret value, which specifically includes: the electronic device stores the registered identity authentication information and the encrypted first secret value in the security chip.
  • the first secret value may be the secret value four shown in FIG. 10 .
  • the electronic device when the electronic device has a security chip, the electronic device can generate a secret value within the security chip to avoid generating a secret value outside the security chip and causing an attacker to tamper with the secret value and cause user data to be leaked.
  • the encrypted first secret value and the registered identity authentication information are stored in the security chip.
  • the security chip has a high security factor, which further protects the security of the encrypted first secret value and the registered identity authentication information.
  • the method before the electronic device generates the first secret value, the method further includes: the electronic device generates a second secret value through the operating system; the electronic device sends the second secret value to the security chip through the operating system; The device generates the third secret value through the security chip; the electronic device generates the first secret value, which specifically includes: the electronic device generates the first secret value based on the second secret value and the third secret value through the security chip.
  • This application also provides another method of generating the first secret value. That is, the first secret value is jointly generated based on the third secret value generated within the security chip and the second secret value generated outside the security chip. Even if an attacker can tamper with the second secret value generated outside the security chip, he cannot tamper with the third secret value generated within the security chip. This can also prevent the first secret value from being tampered with by the attacker.
  • the second secret value may be secret value one shown in FIG. 11
  • the third secret value may be secret value two shown in FIG. 11 .
  • the method further includes: when the first condition is met, the electronic device receives the verification identity authentication information input by the user; When the verification identity authentication information and the registered identity authentication information meet the preset conditions, the electronic device decrypts the encrypted first secret value based on the verification identity authentication information to obtain the first secret value; the electronic device decrypts the encrypted root key based on the first secret value Decrypt to obtain the root key; the electronic device decrypts the encrypted user data based on the root key to obtain unencrypted user data.
  • the first secret value can be directly used to decrypt the encryption root key to obtain the root key, or the first secret value can also participate in other factors to decrypt the encryption root key to obtain the root key. Other factors include but are not limited to one or more of registration authentication information, hardware unique keys, and device unique IDs.
  • the root key After obtaining the root key, the root key can be directly used to decrypt the encrypted user data to obtain unencrypted user data.
  • the data key can also be derived based on the root key, and the encrypted user data can be decrypted based on the data key to obtain unencrypted user data.
  • the root key can be derived from one or more levels to obtain the data key.
  • the security chip When verifying the identity authentication information input by the user, the security chip can decrypt the encrypted first secret value based on the identity authentication information only if the identity authentication information and registration identity authentication information input by the user meet the preset conditions. Get the unencrypted first secret value. In this way, the attacker can be prevented from tampering with the verification logic if the first secret value is not encrypted. The circumstances leading to the leakage of the first secret value situation occurs.
  • the preset condition can be that the verification identity authentication information input by the user is completely consistent with the registered identity authentication information stored in the security chip, or that the verification identity authentication information input by the user is transformed and is consistent with the registered identity stored in the electronic device.
  • the certification information is completely consistent.
  • the preset condition can also be other conditions, which are not limited in the embodiments of this application.
  • the method further Including: the electronic device desensitizes the identity verification information through the operating system to obtain the desensitized verification identity authentication information; the electronic device sends the desensitized verification identity authentication information to the security chip through the operating system; the electronic device encrypts the third-party authentication information based on the verification identity authentication information.
  • Decryption of a secret value specifically includes: when the desensitization verification identity authentication information and the desensitization registration identity authentication information meet preset conditions, the electronic device decrypts the encrypted first secret value based on the desensitization verification identity authentication information through the security chip, Get the first secret value.
  • the electronic device can directly encrypt the first secret value based on the desensitized registration identity authentication information through the security chip to obtain the encrypted first secret value.
  • the electronic device may also perform key derivation on the desensitized registration identity authentication information, or perform hash calculation on the desensitized registration identity authentication information, and use the derived key or hash calculated value to A secret value is encrypted to obtain the encrypted first secret value.
  • the embodiments of the present application do not limit this.
  • the electronic device registration identity authentication information is desensitized to avoid the leakage of the registration identity authentication information caused by being transmitted in plain text during the transmission process.
  • the method further includes: the electronic device verifies the identity authentication information through the operating system.
  • the identity authentication information is desensitized to obtain the desensitization verification identity authentication information; the electronic device sends the desensitization verification identity authentication information to the security chip through the operating system; the electronic device decrypts the encrypted first secret value based on the verification identity authentication information, specifically including: When the desensitization verification identity authentication information and the desensitization registration identity authentication information meet the preset conditions, the electronic device decrypts the encrypted first secret value based on the desensitization verification identity authentication information through the security chip to obtain the first secret value.
  • the electronic device can directly decrypt and decrypt the encrypted first secret value based on the desensitized registration identity authentication information through the security chip to obtain the unencrypted first secret value.
  • the electronic device can also decrypt and decrypt the encrypted first secret value based on the key derived from the desensitized registration identity authentication information or the hash value of the desensitized registration identity authentication information to obtain the unencrypted first secret value. Secret value.
  • the embodiments of the present application do not limit this.
  • the electronic device when the desensitized registration authentication information is stored in the security chip, when verifying the user's ID card, the electronic device also needs to desensitize the verification identity authentication information and compare it with the desensitized registration authentication information.
  • the electronic device receives the registration identity authentication information input by the user, which specifically includes: the electronic device receives the registration lock screen identity information input by the user, and the registered lock screen identity information is used to verify the lock screen identity input by the user.
  • the electronic device is unlocked; the electronic device generates a first secret value, the first secret value is used to encrypt and protect the root key, and the root key is used to protect the electronic device.
  • the user data specifically includes the electronic device generating a first secret value, the first secret value is used to encrypt and protect the first root key, and the first root key is used to protect the user data on the electronic device; the electronic device is based on the registered identity authentication information
  • Encrypting the first secret value to obtain the encrypted first secret value specifically includes: the electronic device encrypts the first secret value based on the registered lock screen identity information to obtain the encrypted first secret value; the electronic device stores the registered identity authentication information and the encrypted first secret value.
  • the secret value specifically includes: the electronic device stores the registered lock screen identity information and the encrypted first secret value.
  • the user can set the lock screen identity information for unlocking the electronic device, and store the lock screen identity information and the first secret value in the security chip.
  • multiple different user accounts can be logged into the electronic device. Users can also set lock screen identity information corresponding to multiple different user accounts.
  • the root keys corresponding to multiple different user accounts may be different or the same, which is not limited in the embodiments of this application.
  • the first secret value can be directly used to encrypt and protect the first root key, and the first secret value can also participate in encryption and protection of the first root key together with other factors.
  • Other factors include but are not limited to one or more of registration authentication information, hardware unique keys, and device unique IDs.
  • the first root key After obtaining the first root key, the first root key can be directly used to encrypt and protect user data on the electronic device. It can also be based on the first The root key is derived to obtain the data key, and the user data on the electronic device is encrypted and protected based on the data key. Among them, the first root key can be derived through one or more levels to obtain the data key.
  • the method further includes: the electronic device receives the registration opening authentication information input by the user, and the registration opening authentication information is used when the user inputs the registration opening authentication information.
  • the first application is launched;
  • the electronic device generates a fourth secret value, the fourth secret value is used to encrypt and protect the second root key, and the second root key is used to protect the application data in the first application; the electronic device opens the authentication information based on the registration to the fourth secret value Encrypt to obtain the encrypted fourth secret value, and the electronic device stores the registration opening authentication information and the encrypted fourth secret value.
  • the fourth secret value can be directly used to encrypt and protect the second root key, and the fourth secret value can also participate in encryption and protection of the second root key together with other factors.
  • Other factors include but are not limited to one or more of registration opening authentication information, hardware unique key, device unique ID, and application identification.
  • the second root key can be directly used to encrypt and protect application data within the first application.
  • the data key may also be derived based on the second root key, and the application data decryption in the first application may be encrypted and protected based on the data key.
  • the root key can be derived from one or more levels to obtain the data key.
  • the user can set the opening authentication information of multiple applications on the electronic device, and store the opening authentication information and the fourth secret value in the security chip.
  • the opening authentication information of the same application may be different or the same, which is not limited in the embodiments of this application.
  • the second root key is different from the first root key.
  • the second root key and the first root key may also be the same, which is not limited in the embodiments of the present application.
  • Figure 16 is a schematic flowchart of a data storage device provided by an embodiment of the present application.
  • the device 1600 may include a receiving unit 1601, a processing unit 1602, and a storage unit 1603.
  • the device 1600 can be used to perform a data storage method shown in the embodiment of Figure 15.
  • the receiving unit 1601 is used to receive the registration identity authentication information input by the user.
  • the processing unit 1602 is configured to generate a first secret value, the first secret value is used to encrypt and protect a root key, and the root key is used to protect user data on the electronic device.
  • the processing unit 1602 is also configured to encrypt the first secret value based on the registered identity authentication information to obtain the encrypted first secret value.
  • Storage unit 1603 used to store registered identity authentication information and encrypted first secret value.
  • the first secret value can be directly used to encrypt and protect the root key, and the first secret value can also participate in encrypting and protecting the root key together with other factors.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the root key can be used directly to encrypt and protect user data on electronic devices.
  • the root key can also be derived from the data key, and user data on the electronic device is encrypted and protected based on the data key.
  • the root key can be derived from one or more levels to obtain the data key.
  • the secret value can be encrypted and stored based on the registration identity authentication information entered by the user, further protecting the security of the secret value.
  • the receiving unit 1601 is specifically configured to receive registration identity authentication information input by the user through the operating system.
  • the processing unit 1602 is also used to send the registration identity authentication information to the security chip through the operating system.
  • the processing unit 1602 is specifically configured to generate a first secret value through a security chip.
  • the storage unit 1603 is specifically configured to encrypt the first secret value based on the registered identity authentication information through the security chip to obtain the encrypted first secret value.
  • the storage unit 1603 is specifically used to store the registered identity authentication information and the encrypted first secret value in the security chip.
  • the electronic device when the electronic device has a security chip, the electronic device can generate a secret value within the security chip to avoid generating a secret value outside the security chip and causing an attacker to tamper with the secret value and cause user data to be leaked.
  • the encrypted first secret value and the registered identity authentication information are stored in the security chip.
  • the security chip has a high security factor, which further protects the security of the encrypted first secret value and the registered identity authentication information.
  • the processing unit 1602 is also configured to generate a second secret value through the operating system.
  • the processing unit 1602 is also configured to send the second secret value to the security chip through the operating system.
  • the processing unit 1602 is also used to generate a third secret value through the security chip.
  • the processing unit 1602 is also configured to generate a first secret value based on the second secret value and the third secret value through the security chip.
  • This application also provides another method of generating the first secret value. That is, the first secret value is jointly generated based on the third secret value generated within the security chip and the second secret value generated outside the security chip. Even if an attacker can tamper with the second secret value generated outside the security chip, he cannot tamper with the third secret value generated within the security chip. This can also prevent the first secret value from being tampered with by the attacker.
  • the receiving unit 1601 is also configured to, when the first condition is met, the electronic device receive the verification identity authentication information input by the user.
  • the processing unit 1602 is also configured to decrypt the encrypted first secret value based on the verified identity authentication information and obtain the first secret value when the verification identity authentication information and the registered identity authentication information meet the preset conditions.
  • the processing unit 1602 is also configured to decrypt the encrypted root key based on the first secret value to obtain the root key.
  • the processing unit 1602 is also used to decrypt the encrypted user data based on the root key to obtain unencrypted user data.
  • the electronic device can directly decrypt the encrypted user data based on the root key to obtain unencrypted user data.
  • the first secret value can be directly used to decrypt the encryption root key to obtain the root key, or the first secret value can also participate in other factors to decrypt the encryption root key to obtain the root key.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the root key After obtaining the root key, the root key can be directly used to decrypt the encrypted user data to obtain unencrypted user data.
  • the data key can also be derived based on the root key, and the encrypted user data can be decrypted based on the data key to obtain unencrypted user data.
  • the root key can be derived from one or more levels to obtain the data key.
  • the security chip When verifying the identity authentication information input by the user, the security chip can decrypt the encrypted first secret value based on the identity authentication information only if the identity authentication information and registration identity authentication information input by the user meet the preset conditions. Get the unencrypted first secret value. In this way, the attacker can be prevented from tampering with the verification logic if the first secret value is not encrypted. A situation leading to the leakage of the first secret value occurs.
  • the processing unit 1602 is specifically configured to desensitize the registration identity authentication information through the operating system to obtain the desensitized registration identity authentication information.
  • the processing unit 1602 is specifically configured to send the desensitized registration identity authentication information to the security chip through the operating system.
  • the processing unit 1602 is specifically configured to encrypt the first secret value based on the desensitized registration identity authentication information through the security chip to obtain the encrypted first secret value.
  • the electronic device can directly encrypt the first secret value based on the desensitized registration identity authentication information through the security chip to obtain the encrypted first secret value.
  • the electronic device may also perform key derivation on the desensitized registration identity authentication information, or perform hash calculation on the desensitized registration identity authentication information, and use the derived key or hash calculated value to A secret value is encrypted to obtain the encrypted first secret value.
  • the embodiments of the present application do not limit this.
  • the electronic device registration identity authentication information is desensitized to avoid the leakage of the registration identity authentication information caused by being transmitted in plain text during the transmission process.
  • the processing unit 1602 is also configured to desensitize the identity verification information through the operating system to obtain the desensitized verification identity authentication information.
  • the processing unit 1602 is also used to send desensitization verification identity authentication information to the security chip through the operating system.
  • the processing unit 1602 is specifically configured to decrypt the encrypted first secret value based on the desensitized verification identity authentication information through the security chip to obtain the first secret value when the desensitized verification identity authentication information and the desensitized registration identity authentication information meet the preset conditions. Secret value.
  • the electronic device can directly decrypt and decrypt the encrypted first secret value based on the desensitized registration identity authentication information through the security chip to obtain the unencrypted first secret value.
  • the electronic device can also decrypt the encrypted first secret value based on the key derived from the desensitized registration identity authentication information or the value calculated by hashing the desensitized registration identity authentication information to obtain the unencrypted first secret value. Secret value.
  • the embodiments of the present application do not limit this.
  • the electronic device when the desensitized registration authentication information is stored in the security chip, when verifying the user's ID card, the electronic device also needs to desensitize the verification identity authentication information and compare it with the desensitized registration authentication information.
  • the registration identity authentication information includes the registration lock screen identity authentication information of the electronic device and/or the registration opening authentication information of the first application on the electronic device; wherein the registration lock screen identity information is used when the user inputs Unlock the electronic device when the verification lock screen identity authentication information and registered lock screen identity information meet the preset conditions;
  • the registration opening authentication information is used to open the first application when the verification registration opening authentication information and the registration opening authentication information input by the user meet the preset conditions.
  • the receiving unit 1601 is specifically configured to receive the registered lock screen identity information input by the user.
  • the registered lock screen identity information is used to verify the lock screen identity authentication information input by the user and the registered lock screen identity information. Unlock the electronic device under preset conditions.
  • the processing unit 1602 is specifically configured to generate a first secret value.
  • the first secret value is used to encrypt and protect the first root key.
  • the first root key is used to protect user data on the electronic device.
  • the processing unit 1602 is specifically configured to encrypt the first secret value based on the registered lock screen identity information to obtain the encrypted first secret value.
  • the processing unit 1602 is specifically configured to store the registered lock screen identity information and the encrypted first secret value.
  • the first secret value can be directly used to encrypt and protect the first root key, and the first secret value can also participate in encryption and protection of the first root key together with other factors.
  • Other factors include but are not limited to one or more of registration identity authentication information, hardware unique keys, and device unique IDs.
  • the first root key can be directly used to encrypt and protect user data on the electronic device.
  • the data key can also be derived based on the first root key, and the user data on the electronic device is encrypted and protected based on the data key.
  • the first root key can be derived through one or more levels to obtain the data key.
  • the user can set the lock screen identity information for unlocking the electronic device, and store the lock screen identity information and the first secret value in the security chip.
  • multiple different user accounts can be logged into the electronic device. Users can also set lock screen identity information corresponding to multiple different user accounts.
  • the root keys corresponding to multiple different user accounts may be different or the same, which is not limited in the embodiments of this application.
  • the receiving unit 1601 is also used to receive the registration activation authentication information input by the user.
  • the registration activation authentication information is used to verify that the registration activation authentication information input by the user and the registration activation authentication information meet the preset conditions. In this case, open the first application.
  • the processing unit 1602 is also configured to generate a fourth secret value.
  • the fourth secret value is used to encrypt and protect the second root key.
  • the second root key is used to protect application data in the first application.
  • the processing unit 1602 is also configured to encrypt the fourth secret value based on the registration activation authentication information to obtain the encrypted fourth secret value.
  • the electronic device stores the registration activation authentication information and the encrypted fourth secret value.
  • the fourth secret value can be directly used to encrypt and protect the second root key, and the fourth secret value can also participate in encryption and protection of the second root key together with other factors.
  • Other factors include but are not limited to one or more of registration opening authentication information, hardware unique key, device unique ID, and application identification.
  • the second root key can be directly used to encrypt and protect application data within the first application.
  • the data key may also be derived based on the second root key, and the application data decryption in the first application may be encrypted and protected based on the data key.
  • the root key can be derived from one or more levels to obtain the data key.
  • the user can set the opening authentication information of multiple applications on the electronic device, and store the opening authentication information and the fourth secret value in the security chip.
  • the opening authentication information of the same application may be different or the same, which is not limited in the embodiments of this application.
  • the second root key is different from the first root key.
  • the second root key and the first root key may also be the same, which is not limited in the embodiments of the present application.
  • the electronic device includes: one or more processors, one or more memories, and a display screen; one or more memories and display screens are coupled with one or more processors, and one or more
  • the memory is used to store computer program code.
  • the computer program code includes computer instructions.
  • One or more processors call the computer instructions to cause the electronic device to execute a data protection method shown in Figure 15.
  • the present application provides a computer-readable storage medium for storing computer instructions.
  • the computer instructions When the computer instructions are run on electronic equipment, the electronic equipment executes a data protection method shown in Figure 15.
  • This application provides a computer program product.
  • the computer program product When the computer program product is run on an electronic device, it causes the electronic device to execute a data protection method shown in Figure 15.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Mathematical Physics (AREA)
  • Storage Device Security (AREA)

Abstract

本申请提供了一种数据保护方法及电子设备,方法包括:电子设备接收用户输入的注册身份认证信息;电子设备生成第一秘密值,第一秘密值用于加密保护根密钥,根密钥用于保护电子设备上的用户数据;电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值;电子设备存储注册身份认证信息和加密第一秘密值,这样,在电子设备生成秘密值之后。可以基于用户输入的注册身份认证信息对秘密值加密后存储,进一步保护了秘密值的安全性。

Description

一种数据保护方法及电子设备
本申请要求于2022年9月2日提交中国专利局、申请号为202211072325.1、申请名称为“一种数据保护方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据安全技术领域,尤其涉及一种数据保护方法及电子设备。
背景技术
安全芯片作为硬件级的高安全可信环境,具有防物理攻击的安全强度,被广泛应用于具有高安全需求的移动设备、物联网(internet of things,IOT)设备等设备中。
目前,设备中的安全芯片主要用于存储与用户身份认证相关的信息。虽然安全芯片的安全性很高,但是目前也有通过不法手段窃取安全芯片中存储的与用户身份认证相关的信息的情况发生,从而导致用户数据泄露。如何进一步提高安全芯片中存储的与用户身份认证相关的信息的安全性,有待进一步研究。
发明内容
本申请提供了一种数据保护方法及电子设备,可以基于用户输入的注册身份认证信息对秘密值加密后存储,进一步保护了秘密值的安全性。
第一方面,本申请提供了一种数据保护方法,方法包括:电子设备接收用户输入的注册身份认证信息;电子设备生成第一秘密值,第一秘密值用于加密保护根密钥,根密钥用于保护电子设备上的用户数据;电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值;电子设备存储注册身份认证信息和加密第一秘密值。
其中,第一秘密值可以直接用于加密保护根密钥,第一秘密值也可以和其他因素共同参与加密保护根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
根密钥可以直接用于加密保护电子设备上的用户数据。根密钥也可以派生得到数据密钥,基于数据密钥加密保护电子设备上的用户数据。其中,根密钥可以通过一级或者多级派生得到数据密钥。
这样,在电子设备生成秘密值之后。可以基于用户输入的注册身份认证信息对秘密值加密后存储,进一步保护了秘密值的安全性。
结合第一方面,在一种可能的实现方式中,电子设备接收用户输入的注册身份认证信息,具体包括:电子设备通过操作系统接收用户输入的注册身份认证信息;在电子设备接收用户输入的注册身份认证信息之后,在电子设备生成第一秘密值之前,方法还包括:电子设备通过操作系统将注册身份认证信息发送至安全芯片;电子设备生成第一秘密值,具体包括:电子设备通过安全芯片生成第一秘密值;电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值,具体包括:电子设备通过安全芯片基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值;电子设备存储注册身份认证信息和加密第一秘密值,具体包括:电子设备将注册身份认证信息和加密第一秘密值存储在安全芯片内。
这样,电子设备有安全芯片的情况下,电子设备可以在安全芯片内生成秘密值,避免在安全芯片外生成秘密值,攻击者篡改秘密值,造成用户数据泄露的情况发生。
并且,将加密第一秘密值和注册身份认证信息存储在安全芯片内,安全芯片的安全系数较高,进一步保护了加密第一秘密值和注册身份认证信息的安全性。
结合第一方面,在一种可能的实现方式中,在电子设备生成第一秘密值之前,方法还包括:电子设备通过操作系统生成第二秘密值;电子设备通过操作系统将第二秘密值发送至安全芯片;电子设备通过安全芯片生成第三秘密值;电子设备生成第一秘密值,具体包括:电子设备通过安全芯片基于第二秘密值和第三秘密值生成第一秘密值。
本申请还提供了另一种生成第一秘密值的方法。即基于安全芯片内生成的第三秘密值和安全芯片外生成的第二秘密值,共同生成第一秘密值。即使攻击者可以篡改安全芯片外生成的第二秘密值,但是无法篡改安全芯片内生成的第三秘密值,这样也可以避免第一秘密值被攻击者篡改的情况发生。
结合第一方面,在一种可能的实现方式中,在电子设备存储注册身份认证信息和加密第一秘密值之后,方法还包括:在满足第一条件的情况下,电子设备接收用户输入的验证身份认证信息;在验证身份认证信 息和注册身份认证信息满足预设条件的情况下,电子设备基于验证身份认证信息将加密第一秘密值解密,得到第一秘密值;电子设备基于第一秘密值将加密根密钥解密,得到根密钥;电子设备基于根密钥将加密用户数据解密,得到未加密用户数据。
其中,第一秘密值可以直接用于将加密根密钥解密,得到根密钥,第一秘密值也可以和其他因素共同参与将加密根密钥解密,得到根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
在得到根密钥之后,根密钥可以直接用于将加密用户数据解密,得到未加密用户数据。也可以基于根密钥派生得到数据密钥,基于数据密钥将加密用户数据解密,得到未加密用户数据。其中,根密钥可以通过一级或者多级派生得到数据密钥。
在验证用户输入的验证身份认证信息时,只有在用户输入的验证身份认证信息和注册身份认证信息满足预设条件的情况下,安全芯片才可以基于验证身份认证信息对加密第一秘密值解密,得到未加密的第一秘密值。这样,可以避免攻击者篡改验证逻辑的情况下,若第一秘密值未加密。导致第一秘密值泄露的情况发生。
结合第一方面,在一种可能的实现方式中,电子设备通过操作系统将注册身份认证信息发送至安全芯片,具体包括:电子设备通过操作系统将注册身份认证信息脱敏,得到脱敏注册身份认证信息;电子设备通过操作系统将脱敏注册身份认证信息发送至安全芯片;电子设备通过安全芯片基于注册身份认证信息对第一秘密值加密,具体包括:电子设备通过安全芯片基于脱敏注册身份认证信息对第一秘密值加密,得到加密第一秘密值。
可选的,电子设备可以直接通过安全芯片基于脱敏注册身份认证信息对第一秘密值加密,得到加密第一秘密值。在其他实施例中,电子设备也可以将脱敏注册身份认证信息进行密钥派生,或者对脱敏注册身份认证信息进行哈希计算,利用派生后的密钥或者哈希计算后的值对第一秘密值加密,得到加密第一秘密值。本申请实施例对此不做限定。
这样,电子设备注册身份认证信息进行脱敏处理,避免在传递的过程中以明文的方式传递造成注册身份认证信息泄露的情况发生。
结合第一方面,在一种可能的实现方式中,在电子设备接收用户输入的验证身份认证信息之后,在电子设备基于验证身份认证信息将加密第一秘密值解密之前,方法还包括:电子设备通过操作系统将验证身份认证信息脱敏,得到脱敏验证身份认证信息;电子设备通过操作系统将脱敏验证身份认证信息发送至安全芯片;电子设备基于验证身份认证信息将加密第一秘密值解密,具体包括:在脱敏验证身份认证信息和脱敏注册身份认证信息满足预设条件的情况下,电子设备通过安全芯片基于脱敏验证身份认证信息将加密第一秘密值解密,得到第一秘密值。
可选的,电子设备可以直接通过安全芯片基于脱敏注册身份认证信息对加密第一秘密值解密解密,得到未加密的第一秘密值。在其他实施例中,电子设备也可以基于脱敏注册身份认证信息派生后的密钥或者脱敏注册身份认证信息哈希计算后的值对加密第一秘密值解密解密,得到未加密的第一秘密值。本申请实施例对此不做限定。
这样,在安全芯片内存储的是脱敏注册认证信息时,在验证用户身份证时,电子设备也需将验证身份认证信息进行脱敏处理,并与脱敏注册认证信息进行比对。
结合第一方面,在一种可能的实现方式中,注册身份认证信息包括电子设备的注册锁屏身份认证信息和/或电子设备上第一应用的注册开启认证信息;其中,注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与注册锁屏身份信息满足预设条件的情况下,将电子设备解锁;
注册开启认证信息用于在用户输入的验证注册开启认证信息与注册开启认证信息满足预设条件的情况下,开启第一应用。
结合第一方面,在一种可能的实现方式中,电子设备接收用户输入的注册身份认证信息,具体包括:电子设备接收用户输入的注册锁屏身份信息,注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与注册锁屏身份信息满足预设条件的情况下,将电子设备解锁;电子设备生成第一秘密值,第一秘密值用于加密保护根密钥,根密钥用于保护电子设备上的用户数据,具体包括:电子设备生成第一秘密值,第一 秘密值用于加密保护第一根密钥,第一根密钥用于保护电子设备上的用户数据;电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值,具体包括:电子设备基于注册锁屏身份信息对第一秘密值加密,得到加密第一秘密值;电子设备存储注册身份认证信息和加密第一秘密值,具体包括:电子设备存储注册锁屏身份信息和加密第一秘密值。
这样,用户可以设置用户解锁电子设备的锁屏身份信息,并将锁屏身份信息和第一秘密值存储在安全芯片内。
可选的,电子设备上可以登录有多个不同的用户账号。用户也可以分别设置多个不同的用户账号对应的锁屏身份信息。
可选的,多个不同的用户账号对应的根密钥也可以不同,也可以相同,本申请实施例对此不做限定。
其中,第一秘密值可以直接用于将加密保护第一根密钥,第一秘密值也可以和其他因素共同参与加密保护第一根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
在得到第一根密钥之后,第一根密钥可以直接用于加密保护电子设备上的用户数据。也可以基于第一根密钥派生得到数据密钥,基于数据密钥加密保护电子设备上的用户数据。其中,第一根密钥可以通过一级或者多级派生得到数据密钥。
结合第一方面,在一种可能的实现方式中,在电子设备存储注册锁屏身份信息和加密第一秘密值之后,方法还包括:电子设备接收用户输入的注册开启认证信息,注册开启认证信息用于在用户输入的验证注册开启认证信息与注册开启认证信息满足预设条件的情况下,开启第一应用;电子设备生成第四秘密值,第四秘密值用于加密保护第二根密钥,第二根密钥用于保护第一应用内的应用数据;电子设备基于注册开启认证信息对第四秘密值加密,得到加密第四秘密值电子设备存储注册开启认证信息和加密第四秘密值。
其中,第四秘密值可以直接用于加密保护第二根密钥,第四秘密值也可以和其他因素共同参与加密保护第二根密钥。其他因素包括但不仅限于注册开启认证信息、硬件唯一密钥、设备唯一ID、应用标识中的一种或几种。
第二根密钥可以直接用于加密保护第一应用内的应用数据。也可以基于第二根密钥派生得到数据密钥,基于数据密钥加密保护第一应用内的应用数据解密。其中,根密钥可以通过一级或者多级派生得到数据密钥。
这样,用户可以设置电子设备上多个应用的开启认证信息,并将开启认证信息和第四秘密值存储在安全芯片内。
可选的,对于同一个应用,不同用户账号下,该同一个应用的开启认证信息也可以不同,也可以相同,本申请实施例对此不做限定。
结合第一方面,在一种可能的实现方式中,第二根密钥和第一根密钥不同。
可选的,第二根密钥和第一根密钥也可以相同,本申请实施例对此不做限定。
第二方面,本申请提供了一种电子设备,电子设备包括:一个或多个处理器、一个或多个存储器、显示屏;一个或多个存储器、显示屏与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,一个或多个处理器调用计算机指令以使得电子设备执行第一方面中任一可能的实现方式中提供的一种数据保护方法。
第三方面,本申请提供了一种计算机可读存储介质,用于存储计算机指令,当计算机指令在电子设上运行时,使得电子设执行第一方面中任一可能的实现方式中提供的一种数据保护方法。
第四方面,本申请提供了一种计算机程序产品,当计算机程序产品在电子设上运行时,使得电子设执行第一方面中任一可能的实现方式中提供的一种数据保护方法。
对于第二方面至第四方面中的有益效果,可以参考第一方面中有益效果的描述,本申请实施例在此不再赘述。
附图说明
图1-图3为本申请实施例提供的几种安全芯片的显示形态示意图;
图4为本申请实施例提供的一种生成和保存秘密值的方法流程示意图;
图5为本申请实施例提供的一种电子设备100上认证身份认证信息的方法流程图;
图6为本申请实施例提供的一种电子设备100的结构示意图;
图7为本申请实施例提供的一种电子设备100的软件结构示意图;
图8A-图8F为本申请实施例提供的一组电子设备100接收并响应用户的操作,接收用户注册的电子设备100的注册锁屏身份信息的示意图;
图8G-图8J为本申请实施例提供的一组电子设备100接收用户设置电子设备100上不同用户账号对应的锁屏身份信息的示意图;
图9A-图9E为本申请实施例提供的一组电子设备100接收并响应用户的操作,接收用户注册的应用一的开启密码的示意图;
图10为本申请实施例提供的另一种注册身份认证信息的方法流程示意图;
图11为本申请实施例提供的又一种注册身份认证信息的方法流程示意图;
图12为本申请实施例提供的一种比对验证注册身份认证信息和注册身份认证信息的方法流程示意图;
图13A-图13F为本申请实施例提供的一种UI图;
图14为本申请实施例提供的另一种比对验证注册身份认证信息和注册身份认证信息的方法流程示意图;
图15为本申请实施例提供的一种数据保护方法的流程示意图;
图16为本申请实施例提供的一种数据存储装置的流程示意图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请以下实施例中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的文本、图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。
首先对本申请实施例涉及的技术术语进行解释。
1、身份认证信息和安全芯片
身份认证信息可以是电子设备100的锁屏身份信息,电子设备100的锁屏身份信息可以是pin码、人脸图像、指纹、声纹等等。锁屏身份信息用于电子设备在息屏后,基于用户输入的身份信息与电子设备内存储的锁屏身份信息进行比对,看两者是否满足预设条件。预设条件可以是,用户输入的锁屏身份信息与电子设备内存储的锁屏身份信息完全一致,或者用户输入的锁屏身份信息在经过变换之后,与电子设备内存储的锁屏身份信息完全一致。在确定出两者满足预设条件后,电子设备可以执行解锁操作。
身份认证信息也可以是电子设备100上应用的开启认证信息,应用的开启认证信息也可以是pin码、人脸图像、指纹、声纹等等。应用的开启认证信息用于在用户开启应用时,基于用户输入的开启认证信息与电子设备内存储的开启认证信息进行比对,看两者是否满足预设条件。预设条件可以是,用户输入的开 启认证信息与电子设备内存储的开启认证信息完全一致,或者用户输入的开启认证信息在经过变换之后,与电子设备内存储的开启认证信息完全一致。在确定出两者满足预设条件后,电子设备可以执行开启应用的操作。
为了保证电子设备内存储的身份认证信息的安全性,一般将身份认证信息存储在电子设备内的安全芯片内,防止电子设备内存储的身份认证信息泄露。
安全芯片在电子设备中有以下几种形态:
形态一:如图1所示,安全芯片位于电子设备内主芯片(SOC芯片)中的内置安全核中。
形态二:如图2所示,安全芯片位于外置SOC芯片的安全元件(secure element,SE)中,SE是防物理攻击的电子元件,其内部包含微处理器、存储以及加解密硬件等,可独立使用。
形态三:如图3所示,安全芯片由SOC芯片与外置SOC芯片的SE共同组成,完成一些高安全业务,保证设备的高安全性。
不仅限于以上三种形态,安全芯片还可以是其他的形态,本申请实施例对此不做限定。
2、秘密值、根密钥和数据密钥
在用户注册锁屏身份信息完成后,电子设备会生成秘密值。其中,电子设备可以基于锁屏身份信息生成秘密值,电子设备也可以随机生成秘密值,或者秘密值为预设的固定值,电子设备在确定出用户注册锁屏身份信息完成后,获取到该预设的秘密值。
秘密值与锁屏身份信息可以用于共同保护根密钥。
可选的,秘密值可单独用于保护根密钥。
可选的,锁屏身份信息也可单独用于保护根密钥。
可选的,秘密值与锁屏身份信息和其他派生因子可以用于共同保护根密钥。
可选的,秘密值和其他派生因子可以用于共同保护根密钥。
可选的,锁屏身份信息和其他派生因子可以用于共同保护根密钥。
还可以基于其他的方式保护根密钥,本申请实施例对此不做限定。
根密钥用于电子设备派生成数据密钥,并基于数据密钥对电子设备上的用户数据进行加密,防止电子设备上的用户数据泄露。用户数据可以包括但不仅限于:图片、文字、视频、文件、音频等。
可选的,对于不同类型的用户数据,电子设备可以基于根密钥派生成不同的数据密钥,电子设备可以基于不同的数据密钥对不同类型的用户数据加密。
可选的,用户数据也可以按照应用分类,电子设备可以基于根密钥派生成不同的数据密钥,电子设备可以基于不同的数据密钥对不同应用产生的用户数据进行加密。
可选的,电子设备也可以不再区分用户数据的类型,对电子设备上所有的用户数据,均可以采用相同的数据密钥进行加密。
基于数据密钥对电子设备上的用户数据加密,是为了防止用户数据泄露。例如在电子设备处于关机状态下,电子设备可以基于数据密钥对电子设备上的用户数据加密。在电子设备首次开机后,用户需输入正确的锁屏身份信息,只有在电子设备确认用户输入的锁屏身份信息与安全芯片中存储的锁屏身份信息满足预设条件时,电子设备才会执行解锁操作,并基于数据密钥对电子设备上的用户数据解密,使得用户可以正常查看并使用电子设备上的用户数据。当用户输入错误的锁屏身份信息时,即用户输入的锁屏身份信息与安全芯片中存储的锁屏身份信息不满足预设条件,则电子设备还是在锁屏状态,电子设备上的用户数据还是呈现加密状态。
这样,可以避免手机上存储的用户数据被泄露的风险。例如在电子设备丢失的情况下,其他用户不知道该电子设备的锁屏身份信息,其他用户可以将该电子设备的芯片拆下来,其他用户使用专业的工具从芯片上读取数据,若该电子设备上的用户数据用数据密钥加密后,即使其他用户使用专业的工具从芯片上读取数据,读取的数据也是加密的用户数据,无法获取到真实的用户数据。若该电子设备上的用户数据没有用数据密钥加密,其他用户使用专业的工具从芯片上读取数据后,读取到的至未加密的用户数据,导致用户数据泄露。
由前述描述可知,数据密钥是基于根密钥派生得到的保护电子设备上用户数的安全,重点在于保护根密钥的安全性。
在一些实施例中,可以由秘密值参与保护根密钥,也可以由秘密值和身份认证信息共同作用于保护根 密钥。也就是说,保护根密钥需要有秘密值的参与。
图4示出了一种生成和保存秘密值的方法流程示意图。
S401、电子设备100的操作系统接收用户输入的注册身份认证信息。
注册身份认证信息包括但不仅限于:pin码、人脸图像信息、指纹信息、声纹信息等。本申请以下实施例以注册身份认证信息为pin码为例进行说明。
用户在设置电子设备的锁屏密码或者应用的开启密码时,电子设备100的操作系统接收用户输入的注册身份认证信息。
S 402、电子设备100的操作系统在接收到用户输入的注册身份认证信息后,随机生成秘密值。
秘密值用于参与保护根密钥。秘密值是在安全芯片外生成的。
S 403、电子设备100的操作系统将注册身份认证信息和秘密值发送至安全芯片。
S 404、电子设备100上的安全芯片保存注册身份认证信息和秘密值。
秘密值在安全芯片内生成的。在秘密值生成之后,电子设备100的操作系统将注册身份认证信息和秘密值发送至安全芯片内,使得注册身份认证信息和秘密值存储在安全芯片内,避免注册身份认证信息和秘密泄露。
S 405、电子设备100上的安全芯片保存向电子设备100的操作系统发送注册成功通知。
在注册身份认证信息和秘密值存储在安全芯片后之后,安全芯片向电子设备100的操作系统发送注册成功通知。
S 406、电子设备100的操作系统基于注册身份认证信息和秘密值对根密钥进行加密。
这样,可以基于注册身份认证信息和秘密值保护根密钥。
从图4实施例中可以看出,秘密值是由电子设备的操作系统生成的,然后存储在安全芯片内,在存储在安全芯片内之前,可能存在被攻击者篡改的风险。例如,电子设备100上安装有恶意代码,恶意代码可以对随机生成的秘密值进行篡改,再将篡改后的秘密值存储在安全芯片内。这样,根密钥在加密时,也是基于篡改后的秘密值加密的。在一些场景中,若根密钥仅基于秘密值加密,那么在这种情况下,攻击者篡改了秘密值,即后续不需要验证用户输入的身份认证信息的正确性,攻击者就可以知道篡改的秘密值。从而基于篡改的秘密值将根密钥解密,从而获取到根密钥。再基于根密钥获取到数据密钥,再基于数据密钥对用户数据解密,获取到真实的用户数据,导致用户数据泄露的情况发生。
图5为本申请实施例提供的一种电子设备100上认证身份认证信息的方法流程图。
S501、电子设备100的操作系统接收用户输入的验证身份认证信息。
在电子设备100需要验证用户的身份时,电子设备100可以接收用户输入的验证身份认证信息。
S502、电子设备100的操作系统将验证身份认证信息发送至安全芯片。
S503、电子设备100的安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件。
电子设备100的安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件,则说明验证通过。
预设条件可以是,用户输入的验证验证身份认证信息与安全芯片内存储的注册身份认证信息完全一致,或者用户输入的验证身份认证信息在经过变换之后,与电子设备内存储的注册身份认证信息完全一致。本申请实施例对此不做限定。
S504、在验证成功之后,电子设备100上的安全芯片向电子设备100上的操作系统返回秘密值。
在验证成功之后,电子设备100上的安全芯片将安全芯片内存储的秘密值返回至操作系统。
S505、电子设备100的操作系统在获取到秘密值之后,基于验证身份认证信息和秘密值对根密钥进行解密,得到根密钥,再基于根密钥得到数据密钥,基于数据密钥对用户数据进行解密。
从图5实施例中可以看出,在身份认证信息比对过程中,比对逻辑比较简单。若比对逻辑被篡改,在一些实施例中,无论用户输入的验证身份认证信息为何值,均可以实现比对成功,从而成功获取到秘密值。在一些场景中,若根密钥仅基于秘密值加密,那么在这种情况下,攻击者就可以基于获取到的秘密值将根密钥解密,从而获取到根密钥。再基于根密钥获取到数据密钥,再基于数据密钥对用户数据解密,获取到真实的用户数据,导致用户数据泄露的情况发生。
基于此,为了进一步保护电子设备上的用户数据的安全,本申请提供了一种数据保护方法,该方法只要在于保护秘密值的安全性。
一方面,本申请实施例将生成秘密值的步骤放在安全芯片内进行。因为安全芯片的安全性远远高于操作系统的安全性。因此在安全芯片内生成秘密值,可以避免秘密值被篡改的情况发生。
另一方面,本申请实施例中秘密值在安全芯片内存储,依赖于身份认证信息的参与。即安全芯片在生成秘密值之后,再将秘密值基于注册身份认证信息加密后在存储在安全芯片内。这样,即使攻击者篡改了身份认证信息的比对逻辑,但是攻击者在没获取到注册身份认证信息的情况下,攻击者也无法将基于注册身份认证信息加密的秘密值解密,即无法获取到秘密值,避免秘密值泄露的情况发生。
本申请可以应用于设备级的用户数据保护。例如,在电子设备接收用户注册锁屏认证信息时,在电子设备100的操作系统将注册锁屏认证信息发送至安全芯片之后,电子设备100的安全芯片将随机生成锁屏秘密值。在将锁屏秘密值存储在安全芯片上之前,电子设备100的安全芯片基于注册锁屏认证信息将锁屏秘密值加密,得到加密锁屏秘密值,并将加密锁屏秘密值保存在安全芯片内。
本申请可以应用于应用级的用户数据保护。例如,在电子设备接收用户注册第一应用的开启认证信息时,在电子设备100的操作系统将注册开启认证信息发送至安全芯片之后,电子设备100的安全芯片将随机生成开启秘密值。在将开启秘密值存储在安全芯片上之前,电子设备100的安全芯片基于注册开启认证信息将开启秘密值加密,得到加密开启秘密值,并将加密开启秘密值保存在安全芯片内。
可选的,用户可以设置电子设备上的不同应用的开启认证信息不同,例如对于隐私程度较高的应用,例如通讯录、短信等应用,可以设置开启密码。当然,不同应用的开启认证信息也可以相同,本申请实施例对此不做限定。
图6示出了电子设备100的结构示意图。
电子设备100可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请实施例对该电子设备的具体类型不作特殊限制。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
可选的,在一些实施例中,电子设备100上还可以包括一个或多个安全芯片。
其中,一个或多个安全芯片用于存储身份认证信息和基于身份认证信息加密后的秘密值。若电子设备100上有多个安全芯片,身份认证信息和基于身份认证信息加密后的秘密值可以存储在不同的安全芯片上,身份认证信息和基于身份认证信息加密后的秘密值也可以存储在同一个安全芯片上,本申请实施例对此不做限定。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电 器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器, 连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5SDRAM)等;非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。快闪存储器按照运作原理划分可以包括NOR FLASH、NAND FLASH、3D NAND FLASH等,按照存储单元电位阶数划分可以包括单阶存储单元(single-level cell,SLC)、多阶存储单元(multi-level cell,MLC)、三阶储存单元(triple-level cell,TLC)、四阶储存单元(quad-level cell,QLC)等,按照存储规范划分可以包括通用闪存存储(英文:universal flash storage,UFS)、嵌入式多媒体存储卡(embedded multi media Card,eMMC)等。随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备100的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
图7示出了电子设备100的软件结构示意图。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。电子设备100的系统还可以是IOS系统、鸿蒙系统等等,本申请实施例对此不做限定。电子设备100的类型不同,电子设备100的系统也可以不同,本申请实施例以电子设备100的系统为Android系统为例进行说明。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。本申请实施例对电子设备的软件结构的分层不做限制。参照图7,本申请实施例中可以将安卓运行时和系统库,以及内核层看作一层,称为系统层。应理解,图7在Android系统的基础上还增加了电子设备中的硬件层。
应理解,图7所示的各分层中包括的模块为本申请实施例中涉及到的模块,如下各分层中包括的模块并不构成对电子设备的结构和模块部署的层级(示例说明)的限定。示例性的,如身份认证信息注册模块可以部署在应用程序层,也可以部署在应用程序框架层。在一种实施例中,图7中所示的模块可以单独部署,或者几个模块可以部署在一起,图7中对模块的划分为一种示例。在一种实施例中,图7中所示的模块的名称为示例说明。
应用程序层可以包括一系列应用程序包。
如图7所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图7所示,应用程序框架层可以包括窗口管理器,内容提供器,电话管理器,资源管理器,身份认证信息注册模块,身份认证信息验证模块等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕身份认证信息验证模块等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
身份认证信息注册模块用于提供接口,让用户设置身份认证信息。在一些实施例中,身份认证信息注册模块也可以提供接口,让用户设置不同用户账号的身份认证信息。在一些实施例中,身份认证信息注册模块也可以提供接口,让用户设置电子设备上不同应用的身份认证信息。
身份认证信息验证模块用于基于用户输入的验证身份认证信息与电子设备内存储的注册身份认证信息进行比对,看是否一致。若一致,则执行解锁操作或者开启应用。若不一致,且用户输入的验证身份认证信息的错误次数达到阈值之后,将触发身份认证信息自毁模块将电子设备内存储的身份认证信息清除掉。达到电子设备无法解锁或者应用无法开启,避免用户数据或者应用数据泄露的情况发生。
因为本申请实施例中将安卓运行时和系统库,以及内核层看作一层,因此系统层中可以包括安卓运行时和系统库,以及内核层中的功能模块。
系统层可以包括安全芯片,安全芯片的数量可以是一个或多个。
身份认证信息可以是电子设备100的锁屏身份信息,电子设备100的锁屏身份信息可以是pin码、人脸图像、指纹、声纹等等。
身份认证信息也可以是电子设备100上应用的开启认证信息,应用的开启认证信息也可以是pin码、人脸图像、指纹、声纹等等。
用户可以在电子设备100上操作,设置电子设备100的锁屏身份信息,或者称为注册锁屏身份信息。本申请以下实施例以注册锁屏身份信息为pin码为例进行说明,该pin码也可以被称为注册锁屏密码。
可选的,若电子设备100登录有不同的用户账号,用户也可以在电子设备100上操作,设置电子设备100上不同用户账号的注册锁屏身份信息。
用户也可以在电子设备100上操作,设置电子设备100上应用的开启身份信息,或者称为注册开启身份信息。本申请以下实施例以注册开启身份信息为pin码为例进行说明,该pin码也可以被称为注册开启密码。
图8A-图8F示出了电子设备100接收并响应用户的操作,接收用户注册的电子设备100的注册锁屏身份信息的示意图。
示例性的,电子设备100的注册锁屏身份信息可以是pin码。
图8A示例性示出了电子设备100的主界面。图8A中示出了多个应用的图标,例如文件管理应用的图标、电子邮件应用的图标、音乐应用的图标、智慧生活应用的图标、运动健康应用的图标、设置应用的图标、相机应用的图标、通讯录应用的图标、电话应用的图标、信息应用的图标等等。图8A还示出了页面指示符、天气指示符、日历指示符、电量指示符、时间指示符、信号指示符等等。
如图8A所示,电子设备100接收用户针对设置应用的图标的输入操作(例如单击),响应于用户的输入操作,电子设备100显示如图8B所示的用户界面701。用户界面701中示出了多个设置项,例如飞行模式设置项(当前飞行模式已关闭)、Wi-Fi设置项(当前Wi-Fi已关闭)、蓝牙设置项(当前蓝牙功能关闭)、个人热点设置项、移动网络设置项、勿扰模式设置项、显示与亮度设置项、华为账号设置项、生物识别和密码选项等等。
如图8B所示,电子设备100接收用户针对生物识别和密码选项等的输入操作(例如单击),响应于用户的输入操作,电子设备100显示如图8C所示的用户界面702。
用户界面702中示出了多个设置选项,例如生物识别设置选项,生物识别设置选项包括但不仅限于指纹设置选项、人脸识别设置选项、骨声设置选项等。用户界面702中还示出了密码设置选项,密码设置选 项包括但不仅限于设置锁屏密码选项和关闭锁屏密码选项等等。用户界面702中还示出了其他设置选项,例如锁屏密码自毁设置选项、安全锁定设备设置选项等。
电子设备100可以接收用户操作在用户界面702中的操作,设置解锁密码。解锁密码也可以被称为pin码。
如图8C所示,电子设备100接收用户针对用户界面702中设置锁屏密码选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示如图8D所示的用户界面703。
用户界面703可以为电子设备100的锁屏密码设置界面。电子设备100可以接收用户在用户界面703中的操作,设置锁屏密码。
用户在用户界面703中输入锁屏密码后,如图8E所示,电子设备100可以显示用户界面704。
可选的,电子设备100可以提示用户多次输入相同的锁屏密码,在用户多次输入的锁屏密码均相同的情况下,电子设备100可以显示如图8E所示的用户界面704。
如图8F所示,电子设备100可以接收用户针对用户界面704中确定选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以将输入的密码作为电子设备100的锁屏密码。
可选的,锁屏密码可以为6位数字,也可以为更多或者更少的数字,也可以为字母、符号、数字中的一种或者多种组合,本申请实施例对此不做限定。
可选的,在一些实施例中,若电子设备100上有多个不同用户账号,那么电子设备100也可以接收用户的操作,分别设置每一个用户的锁屏密码。
电子设备100上不同的用户账号是指,电子设备100在登陆某个用户账号后,可以显示该用户账号对应的内容。不同用户账号对应的内容不同。例如不同用户账号下对应的应用类型、应用产生的应用数据不同。
图8G-图8J示出了电子设备100接收用户设置电子设备100上不同用户账号对应的锁屏身份信息的示意图。
如图8G所示,电子设备100接收用户针对用户界面702中设置锁屏密码选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示如图8H所示的用户界面705。
用户界面705中示出了多个不同的用户账号,例如用户“Lisa”和用户“旺仔牛奶的iphone”。用户可以在用户界面705中选择某一个用户账号,并设置该某一个账号的锁屏密码。
如图8H所示,电子设备100可以接收用户针对用户界面705中用户“Lisa”选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示如图8I所示的用户界面706。
用户界面706可以为电子设备100中用户“Lisa”的锁屏密码设置界面。电子设备100可以接收用户在用户界面706中的操作,设置用户“Lisa”的锁屏密码。
用户在用户界面706中输入锁屏密码后,如图8J所示,电子设备100可以显示用户界面707。
可选的,电子设备100可以提示用户多次输入相同的锁屏密码,在用户多次输入的锁屏密码均相同的情况下,电子设备100可以显示如图8J所示的用户界面707。
图9A-图9E示出了电子设备100接收并响应用户的操作,接收用户注册的应用一的开启密码的示意图。
示例性的,应用一可以是通讯录应用,应用一的开启密码也可以是pin码。
如图9A所示,电子设备100接收用户针对通讯录应用图标的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示如图9B所示的用户界面801。
用户界面801示出了最近的通话记录,例如在今天19:38,与妈妈打了电话。在今天19:20,与爸爸打了电话。昨天,与小赵打了电话、昨天,与小张打了电话。昨天,还与哥哥打了电话。
如图9B所示,电子设备100接收用户针对用户界面801中设置选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示通讯录应用的设置界面,例如显示如图9C所示的用户界面802。
用户界面802中示出了多个设置选项。例如密码设置选项,密码设置选项包括设置开启密码选项、关闭开启密码选项等。用户界面802中还示出了其他设置选项,例如开启密码自毁选项等等。
电子设备100可以接收用户操作在用户界面802中的操作,设置开启密码。开启密码也可以被称为pin码。
如图9C所示,电子设备100可以接收用户针对用户界面802中设置开启密码选项的输入操作(例如 单击),响应于用户的输入操作,电子设备100可以显示如图9D所示的用户界面803。
用户界面803可以为电子设备100的开启密码设置界面。电子设备100可以接收用户在用户界面803中的操作,设置通讯录应用的开启密码。
用户在用户界面803中输入通讯录应用的开启密码,如图9E所示,电子设备100可以显示用户界面804。
可选的,电子设备100可以提示用户多次输入相同的开启密码,在用户多次输入的开启密码均相同的情况下,电子设备100可以显示如图9E所示的用户界面804。
电子设备100可以接收用户针对用户界面804中确定选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以将输入的密码作为通讯录应用的开启密码。
可选的,开启密码可以为6位数字,也可以为更多或者更少的数字,也可以为字母、符号、数字中的一种或者多种组合,本申请实施例对此不做限定。
需要说明的是,不仅限于在应用内设置应用的最大输入开启次数,还可以在设置应用内设置应用的最大输入开启次数,本申请实施例对此不做限定。
图10为本申请实施例提供的另一种注册身份认证信息的方法流程示意图。
S1001、电子设备100的操作系统接收用户输入的注册身份认证信息。
身份认证信息可以是电子设备100的锁屏身份信息,电子设备100的锁屏身份信息可以是pin码、人脸图像、指纹、声纹等等。
身份认证信息也可以是电子设备100上应用的开启认证信息,应用的开启认证信息也可以是pin码、人脸图像、指纹、声纹等等。
用户可以在电子设备100上操作,设置电子设备100的锁屏身份信息。
可选的,若电子设备100登录有不同的用户账号,用户也可以在电子设备100上操作,设置电子设备100上不同用户账号的注册锁屏身份信息。
用户也可以在电子设备100上操作,设置电子设备100上应用的开启身份信息。
S1002、电子设备100通过操作系统将注册身份认证信息发送至安全芯片。
可选的,在电子设备100通过操作系统将注册身份认证信息发送至安全芯片之前,电子设备100可以通过操作系统将注册身份认证信息进行脱敏处理,将脱敏处理后的注册身份认证信息发送至安全芯片。这样,可以避免在发送过程中,明文传递的方式导致信息泄露的情况发生。
脱敏的方式包括但不仅限于:单向哈希(HASH)算法、Scrypt迭代哈希算法或PBKDF2迭代哈希算法等。本申请实施例对此脱敏的方式不做限定。
S1003、电子设备100通过安全芯片生成秘密值四。
秘密值四用于参与保护电子设备100上的根密钥。
S1003中,在安全芯片内生成秘密值,可以避免秘密值被篡改的情况发生。
S1004、电子设备100通过安全芯片基于注册身份认证信息对秘密值四加密,得到加密秘密值四。
可选的,电子设备100也可以通过安全芯片基于脱敏后的注册身份认证信息对秘密值四加密。
基于注册身份认证信息对秘密值四加密,可以是字节加密,也可以是异或运算,也可以是HMAC等方式,本申请实施例对此不做限定。
即安全芯片在生成秘密值之后,再将秘密值基于注册身份认证信息加密后在存储在安全芯片内。这样,即使攻击者篡改了身份认证信息的比对逻辑,但是攻击者在没获取到注册身份认证信息的情况下,攻击者也无法将基于注册身份认证信息加密的秘密值解密,即无法获取到秘密值,避免秘密值泄露的情况发生。
S1005、电子设备100通过安全芯片存储加密秘密值四和注册身份认证信息。
可选的,电子设备100也可以通过安全芯片存储加密秘密值四和脱敏后的注册身份认证信息。
由于安全芯片的安全性较高,将加密秘密值四和身份认证信息存储在安全芯片内,可以防止加密秘密值四和身份认证信息泄露的情况发生。
可选的,若电子设备100登录有多个不同的用户账号,则安全芯片内存储有多个不同用户账号对应的加密秘密值和册身份认证信息。
表1
如表1所示,若电子设备100上有多个不同的用户账号,电子设备100可以接收用户的操作设置不同的用户账号对应的注册身份认证信息。并在安全芯片内存储不同的用户账号对应的注册身份认证信息和加密秘密值。示例性的,对于用户账号Lisa,用户可以设置用户账号Lisa的注册身份认证信息,并在安全芯片内存储用户账号Lisa的注册身份认证信息和加密秘密值四,秘密值四用于加密保护用户账号Lisa对应的用户数据。对于用户账号Lucy,用户可以设置用户账号Lucy的注册身份认证信息,并在安全芯片内存储用户账号Lucy的注册身份认证信息和加密秘密值五,秘密值五用于加密保护用户账号Lucy对应的用户数据。对于用户账号Tom,用户可以设置用户账号Tom的注册身份认证信息,并在安全芯片内存储用户账号Tom的注册身份认证信息和加密秘密值六,秘密值六用于加密保护用户账号Tom对应的用户数据。
需要说明的是,电子设备100上还可以包括更多或者更少的用户账号,本申请实施例对此不做限定。
需要说明的是,安全芯片内存储的也不是表1所示的用户账号,安全芯片内存储的可能是用户账号的ID。例如,用户账号“Lisa”对应的用户账号的ID可以是“0123”。用户账号“Lucy”对应的用户账号的ID可以是“0124”。用户账号“Tom”对应的用户账号的ID可以是“0125”等等。用户账号的ID还可以是其他形式的,本申请实施例对此不做限定。
可选的,安全芯片内存储的也可能不是用户账号的ID,可能存储的是与用户账号的ID有映射关系的ID等。可以基于与用户账号的ID有映射关系的ID查找到用户账号的ID。本申请实施例对此不做限定。
本申请以下实施例以安全芯片中存储的是用户账号名为例进行说明。
表2
如表2所示,对于电子设备100登录的同一个用户账号(例如用户账号Lisa)下,用户下载安装有多个应用,例如第一应用、第二应用和第三应用。用户可以设置用户账号Lisa下多个应用的开启认证信息。即在开启应用之前需用户输入正确的开启认证信息,应用才可以开启,否则应用将无法开启。如表2所示,用户可以设备第一应用的注册开启认证信息,并在安全芯片内存储第一应用的注册开启认证信息和加密秘密值七,秘密值七用于加密保护第一应用内的应用数据。用户可以设备第二应用的注册开启认证信息,并在安全芯片内存储第二应用的注册开启认证信息和加密秘密值八,秘密值八用于加密保护第二应用内的应用数据。用户可以设备第三应用的注册开启认证信息,并在安全芯片内存储第三应用的注册开启认证信息和加密秘密值九,秘密值九用于加密保护第三应用内的应用数据。
可选的,用户也可以将用户账号Lisa下多个应用的开启认证信息设置为相同的,例如一键设置用户账号Lisa下多个应用的开启认证信息,可以减少用户的操作。
可选的,对于同一个应用,不同用户账号下,该同一个应用的开启认证信息也可以不同,也可以相同,本申请实施例对此不做限定。
需要说明的是,安全芯片内存储的也不是表2所示的应用标识,安全芯片内存储的可能是应用标识的ID。例如,应用标识“第一应用”对应的应用标识的ID可以是“0X01”。应用标识“第二应用”对应的应用标识的ID可以是“0X02”。应用标识“第三应用”对应的应用标识的ID可以是“0X03”。应用标识的ID还可以是其他形式的,本申请实施例对此不做限定。
可选的,安全芯片内存储的也可能不是应用标识的ID,可能存储的是与应用标识的ID有映射关系的ID等。可以基于与应用标识的ID有映射关系的ID查找到应用标识的ID。本申请实施例对此不做限定。
S1006、电子设备100通过安全芯片将秘密值四发送至操作系统。
可选的,在电子设备100通过安全芯片将秘密值四发送至操作系统之前,可以将秘密值四脱敏后发送至操作系统,或者将加密秘密值四发送至操作系统。这样,可以避免安全芯片将秘密值发送至操作系统,在发送过程中导致信息泄露的情况发生。
S1007、电子设备100通过操系统基于秘密值四对根密钥进行加密。
可选的,电子设备100可以仅基于秘密值四对根密钥进行加密。
可选的,电子设备100也可以通过秘密值四和注册身份认证信息对根密钥进行加密。
可选的,电子设备100也可以通过秘密值四和脱敏后的注册身份认证信息对根密钥进行加密。
可选的,电子设备100也可以通过秘密值四、注册身份认证信息和其它因素共同对根密钥进行加密。本申请实施例对根密钥的加密方式不做限定。
可选的,电子设备100也可以通过秘密值四、脱敏后的注册身份认证信息和其它因素共同对根密钥进行加密。本申请实施例对根密钥的加密方式不做限定。
在一些实施例中,S1006和S1007也可以在安全芯片内执行。即S1006和S1007可以被替换为S1008。
S1008、电子设备100通过安全芯片基于秘密值四对根密钥进行加密。
这样,可以避免安全芯片将秘密值发送至操作系统,在发送过程中导致信息泄露的情况发生。
在一些实施例中,在注册身份认证信息为注册锁屏身份认证信息的情况下,在满足第一条件时,电子设备100可以基于根密钥派生得到数据密钥,并基于数据密钥对电子设备100上的用户数据进行加密保护。只有在用户输入正确的验证锁屏身份认证信息的情况下,电子设备100才可以基于数据密钥对电子设备100上的用户数据进行解密,得到真实的用户数据。
第一条件可以是以下任一一项或者多项:
一:在电子设备100关机后,首次开机时,电子设备100可以基于数据密钥对电子设备100上的用户数据进行加密保护。
二:电子设备100处于开机且锁屏状态,但是电子设备100的锁屏时间超过一定时间,则电子设备100可以基于数据密钥对电子设备100上的用户数据进行加密保护。
三:电子设备100处于开机且锁屏状态,但是电子设备100基于锁屏身份信息验证用户身份连续一定次数均验证不通过,则电子设备100可基于数据密钥对电子设备100上的用户数据进行加密保护。
示例性的,第一类型的锁屏身份信息可以是人脸图像、指纹图像、声纹特征等等。
第二类型的锁屏身份信息可以是pin码。第二类型的锁屏身份信息的安全性高于第一类型的锁屏身份信息的安全性。
例如电子设备100处于开机且锁屏状态,用户使用人脸图像进行解锁,在连续解锁5次均没有解锁成功的情况下,电子设备100可以基于数据密钥对电子设备100上的用户数据进行加密保护。
第一条件还可以是其他条件,本申请实施例对此不做限定。
在一些实施例中,在注册身份认证信息为注册开启身份认证信息的情况下,在满足第一条件时,电子设备100可以基于根密钥派生得到数据密钥,并基于数据密钥对应用一内的应用数据进行加密保护。只有在用户输入正确的验证开启身份认证信息的情况下,电子设备100才可以基于数据密钥对应用一内的应用数据进行解密,得到真实的应用数据。
第一条件可以是以下任一一项或者多项:
一:在电子设备100关机后,首次开机时,电子设备100可以基于根密钥对应用一内的应用数据进行加密保护。
二、应用一超过一定时间未使用,电子设备100可以基于根密钥对应用一内的应用数据进行加密保护。
三、电子设备100基于开启认证信息验证用户身份连续一定次数均验证不通过,电子设备100可以基于根密钥对应用一内的应用数据进行加密保护。
例如用户使用人脸图像开启应用一,在连续解锁5次均没有解锁成功的情况下,电子设备100可以基于根密钥对应用一内的应用数据进行加密保护。
第一条件还可以是其他条件,本申请实施例对此不做限定。
可选的,设备级别的根密钥和应用级别的更密钥可以不同,也可以相同。设备级别基于根密钥派生得到的数据密钥和应用级别基于根密钥派生得到的数据密钥的方式也可以不同,也可以相同,本申请实施例对此不做限定。
图11为本申请实施例提供的又一种注册身份认证信息的方法流程示意图。
图11实施例与图10实施例类似,区别在于,图11实施例与图10实施例中生成秘密值的方式不同。
S1101、电子设备100通过操作系统接收用户输入的注册身份认证信息。
对于S1101的描述,可以参考SS1001的描述,本申请实施例在此不再赘述。
S1102、电子设备100通过操作系统在接收到用户输入的注册身份认证信息后,随机生成秘密值一。
S1103、电子设备100通过操作系统将注册身份认证信息和秘密值一发送至安全芯片。
可选的,电子设备100也可以将注册身份认证信息脱敏后,发送至安全芯片。
即电子设备100可以通过操作系统将脱敏后的注册身份认证信息和秘密值一发送至安全芯片。
S1104、电子设备100通过安全芯片生成秘密值二。
S1105、电子设备100基于秘密值一和秘密值二得到秘密值三。
可选的,电子设备100也可以通过秘密值一、秘密值二和其他因素得到秘密值三,本申请实施例对此不做限定。
这样,秘密值二是在安全芯片内生成的,基于秘密值一和秘密值二得到秘密值三,可以避免秘密值三被篡改的情况发生。
S1106、电子设备100通过安全芯片基于身份认证信息对秘密值三加密,得到加密秘密值三。
S1107、电子设备100通过安全芯片存储加密秘密值三和身份认证信息。
S1108、电子设备100通过安全芯片将秘密值三发送至操作系统。
S1109、电子设备100通过操作系统基于秘密值三对根密钥进行加密。
对于S1106-S1109的描述,可以参考S1104-S1107中的描述,本申请实施例在此不再赘述。
图12为本申请实施例提供的一种比对验证注册身份认证信息和注册身份认证信息的方法流程示意图。
图12所示的比对验证注册身份认证信息和注册身份认证信息的方法,是基于图10所示的注册身份认证信息的方法提供的一种验证方法。
S1201、电子设备100通过操作系统接收用户输入的验证身份认证信息。
身份认证信息可以是用户账号“Lisa”的锁屏认证信息,如图13A所述,电子设备100可以显示用户界面1501,用户界面1501用于提示用户输入用户账号“Lisa”的锁屏认证信息。
或者,在用户账号“Lisa”的锁屏认证信息输入达到最大输入错误次数之后,电子设备100显示如图13B所示的提示信息,例如提示信息可以是“设备已无法解锁”。或者提示信息可以是“请在多长时间之后解锁”。随着锁屏认证信息输入错误次数增加,用户可解锁时间也对应增加。电子设备100可以接收用户在用户界面1502中的操作切换登陆其他阿德用户账号。例如,电子设备100可以接收用户针对用户界面1502中选项1503的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示如图13C所示的提示栏1504。用户可以在提示栏1504中选择登陆的用户账号。
如图13C所示,电子设备100可以接收用户针对提示栏1504中用户账号“Lucy”选项的输入操作(例如单击),响应于用户的输入操作,电子设备100可以登陆用户账号“Lucy”。响应于用户针对提示栏1504中用户账号“Lucy”选项的输入操作,电子设备100可以显示如图13D所示的用户界面1505。用户界面1505为用户账号“Lucy”的解锁界面。电子设备100可以接收用户在用户界面1505中输入用户账号“Lucy”对应的锁屏认证信息。在用户输入的用户账号“Lucy”对应的锁屏认证信息正确的情况下,电子设备100可以执行解锁操作,并显示用户账号“Lucy”对应的用户数据。
身份认证信息可以是电子设备100手上某一个应用的开启认证信息。示例性的,该某一个应用可以是通讯录应用。
图13E示出了电子设备100的主界面1506,主界面1506示出了多个应用的图标,例如文件管理应用的图标、电子邮件应用的图标、音乐应用的图标、智慧生活应用的图标、运动健康应用的图标、设置应用的图标、相机应用的图标、通讯录应用的图标、电话应用的图标、信息应用的图标等等。图13E还示出了页面指示符、天气指示符、日历指示符、电量指示符、时间指示符、信号指示符等等。
如图13E所示,电子设备100接收用户针对通讯录应用的图标的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示如图13F所示的用户界面1507。用户界面1507用于提示用户输入通讯录应用的开启密码。在用户输入的通讯录应用的开启密码正确的情况下,电子设备100可以执行开启通讯录应用的操作,并显示通讯录应用内的应用数据。
可选的,对于不同的用户账号,同一个应用的开启密码可以不同。
S1202、电子设备100通过操作系统将验证身份认证信息发送至安全芯片。
可选的,电子设备100可以通过操作系统将验证身份认证信息脱敏,再将脱敏后的验证身份认证信息发送至安全芯片。
S1203、电子设备100通过安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件。
电子设备100的安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件,则说明验证通过。
预设条件可以是用户输入的验证验证身份认证信息与安全芯片内存储的注册身份认证信息完全一致,或者用户输入的验证身份认证信息在经过变换之后,与电子设备内存储的注册身份认证信息完全一致。预设条件还可以是其他条件,本申请实施例对此不做限定
S1204、电子设备100通过安全芯片基于验证身份认证信息将加密秘密值四解密,得到秘密值四。
图10实施例S1004中有提及,加密秘密值四是基于注册身的份认证信息加密。在安全芯片确定出验证身份认证信息通过的情况下,可以基于验证身份认证信息将加密秘密值四解密,得到秘密值四。以便后续对根密钥解密,得到数据密钥,从而对用户数据解密,得到真实的用户数据。
可选的,若秘密值四除了注册身的份认证信息加密,还基于其他的因素加密,那么在解密时,也许使用到其他的因素。
可选的,若电子设备100通过安全芯片确认出验证身份认证信息和注册身份认证信息不满足预设条件,则说明验证身份认证信息没有验证通过,那么电子设备100不会执行S1204,也就无法得到秘密值四,进而无法得到根密钥。这样,保证了加密用户数据的安全性。
S1205、电子设备100通过安全芯片向操作系统发送秘密值四。
在安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件后,及验证成功,安全芯片基于验证身份认证信息将加密秘密值四解密,得到秘密值四,并将秘密值四发送至操作系统,使得操作系统可以基于秘密值四对加密根密钥进行解密,得到根密钥。
S1206、电子设备100通过操作系统基于秘密值四对根密钥进行解密,得到根密钥,再基于根密钥得到数据密钥,基于数据密钥对用户数据进行解密。
电子设备100通过操作系统接收到秘密值四之后,可以基于秘密值四对之前加密的根密钥进行解密,得到根密钥。再基于根密钥得到数据密钥。从而将基于数据密钥加密的用户数据解密,得到未加密的用户数据。使得用户可以查看的使用真实的用户数据。
可选的,若根密钥在加密时还基于其他的因素加密,那么在解密的时候还需其他的因素参与进行解密,得到未加密的根密钥。
图14为本申请实施例提供的另一种比对验证注册身份认证信息和注册身份认证信息的方法流程示意图。
图14所示的比对验证注册身份认证信息和注册身份认证信息的方法,是基于图11所示的注册身份认证信息的方法提供的一种验证方法。
S1401、电子设备100通过操作系统接收用户输入的验证身份认证信息。
对于S1401的描述,可以参考图12实施例中针对S1201的描述,本申请实施例在此不再赘述。
S1402、电子设备100通过操作系统将验证身份认证信息发送至安全芯片。
可选的,电子设备100可以通过操作系统将验证身份认证信息脱敏,再将脱敏后的验证身份认证信息发送至安全芯片。
S1403、电子设备100通过安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件。
电子设备100的安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件,则说明验证通过。
预设条件可以是,用户输入的验证验证身份认证信息与安全芯片内存储的注册身份认证信息完全一致,或者用户输入的验证身份认证信息在经过变换之后,与电子设备内存储的注册身份认证信息完全一致。预设条件还可以是其他条件,本申请实施例对此不做限定。
S1404、电子设备100通过安全芯片基于验证身份认证信息将加密秘密值三解密,得到秘密值三。
图11实施例S1106中有提及,加密秘密值三是基于注册身的份认证信息加密。在安全芯片确定出验证身份认证信息通过的情况下,可以基于验证身份认证信息将加密秘密值三解密,得到秘密值三。以便后续对根密钥解密,得到数据密钥,从而对用户数据解密,得到真实的用户数据。
可选的,若秘密值三除了注册身的份认证信息加密,还基于其他的因素加密,那么在解密时,也许使用到其他的因素。
可选的,若电子设备100通过安全芯片确认出验证身份认证信息和注册身份认证信息不满足预设条件,则说明验证身份认证信息没有验证通过,那么电子设备100不会执行S1304,也就无法得到秘密值三,进而无法得到根密钥。这样,保证了加密用户数据的安全性。
S1405、电子设备100通过安全芯片向操作系统发送秘密值三。
在安全芯片确认出验证身份认证信息和注册身份认证信息满足预设条件后,及验证成功,安全芯片基于验证身份认证信息将加密秘密值三解密,得到秘密值三,并将秘密值三发送至操作系统,使得操作系统可以基于秘密值三对加密根密钥进行解密,得到根密钥。
S1406、电子设备100通过操作系统基于秘密值三对根密钥进行解密,得到根密钥,再基于根密钥得到数据密钥,基于数据密钥对用户数据进行解密。
电子设备100通过操作系统接收到秘密值三之后,可以基于秘密值三对之前加密的根密钥进行解密,得到根密钥。再基于根密钥得到数据密钥。从而将基于数据密钥加密的用户数据解密,得到未加密的用户数据。使得用户可以查看的使用真实的用户数据。
可选的,若根密钥在加密时还基于其他的因素加密,那么在解密的时候还需其他因素参与进行解密,得到未加密的根密钥。
其他因素参包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
图15为本申请实施例提供的一种数据保护方法的流程示意图。
S1501、电子设备接收用户输入的注册身份认证信息。
在一种可能的实现方式中,注册身份认证信息包括电子设备的注册锁屏身份认证信息和/或电子设备上第一应用的注册开启认证信息;其中,注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与注册锁屏身份信息满足预设条件的情况下,将电子设备解锁;
注册开启认证信息用于在用户输入的验证注册开启认证信息与注册开启认证信息满足预设条件的情况下,开启第一应用。
S1502、电子设备生成第一秘密值,第一秘密值用于加密保护根密钥,根密钥用于保护电子设备上的 用户数据。
其中,第一秘密值可以直接用于加密保护根密钥,第一秘密值也可以和其他因素共同参与加密保护根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
根密钥可以直接用于加密保护电子设备上的用户数据。根密钥也可以派生得到数据密钥,基于数据密钥加密保护电子设备上的用户数据。其中,根密钥可以通过一级或者多级派生得到数据密钥。
S1503、电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值。
S1504、电子设备存储注册身份认证信息和加密第一秘密值。
这样,在电子设备生成秘密值之后。可以基于用户输入的注册身份认证信息对秘密值加密后存储,进一步保护了秘密值的安全性。
在一种可能的实现方式中,电子设备接收用户输入的注册身份认证信息,具体包括:电子设备通过操作系统接收用户输入的注册身份认证信息;在电子设备接收用户输入的注册身份认证信息之后,在电子设备生成第一秘密值之前,方法还包括:电子设备通过操作系统将注册身份认证信息发送至安全芯片;电子设备生成第一秘密值,具体包括:电子设备通过安全芯片生成第一秘密值;电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值,具体包括:电子设备通过安全芯片基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值;电子设备存储注册身份认证信息和加密第一秘密值,具体包括:电子设备将注册身份认证信息和加密第一秘密值存储在安全芯片内。
这里,第一秘密值可以是图10所示的秘密值四。具体的,可以参考图10实施例中的描述,本申请实施例在此不再赘述。
这样,电子设备有安全芯片的情况下,电子设备可以在安全芯片内生成秘密值,避免在安全芯片外生成秘密值,攻击者篡改秘密值,造成用户数据泄露的情况发生。
并且,将加密第一秘密值和注册身份认证信息存储在安全芯片内,安全芯片的安全系数较高,进一步保护了加密第一秘密值和注册身份认证信息的安全性。
在一种可能的实现方式中,在电子设备生成第一秘密值之前,方法还包括:电子设备通过操作系统生成第二秘密值;电子设备通过操作系统将第二秘密值发送至安全芯片;电子设备通过安全芯片生成第三秘密值;电子设备生成第一秘密值,具体包括:电子设备通过安全芯片基于第二秘密值和第三秘密值生成第一秘密值。
本申请还提供了另一种生成第一秘密值的方法。即基于安全芯片内生成的第三秘密值和安全芯片外生成的第二秘密值,共同生成第一秘密值。即使攻击者可以篡改安全芯片外生成的第二秘密值,但是无法篡改安全芯片内生成的第三秘密值,这样也可以避免第一秘密值被攻击者篡改的情况发生。
这里,第二秘密值可以是图11所示的秘密值一,第三秘密值可以是图11所示的秘密值二。具体的,可以参考图11实施例中的描述,本申请实施例在此不再赘述。
在一种可能的实现方式中,在电子设备存储注册身份认证信息和加密第一秘密值之后,方法还包括:在满足第一条件的情况下,电子设备接收用户输入的验证身份认证信息;在验证身份认证信息和注册身份认证信息满足预设条件的情况下,电子设备基于验证身份认证信息将加密第一秘密值解密,得到第一秘密值;电子设备基于第一秘密值将加密根密钥解密,得到根密钥;电子设备基于根密钥将加密用户数据解密,得到未加密用户数据。
其中,第一秘密值可以直接用于将加密根密钥解密,得到根密钥,第一秘密值也可以和其他因素共同参与将加密根密钥解密,得到根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
在得到根密钥之后,根密钥可以直接用于将加密用户数据解密,得到未加密用户数据。也可以基于根密钥派生得到数据密钥,基于数据密钥将加密用户数据解密,得到未加密用户数据。其中,根密钥可以通过一级或者多级派生得到数据密钥。
在验证用户输入的验证身份认证信息时,只有在用户输入的验证身份认证信息和注册身份认证信息满足预设条件的情况下,安全芯片才可以基于验证身份认证信息对加密第一秘密值解密,得到未加密的第一秘密值。这样,可以避免攻击者篡改验证逻辑的情况下,若第一秘密值未加密。导致第一秘密值泄露的情 况发生。
预设条件预设条件可以是用户输入的验证验证身份认证信息与安全芯片内存储的注册身份认证信息完全一致,或者用户输入的验证身份认证信息在经过变换之后,与电子设备内存储的注册身份认证信息完全一致。预设条件还可以是其他条件,本申请实施例对此不做限定
具体的,可以参考图12和图13实施例中的描述,本申请实施例在此不再赘述。
在一种可能的实现方式中,在一种可能的实现方式中,在电子设备接收用户输入的验证身份认证信息之后,在电子设备基于验证身份认证信息将加密第一秘密值解密之前,方法还包括:电子设备通过操作系统将验证身份认证信息脱敏,得到脱敏验证身份认证信息;电子设备通过操作系统将脱敏验证身份认证信息发送至安全芯片;电子设备基于验证身份认证信息将加密第一秘密值解密,具体包括:在脱敏验证身份认证信息和脱敏注册身份认证信息满足预设条件的情况下,电子设备通过安全芯片基于脱敏验证身份认证信息将加密第一秘密值解密,得到第一秘密值。
可选的,电子设备可以直接通过安全芯片基于脱敏注册身份认证信息对第一秘密值加密,得到加密第一秘密值。在其他实施例中,电子设备也可以将脱敏注册身份认证信息进行密钥派生,或者对脱敏注册身份认证信息进行哈希计算,利用派生后的密钥或者哈希计算后的值对第一秘密值加密,得到加密第一秘密值。本申请实施例对此不做限定。
这样,电子设备注册身份认证信息进行脱敏处理,避免在传递的过程中以明文的方式传递造成注册身份认证信息泄露的情况发生。
在一种可能的实现方式中,在电子设备接收用户输入的验证身份认证信息之后,在电子设备基于验证身份认证信息将加密第一秘密值解密之前,方法还包括:电子设备通过操作系统将验证身份认证信息脱敏,得到脱敏验证身份认证信息;电子设备通过操作系统将脱敏验证身份认证信息发送至安全芯片;电子设备基于验证身份认证信息将加密第一秘密值解密,具体包括:在脱敏验证身份认证信息和脱敏注册身份认证信息满足预设条件的情况下,电子设备通过安全芯片基于脱敏验证身份认证信息将加密第一秘密值解密,得到第一秘密值。
可选的,电子设备可以直接通过安全芯片基于脱敏注册身份认证信息对加密第一秘密值解密解密,得到未加密的第一秘密值。在其他实施例中,电子设备也可以基于脱敏注册身份认证信息派生后的密钥或者脱敏注册身份认证信息哈希计算后的值对加密第一秘密值解密解密,得到未加密的第一秘密值。本申请实施例对此不做限定。
这样,在安全芯片内存储的是脱敏注册认证信息时,在验证用户身份证时,电子设备也需将验证身份认证信息进行脱敏处理,并与脱敏注册认证信息进行比对。
在一种可能的实现方式中,电子设备接收用户输入的注册身份认证信息,具体包括:电子设备接收用户输入的注册锁屏身份信息,注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与注册锁屏身份信息满足预设条件的情况下,将电子设备解锁;电子设备生成第一秘密值,第一秘密值用于加密保护根密钥,根密钥用于保护电子设备上的用户数据,具体包括电子设备生成第一秘密值,第一秘密值用于加密保护第一根密钥,第一根密钥用于保护电子设备上的用户数据;电子设备基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值,具体包括:电子设备基于注册锁屏身份信息对第一秘密值加密,得到加密第一秘密值;电子设备存储注册身份认证信息和加密第一秘密值,具体包括:电子设备存储注册锁屏身份信息和加密第一秘密值。
这样,用户可以设置用户解锁电子设备的锁屏身份信息,并将锁屏身份信息和第一秘密值存储在安全芯片内。
可选的,电子设备上可以登录有多个不同的用户账号。用户也可以分别设置多个不同的用户账号对应的锁屏身份信息。
可选的,多个不同的用户账号对应的根密钥也可以不同,也可以相同,本申请实施例对此不做限定。
其中,第一秘密值可以直接用于将加密保护第一根密钥,第一秘密值也可以和其他因素共同参与加密保护第一根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
在得到第一根密钥之后,第一根密钥可以直接用于加密保护电子设备上的用户数据。也可以基于第一 根密钥派生得到数据密钥,基于数据密钥加密保护电子设备上的用户数据。其中,第一根密钥可以通过一级或者多级派生得到数据密钥。
在一种可能的实现方式中,在电子设备存储注册锁屏身份信息和加密第一秘密值之后,方法还包括:电子设备接收用户输入的注册开启认证信息,注册开启认证信息用于在用户输入的验证注册开启认证信息与注册开启认证信息满足预设条件的情况下,开启第一应用;
电子设备生成第四秘密值,第四秘密值用于加密保护第二根密钥,第二根密钥用于保护第一应用内的应用数据;电子设备基于注册开启认证信息对第四秘密值加密,得到加密第四秘密值电子设备存储注册开启认证信息和加密第四秘密值。
其中,第四秘密值可以直接用于加密保护第二根密钥,第四秘密值也可以和其他因素共同参与加密保护第二根密钥。其他因素包括但不仅限于注册开启认证信息、硬件唯一密钥、设备唯一ID、应用标识中的一种或几种。
第二根密钥可以直接用于加密保护第一应用内的应用数据。也可以基于第二根密钥派生得到数据密钥,基于数据密钥加密保护第一应用内的应用数据解密。其中,根密钥可以通过一级或者多级派生得到数据密钥。
这样,用户可以设置电子设备上多个应用的开启认证信息,并将开启认证信息和第四秘密值存储在安全芯片内。
可选的,对于同一个应用,不同用户账号下,该同一个应用的开启认证信息也可以不同,也可以相同,本申请实施例对此不做限定。
结合第一方面,在一种可能的实现方式中,第二根密钥和第一根密钥不同。
可选的,第二根密钥和第一根密钥也可以相同,本申请实施例对此不做限定。
图16为本申请实施例提供的一种数据存储装置的流程示意图。
一种可能的实施方式中,装置1600可以包括接收单元1601、处理单元1602和存储单元1603。该装置1600可用于执行图15实施例所示的一种数据存储方法。
其中,接收单元1601,用于接收用户输入的注册身份认证信息。
处理单元1602,用于生成第一秘密值,第一秘密值用于加密保护根密钥,根密钥用于保护电子设备上的用户数据。
处理单元1602,还用于基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值。
存储单元1603,用于存储注册身份认证信息和加密第一秘密值。
其中,第一秘密值可以直接用于加密保护根密钥,第一秘密值也可以和其他因素共同参与加密保护根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
根密钥可以直接用于加密保护电子设备上的用户数据。根密钥也可以派生得到数据密钥,基于数据密钥加密保护电子设备上的用户数据。其中,根密钥可以通过一级或者多级派生得到数据密钥。
这样,在电子设备生成秘密值之后。可以基于用户输入的注册身份认证信息对秘密值加密后存储,进一步保护了秘密值的安全性。
在一种可能的实现方式中,接收单元1601,具体用于通过操作系统接收用户输入的注册身份认证信息。
处理单元1602,还用于通过操作系统将注册身份认证信息发送至安全芯片。
处理单元1602,具体用于通过安全芯片生成第一秘密值。
存储单元1603,具体用于通过安全芯片基于注册身份认证信息对第一秘密值加密,得到加密第一秘密值。
存储单元1603,具体用于将注册身份认证信息和加密第一秘密值存储在安全芯片内。
这样,电子设备有安全芯片的情况下,电子设备可以在安全芯片内生成秘密值,避免在安全芯片外生成秘密值,攻击者篡改秘密值,造成用户数据泄露的情况发生。
并且,将加密第一秘密值和注册身份认证信息存储在安全芯片内,安全芯片的安全系数较高,进一步保护了加密第一秘密值和注册身份认证信息的安全性。
在一种可能的实现方式中,处理单元1602,还用于通过操作系统生成第二秘密值。
处理单元1602,还用于通过操作系统将第二秘密值发送至安全芯片。
处理单元1602,还用于通过安全芯片生成第三秘密值。
处理单元1602,还用于通过安全芯片基于第二秘密值和第三秘密值生成第一秘密值。
本申请还提供了另一种生成第一秘密值的方法。即基于安全芯片内生成的第三秘密值和安全芯片外生成的第二秘密值,共同生成第一秘密值。即使攻击者可以篡改安全芯片外生成的第二秘密值,但是无法篡改安全芯片内生成的第三秘密值,这样也可以避免第一秘密值被攻击者篡改的情况发生。
在一种可能的实现方式中,接收单元1601,还用于在满足第一条件的情况下,电子设备接收用户输入的验证身份认证信息。
处理单元1602,还用于在验证身份认证信息和注册身份认证信息满足预设条件的情况下,基于验证身份认证信息将加密第一秘密值解密,得到第一秘密值。
处理单元1602,还用于基于第一秘密值将加密根密钥解密,得到根密钥。
处理单元1602,还用于基于根密钥将加密用户数据解密,得到未加密用户数据。
可选的,电子设备可以直接基于根密钥将加密用户数据解密,得到未加密用户数据。
其中,第一秘密值可以直接用于将加密根密钥解密,得到根密钥,第一秘密值也可以和其他因素共同参与将加密根密钥解密,得到根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
在得到根密钥之后,根密钥可以直接用于将加密用户数据解密,得到未加密用户数据。也可以基于根密钥派生得到数据密钥,基于数据密钥将加密用户数据解密,得到未加密用户数据。其中,根密钥可以通过一级或者多级派生得到数据密钥。
在验证用户输入的验证身份认证信息时,只有在用户输入的验证身份认证信息和注册身份认证信息满足预设条件的情况下,安全芯片才可以基于验证身份认证信息对加密第一秘密值解密,得到未加密的第一秘密值。这样,可以避免攻击者篡改验证逻辑的情况下,若第一秘密值未加密。导致第一秘密值泄露的情况发生。
在一种可能的实现方式中,处理单元1602,具体用于通过操作系统将注册身份认证信息脱敏,得到脱敏注册身份认证信息。
处理单元1602,具体用于通过操作系统将脱敏注册身份认证信息发送至安全芯片。
处理单元1602,具体用于通过安全芯片基于脱敏注册身份认证信息对第一秘密值加密,得到加密第一秘密值。
可选的,电子设备可以直接通过安全芯片基于脱敏注册身份认证信息对第一秘密值加密,得到加密第一秘密值。在其他实施例中,电子设备也可以将脱敏注册身份认证信息进行密钥派生,或者对脱敏注册身份认证信息进行哈希计算,利用派生后的密钥或者哈希计算后的值对第一秘密值加密,得到加密第一秘密值。本申请实施例对此不做限定。
这样,电子设备注册身份认证信息进行脱敏处理,避免在传递的过程中以明文的方式传递造成注册身份认证信息泄露的情况发生。
在一种可能的实现方式中,处理单元1602,还用于通过操作系统将验证身份认证信息脱敏,得到脱敏验证身份认证信息。
处理单元1602,还用于通过操作系统将脱敏验证身份认证信息发送至安全芯片。
处理单元1602,具体用于在脱敏验证身份认证信息和脱敏注册身份认证信息满足预设条件的情况下,通过安全芯片基于脱敏验证身份认证信息将加密第一秘密值解密,得到第一秘密值。
可选的,电子设备可以直接通过安全芯片基于脱敏注册身份认证信息对加密第一秘密值解密解密,得到未加密的第一秘密值。在其他实施例中,电子设备也可以基于脱敏注册身份认证信息派生后的密钥或者脱敏注册身份认证信息哈希计算后的值对加密第一秘密值解密解密,得到未加密的第一秘密值。本申请实施例对此不做限定。
这样,在安全芯片内存储的是脱敏注册认证信息时,在验证用户身份证时,电子设备也需将验证身份认证信息进行脱敏处理,并与脱敏注册认证信息进行比对。
在一种可能的实现方式中,注册身份认证信息包括电子设备的注册锁屏身份认证信息和/或电子设备上第一应用的注册开启认证信息;其中,注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与注册锁屏身份信息满足预设条件的情况下,将电子设备解锁;
注册开启认证信息用于在用户输入的验证注册开启认证信息与注册开启认证信息满足预设条件的情况下,开启第一应用。
在一种可能的实现方式中,接收单元1601,具体用于接收用户输入的注册锁屏身份信息,注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与注册锁屏身份信息满足预设条件的情况下,将电子设备解锁。
处理单元1602,具体用于生成第一秘密值,第一秘密值用于加密保护第一根密钥,第一根密钥用于保护电子设备上的用户数据。
处理单元1602,具体用于基于注册锁屏身份信息对第一秘密值加密,得到加密第一秘密值。
处理单元1602,具体用于存储注册锁屏身份信息和加密第一秘密值。
其中,第一秘密值可以直接用于将加密保护第一根密钥,第一秘密值也可以和其他因素共同参与加密保护第一根密钥。其他因素包括但不仅限于注册身份认证信息、硬件唯一密钥、设备唯一ID中的一种或几种。
在得到第一根密钥之后,第一根密钥可以直接用于加密保护电子设备上的用户数据。也可以基于第一根密钥派生得到数据密钥,基于数据密钥加密保护电子设备上的用户数据。其中,第一根密钥可以通过一级或者多级派生得到数据密钥。
这样,用户可以设置用户解锁电子设备的锁屏身份信息,并将锁屏身份信息和第一秘密值存储在安全芯片内。
可选的,电子设备上可以登录有多个不同的用户账号。用户也可以分别设置多个不同的用户账号对应的锁屏身份信息。
可选的,多个不同的用户账号对应的根密钥也可以不同,也可以相同,本申请实施例对此不做限定。
在一种可能的实现方式中,接收单元1601,还用于接收用户输入的注册开启认证信息,注册开启认证信息用于在用户输入的验证注册开启认证信息与注册开启认证信息满足预设条件的情况下,开启第一应用。
处理单元1602,还用于生成第四秘密值,第四秘密值用于加密保护第二根密钥,第二根密钥用于保护第一应用内的应用数据。
处理单元1602,还用于基于注册开启认证信息对第四秘密值加密,得到加密第四秘密值电子设备存储注册开启认证信息和加密第四秘密值。
其中,第四秘密值可以直接用于加密保护第二根密钥,第四秘密值也可以和其他因素共同参与加密保护第二根密钥。其他因素包括但不仅限于注册开启认证信息、硬件唯一密钥、设备唯一ID、应用标识中的一种或几种。
第二根密钥可以直接用于加密保护第一应用内的应用数据。也可以基于第二根密钥派生得到数据密钥,基于数据密钥加密保护第一应用内的应用数据解密。其中,根密钥可以通过一级或者多级派生得到数据密钥。
这样,用户可以设置电子设备上多个应用的开启认证信息,并将开启认证信息和第四秘密值存储在安全芯片内。
可选的,对于同一个应用,不同用户账号下,该同一个应用的开启认证信息也可以不同,也可以相同,本申请实施例对此不做限定。
在一种可能的实现方式中,第二根密钥和第一根密钥不同。
可选的,第二根密钥和第一根密钥也可以相同,本申请实施例对此不做限定。
本申请提供了一种电子设备,电子设备包括:一个或多个处理器、一个或多个存储器、显示屏;一个或多个存储器、显示屏与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,一个或多个处理器调用计算机指令以使得电子设备执行图15所示的一种数据保护方法。
本申请提供了一种计算机可读存储介质,用于存储计算机指令,当计算机指令在电子设上运行时,使得电子设执行图15所示的一种数据保护方法。
本申请提供了一种计算机程序产品,当计算机程序产品在电子设上运行时,使得电子设执行图15所示的一种数据保护方法。
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (13)

  1. 一种数据保护方法,其特征在于,所述方法包括:
    电子设备接收用户输入的注册身份认证信息;
    所述电子设备生成第一秘密值,所述第一秘密值用于加密保护根密钥,所述根密钥用于保护所述电子设备上的用户数据;
    所述电子设备基于所述注册身份认证信息对所述第一秘密值加密,得到加密第一秘密值;
    所述电子设备存储所述注册身份认证信息和所述加密第一秘密值。
  2. 根据权利要求1所述的方法,其特征在于,所述电子设备接收用户输入的注册身份认证信息,具体包括:
    所述电子设备通过操作系统接收用户输入的注册身份认证信息;
    在所述电子设备接收用户输入的注册身份认证信息之后,在所述电子设备生成第一秘密值之前,所述方法还包括:
    所述电子设备通过操作系统将所述注册身份认证信息发送至安全芯片;
    所述电子设备生成第一秘密值,具体包括:
    所述电子设备通过所述安全芯片生成所述第一秘密值;
    所述电子设备基于所述注册身份认证信息对所述第一秘密值加密,得到加密第一秘密值,具体包括:
    所述电子设备通过安全芯片基于所述注册身份认证信息对所述第一秘密值加密,得到所述加密第一秘密值;
    所述电子设备存储所述注册身份认证信息和所述加密第一秘密值,具体包括:
    所述电子设备将所述注册身份认证信息和所述加密第一秘密值存储在所述安全芯片内。
  3. 根据权利要求1所述的方法,其特征在于,在所述电子设备生成第一秘密值之前,所述方法还包括:
    所述电子设备通过操作系统生成第二秘密值;
    所述电子设备通过所述操作系统将所述第二秘密值发送至所述安全芯片;
    所述电子设备通过所述安全芯片生成第三秘密值;
    所述电子设备生成第一秘密值,具体包括:
    所述电子设备通过所述安全芯片基于所述第二秘密值和所述第三秘密值生成所述第一秘密值。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,在所述电子设备存储所述注册身份认证信息和所述加密第一秘密值之后,所述方法还包括:
    在满足第一条件的情况下,所述电子设备接收用户输入的验证身份认证信息;
    在所述验证身份认证信息和所述注册身份认证信息满足预设条件的情况下,所述电子设备基于所述验证身份认证信息将所述加密第一秘密值解密,得到所述第一秘密值;
    所述电子设备基于所述第一秘密值将加密根密钥解密,得到所述根密钥;
    所述电子设备基于所述根密钥将加密用户数据解密,得到未加密用户数据。
  5. 根据权利要求2述的方法,其特征在于,所述电子设备通过操作系统将所述注册身份认证信息发送至安全芯片,具体包括:
    所述电子设备通过所述操作系统将所述注册身份认证信息脱敏,得到脱敏注册身份认证信息;
    所述电子设备通过所述操作系统将所述脱敏注册身份认证信息发送至所述安全芯片;
    所述电子设备通过安全芯片基于所述注册身份认证信息对所述第一秘密值加密,具体包括:
    所述电子设备通过所述安全芯片基于所述脱敏注册身份认证信息对所述第一秘密值加密,得到所述加密第一秘密值。
  6. 根据权利要求4述的方法,其特征在于,在所述电子设备接收用户输入的验证身份认证信息之后,在所述电子设备基于所述验证身份认证信息将所述加密第一秘密值解密之前,所述方法还包括:
    所述电子设备通过所述操作系统将验证身份认证信息脱敏,得到脱敏验证身份认证信息;
    所述电子设备通过所述操作系统将所述脱敏验证身份认证信息发送至所述安全芯片;
    所述电子设备基于所述验证身份认证信息将所述加密第一秘密值解密,具体包括:
    在所述脱敏验证身份认证信息和脱敏注册身份认证信息满足预设条件的情况下,所述电子设备通过所述安全芯片基于所述脱敏验证身份认证信息将所述加密第一秘密值解密,得到所述第一秘密值。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述注册身份认证信息包括所述电子设备的注册锁屏身份认证信息和/或所述电子设备上第一应用的注册开启认证信息;
    其中,所述注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与所述注册锁屏身份信息满足预设条件的情况下,将所述电子设备解锁;
    所述注册开启认证信息用于在用户输入的验证注册开启认证信息与所述注册开启认证信息满足预设条件的情况下,开启所述第一应用。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,电子设备接收用户输入的注册身份认证信息,具体包括:
    电子设备接收用户输入的注册锁屏身份信息,所述注册锁屏身份信息用于在用户输入的验证锁屏身份认证信息与所述注册锁屏身份信息满足预设条件的情况下,将所述电子设备解锁;
    所述电子设备生成第一秘密值,所述第一秘密值用于加密保护根密钥,所述根密钥用于保护所述电子设备上的用户数据,具体包括
    所述电子设备生成第一秘密值,所述第一秘密值用于加密保护第一根密钥,所述第一根密钥用于保护所述电子设备上的用户数据;
    所述电子设备基于所述注册身份认证信息对所述第一秘密值加密,得到加密第一秘密值,具体包括:
    所述电子设备基于所述注册锁屏身份信息对所述第一秘密值加密,得到所述加密第一秘密值;
    所述电子设备存储所述注册身份认证信息和所述加密第一秘密值,具体包括:
    所述电子设备存储所述注册锁屏身份信息和所述加密第一秘密值。
  9. 根据权利要求8述的方法,其特征在于,在所述电子设备存储所述注册锁屏身份信息和所述加密第一秘密值之后,所述方法还包括:
    电子设备接收用户输入的注册开启认证信息,所述注册开启认证信息用于在用户输入的验证注册开启认证信息与所述注册开启认证信息满足预设条件的情况下,开启所述第一应用;
    所述电子设备生成第四秘密值,所述第四秘密值用于加密保护第二根密钥,所述第二根密钥用于保护所述第一应用内的应用数据;
    所述电子设备基于所述注册开启认证信息对所述第四秘密值加密,得到加密第四秘密值
    所述电子设备存储所述注册开启认证信息和所述加密第四秘密值。
  10. 根据权利要求9述的方法,其特征在于,所述第二根密钥和所述第一根密钥不同。
  11. 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器、一个或多个存储器、显示屏;所述一个或多个存储器、所述显示屏与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述一个或多个处理器调用所述计算机指令以使得所述电子设备执行上述权利要求1-10任一项所述的方法。
  12. 一种计算机可读存储介质,其特征在于,用于存储计算机指令,当所述计算机指令在电子设上运行时,使得所述电子设执行上述权利要求1-10任一项所述的方法。
  13. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设上运行时,使得所述电子设执行上述权利要求1-10任一项所述的方法。
PCT/CN2023/116087 2022-09-02 2023-08-31 一种数据保护方法及电子设备 WO2024046418A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211072325.1 2022-09-02
CN202211072325.1A CN117688566A (zh) 2022-09-02 2022-09-02 一种数据保护方法及电子设备

Publications (1)

Publication Number Publication Date
WO2024046418A1 true WO2024046418A1 (zh) 2024-03-07

Family

ID=90100422

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/116087 WO2024046418A1 (zh) 2022-09-02 2023-08-31 一种数据保护方法及电子设备

Country Status (2)

Country Link
CN (1) CN117688566A (zh)
WO (1) WO2024046418A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105590040A (zh) * 2014-11-03 2016-05-18 索尼公司 用于加密数字内容的数字权限管理的方法和系统
EP3276878A1 (en) * 2016-07-28 2018-01-31 INFOCERT S.p.A. Method for the safe authentication of a request made to a remote provider and generated in a personal device with bifurcation of the transmission of an authentication means
CN108667608A (zh) * 2017-03-28 2018-10-16 阿里巴巴集团控股有限公司 数据密钥的保护方法、装置和系统
KR20210045634A (ko) * 2019-10-17 2021-04-27 한국전자인증 주식회사 생체정보 기반 otp 인증 방법 및 시스템
CN112989375A (zh) * 2021-03-05 2021-06-18 武汉大学 一种分级优化加密无损隐私保护方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105590040A (zh) * 2014-11-03 2016-05-18 索尼公司 用于加密数字内容的数字权限管理的方法和系统
EP3276878A1 (en) * 2016-07-28 2018-01-31 INFOCERT S.p.A. Method for the safe authentication of a request made to a remote provider and generated in a personal device with bifurcation of the transmission of an authentication means
CN108667608A (zh) * 2017-03-28 2018-10-16 阿里巴巴集团控股有限公司 数据密钥的保护方法、装置和系统
KR20210045634A (ko) * 2019-10-17 2021-04-27 한국전자인증 주식회사 생체정보 기반 otp 인증 방법 및 시스템
CN112989375A (zh) * 2021-03-05 2021-06-18 武汉大学 一种分级优化加密无损隐私保护方法

Also Published As

Publication number Publication date
CN117688566A (zh) 2024-03-12

Similar Documents

Publication Publication Date Title
WO2020047710A1 (zh) 一种登录方法、令牌发送方法及设备
KR102223609B1 (ko) 전자 기기간 콘텐트 공유 방법 및 장치
CN113609498B (zh) 数据保护方法及电子设备
WO2020238728A1 (zh) 智能终端的登录方法及电子设备
US20230029683A1 (en) Authentication Method, Medium, and Electronic Device
EP4152198A1 (en) Method and apparatus for storing ciphertext
WO2020015259A1 (zh) 一种数据备份方法及终端
WO2022160991A1 (zh) 权限控制方法和电子设备
WO2021057982A1 (zh) 应用程序的处理方法及相关产品
WO2020107463A1 (zh) 一种电子设备的控制方法及电子设备
WO2023284633A1 (zh) 个人身份识别码pin码的处理方法和装置
WO2022111469A1 (zh) 一种文件共享方法、装置及电子设备
CN116484431B (zh) 一种数据保护方法、电子设备及存储介质
WO2024046418A1 (zh) 一种数据保护方法及电子设备
CN114692119A (zh) 校验应用的方法和电子设备
CN115017498A (zh) 小应用程序的操作方法和电子设备
WO2024061326A1 (zh) 一种数据保护方法及电子设备
CN116049826B (zh) 基于tpm的数据保护方法、电子设备及存储介质
WO2020133477A1 (zh) 数据显示方法
WO2022042273A1 (zh) 密钥使用方法及相关产品
RU2809740C2 (ru) Способ обработки файла, хранящегося во внешней памяти
WO2024002137A1 (zh) 通信方法、通信系统及电子设备
WO2024022310A1 (zh) 一种设备安全处理方法及电子设备
WO2023221917A1 (zh) 账户屏蔽方法、通信系统及电子设备
CN113691671B (zh) 安全信息的开放方法、系统及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23859447

Country of ref document: EP

Kind code of ref document: A1