Attack defense and detection method, system and device, storage medium and program product

By embedding verification information at the tail of the image data stream in the face recognition authentication system and detecting its existence, the problem of fake face image attack generated by artificial intelligence is solved, and the security and reliability of identity authentication are improved.

CN119150268AActive Publication Date: 2024-12-17ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411168083.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-17
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The existing facial recognition authentication system lacks the defense and detection capabilities of artificial intelligence generated content (AIGC) forged face pictures, resulting in insufficient security and reliability of the identity authentication process.

Method used

The client converts the face image into a preset image data stream, and embeds specified verification information at the tail of the data stream, and sends it to the server to prevent face image replacement attacks; the server checks the tail identification of the data stream Detect whether there is a specified verification information and determine whether there is a risk of face image replacement attack when the identity authentication task is used.

Benefits of technology

Effectively prevent attacks on fake face pictures to replace real face pictures, improve the security and reliability of the identity authentication process, reduce authentication failures or security vulnerabilities, and ensure the accuracy and privacy protection of identity authentication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150268A_ABST
    Figure CN119150268A_ABST
Patent Text Reader

Abstract

One or more embodiments of the invention provide an attack defense and detection method, system and device, a storage medium and a program product. The attack defense method comprises the following steps: in response to an identity authentication operation, obtaining a to-be-authenticated face image and specified verification information; converting the face image into an image data stream in a preset format; embedding specified verification information into the tail of the image data stream to obtain a to-be-authenticated image data stream; and sending the to-be-authenticated image data stream to the server for identity authentication. The attack detection method comprises the following steps: receiving a to-be-authenticated image data stream uploaded by any to-be-authenticated client; determining whether specified verification information can be extracted from the to-be-authenticated image data stream or not based on the tail identifier of the image data stream in the preset format; if yes, no face image replacement attack exists in the identity authentication task; if not, determining that the current identity authentication task has a face image replacement attack risk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computer software technology, and in particular, to an attack defense, an attack detection method, an identity authentication system, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] At present, face recognition authentication technology has penetrated into all aspects of work and life. Commonly, face recognition technology is used for identity authentication in many mobile applications. When authenticating facial information, the face image is first collected through the client camera, and then the face image is sent to the face authentication server for face information verification, and the authentication result is returned to the client after verification. However, as AIGC (Artificial Intelligence Generated Content) becomes more and more powerful, attackers often use fake face images to replace the collected real face images for attacks. The current identity recognition system lacks the ability to defend and detect this new type of attack. Summary of the invention

[0003] In view of this, one or more embodiments of the present specification provide an attack defense, an attack detection method, an identity authentication system, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0005] According to a first aspect of one or more embodiments of this specification, an attack defense method is proposed, which is applied to a client. The method includes:

[0006] In response to the identity authentication operation, obtaining a face image to be authenticated and designated verification information;

[0007] Converting the facial image into an image data stream in a preset format;

[0008] Embedding the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated;

[0009] The image data stream to be authenticated is sent to the server for identity authentication; wherein the specified verification information is embedded in the image data stream to be authenticated to defend against possible face image replacement attacks in this identity authentication task.

[0010] According to a second aspect of an embodiment of this specification, there is provided an attack detection method, which is applied to a server, and the method includes:

[0011] Receive the image data stream to be authenticated uploaded by any client to be authenticated;

[0012] Determining whether the specified verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in a preset format;

[0013] If yes, it is determined that the image data stream to be authenticated carries the specified authentication information, then there is no face image replacement attack in this identity authentication task;

[0014] If not, it is determined that the image data stream to be authenticated does not carry the specified verification information, and there is a risk of face image replacement attack in this identity authentication task.

[0015] According to a third aspect of an embodiment of this specification, there is provided an identity authentication system, including a server and multiple clients;

[0016] Any one of the clients is used to obtain a face image to be authenticated and designated verification information in response to an identity authentication operation; convert the face image into an image data stream in a preset format; embed the designated verification information into the end of the image data stream to obtain an image data stream to be authenticated; and send the image data stream to be authenticated to the server for identity authentication; wherein, embedding the designated verification information in the image data stream to be authenticated is used to defend against a face image replacement attack that may occur in this identity authentication task;

[0017] The server is used to receive an image data stream to be authenticated uploaded by any client to be authenticated; based on the tail identifier of the image data stream in a preset format, determine whether specified verification information can be extracted from the image data stream to be authenticated; if so, it is determined that the image data stream to be authenticated carries the specified verification information, and there is no face image replacement attack in this identity authentication task; if not, it is determined that the image data stream to be authenticated does not carry the specified verification information, and there is a risk of face image replacement attack in this identity authentication task.

[0018] According to a fourth aspect of the embodiments of this specification, there is provided an electronic device, including:

[0019] processor;

[0020] a memory for storing processor-executable instructions;

[0021] When the processor executes the executable instructions, it is used to implement the method described in the first aspect or the second aspect.

[0022] According to a fifth aspect of the embodiments of this specification, there is provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above methods are implemented.

[0023] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.

[0024] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0025] The embodiments of this specification provide an attack defense method applied to a client and an attack detection method applied to a server.

[0026] After the client converts the acquired facial image into an image data stream in a preset format, it can embed the specified verification information at the end of the facial image data stream to be authenticated, thereby effectively preventing attackers from using forged facial images to replace real facial images for identity authentication, thereby increasing the security and reliability of the identity authentication process and reducing authentication failures or security vulnerabilities caused by forged facial attacks; and since the embedded verification information does not affect the content and structure of the original image data, it is also conducive to ensuring the accuracy of identity authentication.

[0027] After receiving the image data stream to be authenticated uploaded by any client, the server checks whether the specified verification information can be extracted from it based on the tail identifier of the image data stream in a preset format. If the specified verification information can be successfully extracted, the image can be considered to be authentic and not tampered with, which effectively prevents face image replacement attacks because attackers cannot correctly embed the specified verification information in the image. Through this detection mechanism, the server can quickly and accurately determine whether there is a security risk when processing the image data stream to be authenticated uploaded by any client, which not only improves the security of identity authentication, but also enhances reliability, enabling it to cope with increasingly complex fraud attacks.

[0028] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is an architectural diagram of an identity authentication system provided by an exemplary embodiment.

[0030] Figure 2 It is an architectural diagram of another identity authentication system provided by an exemplary embodiment.

[0031] Figure 3 This is an interaction sequence diagram between a server and a client provided by an exemplary embodiment.

[0032] Figure 4 It is a schematic diagram of a format of an image data stream to be authenticated provided by an exemplary embodiment.

[0033] Figure 5 It is a schematic diagram of another format of an image data stream to be authenticated provided by an exemplary embodiment.

[0034] Figure 6 The present invention is a flowchart of a server verifying specified verification information provided by an exemplary embodiment.

[0035] Figure 7 It is a schematic diagram of a client acquiring and transmitting two image data streams to be authenticated, provided by an exemplary embodiment.

[0036] Figure 8 It is a flowchart of an attack defense method provided by an exemplary embodiment.

[0037] Fig. 9 It is a flowchart of an attack detection method provided by an exemplary embodiment.

[0038] Fig.10 It is a schematic structural diagram of an electronic device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0040] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0041] At present, face recognition authentication technology has penetrated into all aspects of work and life. Commonly, face recognition technology is used for real-name identity authentication in many mobile applications. However, due to the large number of face recognition service providers on the market, and in order to simplify the connection, the entire face recognition authentication process does not have much security protection, and most security measures are solved by the caller.

[0042] When authenticating face information, the client camera first collects face images, then sends the face images to the face authentication server for face information verification, and returns the authentication results to the client after verification. However, as AIGC (Artificial Intelligence Generated Content) becomes more and more powerful, attackers often use fake face images to replace the collected real face images to attack. The current identity recognition system lacks the ability to defend and detect this new type of attack.

[0043] Based on this, this specification provides an attack defense method applied to the client and an attack detection method applied to the server. After the client converts the acquired face image into an image data stream in a preset format, by embedding the specified verification information in the tail of the face image data stream to be authenticated, it can effectively prevent the attacker from using a forged face image to replace the real face image for identity authentication, thereby increasing the security and reliability of the identity authentication process and reducing the authentication failure or security vulnerability caused by forged face attacks. The server can detect and verify whether there is embedded specified verification information in the image data stream to be authenticated according to the tail identifier of the image data stream in the preset format, and can effectively determine whether there is a risk of face image replacement attack, thereby improving the trust and reliability of the authenticity of the user's identity.

[0044] Figure 1 FIG. 1 is a schematic diagram of the architecture of an identity authentication system provided by an exemplary embodiment. Figure 1 As shown, the system may include a server 11, a network 12, and several electronic devices, including but not limited to a PC (Personal Computer) 13, a mobile phone 14, and the like.

[0045] The server 11 may be a physical server including an independent host, or the server 11 may be a virtual server carried by a host cluster. During operation, the server 11 may run a server-side program of a certain application to implement the relevant functions of the application. For example, when the server 11 runs an identity authentication service program, it may be implemented as a corresponding identity authentication service platform (or server end).

[0046] PC13 and mobile phone 14 are only some types of electronic devices that users can use. In fact, users can obviously also use electronic devices such as the following types: tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of this specification do not limit this. During operation, the electronic device can run a program on the client side of a certain application to implement the relevant functions of the application. For example, when the electronic device runs the program of the identity authentication service, it can be implemented as a client of the identity authentication service. Among them, the application program of the client of the above-mentioned identity authentication service can be started and run on the electronic device. The program on the client side can be a native application installed on the electronic device, or the program on the client side can be a small program, a quick application or other similar forms. Of course, when using web page technologies such as HTML5 or similar, the relevant functions can be implemented through the page displayed by the browser. The browser here can be an independent browser application or a browser module embedded in certain applications.

[0047] As for the network 12 for interaction between electronic devices such as PC 13 and mobile phone 14 and server 11, it is possible to select a wired or wireless network to achieve communication based on the communication mode supported by the corresponding electronic device, and this specification does not limit this. For example, PC 13 can support both wired and wireless communication, so it can use a wired or wireless network to achieve communication as needed, while mobile phone 14 usually only supports wireless communication, so it can use a wireless network to achieve communication.

[0048] See also Figure 2 and Figure 3 This specification provides an identity authentication system including a server 10 and multiple clients 20.

[0049] Any client 20 is used to respond to the identity authentication operation, obtain the face image to be authenticated and the specified verification information (S301); convert the face image into an image data stream in a preset format (S302); embed the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated (S303), and can append data without affecting the visualization of the original image data stream; send the image data stream to be authenticated to the server 10 for identity authentication (S304); wherein, embedding the specified verification information in the image data stream to be authenticated is used to defend against the face image replacement attack that may occur in this identity authentication task.

[0050] Exemplarily, the electronic device used to install the client 20 is integrated with a camera, or the electronic device used to install the client 20 is communicatively connected to the camera. The client 20 can control the camera to capture facial images in response to the identity authentication operation, so that the facial image to be authenticated can be obtained from the camera.

[0051] Exemplarily, the specific content of the specified verification information may be pre-agreed upon by the client 20 and the server 10, and this implementation does not impose any limitation on this.

[0052] Exemplary, preset formats include but are not limited to: (1) JPEG (Joint Photographic Experts Group) format, a lossy compressed image format, commonly used to store photos and other true color images; (2) PNG (Portable Network Graphics) format, a lossless compressed bitmap image format, suitable for network transmission and storage of digital graphics; (3) GIF (Graphics Interchange Format) format, a bitmap image format that supports animation and transparency, commonly used for simple animations or icons; (4) BMP (Bitmap) format, a bitmap image format commonly used in Windows operating systems, which stores data in a lossless compressed manner; (5) TIFF (Tagged Image File Format) format, a lossless or lossy compressed image file format, suitable for storage and processing of high-quality images; (6) SVG (Scalable Vector Graphics) format, an XML-based vector graphics format, suitable for scalable graphics display on the Web.

[0053] Considering that the image data stream of the preset format usually has a fixed tail mark, which is used to mark the end of the image data. For example, the header mark of the JPEG image data stream is FFD8, and the tail mark is FFD9; the beginning of the PNG image data stream starts with a fixed 8-byte mark "89 50 4E 47 0D 0A 1A 0A", and the end is determined by the IEND block mark; the beginning of the GIF image data stream starts with a fixed 6-byte mark, that is, 47 49 46 38 39 61 (that is, "GIF89a") or 47 4946 38 37 61 (that is, "GIF87a"), and the end is determined by a special 3-byte mark, that is, 003B (that is, ";" in ASCII code), indicating the end of the GIF image data.

[0054] Therefore, the embodiment of this specification embeds the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated, which can effectively defend against the face image replacement attack that may occur in this identity authentication task. In addition, since the embedded verification information does not affect the content and structure of the original image data, it is also beneficial to ensure the accuracy of identity authentication, and can also reduce the complexity and network overhead caused by uploading the specified verification information separately. At the same time, this embedding method can also improve privacy protection. Therefore, the specified verification information is directly embedded in the image data stream and will not be exposed to attackers or middlemen during the transmission process. For example, please refer to Figure 4 , Figure 4 A schematic diagram showing how to embed designated verification information at the end of a JPEG image data stream.

[0055] See also Figure 3 The server 10 is used to receive the image data stream to be authenticated uploaded by any client 20 to be authenticated (S305); based on the tail identifier of the image data stream in a preset format, determine whether the specified verification information can be extracted from the image data stream to be authenticated (S306); the tail identifier can be used to enable the server 10 to locate the position of the specified verification information.

[0056] If yes, it is determined that the image data stream to be authenticated carries the specified verification information, then there is no face image replacement attack in this identity authentication task (S307); if no, it is determined that the image data stream to be authenticated does not carry the specified verification information, then there is a risk of face image replacement attack in this identity authentication task (S308). Further, the server 10 can determine the risk level of this identity authentication task based on the attack detection result, and return the risk level to the client 20 (S309), so that the client 20 determines the authentication result of this identity authentication task based on the risk level (310).

[0057] In this embodiment, the server 10 checks whether the specified verification information can be extracted from the image data stream based on the tail identifier of the preset format. If the verification information can be successfully extracted, it means that the image data stream to be authenticated contains the specified identity authentication information, and the image can be considered to be authentic and not tampered with. This effectively prevents face image replacement attacks because the attacker cannot correctly embed the specified verification information in the image. Through this detection mechanism, the server 10 can quickly and accurately determine whether there is a security risk when processing the image data stream uploaded by any client 20 in real time, which not only improves the security of identity authentication, but also enhances reliability, enabling it to cope with increasingly complex fraud attacks.

[0058] For example, the client 20 and the server 10 agree in advance to embed the designated verification information into the tail of the image data stream. The server 10 receives the image data stream to be authenticated uploaded by the client 20. The server 10 can find the tail identifier of the image data stream in the preset format in the image data stream to be authenticated, and then read the designated verification information from the tail identifier. If there is no other data after the tail identifier, it can be determined that the image data stream to be authenticated does not carry the designated verification information. If there is no other data after the tail identifier, it is necessary to further verify whether the other data is the designated verification information. If the other data is not the designated verification information, it is determined that the image data stream to be authenticated does not carry the designated verification information; if the other data is the designated verification information, it is determined that the image data stream to be authenticated carries the designated verification information. Based on the results of the attack detection, the server 10 can determine the risk level of this identity authentication task. For example, if the attack detection finds that the image data has signs of suspected tampering, or the designated verification information does not conform to the expected pattern, the server 10 may mark this authentication task as high risk. The server 10 returns the risk level information to the client 20. The risk level information includes a specific risk code or a simple high, medium, or low risk identification, as well as corresponding explanations or suggestions. After the client 20 receives the risk level information returned by the server 10, the client 20 can decide the next operation based on the risk level. For example, for high risk, the client 20 may choose to terminate the current authentication process and prompt the user to re-authenticate or take other security measures. For low risk, the client 20 can continue the authentication process, or remind the user that the current authentication risk is low and recommend the user to continue.

[0059] In some embodiments, in order to further improve the security of the identity authentication process, the client 20 can respond to the identity authentication operation, obtain the face image to be authenticated and the specified verification information, and generate an identity authentication request and send it to the server 10. The server 10 can generate a token for uniquely identifying this identity authentication task based on the identity authentication request and return it to the client 20. This embodiment uses a token to uniquely identify the identity authentication task, ensuring the uniqueness and authenticity of each identity authentication task. Exemplarily, the token can be a string randomly and dynamically generated by the server 10.

[0060] The client 20 can then convert the face image to be authenticated into an image data stream in a preset format, and use the token to encrypt the above-mentioned specified verification information, and embed the encrypted specified verification information into the end of the image data stream to obtain the image data stream to be authenticated. In this embodiment, embedding the encrypted specified verification information in the image data stream can effectively prevent the forgery or replacement attack of the face image, and this encryption and embedding process can prevent the attacker from stealing or tampering with the specified verification information during the transmission process, ensuring the confidentiality and integrity of the specified information; that is, only the client 20 with the correct encryption information can generate the correct image data stream, thereby passing the identity authentication.

[0061] Exemplarily, the specified verification information includes at least one of the following: device information of the device where the client 20 is located, a hash value obtained by processing the image data stream based on a preset hash function, and a token. The device information of the device where the client 20 is located includes at least one of the following: a device fingerprint of the device where the client 20 is located, and a risk indicator determined based on the operating status of the device where the client 20 is located.

[0062] The device fingerprint of the device where the client 20 is located is a unique identifier of the device where the client 20 is located, which is usually generated based on the hardware and software features of the device. The device fingerprint may include information such as the device model, operating system version, unique hardware identifier (such as International Mobile Equipment Identity (IMEI) or serial number), network configuration, etc. Through the device fingerprint, the server 10 can identify and track specific devices to ensure the legitimacy of the device for identity authentication.

[0063] The risk index is an index determined based on the operation of the client 20 device, which is used to evaluate the risk level of this identity authentication task. For example, by scanning the files, processes and system status on the device, it is detected whether there are known malware or viruses (devices infected with malware may leak sensitive information, be remotely controlled or perform unauthorized operations, so the authentication system should be alert to the risks that such devices may bring); or verify whether the device has been authorized by a normal user to avoid unauthorized access or modification (unauthorized operations may cause the authentication process to be disturbed or tampered with, thereby affecting the credibility of the authentication result); or check whether the device is connected to a known secure network or whether there is a network with high security risks (being in an untrusted network environment may increase the risk of information leakage, man-in-the-middle attacks, etc., affecting the security and integrity of the authentication data); or verify whether the device operating system and application are in the expected original state (devices with tampered or root permissions may have a higher attack potential and can bypass normal security controls, so additional precautions are required to ensure the security of the authentication process). Risk indicators can help the server 10 make more accurate risk assessments and decisions during the authentication process.

[0064] The hash value is generated by processing the image data stream in a preset format using a preset hash function, and can be used to verify the integrity of the image data stream to ensure that the data has not been tampered with or damaged during transmission. For example, the server 10 can compare the received hash value with the expected hash value calculated by itself to confirm the validity and integrity of the image data stream. The specific algorithm of the hash function can be pre-agreed by the client 20 and the server 10, and this embodiment does not impose any restrictions on this.

[0065] The token is generated by the server 10 and returned to the client 20 during the identity authentication process. The client 20 uses the token to identify a specific identity authentication task to ensure the uniqueness and legitimacy of each identity authentication task.

[0066] Those skilled in the art will appreciate that any one of the above information, or a combination of two or more information, may be used as designated verification information, and this embodiment does not impose any limitation on this.

[0067] For example, see Figure 5 , Figure 5The schematic diagram of embedding encrypted designated verification information at the end of the JPEG image data stream is shown. The designated verification information includes hash values, device fingerprints, risk indicators and tokens. These verification information are used in combination to provide a multi-level security guarantee and verification mechanism in the identity authentication process. The device fingerprint and risk indicators help the server 10 to identify and verify the legitimacy and risk level of the device. The hash operation result ensures the integrity of the transmitted data, and the token is used to ensure the uniqueness and security of the authentication request. This comprehensive method can effectively prevent multiple attacks and improve the overall security and credibility of the identity authentication process.

[0068] In some embodiments, if the designated verification information also contains the same field as the tail identifier of the image data stream in the preset format, the server 10 will not be able to correctly verify whether the received image data stream to be authenticated carries the designated verification information, resulting in verification failure. For example, the tail identifier of the JPEG image data stream is FFD9. If the designated verification information also contains "FFD9", the server 10 will not be able to correctly identify the designated verification information and the image data stream in the preset format.

[0069] Therefore, after encrypting the specified verification information, the client 20 can determine the data volume information of the encrypted specified verification information, and then embed the data volume information into the tail of the image data stream to be authenticated; this can be achieved by adding additional information to the tail or using a specific structure, for example, see Figure 5 , showing that the data volume information is embedded at the end of the image data stream to be authenticated. The encrypted data volume information of the specified authentication information is used to assist the server 10 to correctly locate and extract the specified authentication information.

[0070] Among them, the data volume information of the encrypted specified verification information is represented by a fixed number of bytes (such as 1 byte, 2 bytes or 4 bytes, etc., but not limited to this), so that the server 10 can know in advance the number of bytes that need to be read during parsing, so as to correctly extract and decrypt the encrypted specified verification information.

[0071] This embodiment ensures through the above method that even if the encrypted specified verification information contains content that is the same as the preset tail identifier of the image data stream, the server 10 can still correctly locate and extract the specified verification information based on the data volume information represented by the preset number of bytes. This method not only ensures the validity of the verification, but also avoids the problem of verification failure due to identifier conflicts.

[0072] After receiving the data stream to be authenticated sent by any client 20, the server 10 can read the data volume information of the specified verification information from the tail of the image data stream to be authenticated according to the fixed number of bytes used to identify the data volume of the encrypted specified verification information. Among them, the fixed number of bytes used to identify the data volume of the encrypted specified verification information is pre-agreed, for example, determined by a protocol or communication specification. Then the server 10 can determine whether the specified verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in a preset format and the data volume information of the specified verification information. In this way, the server 10 can avoid the verification failure caused by the conflict between the tail identifier of the image data stream in a preset format and the specified verification information. By agreeing on a fixed number of bytes in advance to represent the data volume information, the server 10 can accurately locate and extract the specified verification information, ensuring the effectiveness and accuracy of the verification process. This solution can not only ensure the security of data, but also effectively deal with potential data format conflicts.

[0073] by Figure 5 The example shown is used for illustrative purposes: the server 10 receives an image data stream to be authenticated, and the tail of the image data stream to be authenticated contains the encrypted designated verification information and data volume information. Assuming that the data volume information is represented by a fixed 4 bytes, the server 10 reads 4 bytes of data volume information from the tail of the image data stream. Assuming that the read byte sequence is 0x00 0x00 0x00 0x64, this indicates that the length of the encrypted designated verification information is 100 bytes. Based on the read data volume information (100 bytes), the server 10 reads 100 bytes from the fifth byte from the tail of the image data stream to be authenticated. These bytes may contain the encrypted designated verification information (not yet certain at this time, and further verification is required, see the following description for details). If the server continues to read forward, it will be the tail identifier of the image data stream in a preset format.

[0074] See also Figure 6 After receiving the data stream to be authenticated sent by any client 20 (S601), the server 10 can obtain a pre-generated token for uniquely identifying the identity authentication task initiated by the client 20 to be authenticated. Then, based on the tail identifier of the image data stream in the preset format and the data volume information of the specified verification information, it is determined whether other data other than the image data stream in the preset format can be extracted from the image data stream to be authenticated (S602). If other data cannot be extracted, it is determined that the image data stream to be authenticated does not carry the specified verification information (S606).

[0075] If other data can be extracted, it is further determined whether other data can be decrypted based on the token (S603). Exemplarily, the server 10 and the client 20 may pre-agree to use the token as a key and use symmetric encryption to encrypt and decrypt the specified verification information.

[0076] In the case where the decryption of other data based on the token fails, it is determined that the image data stream to be authenticated does not carry the specified verification information (S606). In the case where the decrypted other data based on the token is successfully decrypted, the decrypted other data can be further verified based on a preset verification rule (S604). The verification rule can be determined based on the specific content of the specified verification information agreed upon between the server 10 and the client 20, and the details can be seen in the following description.

[0077] In the case where the verification of the other decrypted data is successful, it is determined that the image data stream to be authenticated carries the specified verification information (S605). In the case where the verification of the other decrypted data fails, it is determined that the image data stream to be authenticated does not carry the specified verification information (S606). In this embodiment, through the above-mentioned verification method, the server 10 can effectively identify and verify whether the image data stream to be authenticated carries the specified verification information based on the token, accurately detect the face image replacement attack, and ensure that the identity authentication task is processed under the premise of safety and reliability.

[0078] The following is an exemplary description of the process of verifying other decrypted data:

[0079] In a first possible implementation, if the server 10 and the client 20 agree in advance that the specified verification information includes a hash value, the server 10 can process the image data stream in a preset format extracted from the image data stream to be authenticated based on a preset hash function to obtain an expected hash value; then the expected hash value is compared with the other decrypted data; if the comparison is consistent, it indicates that the verification of the other decrypted data is successful; if the comparison is inconsistent, it indicates that the verification of the other decrypted data has failed. In this embodiment, through this verification method, the server 10 not only verifies whether the decrypted data exists, but also ensures the integrity and correctness of the data. The comparison of hash values ​​can provide an additional layer of security because even if the attacker is able to decrypt the hidden data, they still need to ensure that the modified image can generate the same hash value, which is very difficult in practice.

[0080] In a second possible implementation, if the server 10 and the client 20 agree in advance that the specified verification information includes the device information of the device where the client 20 is located, the server 10 can determine whether the data format of the other data after decryption conforms to the preset data format of the device information; if the data format of the other data after decryption conforms to the preset data format of the device information, it indicates that the verification of the other data after decryption is successful; if the data format of the other data after decryption does not conform to the preset data format of the device information, it indicates that the verification of the other data after decryption fails. In this embodiment, the server 10 can verify whether the data format of the other data after decryption conforms to the expected device data format, which can effectively prevent data format errors caused by data tampering or accidental errors.

[0081] In a third possible implementation, if the server 10 and the client 20 pre-agree that the specified verification information includes a token for uniquely identifying the current identity authentication task, the server 10 can compare the token pre-generated by itself for uniquely identifying the identity authentication task initiated by the client 20 to be authenticated with the other decrypted data. If the comparison is consistent, it means that the verification of the other decrypted data is successful; if the comparison is inconsistent, it means that the verification of the other decrypted data fails. In this embodiment, the token is one of the pre-agreed verification information, which enhances the security of the authentication. Only the client 20 with the correct token can pass the verification, thereby effectively preventing unauthorized access and data tampering.

[0082] In a fourth possible implementation, if the server 10 and the client 20 agree in advance that the specified verification information includes at least two of the above-mentioned hash value, device information and token, both verification information need to be successfully verified to determine that the image data stream to be authenticated carries the specified verification information.

[0083] Exemplarily, if the server 10 and the client 20 pre-agree that the specified verification information includes the device information of the device where the client 20 is located, and the device information includes the device fingerprint and at least one of the above-mentioned risk indicators, when the other decrypted data is successfully verified, the server 10 can make a risk decision based on the device information contained in the other decrypted data, thereby determining the risk level of this identity authentication task. In this embodiment, using the client 20 device information for risk decision-making can help the server 10 more accurately evaluate the legitimacy and security of the identity authentication task, and improve the system's protection capabilities and user experience.

[0084] For example, the server 10 can check whether the device fingerprint is associated with a known high-risk device, such as a device that has been reported stolen or used for malicious activities. Alternatively, the server 10 can compare the IP address or other geographic location information to verify whether the device is usually in the area where the user usually logs in. Alternatively, the server 10 can identify whether the device shows abnormal activity patterns based on risk indicators, such as a sudden large number of authentication attempts or atypical usage patterns.

[0085] Based on the analysis of the device information, the server 10 can determine the risk level of this authentication task. This may include: (1) low risk, the device information shows that the device for the authentication request is normal and has no abnormal activity. (2) medium risk, the device information has certain risk indicators, but may not be sufficient to completely deny the authentication request. (3) high risk, the device information shows obvious abnormalities or high risk indicators, and additional verification steps may be required or the authentication request may be rejected.

[0086] In some embodiments, see Figure 7 The client 20 includes a first processing layer 21 and a second processing layer 22, and the protection level of the first processing layer is lower than that of the second processing layer. In a software system, the first processing layer and the second processing layer are usually used to describe different levels of data processing and security protection.

[0087] Exemplarily, the first processing layer may be a UI presentation layer, and the second processing layer may be a core logic layer of the background.

[0088] The first processing layer is usually responsible for the display and interaction of the user interface (UI). It receives user input, displays data and content, and handles basic user operations. Because it interacts directly with users, the first processing layer usually has a lower level of security protection, and the main focus is on user experience and interface response speed. Therefore, security measures may focus on preventing common input errors, the rationality of UI / UX design, and basic data validity checks.

[0089] The second processing layer includes the core processing logic and data processing functions. It is responsible for data processing, storage, logical operations, main function implementation, etc. The second processing layer usually has a higher level of security protection. This layer faces the data flow inside and outside the system, the correctness of the processing logic, the integrity and security of the data, and needs to protect the system from malicious attacks and illegal access. Security measures include access control, data encryption, security logging, integrity checking, etc.

[0090] In order to further effectively defend against facial image replacement attacks, the client 20 can perform identity authentication processing at both the first processing layer and the second processing layer. In response to the identity authentication operation, the client 20 can obtain the first facial image to be authenticated through the first processing layer, convert the first facial image into a first image data stream in a preset format, and use the first image data stream as the first image data stream to be authenticated, and the client 20 can obtain the second facial image to be authenticated and the second designated verification information through the second processing layer, convert the second facial image into a second image data stream in a preset format, and embed the second designated verification information into the tail of the second image data stream to obtain the second image data stream to be authenticated. Exemplarily, the second designated verification information can be embedded into the tail of the second image data stream after being encrypted using the above-mentioned token, and the tail of the second image data stream to be authenticated can also embed the data volume information of the encrypted second designated verification information represented by a fixed number of bytes.

[0091] It can be understood that the implementation logic of the first processing layer and the second processing layer for acquiring facial images and format conversion is the same. In order to avoid confusing the processing objects, they are distinguished by "first facial image, second facial image, first image data stream and second image data stream".

[0092] Next, the client 20 sends the first image data stream to be authenticated that carries the first processing layer identifier and the second image data stream to be authenticated that carries the second processing layer identifier to the server 10; wherein, the two image data streams to be authenticated are used to further defend against facial image replacement attacks that may occur in this identity authentication task. This embodiment increases the defense capability against facial image replacement attacks by requiring the client 20 to send two image data streams to be authenticated. A facial image replacement attack refers to an attacker attempting to use a synthetic or false facial image to impersonate a legitimate user. By comparing the similarities of the facial images in the two image data streams to be authenticated, the server 10 can effectively confirm the authenticity and integrity of the image data to be authenticated, thereby preventing such attacks.

[0093] Specifically, the server 10 can receive two image data streams to be authenticated uploaded by any client 20 to be authenticated; the two image data streams to be authenticated include a first image data stream to be authenticated carrying a first processing layer identifier and a second image data stream to be authenticated carrying a second processing layer identifier. Then, it can be determined whether the specified verification information can be extracted from the second image data stream to be authenticated based at least on the tail identifier of the image data stream in a preset format. Alternatively, it can be determined whether the specified verification information can be extracted from the second image data stream to be authenticated based on the tail identifier of the image data stream in a preset format and the data volume information of the specified verification information. The specific determination process can be found in the above description and will not be repeated here.

[0094] Considering that the protection level of the first processing layer is lower than that of the second processing layer, the code for identity authentication in the first processing layer is more likely to be discovered and attacked by attackers, that is, the first image data stream to be authenticated generated by the first processing layer is easily replaced by attackers. Therefore, the server 10 can extract the first image data stream in the preset format from the first image data stream to be authenticated based on the tail identifier of the image data stream in the preset format, and then convert the format of the first image data stream in the preset format to obtain the first face image; and extract the second image data stream in the preset format from the second image data stream to be authenticated based on the tail identifier of the image data stream in the preset format, and then convert the format of the second image data stream in the preset format to obtain the second face image; and then calculate the image similarity between the first face image and the second face image. Finally, the server 10 can determine that there is no face image replacement attack in this identity authentication task when the second image data stream to be authenticated carries the specified verification information and the image similarity is greater than the preset threshold. Among them, the preset threshold can be specifically set according to the actual application scenario, and this embodiment does not impose any restrictions on this.

[0095] In this embodiment, by simultaneously transmitting and verifying two image data streams to be authenticated, the server 10 can detect and prevent possible facial image replacement attacks. The content of the first image data stream to be authenticated is relatively simple and easy for attackers to tamper with. However, by comparing it with the second image data stream to be authenticated, any inconsistencies and signs of attacks can be found, thereby improving the credibility and security of authentication. By using image similarity calculations and matching of specified verification information, the server 10 can more accurately determine whether face replacement or other fraudulent behavior has been performed. This sophisticated authentication process helps reduce the risk of misidentification and improves the accuracy and reliability of the overall authentication. It can be seen that the above-mentioned multi-level security measures and verification mechanisms enhance the system's ability to resist different types of attacks, making the identity authentication process more robust and reliable, and able to cope with increasingly complex and diverse security challenges.

[0096] In some embodiments, in addition to sending two channels of image data streams to be authenticated, the client 20 can also obtain the first designated verification information through the first processing layer, and then send the first designated verification information carrying the first processing layer identifier and the second designated verification information carrying the second processing layer identifier to the server 10; wherein the two channels of designated verification information are used to further defend against face image replacement attacks that may occur in this identity authentication task. This embodiment increases the defense capability against face image replacement attacks by requiring the client 20 to send two channels of image data streams to be authenticated and two channels of designated verification information. A face image replacement attack refers to an attacker attempting to use a synthetic or false face image to impersonate a legitimate user. By comparing the consistency of the two channels of designated verification information and the designated verification information hidden in one of the image data streams to be authenticated, the server 10 can effectively confirm the authenticity and integrity of the image data to be authenticated, thereby preventing such attack methods.

[0097] Specifically, the server 10 can receive two image data streams to be authenticated and two designated verification information uploaded by any client 20 to be authenticated; the two designated verification information include first designated verification information carrying a first processing layer identifier and second designated verification information carrying a second processing layer identifier; the two image data streams to be authenticated can be verified in the above manner, and when it is determined that the second image data stream to be authenticated carries the designated verification information, it can be further detected whether the first designated verification information, the second designated verification information and the designated verification information carried by the image data stream to be authenticated are consistent; when they are consistent, it is determined that there is no face image replacement attack in this identity authentication task.

[0098] In this embodiment, after receiving two channels of image data streams to be authenticated and two channels of specified authentication information, the server 10 performs a detailed consistency check. This method can reduce misjudgment and ensure the accuracy and reliability of the identity authentication task. By comparing the authentication information of the two processing layers, the accuracy of authentication can be further improved and the possibility of recognition errors can be reduced.

[0099] The various technical features in the above embodiments can be arbitrarily combined as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, any combination of the various technical features in the above embodiments also falls within the scope of this specification.

[0100] Based on the same concept as the above system, please refer to Figure 8 This specification also provides an attack defense method, which is applied to a client, and the method includes:

[0101] In S801, in response to an identity authentication operation, a face image to be authenticated and designated verification information are acquired.

[0102] In S802, the face image is converted into an image data stream in a preset format.

[0103] In S803, the designated verification information is embedded into the end of the image data stream to obtain the image data stream to be authenticated.

[0104] In S804, the image data stream to be authenticated is sent to the server for identity authentication; wherein, the specified verification information is embedded in the image data stream to be authenticated to defend against possible face image replacement attacks in this identity authentication task.

[0105] In one implementation, before sending the image data stream to be authenticated to the server, it also includes: generating an authentication request in response to the authentication operation and sending it to the server, so that the server generates a token for uniquely identifying this authentication task based on the authentication request and returns it to the client.

[0106] The designated verification information is embedded into the tail of the image data stream to obtain the image data stream to be authenticated, including: encrypting the designated verification information by using a token, and embedding the encrypted designated verification information into the tail of the image data stream to obtain the image data stream to be authenticated.

[0107] In one implementation, the specified verification information includes at least one of the following: device information of the device where the client is located, a hash value obtained by processing the image data stream based on a preset hash function, and a token; wherein the device information of the device where the client is located includes at least one of the following: a device fingerprint of the device where the client is located, and a risk indicator determined based on the operating status of the device where the client is located.

[0108] In one implementation, it also includes: determining the data volume information of the encrypted designated verification information; embedding the data volume information into the end of the image data stream to be authenticated; wherein the data volume information of the encrypted designated verification information is represented by a fixed number of bytes.

[0109] In one implementation, the client includes a first processing layer and a second processing layer; the protection level of the first processing layer is lower than the protection level of the second processing layer.

[0110] Acquire a facial image to be authenticated and designated verification information, convert the facial image into an image data stream in a preset format, embed the designated verification information into the end of the image data stream, and obtain the image data stream to be authenticated, including: acquiring a first facial image to be authenticated through a first processing layer, converting the first facial image into a first image data stream in a preset format, and using the first image data stream as a first image data stream to be authenticated; acquiring a second facial image to be authenticated and second designated verification information through a second processing layer, converting the second facial image into a second image data stream in a preset format, and embedding the second designated verification information into the end of the second image data stream to obtain a second image data stream to be authenticated.

[0111] Sending an image data stream to be authenticated to a server includes: sending a first image data stream to be authenticated carrying a first processing layer identifier and a second image data stream to be authenticated carrying a second processing layer identifier to the server; wherein the two image data streams to be authenticated are used to further defend against possible face image replacement attacks in this identity authentication task.

[0112] In one implementation, it also includes: obtaining first designated verification information through the first processing layer; sending the first designated verification information carrying the first processing layer identifier and the second designated verification information carrying the second processing layer identifier to the server; wherein the two-way designated verification information is used to further defend against face image replacement attacks that may occur in this identity authentication task.

[0113] In one implementation, the preset format includes at least one of the following: JPEG format, PNG format, GIF format, BMP format, and TIFF format.

[0114] Based on the same concept as the above system, please refer to Fig. 9 This specification also provides an attack detection method, which is applied to the server, and the method includes:

[0115] In S901, an image data stream to be authenticated uploaded by any client to be authenticated is received.

[0116] In S902, based on the tail identifier of the image data stream in a preset format, it is determined whether the designated verification information can be extracted from the image data stream to be authenticated.

[0117] In S903, if it is determined that the image data stream to be authenticated carries the specified verification information, then there is no face image replacement attack in this identity authentication task.

[0118] In S904, if no, it is determined that the image data stream to be authenticated does not carry the specified verification information, then this identity authentication task has the risk of face image replacement attack.

[0119] In one implementation, based on a tail identifier of an image data stream in a preset format, determining whether specified verification information can be extracted from the image data stream to be authenticated includes: reading data amount information of the specified verification information from the tail of the image data stream to be authenticated according to a fixed number of bytes used to identify the data amount of the specified verification information; and determining whether the specified verification information can be extracted from the image data stream to be authenticated based on a tail identifier of the image data stream in a preset format and data amount information of the specified verification information.

[0120] In one implementation, the method further includes: obtaining a pre-generated token for uniquely identifying the identity authentication task initiated by the client to be authenticated.

[0121] Based on the tail identifier of the image data stream in a preset format and the data volume information of the specified verification information, determine whether the specified verification information can be extracted from the image data stream to be authenticated, including: based on the tail identifier of the image data stream in a preset format and the data volume information of the specified verification information, determine whether other data except the image data stream in the preset format can be extracted from the image data stream to be authenticated, and if other data can be extracted, determine whether the other data can be decrypted based on the token; if the decryption of other data based on the token is successful, verify the decrypted other data based on preset verification rules; if the verification of the decrypted other data is successful, determine that the image data stream to be authenticated carries the specified verification information; if other data cannot be extracted, decryption of other data based on the token fails, or verification of other decrypted data fails, determine that the image data stream to be authenticated does not carry the specified verification information.

[0122] In one implementation, other decrypted data is verified based on preset verification rules, including: if the server and the client agree in advance that the specified verification information includes a hash value, an image data stream in a preset format extracted from the image data stream to be authenticated is processed based on a preset hash function to obtain an expected hash value; the expected hash value is compared with the other decrypted data; if the comparison is consistent, it indicates that the verification of the other decrypted data is successful; if the comparison is inconsistent, it indicates that the verification of the other decrypted data has failed.

[0123] In one implementation, other decrypted data is verified based on preset verification rules, including: if the server and the client agree in advance that the specified verification information includes the device information of the device where the client is located, determining whether the data format of the other decrypted data conforms to the preset data format of the device information; if the data format of the other decrypted data conforms to the preset data format of the device information, it indicates that the verification of the other decrypted data is successful; if the data format of the other decrypted data does not conform to the preset data format of the device information, it indicates that the verification of the other decrypted data has failed.

[0124] In one implementation, receiving an image data stream to be authenticated uploaded by any client to be authenticated includes: receiving two image data streams to be authenticated uploaded by any client to be authenticated; the two image data streams to be authenticated include a first image data stream to be authenticated carrying a first processing layer identifier and a second image data stream to be authenticated carrying a second processing layer identifier.

[0125] Determining whether specified verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in a preset format includes: determining whether specified verification information can be extracted from the second image data stream to be authenticated based on the tail identifier of the image data stream in a preset format.

[0126] The method also includes: obtaining a first face image from a first image data stream to be authenticated, and obtaining a second face image from a second image data stream to be authenticated; calculating the image similarity between the first face image and the second face image;

[0127] If it is determined that the image data stream to be authenticated carries the specified verification information, then there is no face image replacement attack in this identity authentication task, including: when the second image data stream to be authenticated carries the specified verification information and the image similarity is greater than a preset threshold, it is determined that there is no face image replacement attack in this identity authentication task.

[0128] In one implementation, it also includes: receiving two-way designated verification information uploaded by any client to be authenticated; the two-way designated verification information includes: first designated verification information carrying a first processing layer identifier and second designated verification information carrying a second processing layer identifier; when it is determined that the second way of image data stream to be authenticated carries the designated verification information, detecting whether the first designated verification information, the second designated verification information and the designated verification information carried by the image data stream to be authenticated are consistent; when they are consistent, determining that there is no face image replacement attack in this identity authentication task.

[0129] In some embodiments, the embodiments of this specification also provide an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements any of the above methods by running the executable instructions.

[0130] Fig.10 is a schematic structural diagram of a device provided by an exemplary embodiment. Fig.10At the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 1002 reading the corresponding computer program from the non-volatile memory 1010 into the memory 1008 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0131] For example, the attack defense device can be applied to Figure 7 The device shown is used to implement the technical solution of this specification.

[0132] The attack defense device may include:

[0133] An acquisition module, used to obtain a face image to be authenticated and specified verification information in response to an identity authentication operation;

[0134] A conversion module, used for converting a face image into an image data stream in a preset format;

[0135] The embedding module is used to embed the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated;

[0136] The sending module is used to send the image data stream to be authenticated to the server for identity authentication; wherein, the specified verification information is embedded in the image data stream to be authenticated to defend against the face image replacement attack that may occur in this identity authentication task.

[0137] Exemplarily, the attack detection device can be applied to Figure 7 The device shown is used to implement the technical solution of this specification.

[0138] The attack detection device may include:

[0139] The receiving module is used to receive the image data stream to be authenticated uploaded by any client to be authenticated.

[0140] The detection module is used to determine whether the specified verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in a preset format.

[0141] The detection module is also used to determine that if the image data stream to be authenticated carries specified verification information, then there is no face image replacement attack in this identity authentication task.

[0142] The detection module is also used to determine that if the image data stream to be authenticated does not carry the specified verification information, then there is a risk of face image replacement attack in this identity authentication task.

[0143] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.

[0144] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0145] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0146] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0148] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. An attack defense method, applied to a client, the method include: In response to the identity authentication operation, obtaining a face image to be authenticated and designated verification information; Converting the facial image into an image data stream in a preset format; Embedding the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated; The image data stream to be authenticated is sent to the server for identity authentication; wherein, the specified verification information is embedded in the image data stream to be authenticated to defend against face image replacement attacks that may occur in this identity authentication task.

2. The method according to claim 1, before sending the image data stream to be authenticated to the server, include: In response to the identity authentication operation, an identity authentication request is generated and sent to the server, so that the server generates a token for uniquely identifying the identity authentication task based on the identity authentication request and returns it to the client; The step of embedding the designated verification information into the tail of the image data stream to obtain the image data stream to be authenticated comprises: The token is used to encrypt the designated verification information, and the encrypted designated verification information is embedded into the tail of the image data stream to obtain the image data stream to be authenticated.

3. According to the method of claim 1 or 2, the specified verification information includes at least one of the following: device information of the device where the client is located, a hash value obtained by processing the image data stream based on a preset hash function, and a token used to uniquely identify this identity authentication task; in, The device information of the device where the client is located includes at least one of the following: a device fingerprint of the device where the client is located, and a risk indicator determined based on the operation status of the device where the client is located.

4. The method according to claim 2, further comprising: include: Determine the data volume information of the encrypted specified verification information; The data volume information is embedded into the tail of the image data stream to be authenticated; wherein the data volume information of the encrypted designated verification information is represented by a fixed number of bytes.

5. The method according to claim 1, wherein the client comprises a first processing layer and a second processing layer; the protection level of the first processing layer is lower than the protection level of the second processing layer; The facial image to be authenticated and the specified verification information are obtained, the facial image is converted into an image data stream in a preset format, and the specified verification information is embedded into the end of the image data stream to obtain the image data stream to be authenticated. include: Acquire a first facial image to be authenticated through the first processing layer, convert the first facial image into a first image data stream in a preset format, and use the first image data stream as a first image data stream to be authenticated; Acquire a second facial image to be authenticated and second specified verification information through the second processing layer, convert the second facial image into a second image data stream in a preset format, and embed the second specified verification information into the end of the second image data stream to obtain a second image data stream to be authenticated; The sending the to-be-authenticated image data stream to the server includes: The first image data stream to be authenticated carrying the first processing layer identifier and the second image data stream to be authenticated carrying the second processing layer identifier are sent to the server; wherein the two image data streams to be authenticated are used to further defend against facial image replacement attacks that may occur in this identity authentication task.

6. The method according to claim 5, further comprising: include: Acquire first specified verification information through the first processing layer; The first designated verification information carrying the first processing layer identifier and the second designated verification information carrying the second processing layer identifier are sent to the server; wherein the two-way designated verification information is used to further defend against possible facial image replacement attacks in this identity authentication task. 7 . The method according to claim 1 , wherein the preset format comprises at least one of the following: JPEG format, PNG format, GIF format, BMP format and TIFF format.

8. An attack detection method, applied to a server, the method include: Receive the image data stream to be authenticated uploaded by any client to be authenticated; Determining whether the specified verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in a preset format; If yes, it is determined that the image data stream to be authenticated carries the specified authentication information, then there is no face image replacement attack in this identity authentication task; If not, it is determined that the image data stream to be authenticated does not carry the specified verification information, and there is a risk of face image replacement attack in this identity authentication task.

9. The method according to claim 8, wherein the tail mark of the image data stream in a preset format is used to determine whether the specified verification information can be extracted from the image data stream to be authenticated. include: Reading the data amount information of the designated verification information from the tail of the image data stream to be authenticated according to the fixed number of bytes used to identify the data amount of the designated verification information; Based on the tail identifier of the image data stream in the preset format and the data volume information of the designated verification information, it is determined whether the designated verification information can be extracted from the image data stream to be authenticated.

10. The method according to claim 9, further comprising: include: Obtain a pre-generated token for uniquely identifying the identity authentication task initiated by the client to be authenticated this time; The step of determining whether the designated verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in the preset format and the data volume information of the designated verification information comprises: Based on the tail identifier of the image data stream in the preset format and the data amount information of the specified verification information, determining whether other data other than the image data stream in the preset format can be extracted from the image data stream to be authenticated, and if the other data can be extracted, determining whether the other data can be decrypted based on the token; In the case that the other data is successfully decrypted based on the token, verifying the decrypted other data based on a preset verification rule; In the case where the decrypted other data is successfully verified, determining that the image data stream to be authenticated carries the specified verification information; When the other data cannot be extracted, decryption of the other data based on the token fails, or verification of the decrypted other data fails, it is determined that the image data stream to be authenticated does not carry the specified verification information.

11. The method according to claim 10, wherein the decrypted other data is verified based on a preset verification rule, include: If the server and the client agree in advance that the designated verification information includes a hash value, the image data stream in the preset format extracted from the image data stream to be authenticated is processed based on a preset hash function to obtain an expected hash value; Comparing the expected hash value with the decrypted other data; If the comparison is consistent, it means that the decrypted other data has been successfully verified; If the comparison is inconsistent, it means that the verification of the other decrypted data has failed.

12. The method according to claim 10, wherein the decrypted other data is verified based on a preset verification rule, include: If the server and the client agree in advance that the specified verification information includes device information of the device where the client is located, determining whether the data format of the decrypted other data conforms to the preset data format of the device information; If the data format of the decrypted other data conforms to the preset data format of the device information, it means that the decrypted other data is successfully verified; If the data format of the decrypted other data does not conform to the preset data format of the device information, it means that the verification of the decrypted other data has failed.

13. The method according to any one of claims 8 to 12, wherein receiving an image data stream to be authenticated uploaded by any client to be authenticated, include: Receive two image data streams to be authenticated uploaded by any client to be authenticated; The two to-be-authenticated image data streams include a first to-be-authenticated image data stream carrying a first processing layer identifier and a second to-be-authenticated image data stream carrying a second processing layer identifier; The step of determining whether the specified verification information can be extracted from the image data stream to be authenticated based on the tail identifier of the image data stream in the preset format includes: Based on the tail identifier of the image data stream in a preset format, determining whether the specified verification information can be extracted from the second channel of image data stream to be authenticated; The method further comprises: Acquire a first face image from the first image data stream to be authenticated, and acquire a second face image from the second image data stream to be authenticated; Calculating image similarity between the first face image and the second face image; The determining that the image data stream to be authenticated carries the specified verification information and that no face image replacement attack exists in this identity authentication task includes: When the second to-be-authenticated image data stream carries the designated verification information and the image similarity is greater than a preset threshold, it is determined that no face image replacement attack exists in this identity authentication task.

14. The method according to claim 13, further comprising: include: Receive two-way specified verification information uploaded by any client to be authenticated; The two paths of designated verification information include: first designated verification information carrying the first processing layer identifier and second designated verification information carrying the second processing layer identifier; In the case where it is determined that the second to-be-authenticated image data stream carries the designated verification information, detecting whether the first designated verification information, the second designated verification information, and the designated verification information carried by the to-be-authenticated image data stream are consistent; In the case of consistency, it is determined that there is no face image replacement attack in this identity authentication task.

15. An identity authentication system, comprising a server and multiple clients; Any of the clients is used to obtain the face image to be authenticated and the specified verification information in response to the identity authentication operation; convert the face image into an image data stream in a preset format; ; The specified verification information is embedded into the tail of the image data stream to obtain the image data stream to be authenticated; the image data stream to be authenticated is sent to the server for identity authentication; wherein, Embedding the specified verification information in the image data stream to be authenticated to defend against possible face image replacement attacks in this identity authentication task; The server is used to receive an image data stream to be authenticated uploaded by any client to be authenticated; based on the tail identifier of the image data stream in a preset format, determine whether specified verification information can be extracted from the image data stream to be authenticated; if so, it is determined that the image data stream to be authenticated carries the specified verification information, and there is no face image replacement attack in this identity authentication task; if not, it is determined that the image data stream to be authenticated does not carry the specified verification information, and there is a risk of face image replacement attack in this identity authentication task.

16. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 14 by running the executable instructions.

17. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 14.

18. A computer program product, comprising a computer program, which implements the steps of the method according to any one of claims 1 to 14 when executed by a processor.

Citation Information

Patent Citations

  • Identity authentication method and device, computing equipment and medium

    CN112367314A

  • Face data acquisition and verification method, equipment and system

    CN113726526A

  • Remote identity authentication method and device, equipment and storage medium

    CN115150158A

  • Dynamic face recognition method and device, equipment, storage medium and product

    CN118097748A

  • Capturing method and system, and computing device and computer storage medium

    WO2024139205A1