Authentication processing method and electronic equipment

By using timestamp signatures in electronic devices to update the authenticated image data and the image data to be authenticated, the problem that identity authentication methods such as face recognition are easily subject to playback attacks during image acquisition, storage and transmission are solved, and the high security and reliability of identity authentication are achieved.

CN119808053APending Publication Date: 2025-04-11LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998973.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Identity authentication methods such as facial recognition are easily subject to replay attacks during image acquisition, storage and transmission, resulting in the identity authentication system being bypassed and affecting device and data security.

Method used

By introducing an image collector and two independent memories into the electronic device, the authenticated image data and the image data to be authenticated are signed and updated and matched using the timestamp, ensuring that each authentication process uses the latest time stamp data to prevent replay attacks.

Benefits of technology

It effectively prevents replay attacks, improves the security and reliability of identity authentication, and ensures the security of devices and data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808053A_ABST
    Figure CN119808053A_ABST
Patent Text Reader

Abstract

The invention provides an authentication processing method and electronic equipment, and the method comprises the steps: responding to an image collector of the electronic equipment to execute an image collection action when the electronic equipment is in a first mode, obtaining a first timestamp for the image collector to execute the image collection action, and carrying out the authentication processing according to the first timestamp; performing signature updating on authentication image data in a first memory of the electronic equipment to obtain first authentication data with a first timestamp, and signing a currently acquired image in a second memory of the electronic equipment to obtain first to-be-authenticated data with the first timestamp; and if the first to-be-authenticated data with the first timestamp is matched with the first authentication data, cleaning the first to-be-authenticated data with the first timestamp in the second memory, and triggering the electronic equipment to be switched from the first mode to the second mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application mainly relates to the field of security authentication technology, and in particular to an authentication processing method and electronic equipment. Background Art

[0002] Currently, in authentication scenarios such as unlocking the screen of an electronic device, an application or a process, it is usually necessary to collect any physiological characteristics of the visitor such as fingerprints, faces, irises, or any behavioral characteristics such as handwriting and voice to verify whether the visitor has access rights in order to protect the security of the device and data.

[0003] However, taking face recognition as an example, attackers can maliciously manipulate or hijack the face images of legitimate users for replay during the process of face image collection, storage, and transmission, in order to forge legitimate users for identity authentication, resulting in the risk of the identity authentication system being bypassed. Summary of the invention

[0004] In view of the above problems, this application provides the following solutions:

[0005] The first aspect of the present application provides an authentication processing method, the method comprising:

[0006] When the electronic device is in a first mode, in response to an image collector of the electronic device performing an image acquisition action, acquiring a first timestamp for the image collector performing the image acquisition action;

[0007] According to the first timestamp, the authentication image data in the first memory of the electronic device is signed and updated to obtain the first authentication data with the first timestamp, and the current captured image in the second memory of the electronic device is signed to obtain the first data to be authenticated with the first timestamp; the second memory is different from the first memory;

[0008] If the first data to be authenticated with the first timestamp matches the first authentication data, the first data to be authenticated with the first timestamp in the second memory is cleared, and the electronic device is triggered to switch from the first mode to the second mode.

[0009] In one possible implementation, where:

[0010] When the electronic device is in the first mode for the first time, in response to the image collector of the electronic device performing an image collection action, processing the collected image from the image collector to obtain authentication image data;

[0011] Signing the authentication image data according to a second timestamp when the image collector performs an image acquisition action, to obtain second authentication data having the second timestamp;

[0012] The second authentication data is written into the first memory of the electronic device for storage.

[0013] In a possible implementation, the updating of the signature of the authentication image data in the first memory of the electronic device according to the first timestamp to obtain the first authentication data with the first timestamp includes:

[0014] Loading third authentication data stored in the first memory of the electronic device; the timestamp of the third authentication data is a historical timestamp adjacent to the first timestamp;

[0015] Updating the timestamp of the third authentication data to the first timestamp to obtain first authentication data;

[0016] The third authentication data in the first memory is replaced by the first authentication data.

[0017] In a possible implementation, the method further includes:

[0018] In response to the image collector of the electronic device performing an image acquisition action, second data to be authenticated is read from a second memory of the electronic device;

[0019] It is determined that the timestamp of the second data to be authenticated is inconsistent with the first timestamp, and the second data to be authenticated is refused to be matched with the first authentication data.

[0020] In a possible implementation, when the electronic device is in the first mode, in response to an image collector of the electronic device performing an image acquisition action, includes:

[0021] Acquire an output signal of a detection circuit of the electronic device, and switch from a first state to a second state in response to the output signal of the detection circuit;

[0022] Wherein, the detection circuit is connected to the image collector of the electronic device.

[0023] In a possible implementation, triggering the electronic device to switch from the first mode to the second mode includes:

[0024] Controlling the output signal of the detection circuit to return from the second state to the first state;

[0025] In response to the output signal of the detection circuit being restored to the first state, the first to-be-authenticated data is rejected from being matched with the first authentication data.

[0026] In a possible implementation, the authentication data in the first memory and the data to be authenticated in the second memory of the electronic device have a specified data structure;

[0027] The designated data structure includes corresponding image data and a timestamp, and a signature of the image data using the timestamp and a hardware key in a trusted execution environment of the electronic device.

[0028] In a possible implementation, if the current acquired image is a continuous multi-frame acquired image acquired when the image acquirer performs an image acquisition action, the first to-be-authenticated data having the first timestamp matches the first authentication data, including:

[0029] The first data to be authenticated having the first timestamp corresponding to any one frame of the multiple frames of acquired images matches the first authentication data.

[0030] The second aspect of the present application provides an electronic device, the electronic device comprising: a first memory, a second memory, an image collector, and at least one processor, wherein:

[0031] The image collector is used to collect images and input the currently collected image into the second memory;

[0032] The first memory is used to store authentication data with a timestamp; the authentication data is obtained by signing authentication image data of a legitimate user of the electronic device according to the timestamp;

[0033] The processor is used to execute a computer program in a trusted execution environment to implement the following steps:

[0034] When the electronic device is in the first mode, in response to the image collector performing an image acquisition action, acquiring a first timestamp for the image collector performing the image acquisition action;

[0035] Signing and updating the authentication image data in the first memory of the electronic device according to the first timestamp to obtain first authentication data with the first timestamp, and signing the current captured image in the second memory to obtain first data to be authenticated with the first timestamp;

[0036] If the first data to be authenticated with the first timestamp matches the first authentication data, the first data to be authenticated with the first timestamp in the second memory is cleared, and the electronic device is triggered to switch from the first mode to the second mode.

[0037] In a possible implementation, the electronic device further includes a detection circuit, wherein:

[0038] The detection circuit is connected to the image collector and the processor respectively, and is used to output an output signal having a first state or a second state;

[0039] The processor is specifically used for:

[0040] Acquire the output signal of the detection circuit, and in response to the output signal switching from the first state to the second state, execute the step of updating the signature of the authentication image data in the first memory of the electronic device according to the first timestamp to obtain the first authentication data with the first timestamp, and sign the current collected image in the second memory to obtain the first data to be authenticated with the first timestamp;

[0041] In response to the output signal being restored from the second state to the first state, the first to-be-authenticated data is rejected from being matched with the first authentication data. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0043] Figure 1 A schematic diagram of the hardware structure of a first embodiment of an electronic device applicable to the authentication processing method proposed in the embodiment of the present application;

[0044] Figure 2 A schematic diagram of a camera architecture of an electronic device proposed in this embodiment;

[0045] Figure 3 A schematic diagram of the hardware structure of a second embodiment of an electronic device applicable to the authentication processing method proposed in the embodiment of the present application;

[0046] Figure 4 A schematic diagram of another camera architecture of an electronic device proposed in this embodiment;

[0047] Figure 5 A flowchart of an authentication processing method proposed in Example 1 of the present application;

[0048] Figure 6 A flowchart of an authentication processing method proposed in Example 2 of the present application;

[0049] Figure 7 A flowchart of an authentication processing method proposed in Example 3 of the present application;

[0050] Figure 8 A schematic diagram of the structure of an authentication processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application. The embodiments of the present application are described below in conjunction with the drawings. It is known to those of ordinary skill in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0052] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0053] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information (such as facial images, historical data) involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0054] Regarding the description of the background technology part, during the implementation process of an authentication of the captured image, such as the authentication process of the image captured at time T1, in addition to the authentication image of the legitimate person stored in the secure storage space of the electronic device (that is, the pre-recorded authentication image with electronic device access rights, such as the face image of the electronic device owner or the face image of the legitimate visitor authorized by the owner, etc.), two copies of the image to be authenticated captured at time T1 may be cached, the first copy will be stored in the cache space of the electronic device (such as the secure memory space from the trusted execution environment), and the second copy will be stored in the camera hardware cache space (such as EEPROM (Electrically Erasable Programmable read only memory), etc., so that the image data captured by the image sensor may still be cached after being extracted).

[0055] In actual applications, the entry request of the legitimate user's authentication image (such as a face image) and the authentication request for the visitor are initiated by the complete operating system (such as Android, etc.) running on the electronic device. The address allocation of the cache space for the camera-captured image is also determined by the operating system, that is, after the physical address of the cache space is determined in an untrusted execution environment, it is sent or shared to the processor of the trusted execution environment, and the secure cache space is configured accordingly to store the image captured by the camera, which is compared with the pre-recorded and stored authentication image to determine whether the current visitor has access rights.

[0056] In this way, after the image to be authenticated F1 collected at time T1 is authenticated, if the operating system is maliciously manipulated or hijacked, the cache space allocated this time will be manipulated not to be released, and the authentication process at time T1 will not be closed, resulting in a delay in the authentication process at time T2 or even no authentication process at all. Alternatively, in the authentication process stage at time T2, the image to be authenticated F1 that has been authenticated at time T1 is reused, that is, the image to be authenticated F1 that has been authenticated at time T1 is used at time T2 to impersonate the image to be authenticated F2 that is collected in real time at time T2. An illegal visitor replays the image to be authenticated F1 at time T2, causing the electronic device to misjudge the illegal visitor as a legitimate visitor who has been authenticated at time T1, affecting the security of the electronic device and data.

[0057] In order to solve the above problems, the present application proposes an authentication processing method. The authentication processing method of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. In order to facilitate understanding of the authentication processing method proposed by the present application, the electronic device applicable to the authentication processing method will be described in detail below.

[0058] Reference Figure 1 , is a schematic diagram of the hardware structure of an electronic device applicable to the authentication processing method proposed in the embodiment of the present application. The electronic device may be a terminal device such as a mobile phone, a laptop computer or a desktop computer, such as Figure 1 As shown, the electronic device includes but is not limited to: an image collector 110, a first memory 120, a second memory 130 and at least one processor 140, wherein:

[0059] The image collector 110 can be used to collect images and input the current collected image into the second memory 130 for storage. In the embodiment of the present application, the image collector 110 can be one or more cameras, such as an infrared camera, a common camera, etc., and the present application does not limit the number and type of cameras. In addition, the present application does not limit how to control the image collector 110 to collect images to achieve the control process of security authentication, which can be determined according to the architecture of the image collector used by the electronic device.

[0060] The first memory 120 can be used to store authentication data with a timestamp; the authentication data can be obtained by signing the authentication image data of the legitimate user of the electronic device based on the timestamp, and as the number of authentication processes accumulates, the timestamp of each authentication process is used to synchronously update the timestamp of the authentication data in the first memory 120, so that the timestamp of the authentication data stored in the first memory 120 remains the latest timestamp.

[0061] In the embodiment of the present application, the first memory 120 may include one or more readable storage media among magnetic memory, optical memory and semiconductor memory, such as: NVM (non-volatile memory), PSRAM (Pseudo static random access memory), eMMC (Embedded Multi Media Card), UFS (Universal Flash Storage), OTP (One Time Programmable) memory, solid state drive (SSD), DDR (Double Data Rate) memory, disk and optical medium, etc. The present application does not limit the storage type of the first memory 120.

[0062] The second memory 130 can be used to store the image to be authenticated collected by the image collector 110 during this authentication process, that is, the current captured image. In the embodiment of the present application, in order to prevent the electronic device from being illegally attacked, resulting in the reuse of the authenticated image data cached in the second memory 130, each time the image collector performs an image acquisition action, it will use the current timestamp to perform signature authentication on the current captured image, so that the image data stored in the second memory 130 has the timestamp of the image collector performing the image acquisition action this time.

[0063] In the embodiment of the present application, the second memory 130 may be a non-volatile memory, such as one or more of: memory, SRAM (static random access memory), DRAM (Dynamic Random Access Memory), and Cache. The second memory 130 may also be a storage module corresponding to a storage space allocated in a memory of the type of the first memory 120 listed above for caching data, or a storage module corresponding to a storage space allocated from other storage devices for storing images collected in real time by the image collector 110. The present application does not limit the type of the second memory 130 and the configuration implementation method of its storage space address.

[0064] The processor 140 can be used to execute a computer program in a trusted execution environment (such as TEE) to implement the authentication processing method proposed in this application. The implementation process of the method can refer to the description of the corresponding part of the method embodiment below, which will not be described in detail in this embodiment.

[0065] Among them, TEE can be an isolated trusted execution environment that coexists with REE (Rich Execution Environment, a complete operating system environment running on electronic devices, such as Android system environment, etc.), which can provide a higher level of security protection to process sensitive data and perform key operations such as mobile payment, identity authentication, data encryption, etc. If the security of TEE depends on the TrustZone technology of the ARM processor, the processor 140 state and hardware resources can be divided into secure and non-secure states. TEE runs in a secure state and can protect the data and code therein from attacks by software in REE.

[0066] In the embodiment of the present application, the processor 140 can be any one or more of a central processing unit (CPU), a microprocessor (MP) or a digital signal processor (DSP), an AMD security processor, a PSP processor, an ARM processor (TrustZone), etc., which can be determined according to actual needs.

[0067] In practical applications, refer to Figure 2The schematic diagram of the image collector architecture for electronic devices shown in the figure is taken as an example to illustrate the authentication scenario of facial recognition based on the face image collected by the camera (such as unlocking the electronic device, logging into the application or payment, etc.), if the second memory 130 is a memory, the image collector 110 is a camera. Figure 2 As shown, in a secure camera architecture, a facial recognition application (REE FaceIDApplication) run by REE responds to an authentication request or an entry request (which is generated when the authentication image of a legitimate user is first entered), and can allocate memory (i.e., allocate cache space for this authentication from the second memory 130) to determine the memory address (physical address for caching the facial image of this authentication) of a non-secure area of ​​a memory buffer A (the cache space allocated in the second memory 130 for buffering input / output images), and will notify the TEE that authentication is required and transmit the allocated secure memory space, i.e., memory buffer A, to it. The TEE sets the corresponding cache space in the memory as a secure domain to store the facial image collected during this authentication process.

[0068] Afterwards, in the TEE environment, the processor 140 running the image authentication service (such as the facial recognition service TEE FaceIDService) will load the camera driver designed for TEE and set it to secure mode (secure mode is a special mode of the processor in the TrustZone technology, which can be started by setting the security configuration register. In this mode, the processor can access resources marked as secure, such as memory buffer A set as a secure area), so that the camera control and data processing will be performed in the secure environment of TEE, protecting sensitive data from being accessed or tampered with by programs in REE.

[0069] In the TEE environment, the camera sensor is started in a secure mode through the camera driver. The application in the TEE environment (such as the camera sensor) can respond to frames (image frames / image data) from the camera through the camera driver and collect these frame image data. The image data collected by the camera sensor (i.e.) can be securely transmitted to the TEE environment for storage, such as writing to the second storage (such as Figure 2 The memory buffer A in the memory is securely stored in the secure memory space. This implementation process is implemented under the protection of TEE to achieve isolation from REE and improve data security.

[0070] Based on this, for applications in authentication scenarios where electronic devices are used for the first time, the authentication image data of the legitimate user can be entered, and the authentication image data can be signed using the timestamp corresponding to the acquisition time of the authentication image data, and the obtained authentication data can be stored in the first memory. In order to improve data security here, encryption technology can be used in the TEE environment to encrypt and store the authentication image data, and the corresponding timestamp is associated with the storage. This application does not limit the storage method and data structure of the authentication data of the legitimate user, and can be flexibly configured according to actual needs. Regarding the implementation process of how to use the authentication data to match the authentication data to be authenticated in this authentication process, please refer to the description of the corresponding part of the method embodiment below, which will not be described in detail in this embodiment.

[0071] In some other embodiments, Figure 3 As shown, in order to improve the reliability of detecting whether the image collector performs the image acquisition action, compared with the detection by software method, it cannot be guaranteed that the current acquisition image of the memory buffer A input to the TEE environment comes from the image collector, and it may be sent by the memory buffer A in the illegal area, such as Figure 3 The transmission path shown in step 9 in the example above is prone to misjudgment of authentication. Therefore, the present application proposes to use hardware to accurately and timely determine whether the image collector performs the image acquisition action, thereby improving the reliability of the authentication process.

[0072] Based on this, Figure 4 The hardware structure diagram of the electronic device proposed in the second embodiment of the present application is shown, and the electronic device may also include a detection circuit 150, which is connected to the image collector 110 and the processor 140 respectively, and is used to output an output signal having a first state or a second state. Among them, when the output signal of the detection circuit 150 is in the first state, it means that the image collector 110 has not performed an image acquisition action, and when the output signal of the detection circuit 150 switches from the first state to the second state, it means that the image collector 110 has performed an image acquisition action, so as to ensure that the captured image input into the second memory 130 is an image captured in real time by the image collector 110, rather than obtained by other means.

[0073] Regarding the implementation process of how the processor 140 reliably and securely executes the corresponding steps of the authentication processing method proposed in this application according to the state change of the acquired hardware signal (the output signal of the detection circuit 150) during the switching change between the first state and the second state of the output signal of the detection circuit 150, reference can be made to the description of the method embodiment below. It should be noted that the detection circuit 150 of this application is in write-only mode in the secure area, and the system kernel in any non-secure area (i.e., in the REE environment) cannot access the detection circuit 150 by software to achieve tracking and detection of the image acquisition behavior of the camera, and promptly notify the TEE to make corresponding decisions according to the authentication processing method proposed in this application.

[0074] In one possible implementation, Figure 4 As shown in the schematic diagram of the architecture, the detection circuit can be an input / output interface, such as a GPIO (General Purpose Input / Output) interface for connecting and controlling a camera. By controlling the high and low level states of the output level signal of the GPIO, the memory buffer can be controlled, and the image acquisition and image authentication stages can only be executed in different level states of the GPIO, and after completing the processing of the corresponding stages, it can be reset to the default state in time to improve the reliability and security of authentication. It should be noted that the hardware structure of the detection circuit 150 includes but is not limited to the GPIO interface circuit, and can be implemented using other structural circuits according to the above functional requirements. This application does not give detailed examples one by one.

[0075] It should be understood that Figure 1 and Figure 3 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiment of the present application. In practical applications, the electronic device may include Figure 1 and Figure 3 More or fewer components as shown, or combinations of certain components, such as microphones, speakers, displays, various other sensors, antennas, power modules, RF components, external ports and other input / output components, etc., can be determined based on processing function requirements, and this application does not give detailed examples one by one.

[0076] Based on the composition structure of the electronic device and its functional description described above, the authentication processing method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0077] Reference Figure 5 , is a flow chart of an authentication processing method proposed in Embodiment 1 of the present application, which method can be applied to the electronic device described above, such as Figure 5 As shown, the authentication processing method may include but is not limited to the following steps:

[0078] Step S51, when the electronic device is in the first mode, in response to an image collector of the electronic device performing an image acquisition action, obtaining a first timestamp for the image collector performing the image acquisition action;

[0079] In an embodiment of the present application, the first mode of the electronic device may be an authentication mode of the electronic device. By detecting the type of application / process currently accessed by the electronic device, such as receiving an access request for an application such as unlocking / identity authentication / payment, the electronic device may be considered to be in the first mode. At this time, the image collector is responded to perform an image acquisition action, and it is determined that the current acquired image obtained by the image collector is used for authentication processing, and the authentication processing method proposed in the present application may continue to be executed.

[0080] On the contrary, if the electronic device is in the second mode, which can be any non-authentication mode during the operation of the electronic device, such as the normal photo mode, even if it is determined that the image acquisition device performs an image acquisition action, since it is determined that the current acquired image is not used for identity authentication at this time, the current acquired image can be processed according to the processing strategy for the current acquired image in the second mode, and the authentication processing steps proposed in this embodiment will not be executed.

[0081] Therefore, according to the method described above, it is determined that the image collector has performed an image acquisition action, and the current acquired image generated thereby is used for authentication processing, that is, the electronic device is in the first mode, and responds to the image collector performing an image acquisition action. In order to improve the authentication security and avoid replay attacks, the processor under the trusted execution environment TEE will obtain the timestamp when the image collector performs the image acquisition action, recorded as the first timestamp, thereby serving as an identifier of the data generated and processed during this authentication process to record the sequence value of the time when the image collector performs the image acquisition action for authentication processing. This application does not limit the method of obtaining it.

[0082] Step S52: based on the first timestamp, the authentication image data in the first memory of the electronic device is signed and updated to obtain the first authentication data with the first timestamp, and the current captured image in the second memory of the electronic device is signed to obtain the first data to be authenticated with the first timestamp;

[0083] Combined with the above Figure 2 The camera architecture shown, in the TEE environment, each time the camera is determined to perform an image acquisition action for authentication processing, before the authentication operation is performed on the current acquired image, the latest timestamp (first timestamp) will be used to sign and update the authentication image data of the legitimate user stored in the first memory, so that the first memory stores the authentication data of the latest timestamp and no longer stores the authentication data corresponding to the historical timestamp.

[0084] At the same time, in the TEE environment, the latest timestamp (first timestamp) is used to sign the current captured image generated during the execution of this image capture action, and the data to be authenticated with the latest timestamp is obtained, which is recorded as the first data to be authenticated. Figure 2 The architecture shown can use the first timestamp to sign the current captured image stored in the memory buffer A (such as the cache space allocated to this authentication process in the second memory), so that the second memory stores the data to be authenticated with the latest timestamp.

[0085] In one possible implementation, in order to facilitate subsequent matching operations, the above-mentioned stored authentication data and data to be authenticated can store the image features of the corresponding user, which can be extracted from the corresponding collected images, such as facial image features extracted from facial images, combined with the latest timestamp and other content. This application does not limit the data structure of the authentication data and the data to be authenticated and their encryption storage method.

[0086] Step S53: if the first data to be authenticated with the first timestamp matches the first authentication data, clear the first data to be authenticated with the first timestamp in the second memory, and trigger the electronic device to switch from the first mode to the second mode.

[0087] Following the above analysis, the data stored in the first memory and the second memory respectively have timestamps. In this authentication process, only the data corresponding to the latest timestamp is matched and authenticated, that is, the first data to be authenticated with the first timestamp is matched and authenticated with the first authentication data to ensure that the matching authentication result obtained this time is reliable. The first data to be authenticated is the actual collected image of this authentication process (that is, the current collected image). If the first data to be authenticated with the latest timestamp matches the authentication data with the latest timestamp, it means that the current user is a legitimate user using the electronic device, the authentication is passed, and the electronic device and its data can be used safely.

[0088] On the contrary, if the first data to be authenticated with the first timestamp does not match the first authentication data, or the timestamp of the first data to be authenticated or the authentication data obtained this time does not belong to the storage data of the latest timestamp, the authentication processing operation is terminated. It can be seen that in each authentication processing operation of this application, only the data to be authenticated with the latest timestamp and the authentication data are matched and authenticated. In this way, even if the non-secure area in the REE environment of the last authentication processing is hijacked, resulting in incomplete release of the memory buffer, this authentication processing uses the data to be authenticated that passed the previous authentication to perform a replay attack. Because the timestamp of the acquired data to be authenticated is not the latest timestamp, the authentication operation will be refused to be performed on it, solving the problem of replay attacks.

[0089] Among them, for the first authentication data with the first timestamp in the first memory, the authentication image of the legitimate user can be entered during the first use / configuration of the electronic device, and the authentication image data and the latest timestamp obtained therefrom can be used to obtain the authentication data with the latest timestamp. In each subsequent authentication operation, the storage of the authentication data will be iteratively updated, so that the first stored authentication data has the latest timestamp, thereby improving the reliability of the authentication matching result.

[0090] According to the method described above, it is determined that this authentication processing is implemented for the legitimate user of the electronic device. When completing this authentication operation, in order to further avoid replay attacks, the various data to be authenticated with the first timestamp already in the second memory can be directly cleared, thereby avoiding from the source the reuse of the data to be authenticated that has passed this authentication and is stored in the second memory during subsequent authentication processing operations, allowing illegal visitors to impersonate legitimate users for authentication processing, thereby further improving the accuracy of authentication.

[0091] At the same time, after determining that the authentication is passed, the electronic device can be triggered to switch from the first mode to the second mode. In the second mode, the authentication operation will no longer be performed. That is to say, when the image acquisition device performs the image acquisition action at this time, the acquired image does not and cannot perform the authentication operation. The acquired image can be processed according to the processing strategy corresponding to the second mode type, such as storage or transmission. This application does not limit the processing method of the acquired image in the second mode.

[0092] Combined with the above analysis, when the electronic device is in the first mode for the first time (which may be the entry mode here, i.e., recording the authentication image of the legitimate user for identity authentication during subsequent use, etc.), in response to the image acquisition device of the electronic device performing an image acquisition action, the captured image from the image acquisition device is processed to obtain authentication image data, such as facial image features, etc.; the authentication image data can be signed based on the second timestamp of the image acquisition action performed by the image acquisition device to obtain second authentication data with a second timestamp, and the second authentication data is written into the first memory of the electronic device for storage, so that when the subsequent electronic device enters the first mode again (which may be the authentication mode here) and performs authentication processing on the current captured image, the authentication data stored in the first memory is read to achieve the above.

[0093] It is understandable that the time indicated by the second timestamp is earlier than the time indicated by the first timestamp. If the first timestamp and the second timestamp indicate the time of two adjacent authentication processing operations, in the above step S52, the second authentication data currently stored in the first memory can be loaded first, and the authentication image data of the legitimate user therein can be updated with a signature, such as updating the second timestamp in the second authentication data to the first timestamp, and the first authentication data with the first timestamp can be obtained. The authentication image data in the first authentication data and the second authentication data are both image data of the legitimate user, which are usually fixed, such as facial image features, etc. If the facial features of the legitimate user change, the authentication image data in the authentication data stored in the first memory can be updated in time, and the whole process is implemented in the TEE environment of the electronic device.

[0094] It can be seen that in the authentication processing method proposed in this application, at the time indicated by the first timestamp, even if a vulnerability occurs in the REE environment, resulting in the hijacking of the operating system running in the REE environment, the authentication data stored in the first memory will be loaded, but it will be refused to use the authentication data for authentication matching because it is not the latest timestamp. In addition, after the current authentication operation is completed, the data to be authenticated with the corresponding timestamp cached in the second memory will be cleared, so that in other subsequent authentication processes, even if the data to be authenticated obtained by this authentication process is reused, it will be refused to perform the authentication operation because of its different timestamp, preventing the occurrence of replay attacks, and improving the reliability and accuracy of the authentication results.

[0095] Reference Figure 6 , is a flow chart of an authentication processing method proposed in Embodiment 2 of the present application, in which the current authentication operation using the image collector to collect images is not the first authentication operation scenario, such as Figure 6 As shown, the method may include:

[0096] Step S61, when the electronic device is in the first mode, in response to an image collector of the electronic device performing an image acquisition action, obtaining a first timestamp for the image collector performing the image acquisition action;

[0097] Step S62, loading the third authentication data stored in the first memory of the electronic device; the timestamp of the third authentication data is a historical timestamp adjacent to the first timestamp;

[0098] Step S63, updating the timestamp of the third authentication data to the first timestamp to obtain the first authentication data;

[0099] Step S63, replacing the third authentication data in the first memory with the first authentication data;

[0100] Combined with the relevant description of the above embodiment, each time the image captured in real time by the image collector, i.e., the current captured image, is determined to be used for authentication operation, the timestamp of the authentication data of the legitimate user loaded from the first memory (i.e., the authentication data with the latest timestamp stored in the last authentication process, i.e., the third authentication data with the timestamp of the last authentication process) will be updated to the latest timestamp, i.e., the first timestamp, and the first authentication data with the latest timestamp will be updated to the first memory to ensure that the timestamp of the authentication data of the legitimate user stored in the first memory is the latest timestamp. The signature update method for the authentication image data of the legitimate user includes but is not limited to the implementation method described in this embodiment.

[0101] Step S64, signing the current captured image in the second memory of the electronic device according to the first timestamp to obtain first data to be authenticated with the first timestamp;

[0102] Step S65, determining that the first data to be authenticated with the first timestamp matches the first authentication data, clearing the first data to be authenticated with the first timestamp in the second memory, and triggering the electronic device to switch from the first mode to the second mode.

[0103] Following the above analysis, before performing the authentication operation on the current captured image, the present application will also use the first timestamp to sign the current captured image, obtain the first data to be authenticated of the first timestamp, and replace the current captured image storage in the second memory.

[0104] In this way, in response to the image acquisition device of the electronic device executing the image acquisition action, the second data to be authenticated is read from the second memory of the electronic device. It may be that the non-secure area in the REE environment has been hijacked, and the illegal person attempts to use the second data to be authenticated that passed the last authentication to complete this authentication operation. Because the authentication data of the legitimate user in the first memory has been updated to the latest timestamp before the execution of this authentication operation, the timestamp of the second data to be authenticated will be inconsistent with the first timestamp, indicating that the second data to be authenticated is not, and the second data to be authenticated is refused to be matched with the first authentication data, thereby solving this replay attack problem.

[0105] Exemplarily, at time T1, the authentication image of the legitimate user is entered, and the timestamp T1 is used to sign and authenticate it, and the corresponding authentication data P1 is obtained; at time T2, the current captured image from the image collector is signed to obtain the data to be authenticated f1 with the corresponding timestamp T2, and the timestamp T2 is used to update the signature of the stored authentication image data, and the authentication data P2 with the timestamp T2 is obtained. If the REE non-secure area is hijacked at time T2, resulting in incomplete release of the secure area of ​​the second memory in the TEE environment, and an attempt is made to use the authenticated data to be authenticated at T2 at time T3, the authentication operation at time T3 will be rejected because the timestamp of the authenticated data f1 obtained in the TEE environment is not the latest timestamp, thereby preventing replay attacks and improving authentication security and reliability.

[0106] Reference Figure 7 , is a flowchart of an authentication processing method proposed in Embodiment 3 of the present application, describing an optional implementation method of reliably and timely determining whether to perform an authentication operation on a current captured image from an image collector by detecting the state of an output signal of a circuit, such as Figure 7 As shown, the method may include:

[0107] Step S71, obtaining an output signal of a detection circuit of the electronic device, and obtaining a first timestamp for the image collector to perform an image acquisition action in response to the output signal of the detection circuit switching from a first state to a second state;

[0108] Combined with the above Figure 4 As shown in the schematic diagram of the architecture, the present application uses detection circuits such as GPIO interface circuits to assist in tracking the image acquisition behavior of the image collector, determine that it has performed an image acquisition action in the first mode, and promptly process the current captured image cached in the second memory and the loaded authentication data through TEE. If the output signal of the default detection circuit is in the first state, such as the GPIO output level is low, the image collector can perform image acquisition actions, but is prohibited from performing authentication operations.

[0109] After determining that the image acquisition device has performed the image acquisition action, the acquired image stored in the second memory is the current acquired image from the image acquisition device, and the output signal of the detection circuit is set to the second state, such as setting the GPIO output level to a high level. At this time, image acquisition is not performed, and the current acquired image can be compared and authenticated. Before performing the comparison authentication (i.e., the authentication operation), step S72 will be executed first to update the authentication data and the data to be authenticated in the first memory and the second memory, so as to perform the authentication matching operation by only implementing the data to be authenticated and the authentication data corresponding to the latest timestamp. For example, a similarity algorithm is used to determine whether the similarity between the corresponding image data to be authenticated and the authentication image data is greater than a similarity threshold. If so, it means that the two image data are image data of the same legitimate user, and the authentication is successful; otherwise, the authentication fails, and a corresponding prompt message can be output according to actual needs.

[0110] Step S72: based on the first timestamp, the authentication image data in the first memory of the electronic device is updated with a signature to obtain first authentication data with the first timestamp, and the current captured image in the second memory of the electronic device is signed to obtain first data to be authenticated with the first timestamp;

[0111] Step S73, if the first data to be authenticated with the first timestamp matches the first authentication data, clearing the first data to be authenticated with the first timestamp in the second memory;

[0112] Step S74, controlling the output signal of the detection circuit to return to the first state from the second state;

[0113] Step S75 , in response to the output signal of the detection circuit being restored to the first state, refusing to match the first to-be-authenticated data with the first authentication data.

[0114] After determining that the authentication is successful, clear all the data to be authenticated stored in the second memory, and promptly restore the output signal of the detection circuit from the second state to the first state. At this time, the authentication operation will be refused. When performing the next authentication process, according to the method described above, determine that the image acquisition device performs the image acquisition action. When the current acquired image is used for authentication, the output signal of the detection circuit is triggered to enter the second state, and the authentication process of the current acquired image continues. The implementation process can refer to the description of the corresponding part of the above embodiment.

[0115] Since the present application only matches the data to be authenticated and the authentication data with the latest timestamp, even if an authentication is completed and the corresponding data to be authenticated in the second memory is illegally copied, or the authentication data stored in the first memory is hijacked, authentication will be refused because its timestamp is not the latest time, thus preventing replay attacks and improving the reliability and accuracy of the authentication process.

[0116] It can be seen that each time the present application performs identity authentication, it can only use the image data collected at that time and perform authentication according to the method described above. It is impossible to use the data to be authenticated that was stored in the last identity authentication. Or, even if the data to be authenticated used in the last identity authentication is obtained, because the timestamp is not the latest timestamp and the detection circuit (such as GPIO) is restored to the first state, the data to be authenticated cannot be used to complete the current identity authentication, thereby avoiding the problem of replay attacks and improving the security and reliability of identity authentication.

[0117] Preferably, the authentication data in the first memory of the electronic device and the data to be authenticated in the second memory have a specified data structure, which includes the corresponding image data and a timestamp, and a signature of the image data using the timestamp and a hardware key (Hardware (HW) Key) in the trusted execution environment of the electronic device. Exemplary, the specified data structure is shown in the following table:

[0118]

[0119] Table 1

[0120] Among them, the hardware password HW Key is held by TEE, and the HW Key of different electronic devices is different. As described in the above embodiment of the authentication processing method, each time the electronic device switches to the second state, such as Figure 4 Under the architecture shown, each time the GPIO level is pulled high, the latest timestamp obtained will be used to update the above data structure, such as updating the timestamp in the above data structure to the latest timestamp obtained this time. Preferably, the present application can also constrain the TEE environment of the electronic device to only accept the above data structure for authentication matching, and refuse to perform authentication matching operations for the data to be authenticated and the authentication data of other data organizations.

[0121] In the face recognition authentication scenario, as analyzed above, the facial features extracted based on the face recognition algorithm are used as the corresponding authentication / to-be-authenticated image data, but it is not limited to this image data acquisition method.

[0122] In the actual application of the present application, during each authentication process, the image collector usually continuously captures multiple frames of images, that is, the continuous multiple frames of captured images (such as 15 frames of captured images, etc.) captured when the image collector performs the image capture action are the current captured images. Afterwards, the first data to be authenticated with a first timestamp corresponding to any frame of the multiple frames of captured images can be matched with the first authentication data. If the authentication passes, that is, the match is successful, the authentication operation can be ended and the various data to be authenticated stored in the second memory can be cleared.

[0123] In a possible implementation, a quality assessment may be performed on multiple consecutive frames of captured images, and a frame of captured images with the highest image quality and complete image features may be selected for subsequent processing. The implementation process is not described in detail in this application.

[0124] The above describes a method for saving an authentication processing file provided in an embodiment of the present application. The following describes a device for executing the above authentication processing method.

[0125] Reference Figure 8 , is a schematic diagram of the structure of an authentication processing device provided in an embodiment of the present application. Figure 8 As shown, the authentication processing device may include:

[0126] A first timestamp acquisition module 81 is configured to acquire a first timestamp for the image collector performing the image acquisition action in response to the image collector of the electronic device performing the image acquisition action when the electronic device is in the first mode;

[0127] A signature updating module 82, configured to update the signature of the authentication image data in the first memory of the electronic device according to the first timestamp, so as to obtain first authentication data having the first timestamp;

[0128] A first signature module 83 is used to sign the current captured image in the second memory of the electronic device according to the first timestamp to obtain the first data to be authenticated with the first timestamp; the second memory is different from the first memory;

[0129] The authentication processing module 84 is used to clear the first data to be authenticated with the first timestamp in the second memory and trigger the electronic device to switch from the first mode to the second mode if the first data to be authenticated with the first timestamp matches the first authentication data.

[0130] Combined with the above analysis, in order to avoid the historical images that have passed the authentication (such as the image to be authenticated that has passed the T1 time authentication) from impersonating the real-time collected image, resulting in a replay attack, it is proposed that each time the electronic device performs authentication processing and determines that the image collector executes the image acquisition action, the authentication image data read in this authentication processing is updated with a signature based on the current timestamp, and the signature authentication is performed on the current collected image to ensure that the data to be authenticated in this authentication processing has the latest timestamp (such as the current time) and the stored authentication data also has the latest timestamp. After that, this application will only match and judge the data to be authenticated and the authentication data with the latest timestamp. For the data to be authenticated or the authentication data that is not the latest timestamp, the authentication operation will be directly rejected, thereby improving the reliability and accuracy of the authentication processing.

[0131] Wherein, when the electronic device is in the first mode for the first time, the authentication processing device may further include:

[0132] An authentication image data obtaining module, used for processing a captured image from the image collector of the electronic device to obtain authentication image data in response to the image collector of the electronic device performing an image capturing action;

[0133] A second signature module, used for signing the authentication image data according to a second timestamp of the image acquisition action performed by the image acquisition device, to obtain second authentication data with the second timestamp;

[0134] The first writing module is used to write the second authentication data into the first memory of the electronic device for storage.

[0135] Optionally, the signature update module may include:

[0136] A third authentication data loading unit, configured to load third authentication data stored in the first memory of the electronic device; the timestamp of the third authentication data is a historical timestamp adjacent to the first timestamp;

[0137] A timestamp updating unit, configured to update the timestamp of the third authentication data to the first timestamp to obtain first authentication data;

[0138] A replacement unit is used to replace the third authentication data in the first memory with the first authentication data.

[0139] Based on the above analysis, the authentication processing device may further include:

[0140] A reading module, used for reading second data to be authenticated from a second memory of the electronic device in response to the image collector of the electronic device performing an image acquisition action;

[0141] The matching rejection module is used to determine that the timestamp of the second data to be authenticated is inconsistent with the first timestamp, and reject the matching of the second data to be authenticated with the first authentication data.

[0142] Optionally, the first timestamp acquisition module 81 may include:

[0143] a state switching unit, configured to obtain an output signal of a detection circuit of the electronic device, and switch from a first state to a second state in response to the output signal of the detection circuit;

[0144] Wherein, the detection circuit is connected to the image collector of the electronic device.

[0145] Based on the above analysis, the above authentication processing module may include:

[0146] an output signal control unit, used for controlling the output signal of the detection circuit to return from the second state to the first state;

[0147] An output signal recovery unit is used to refuse to match the first to-be-authenticated data with the first authentication data in response to the output signal of the detection circuit being restored to the first state.

[0148] Preferably, the authentication data in the first memory of the electronic device and the data to be authenticated in the second memory have a specified data structure; the specified data structure may include corresponding image data and a timestamp, as well as a signature of the image data using the timestamp and a hardware key in the trusted execution environment of the electronic device.

[0149] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any authentication processing method provided in the embodiment of the present application.

[0150] When the computer-readable instructions are loaded and executed on the computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-readable instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0151] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any authentication processing method provided in the embodiment of the present application.

[0152] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0153] Through the description of the above implementation methods, in the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. In this specification, each embodiment is described in a progressive or parallel manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device and electronic device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

Claims

1. An authentication processing method, the method comprising: When the electronic device is in a first mode, in response to an image collector of the electronic device performing an image acquisition action, acquiring a first timestamp for the image collector performing the image acquisition action; According to the first timestamp, the authentication image data in the first memory of the electronic device is updated with a signature to obtain first authentication data with the first timestamp, and the current captured image in the second memory of the electronic device is signed to obtain first data to be authenticated with the first timestamp; The second memory is different from the first memory; If the first data to be authenticated with the first timestamp matches the first authentication data, the first data to be authenticated with the first timestamp in the second memory is cleared, and the electronic device is triggered to switch from the first mode to the second mode.

2. The method according to claim 1, wherein: When the electronic device is in the first mode for the first time, in response to the image collector of the electronic device performing an image collection action, processing the collected image from the image collector to obtain authentication image data; Signing the authentication image data according to a second timestamp when the image collector performs an image acquisition action, to obtain second authentication data having the second timestamp; The second authentication data is written into the first memory of the electronic device for storage.

3. The method according to claim 1, wherein the step of updating the signature of the authentication image data in the first memory of the electronic device according to the first timestamp to obtain the first authentication data having the first timestamp comprises: Loading third authentication data stored in the first memory of the electronic device; The timestamp of the third authentication data is a historical timestamp adjacent to the first timestamp; Updating the timestamp of the third authentication data to the first timestamp to obtain first authentication data; The third authentication data in the first memory is replaced by the first authentication data.

4. The method according to claim 1, further comprising: In response to the image collector of the electronic device performing an image acquisition action, second data to be authenticated is read from a second memory of the electronic device; It is determined that the timestamp of the second data to be authenticated is inconsistent with the first timestamp, and the second data to be authenticated is refused to be matched with the first authentication data.

5. The method according to claim 1, wherein when the electronic device is in the first mode, in response to an image collector of the electronic device performing an image acquisition action, the method comprises: Acquire an output signal of a detection circuit of the electronic device, and switch from a first state to a second state in response to the output signal of the detection circuit; Wherein, the detection circuit is connected to the image collector of the electronic device.

6. The method according to claim 5, wherein triggering the electronic device to switch from the first mode to the second mode comprises: Controlling the output signal of the detection circuit to return from the second state to the first state; In response to the output signal of the detection circuit being restored to the first state, the first to-be-authenticated data is rejected from being matched with the first authentication data.

7. The method according to any one of claims 1 to 6, wherein the authentication data in the first memory and the data to be authenticated in the second memory of the electronic device have a specified data structure; The designated data structure includes corresponding image data and a timestamp, and a signature of the image data using the timestamp and a hardware key in a trusted execution environment of the electronic device.

8. The method according to any one of claims 1 to 6, wherein if the current captured image is a continuous multi-frame captured image captured by the image collector when performing an image capture action, the first data to be authenticated having the first timestamp matches the first authentication data, comprising: The first data to be authenticated having the first timestamp corresponding to any one frame of the multiple frames of acquired images matches the first authentication data.

9. An electronic device, comprising: A first memory, a second memory, an image collector, and at least one processor, wherein: The image collector is used to collect images and input the currently collected image into the second memory; The first memory is used to store authentication data with a timestamp; the authentication data is obtained by signing authentication image data of a legitimate user of the electronic device according to the timestamp; The processor is used to execute a computer program in a trusted execution environment to implement the following steps: When the electronic device is in the first mode, in response to the image collector performing an image acquisition action, acquiring a first timestamp for the image collector performing the image acquisition action; Signing and updating the authentication image data in the first memory of the electronic device according to the first timestamp to obtain first authentication data with the first timestamp, and signing the current captured image in the second memory to obtain first data to be authenticated with the first timestamp; If the first data to be authenticated with the first timestamp matches the first authentication data, the first data to be authenticated with the first timestamp in the second memory is cleared, and the electronic device is triggered to switch from the first mode to the second mode.

10. The electronic device according to claim 9, further comprising a detection circuit, wherein: The detection circuit is connected to the image collector and the processor respectively, and is used to output an output signal having a first state or a second state; The processor is specifically used for: Acquire the output signal of the detection circuit, and in response to the output signal switching from the first state to the second state, execute the step of updating the signature of the authentication image data in the first memory of the electronic device according to the first timestamp to obtain the first authentication data with the first timestamp, and sign the current collected image in the second memory to obtain the first data to be authenticated with the first timestamp; In response to the output signal being restored from the second state to the first state, the first to-be-authenticated data is rejected from being matched with the first authentication data.