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

By embedding specified verification information at the end of the image data stream on the client side and having it detected by the server, the problem of defending against and detecting attacks that forge facial images using artificial intelligence-generated content is solved in the identity authentication system, thereby improving the security and reliability of identity authentication.

CN119150268BActive Publication Date: 2026-04-24ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2024-08-22
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing identity authentication systems lack the ability to defend against and detect attacks that use AI-generated content to forge facial images, resulting in insufficient security and reliability in the identity authentication process.

Method used

After the client converts the face image into an image data stream in a preset format, it embeds specified verification information into the end of the image data stream, and the server detects the verification information to determine whether a face image replacement attack exists.

Benefits of technology

It effectively prevents fake facial images from replacing real facial images for identity authentication, improves the security and reliability of identity authentication, reduces authentication failures or security vulnerabilities, and enhances the ability to respond to fraud attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150268B_ABST
    Figure CN119150268B_ABST
Patent Text Reader

Abstract

One or more embodiments of the specification provide an attack defense and detection method, system, device, storage medium and program product. The attack defense method comprises: in response to an identity authentication operation, obtaining a face image to be authenticated and specified verification information; converting the face image into an image data stream in a preset format; embedding the specified verification information into the tail of the image data stream to obtain an image data stream to be authenticated; and sending the image data stream to be authenticated to a server for identity authentication. The attack detection method comprises: receiving an image data stream to be authenticated uploaded by any one of the to-be-authenticated clients; 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; if yes, the current identity authentication task does not exist face image replacement attack; if not, the current identity authentication task exists face image replacement attack risk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer software technology, and in particular to an attack defense, attack detection method, identity authentication system, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] Currently, facial recognition authentication technology has permeated all aspects of work and life. Commonly, many mobile applications use facial recognition technology for identity authentication. During facial information authentication, a facial image is first captured using the client's camera, then sent to a facial authentication server for verification. After verification, the authentication result is returned to the client. However, with the increasing power of AIGC (Artificial Intelligence Generated Content), attackers often replace the captured real facial images with forged ones. Current identity recognition systems lack the ability to defend against and detect this new type of attack. Summary of the Invention

[0003] In view of the above, one or more embodiments of this 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, applied to a client, the method comprising:

[0006] In response to an identity authentication operation, obtain the face image to be authenticated and the specified verification information;

[0007] The face image is converted into an image data stream in a preset format;

[0008] The specified verification information is embedded 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 defend against face image replacement attacks that may occur during this identity authentication task.

[0010] According to a second aspect of the embodiments of this specification, an attack detection method is provided, applied to a server, the method comprising:

[0011] Receives an image data stream to be authenticated uploaded by any client to be authenticated;

[0012] Based on the tail identifier of the image data stream in a preset format, it is determined whether the specified verification information can be extracted from the image data stream to be authenticated;

[0013] If so, and 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;

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

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

[0016] Any of the aforementioned clients is configured to, in response to an authentication operation, acquire a face image to be authenticated and specified verification information; convert the face image into an image data stream in a preset format; embed the specified 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 authentication; wherein, embedding the specified verification information in the image data stream to be authenticated is used to defend against face image substitution attacks that may occur during this authentication task.

[0017] The server is configured to receive an image data stream 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 yes, it is determined that the image data stream to be authenticated carries the specified verification information, and therefore, there is no face image replacement attack in this identity authentication task; if no, it is determined that the image data stream to be authenticated does not carry the specified verification information, and therefore, 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, an electronic device is provided, comprising:

[0019] processor;

[0020] Memory used to store processor-executable instructions;

[0021] Wherein, 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, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the steps of any of the methods described above.

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

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

[0025] This specification provides an attack defense method applied to a client and an attack detection method applied to a server.

[0026] After converting the acquired face image into an image data stream in a preset format, the client can effectively prevent attackers from using forged face images to replace real face images for identity authentication by embedding specified verification information at the end of the face image data stream to be authenticated. This increases the security and reliability of the identity authentication process and reduces authentication failures or security vulnerabilities caused by forged face attacks. Furthermore, since the embedded verification information does not affect the content and structure of the original image data, it also helps to ensure the accuracy of identity authentication.

[0027] Upon receiving an image data stream uploaded by any client, the server checks whether the specified verification information can be extracted from the tail identifier of the image data stream in a preset format. If the specified verification information can be successfully extracted, the image is considered genuine and tamper-proof. This effectively prevents face image replacement attacks because attackers cannot correctly embed the specified verification information into the image. Through this detection mechanism, the server can quickly and accurately determine whether there are security risks when processing image data streams uploaded by any client, improving not only the security of identity authentication but also its reliability, enabling it to cope with increasingly sophisticated fraud attacks.

[0028] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0029] Figure 1 This is an exemplary embodiment of an architecture diagram of an identity authentication system.

[0030] Figure 2 This is an exemplary embodiment of an architecture diagram of another identity authentication system.

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

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

[0033] Figure 5 This is a schematic diagram illustrating another format of an image data stream to be authenticated, provided in an exemplary embodiment.

[0034] Figure 6 This is a schematic diagram of a server-side verification process for specifying verification information, provided in an exemplary embodiment.

[0035] Figure 7 This is an exemplary embodiment of a client acquiring and transmitting two streams of image data to be authenticated.

[0036] Figure 8 This is a flowchart illustrating an attack defense method provided in an exemplary embodiment.

[0037] Figure 9 This is a flowchart illustrating an attack detection method provided in an exemplary embodiment.

[0038] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment. Detailed Implementation

[0039] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses 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 the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0041] Currently, facial recognition authentication technology has permeated all aspects of work and life. Commonly, many mobile applications use facial recognition technology for real-name authentication. However, due to the large number of facial recognition service providers on the market, and for the sake of simplicity, the entire facial recognition authentication process lacks sufficient security protection; most security measures are left to the user to implement themselves.

[0042] During facial recognition authentication, a facial image is first captured using the client's camera. This image is then sent to the facial recognition server for verification, and the authentication result is returned to the client. However, with the increasing power of AIGC (Artificial Intelligence Generated Content), attackers often replace the captured real facial images with forged ones. Current identity recognition systems lack the ability to defend against and detect this new type of attack.

[0043] Based on this, this specification provides an attack defense method for the client side and an attack detection method for the server side. After converting the acquired face image into an image data stream of a preset format, the client embeds specified verification information at the end of the face image data stream to be authenticated. This effectively prevents attackers from using forged face images to replace real face images for identity authentication, increasing the security and reliability of the identity authentication process and reducing authentication failures or security vulnerabilities caused by forged face attacks. The server can detect and verify whether the specified verification information is embedded in the image data stream to be authenticated based on the end identifier of the preset format image data stream. This effectively determines whether there is a risk of face image replacement attacks, thereby improving the trust and reliability of the user's identity authenticity.

[0044] Figure 1 This is a schematic diagram of the architecture of an identity authentication system provided in an exemplary embodiment. For example... 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, etc.

[0045] Server 11 can be a physical server containing an independent host, or it can be a virtual server hosted in a host cluster. During operation, server 11 can run server-side programs for a certain application to implement the relevant functions of that application. For example, when server 11 runs an identity authentication service program, it can act as a corresponding identity authentication service platform (or server).

[0046] PC13 and mobile phone14 are just some of the types of electronic devices that users can use. In reality, users can obviously also use electronic devices such as tablets, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smartwatches, etc.), etc., and one or more embodiments in this specification do not limit this. During operation, the electronic device can run a client-side program of an application to achieve the relevant functions of that application. For example, when the electronic device runs an identity authentication service program, it can act as a client for that identity authentication service. The aforementioned identity authentication service client application can be launched and run on the electronic device. This client-side program can be a native application installed on the electronic device, or it can be a mini-program, quick app, or other similar form. Of course, when using web technologies such as HTML5 or similar, the relevant functions can be achieved through a page displayed by a browser. This browser can be a standalone browser application or a browser module embedded in some applications.

[0047] As for the network 12 that enables interaction between electronic devices such as PC13 and mobile phone 14 and server 11, communication can be achieved using either wired or wireless networks, depending on the communication methods supported by the respective electronic devices. This specification does not impose any restrictions on this. For example, PC13 can support both wired and wireless communication, so it can use either wired or wireless networks as needed. Mobile phone 14 typically only supports wireless communication, so it can use a wireless network for communication.

[0048] Please see 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 by obtaining the face image to be authenticated and the specified verification information (S301); converting the face image into an image data stream in a preset format (S302); embedding the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated (S303), which can append data without affecting the visualization of the original image data stream; and sending 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 face image replacement attacks that may occur in this identity authentication task.

[0050] For example, the electronic device for installing client 20 may have an integrated camera, or the electronic device for installing client 20 may be connected in communication with a camera. Client 20 may control the camera to capture facial images in response to an authentication operation, thereby obtaining the facial image to be authenticated from the camera.

[0051] For example, the specific content of the verification information can be agreed upon in advance by the client 20 and the server 10, and this implementation does not impose any restrictions on it.

[0052] For example, the preset formats include, but are not limited to: (1) JPEG (Joint Photographic Experts Group) format, a lossy compressed image format, usually used to store photographs 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, usually used for simple animations or icons; (4) BMP (Bitmap) format, a bitmap image format commonly used in Windows operating systems, storing 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 preset format image data streams usually have a fixed tail identifier to indicate the end of the image data. For example, the header identifier of a JPEG image data stream is FFD8, and the tail identifier is FFD9; the start of a PNG image data stream begins with a fixed 8-byte identifier "89 50 4E 47 0D 0A 1A 0A", and the end is determined by the IEND block identifier; the start of a GIF image data stream begins with a fixed 6-byte identifier, i.e., 47 49 46 38 39 61 (i.e., "GIF89a") or 47 4946 38 37 61 (i.e., "GIF87a"), and the end is determined by a special 3-byte identifier, i.e., 003B (i.e., the ASCII code ";"), indicating the end of the GIF image data.

[0054] Therefore, the embodiments in this specification embed specified verification information into the end of the image data stream to obtain the image data stream to be authenticated. This effectively defends against face image replacement attacks that may occur during the identity authentication task. Furthermore, since the embedded verification information does not affect the content and structure of the original image data, it also helps ensure the accuracy of identity verification. It also reduces the complexity and network overhead of separately uploading specified verification information. Simultaneously, this embedding method improves privacy protection; therefore, the specified verification information is directly embedded in the image data stream and will not be exposed to attackers or man-in-the-middle attacks during transmission. For example, please refer to... Figure 4 , Figure 4 A schematic diagram is shown of embedding specified verification information at the end of a JPEG image data stream.

[0055] Please see 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 the preset format, it determines 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 can determine 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 tail identifier of the image data stream in a preset format. If the verification information can be successfully extracted, it indicates that the image data stream to be authenticated contains the specified identity verification information, and the image can be considered genuine and tamper-proof. This effectively prevents face image replacement attacks because attackers cannot correctly embed the specified verification information into the image. Through this detection mechanism, the server 10 can quickly and accurately determine whether there are security risks when processing image data streams uploaded by any client 20 in real time. This not only improves the security of identity authentication but also enhances its reliability, enabling it to cope with increasingly complex fraud attack methods.

[0058] For example, client 20 and server 10 pre-agreed to embed specified verification information at the end of the image data stream. When server 10 receives the image data stream to be authenticated uploaded by client 20, it can locate the end marker of the image data stream belonging to the preset format. Then, starting from the end marker, it reads the specified verification information. If no other data follows the end marker, it can be determined that the image data stream does not carry the specified verification information. If no other data follows the end marker, it needs to further verify whether the other data is the specified verification information. If the other data is not the specified verification information, it is determined that the image data stream does not carry the specified verification information; if the other data is the specified verification information, it is determined that the image data stream carries the specified verification information. Based on the attack detection results, server 10 can determine the risk level of this authentication task. For example, if the attack detection finds signs of suspected tampering in the image data, or if the specified verification information does not conform to the expected pattern, server 10 may mark this authentication task as high-risk. Server 10 returns risk level information to client 20. This information includes a specific risk code or a simple high, medium, or low risk indicator, along with corresponding explanations or suggestions. Upon receiving the risk level information from server 10, client 20 can decide on its next step based on the risk level. For example, for a high-risk scenario, client 20 might choose to terminate the current authentication process and prompt the user to re-authenticate or take other security measures. For a low-risk scenario, client 20 might continue the authentication process or remind the user that the current authentication risk is low and suggest that the user continue.

[0059] In some embodiments, to further enhance security during the authentication process, client 20 may, in response to an authentication operation, acquire the face image to be authenticated and specified verification information, generate an authentication request, and send it to server 10. Server 10 may then generate a token based on the authentication request to uniquely identify this authentication task and return it to client 20. This embodiment uses a token to uniquely identify the authentication task, ensuring the uniqueness and authenticity of each authentication task. For example, the token may be a string randomly and dynamically generated by server 10.

[0060] The client 20 can convert the face image to be authenticated into an image data stream in a preset format, and use the token to encrypt the specified verification information. The encrypted verification information is then embedded at the end of the image data stream to obtain the image data stream to be authenticated. In this embodiment, embedding encrypted verification information into the image data stream effectively prevents forgery or substitution attacks on face images. Furthermore, this encryption and embedding process prevents attackers from stealing or tampering with the verification information during transmission, ensuring the confidentiality and integrity of the information. In other words, only the client 20 with the correct encrypted information can generate the correct image data stream, thereby passing the authentication.

[0061] For example, the specified verification information includes at least one of the following: device information of the device where 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 client 20 is located includes at least one of the following: a device fingerprint of the device where client 20 is located, and a risk indicator determined based on the operating status of the device where client 20 is located.

[0062] The device fingerprint of the device where client 20 resides is a unique identifier for the device, typically generated based on the device's hardware and software characteristics. The device fingerprint may include the device model, operating system version, unique hardware identifiers (such as the International Mobile Equipment Identity (IMEI) or serial number), network configuration, and other information. Through the device fingerprint, server 10 can identify and track specific devices, ensuring the legitimacy of the device performing authentication.

[0063] Risk metrics are indicators determined based on the operational status of client device 20 and are used to assess the risk level of this authentication task. For example, scanning files, processes, and system status on the device detects the presence of known malware or viruses (devices infected with malware may leak sensitive information, be remotely controlled, or perform unauthorized operations; therefore, the authentication system should be vigilant about the risks posed by such devices); or verifies whether the device has been authorized by a legitimate user to prevent unauthorized access or modification (unauthorized operations may interfere with or tamper with the authentication process, thus affecting the credibility of the authentication results); or checks 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 authentication data); or verifies whether the device's operating system and applications are in their expected original state (devices with tampered or root privileges may have higher attack potential and be able to bypass normal security controls; therefore, additional preventative measures are needed to ensure the security of the authentication process). Risk metrics can help server 10 make more accurate risk assessments and decisions during the authentication process.

[0064] A hash value is generated by processing a pre-formatted image data stream using a pre-defined hash function. It can be used to verify the integrity of the image data stream, ensuring that the data has not been tampered with or damaged during transmission. For example, server 10 can compare the received hash value with its own calculated expected hash value to confirm the validity and integrity of the image data stream. The specific algorithm of the hash function can be pre-agreed upon by client 20 and server 10; 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 authentication process. The client 20 uses the token to identify a specific authentication task, ensuring the uniqueness and legitimacy of each authentication task.

[0066] Those skilled in the art will understand that any one of the above-mentioned information, or a combination of two or more, can be used as the specified verification information, and this embodiment does not impose any restrictions on this.

[0067] For example, please refer to Figure 5 , Figure 5This diagram illustrates the embedding of encrypted specified verification information at the end of a JPEG image data stream. This verification information includes a hash value, device fingerprint, risk indicator, and token. These verification methods, used in combination, provide multi-layered security and verification mechanisms during the authentication process. The device fingerprint and risk indicator help the server 10 identify and verify the legitimacy and risk level of the device, the hash calculation result ensures the integrity of the transmitted data, and the token ensures the uniqueness and security of the authentication request. This comprehensive approach effectively prevents various attacks and enhances the overall security and trustworthiness of the authentication process.

[0068] In some embodiments, if the specified verification information also contains the same field as the trailing identifier of the image data stream in the preset format, the server 10 may be unable to correctly verify whether the received image data stream to be authenticated carries the specified verification information, thus causing verification failure. For example, in a JPEG image data stream, the trailing identifier is FFD9. If the specified verification information also contains "FFD9", the server 10 may be unable to correctly identify the specified verification information and the image data stream in the preset format.

[0069] Therefore, after encrypting the specified verification information, client 20 can determine the data volume of the encrypted specified verification information, and then embed this data volume information into the end of the image data stream to be authenticated; this can be achieved by adding additional information to the end or by using a specific structure, for example, please refer to [link to relevant documentation]. Figure 5 This illustrates embedding the data volume information at the end of the image data stream to be authenticated. The encrypted data volume information of the specified verification information is used to assist the server 10 in correctly locating and extracting the specified verification information.

[0070] The data volume of the encrypted specified verification information is represented by a fixed number of bytes (such as 1 byte, 2 bytes, or 4 bytes, but not limited to this). This allows the server 10 to know in advance the number of bytes to be read during parsing, thereby correctly extracting and decrypting the encrypted specified verification information.

[0071] This embodiment ensures that even if the encrypted specified verification information contains the same content 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 guarantees the validity of the verification, but also avoids the verification failure problem caused by identifier conflict.

[0072] After receiving a data stream to be authenticated from any client 20, 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 a fixed number of bytes used to identify the data volume of the encrypted specified verification information. 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, 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, server 10 can avoid verification failures caused by conflicts between the tail identifier of the image data stream in a preset format and the specified verification information. By pre-agreing on a fixed number of bytes to represent the data volume information, server 10 can accurately locate and extract the specified verification information, ensuring the effectiveness and accuracy of the verification process. This solution not only guarantees data security but also effectively addresses potential data format conflicts.

[0073] by Figure 5 The example shown illustrates this: Server 10 receives an image data stream to be authenticated. The end of the image data stream contains encrypted specified verification information and data volume information. Assuming the data volume information is represented by a fixed 4 bytes, server 10 reads 4 bytes of data volume information from the end of the image data stream. Assuming the read byte sequence is 0x00 0x00 0x00 0x64, this indicates that the encrypted specified verification information is 100 bytes long. Based on the read data volume information (100 bytes), server 10 reads 100 bytes backwards from the 5th byte from the end of the image data stream to be authenticated. These bytes may contain the encrypted specified verification information (this is not yet certain and requires further verification; please refer to the description below for details). Continuing to read backwards, the result is the end identifier of the image data stream in a preset format.

[0074] Please see Figure 6 After receiving an authentication data stream from any client 20 (S601), server 10 can obtain a pre-generated token used to uniquely identify the authentication task initiated by the client 20. Then, based on the trailing identifier of the preset format image data stream and the data volume information of the specified verification information, it determines whether other data besides the preset format image data stream can be extracted from the authentication image data stream (S602). If other data cannot be extracted, it is determined that the authentication image data stream does not carry the specified verification information (S606).

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

[0076] If 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). If decryption of other data based on the token is successful, the other data can be further verified based on preset verification rules (S604). The verification rules can be determined based on the specific content of the specified verification information agreed upon between the server 10 and the client 20, as detailed in the following description.

[0077] If the verification of other decrypted data is successful, it is determined that the image data stream to be authenticated carries the specified verification information (S605). If the verification of 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 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 face image replacement attacks, and ensure that the identity authentication task is processed under the premise of security and reliability.

[0078] The following is an example of the process for verifying other decrypted data:

[0079] In a first possible implementation, if the server 10 and client 20 pre-agree that the specified verification information includes a hash value, the server 10 can process the image data stream of a preset format extracted from the image data stream to be authenticated based on a preset hash function to obtain the expected hash value; then, the expected hash value is compared with the other decrypted data; if the comparison matches, it indicates that the verification of the other decrypted data is successful; if the comparison does not match, 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 the existence of the decrypted data but also ensures the integrity and correctness of this data. The hash value comparison provides an additional layer of security because even if an attacker can 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 the second possible implementation, 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, then 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 client 20 pre-agree that the specified verification information includes a token used to uniquely identify this authentication task, then the server 10 can compare its pre-generated token, used to uniquely identify the authentication task initiated by the client 20, with the decrypted other data. If the comparison matches, it indicates that the verification of the decrypted other data is successful; if the comparison does not match, it indicates that the verification of the decrypted other data has failed. In this embodiment, the token, as one of the pre-agreed verification information, enhances the security of authentication. Only the client 20 with the correct token can pass the verification, thereby effectively preventing unauthorized access and data tampering.

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

[0083] For example, if the server 10 and the client 20 pre-agree that the specified verification information includes device information of the device where the client 20 is located, and this device information includes a device fingerprint and at least one of the aforementioned risk indicators, then if the verification of the other decrypted data is successful, the server 10 can make risk decisions 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's device information for risk decisions can help the server 10 more accurately assess the legality and security of the identity authentication task, improving the system's protection capabilities and user experience.

[0084] For example, 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, server 10 can compare IP addresses or other geographic location information to verify whether the device is typically located in the region where the user usually logs in. Or, server 10 can identify whether the device exhibits abnormal activity patterns based on risk indicators, such as a sudden surge in 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 indicates that the device requesting authentication is normal and has no abnormal activity. (2) Medium risk, the device information has some risk indicators, but may not be enough to completely reject the authentication request. (3) High risk, the device information shows obvious abnormalities or high-risk indicators, which may require additional verification steps or reject the authentication request.

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

[0087] For example, the first processing layer can be the UI presentation layer, and the second processing layer can be the core logic layer of the backend.

[0088] The first processing layer is typically 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 the user, the security level of the first processing layer is usually low, with the main focus on user experience and interface responsiveness. Therefore, security measures may primarily focus on preventing common input errors, the rationality of UI / UX design, and basic data validity checks.

[0089] The second processing layer includes core processing logic and data processing functions. It is responsible for data processing, storage, logical operations, and the implementation of main functions. The second processing layer typically has a higher level of security protection. This layer needs to protect the system from malicious attacks and unauthorized access, ensuring the correctness of internal and external data flows, the integrity of processing logic, and the security of data. Security measures include access control, data encryption, secure logging, and integrity checks.

[0090] To further effectively defend against face image substitution attacks, client 20 can perform identity authentication processes at both the first and second processing layers. In response to the authentication operation, client 20 can obtain a first face image to be authenticated through the first processing layer, convert the first face image into a first image data stream of a preset format, and use the first image data stream as the first path of image data stream to be authenticated. Similarly, client 20 can obtain a second face image to be authenticated and second specified verification information through the second processing layer, convert the second face image into a second image data stream of a preset format, and embed the second specified verification information into the end of the second image data stream to obtain the second path of image data stream to be authenticated. For example, the second specified verification information can be embedded into the end of the second image data stream after being encrypted using the aforementioned token, and the end of the second path of image data stream to be authenticated can also embed data volume information of the encrypted second specified verification information, represented by a fixed number of bytes.

[0091] It is understandable that the implementation logic for acquiring face images and format conversion in the first and second processing layers is the same. Here, in order to avoid confusion about the processing objects, they are distinguished by "first face image, second face image, first image data stream and second image data stream".

[0092] Next, client 20 sends a first stream of image data to be authenticated, carrying a first processing layer identifier, and a second stream of image data to be authenticated, carrying a second processing layer identifier, to server 10. These two streams are used to further defend against face image substitution attacks that may occur during this authentication process. This embodiment increases the defense against face image substitution attacks by requiring client 20 to send two streams of image data to be authenticated. A face image substitution attack refers to an attacker attempting to impersonate a legitimate user using a synthetic or fake face image. By comparing the similarity of the face images in the two streams of image data to be authenticated, server 10 can effectively verify the authenticity and integrity of the image data to be authenticated, thereby preventing such attacks.

[0093] Specifically, 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 carrying a first processing layer identifier and a second image data stream carrying a second processing layer identifier. Then, at least based on the tail identifier of the image data stream in a preset format, it can be determined whether the specified verification information can be extracted from the second image data stream to be authenticated. 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 is described above 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 used for identity authentication in the first processing layer is more easily discovered and attacked by attackers. In other words, the first stream of image data to be authenticated generated by the first processing layer is easily replaced by attackers. Therefore, the server 10 can extract a first image data stream of a preset format from the first stream of image data to be authenticated based on the tail identifier of the preset format image data stream, and then perform format conversion on the first image data stream of the preset format to obtain a first face image; and extract a second image data stream of a preset format from the second stream of image data to be authenticated based on the tail identifier of the preset format image data stream, and then perform format conversion on the second image data stream of the preset format to obtain a 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 stream of image data to be authenticated carries specified verification information and the image similarity is greater than a preset threshold. The preset threshold can be specifically set according to the actual application scenario, and this embodiment does not impose any restrictions on it.

[0095] This embodiment simultaneously transmits and verifies two image data streams to be authenticated. The server 10 can detect and prevent potential face image substitution attacks. The first image data stream is relatively simple and easily tampered with by attackers, but by comparing it with the second image data stream, any inconsistencies and attack signs can be detected, improving the credibility and security of the authentication. By utilizing image similarity calculations and matching specified verification information, the server 10 can more accurately determine whether face substitution or other fraudulent activities have occurred. This refined authentication process helps reduce the risk of false positives and improves the overall accuracy and reliability of authentication. Therefore, the aforementioned multi-layered security measures and verification mechanisms enhance the system's resistance to different types of attacks, making the identity authentication process more robust and reliable, and capable of addressing increasingly complex and diverse security challenges.

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

[0097] Specifically, server 10 can receive two image data streams to be authenticated and two sets of specified verification information uploaded by any client 20 to be authenticated; the two sets of specified verification information include first specified verification information carrying a first processing layer identifier and second specified verification information carrying a second processing layer identifier; the two image data streams to be authenticated can be verified in the above manner. If it is determined that the second image data stream to be authenticated carries specified verification information, it can further detect whether the first specified verification information, the second specified verification information and the specified verification information carried by the image data stream to be authenticated are consistent; if 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 streams of image data to be authenticated and two streams of specified verification information, the server 10 performs a detailed consistency check. This method can reduce false positives and ensure the accuracy and reliability of the identity authentication task. By comparing the verification information from 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 combined arbitrarily, 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, the arbitrary combination of various technical features in the above embodiments is also within the scope of this specification.

[0100] Based on the same concept as the system described above, please refer to Figure 8 This manual also provides an attack defense method for client-side applications, which includes:

[0101] In S801, in response to an authentication operation, the face image to be authenticated and the specified verification information are obtained.

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

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

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

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

[0106] Embedding specified verification information into the end of the image data stream to obtain the image data stream to be authenticated includes: encrypting the specified verification information using a token, and embedding the encrypted specified verification information into the end 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 client's device, 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 client's device includes at least one of the following: device fingerprint of the client's device, and a risk indicator determined based on the operating status of the client's device.

[0108] In one implementation, the method further includes: determining the data volume information of the encrypted specified verification information; embedding the data volume information into the tail of the image data stream to be authenticated; wherein the data volume information of the encrypted specified 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 that of the second processing layer.

[0110] The process involves: acquiring a face image to be authenticated and specified verification information, converting the face image into an image data stream of a preset format, and embedding the specified verification information into the end of the image data stream to obtain an image data stream to be authenticated. This includes: acquiring a first face image to be authenticated through a first processing layer, converting the first face image into a first image data stream of a preset format, and using the first image data stream as a first path of image data stream to be authenticated; acquiring a second face image to be authenticated and second specified verification information through a second processing layer, converting the second face image into a second image data stream of a preset format, and embedding the second specified verification information into the end of the second image data stream to obtain a second path of image data stream to be authenticated.

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

[0112] In one implementation, the method further includes: obtaining first specified verification information through a first processing layer; sending the first specified verification information carrying the identifier of the first processing layer and the second specified verification information carrying the identifier of the second processing layer to the server; wherein, the two specified verification information are 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 system described above, please refer to Figure 9 This manual also provides an attack detection method for use on the server side, which includes:

[0115] In S901, the 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 specified 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 it is determined that the image data stream to be authenticated does not carry the specified verification information, then the current identity authentication task is at risk of face image replacement attack.

[0119] In one implementation, 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: reading the data volume 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 volume 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 the tail identifier of the image data stream in a preset format and the data volume information of the specified verification information.

[0120] One implementation also includes: obtaining a pre-generated token used to uniquely identify the authentication task initiated by the client to be authenticated.

[0121] Based on the trailing identifier of the image data stream in a preset format and the data volume information of the specified verification information, it is determined whether the specified verification information can be extracted from the image data stream to be authenticated. This includes: determining whether other data besides the image data stream in the preset format can be extracted from the image data stream to be authenticated based on the trailing identifier of the image data stream in a preset format and the data volume information of the specified verification information; if other data can be extracted, determining whether other data can be decrypted based on a token; if other data is successfully decrypted based on a token, verifying the decrypted other data based on preset verification rules; if other data is successfully verified, determining 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 a token fails, or verification of other data after decryption fails, determining that the image data stream to be authenticated does not carry the specified verification information.

[0122] In one implementation, the other data after decryption is verified based on a preset verification rule, including: if the server and the client have agreed in advance that the specified verification information includes a hash value, the image data stream of a preset format extracted from the image data stream to be authenticated is processed based on a preset hash function to obtain the expected hash value; the expected hash value is compared with the other data after decryption; if the comparison is consistent, it means that the verification of the other data after decryption is successful; if the comparison is inconsistent, it means that the verification of the other data after decryption is unsuccessful.

[0123] In one implementation, the other data after decryption is verified based on preset verification rules, including: if the server and the client have pre-agreed 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 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 means 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 means that the verification of the other data after decryption fails.

[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 carrying a first processing layer identifier and a second image data stream carrying a second processing layer identifier.

[0125] 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, including: 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 second image data stream to be authenticated.

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

[0127] If the image data stream to be authenticated is found to carry specified verification information, then there is no face image replacement attack in this identity authentication task. This includes: when the second image data stream to be authenticated carries 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, the method further includes: receiving two specified verification messages uploaded by any client to be authenticated; the two specified verification messages include: first specified verification messages carrying a first processing layer identifier and second specified verification messages carrying a second processing layer identifier; if it is determined that the second image data stream to be authenticated carries specified verification messages, detecting whether the first specified verification messages, the second specified verification messages, and the specified verification messages carried by the image data stream to be authenticated are consistent; if they are consistent, determining that there is no face image replacement attack in this identity authentication task.

[0129] In some embodiments, this specification also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor implements the method described in any one of the above embodiments by executing the executable instructions.

[0130] Figure 10 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 10At the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, memory 1008, and non-volatile memory 1010, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 1002 reads the corresponding computer program from the non-volatile memory 1010 into memory 1008 and then runs it. Of course, besides software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution entity of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.

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

[0132] The attack defense device may include:

[0133] The acquisition module is used to acquire the face image to be authenticated and the specified verification information in response to the identity authentication operation;

[0134] The conversion module is used to convert facial images into image data streams in a preset format;

[0135] The embedding module is used to embed 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, specified verification information is embedded in the image data stream to defend against face image replacement attacks that may occur during this identity authentication task.

[0137] For example, attack detection devices can be applied to, for example, Figure 7 The device shown is used to implement the technical solution described in 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, 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.

[0142] The detection module is also used to determine whether the image data stream to be authenticated does not carry the specified verification information, in which case the current identity authentication task is at risk of face image replacement attack.

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

[0144] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.

[0145] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

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

[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, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

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

Claims

1. An attack defense method applied to a client, the client comprising a first processing layer and a second processing layer; the protection level of the first processing layer is lower than that of the second processing layer; the method comprising: In response to the identity authentication operation, the first face image to be authenticated is obtained through the first processing layer, the first face image is converted into a first image data stream in a preset format, and the first image data stream is used as the first path of the image data stream to be authenticated. The second processing layer obtains the second face image to be authenticated and the second specified verification information, converts the second face image into a second image data stream in a preset format, and embeds the second specified verification information into the end of the second image data stream to obtain the second image data stream to be authenticated. The first image data stream to be authenticated, carrying the identifier of the first processing layer, and the second image data stream to be authenticated, carrying the identifier of the second processing layer, are sent to the server; wherein, the two image data streams to be authenticated are used to further defend against face image replacement attacks that may occur in this identity authentication task.

2. The method according to claim 1, further comprising: In response to an identity authentication operation, obtain the face image to be authenticated and the specified verification information; The face image is converted into an image data stream in a preset format; The specified verification information is embedded 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 defend against face image replacement attacks that may occur during this identity authentication task.

3. The method according to claim 2, further comprising, before sending the image data stream to be authenticated to the server: In response to the authentication operation, an authentication request is generated and sent to the server, so that the server generates a token based on the authentication request to uniquely identify this authentication task and returns it to the client; The step of embedding the specified verification information into the end of the image data stream to obtain the image data stream to be authenticated includes: The specified verification information is encrypted using the token, and the encrypted specified verification information is embedded into the end of the image data stream to obtain the image data stream to be authenticated.

4. The method according to claim 2 or 3, wherein 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 client's device includes at least one of the following: the device fingerprint of the client's device, and a risk indicator determined based on the operating status of the client's device.

5. The method according to claim 3, further comprising: 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 specified verification information is represented by a fixed number of bytes.

6. The method according to claim 1, further comprising: The first specified verification information is obtained 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 designated verification information are used to further defend against face image replacement attacks that may occur in this identity authentication task.

7. The method according to claim 1, wherein the preset format includes 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 comprising: Receive two unauthenticated image data streams uploaded by any client to be authenticated; The two image data streams to be authenticated include a first image data stream carrying a first processing layer identifier and a second image data stream carrying a second processing layer identifier. Based on the tail identifier of the image data stream in a preset format, it is determined whether the specified verification information can be extracted from the second image data stream to be authenticated; Obtain a first face image from the first image data stream to be authenticated, and obtain a second face image from the second image data stream to be authenticated; Calculate the image similarity between the first face image and the second face image; 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.

9. The method according to claim 8, further comprising: Receives 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, it is determined whether the specified verification information can be extracted from the image data stream to be authenticated; If so, and 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; If not, and it is determined that the image data stream to be authenticated does not carry the specified verification information, then this identity authentication task is at risk of face image replacement attack.

10. The method according to claim 9, wherein 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: The data volume information of the specified verification information is read from the tail of the image data stream to be authenticated according to a fixed number of bytes used to identify the data volume of the specified verification information; 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 the specified verification information can be extracted from the image data stream to be authenticated.

11. The method of claim 10, further comprising: Obtain a pre-generated token that uniquely identifies the authentication task initiated by the client to be authenticated this time; The determination of 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 and the data volume information of the specified verification information, includes: 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 besides 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, it is determined whether the other data can be decrypted based on the token. If the other data is successfully decrypted based on the token, the decrypted other data is verified based on preset verification rules; If the other data after decryption is successfully verified, it is determined that the image data stream to be authenticated carries the specified verification information; If the other data cannot be extracted, the other data fails to be decrypted based on the token, or the 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.

12. The method according to claim 11, wherein verifying the decrypted other data based on preset verification rules includes: If the server and the client have agreed in advance that the specified verification information includes a hash value, the image data stream of the preset format extracted from the image data stream to be authenticated is processed based on a preset hash function to obtain the expected hash value; The expected hash value is compared with the decrypted data. If the comparison matches, it means that the other data after decryption has been successfully verified; If the comparison is inconsistent, it means that the verification of the other data after decryption has failed.

13. The method according to claim 11, wherein verifying the decrypted other data based on preset verification rules includes: If the server and the client have agreed in advance that the specified verification information includes the device information of the device where the client is located, 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 decrypted other data conforms to the preset data format of the device information, it means that the verification of the decrypted other data is successful; If the data format of the decrypted other data does not conform to the preset data format of the device information, it indicates that the verification of the decrypted other data has failed.

14. The method of claim 8, further comprising: Receive two specified verification messages uploaded by any client to be authenticated; The two 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; If it is determined that the second image data stream to be authenticated carries the specified verification information, it is detected whether the first specified verification information, the second specified verification information, and the specified verification information carried by the image data stream to be authenticated are consistent; Under consistent conditions, it was determined that no face image substitution attack occurred during this identity authentication task.

15. An identity authentication system, comprising a server and multiple clients; Any of the aforementioned clients is configured to, in response to an authentication operation, acquire a first face image to be authenticated through a first processing layer, convert the first face image into a first image data stream of a preset format, and use the first image data stream as a first path of image data stream to be authenticated; acquire a second face image to be authenticated and second specified verification information through a second processing layer, convert the second face image into a second image data stream of a preset format, and embed the second specified verification information into the end of the second image data stream to obtain a second path of image data stream to be authenticated; The first image data stream to be authenticated, carrying a first processing layer identifier, and the second image data stream to be authenticated, carrying a second processing layer identifier, are sent to the server; wherein, the two image data streams to be authenticated are used to further defend against face image replacement attacks that may occur in this identity authentication task; The server is configured to receive 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 carrying a first processing layer identifier and a second image data stream carrying a second processing layer identifier; based on the tail identifier of the image data stream in a preset format, it determines whether specified verification information can be extracted from the second image data stream to be authenticated; it obtains a first face image from the first image data stream to be authenticated and a second face image from the second image data stream to be authenticated; it calculates the image similarity between the first face image and the second face image; 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 determines that there is no face image replacement attack in this identity authentication task.

16. The system according to claim 15, Any of the aforementioned clients is further configured to, in response to an authentication operation, acquire a face image to be authenticated and specified verification information; convert the face image into an image data stream in a preset format; embed the specified 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 authentication. The specified verification information is embedded in the image data stream to be authenticated in order to defend against face image replacement attacks that may occur during this identity authentication task. The server is further configured to receive an image data stream 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 yes, it is determined that the image data stream to be authenticated carries the specified verification information, and therefore, there is no face image replacement attack in this identity authentication task; if no, it is determined that the image data stream to be authenticated does not carry the specified verification information, and therefore, there is a risk of face image replacement attack in this identity authentication task.

17. An electronic device comprising: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1 to 14 by executing the executable instructions.

18. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1 to 14.

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

Citation Information

Patent Citations

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

    CN115150158A