Portrait encryption method, portrait decryption method, portrait encryption device, portrait decryption device and electronic equipment
By using the white box encryption system to encrypt portrait images on the client and adding traceability marks and timestamps during transmission, the data leakage problem in portrait verification in traditional black box encryption methods is solved, significantly improving the security of data.
Patent Information
- Application Number
- CN202411974986.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
AI Technical Summary
The traditional portrait image transmission method is based on black box encryption. Although it solves security problems to a certain extent, attackers can bypass the client and directly use the portrait call server to complete portrait verification, resulting in data leakage.
The client uses a white box encryption system to encrypt portrait images to ensure that the key and encryption algorithm are invisible to the outside world, and add traceability marks and timestamps during transmission to prevent replay attacks.
Encrypting portrait images on the client through white box encryption significantly improves data security, prevents malicious attacks and data leakage, and prevents replay attacks through traceability marking and timestamping.
Smart Images

Figure CN119854423A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and electronic device for encrypting and decrypting a human portrait. Background Art
[0002] With the rapid development of information technology, biometric technology is increasingly used in daily life. Among them, portrait verification, as an important part of biometric technology, is widely used in identity authentication, financial payment and other fields.
[0003] At present, the main method of portrait verification is to perform liveness detection and collect corresponding portrait pictures through terminal equipment, and then transmit the portrait pictures to the client, which then compares and verifies the portrait pictures.
[0004] However, the traditional way of transmitting portrait images is mainly based on black box encryption. That is, black box encryption only knows the relationship between input and output, but does not know the specific encryption and decryption process. Although black box encryption solves the security problem in the process of portrait transmission to a certain extent, attackers can bypass the client and directly use the portrait to call the server to complete the portrait verification, thus causing data leakage. Summary of the invention
[0005] The embodiments of the present application provide a portrait encryption and decryption method, device and electronic device, which are used to encrypt portrait images on the client side using white box encryption, improve the security of portrait verification, and prevent external malicious attacks.
[0006] In a first aspect, an embodiment of the present application provides a method for encrypting a portrait, the method comprising:
[0007] Get the portrait image to be encrypted;
[0008] Encrypt the portrait image to be encrypted using a preset white box encryption system to obtain an encrypted portrait image;
[0009] The encrypted portrait image is sent to the server so that the server can perform portrait verification based on the encrypted portrait image.
[0010] Through the above method, the portrait image is encrypted by white box encryption on the client side, so that the key and encryption algorithm are invisible to the outside, which improves the security of the data and ensures that it cannot be cracked by attackers during the portrait verification process.
[0011] In an optional implementation, after obtaining the portrait image to be encrypted, the method further includes:
[0012] A traceability mark is added to the portrait image to be encrypted, and the first timestamp corresponding to the portrait image to be encrypted is recorded.
[0013] Through the above method, adding traceability marks and timestamps to the encrypted portrait images can prevent attackers from making repeated attacks and improve data security.
[0014] In an optional implementation, after recording the first timestamp corresponding to the portrait image to be encrypted, the method further includes:
[0015] A preprocessing operation is performed on the portrait image to be encrypted, wherein the preprocessing operation at least includes: image enhancement processing, image denoising processing and image alignment processing.
[0016] By using the above method, the portrait image to be encrypted is preprocessed, which can significantly improve the quality of the portrait image.
[0017] In a second aspect, the present application provides a portrait decryption method, the method comprising:
[0018] Receive the encrypted portrait image;
[0019] Decrypting the encrypted portrait image using a preset key to obtain a decrypted portrait image;
[0020] In response to successfully tracing the decrypted portrait image, extracting a second timestamp corresponding to the decrypted portrait image;
[0021] If the second timestamp is consistent with the first timestamp, a preset feature extraction algorithm is used to extract the portrait features corresponding to the decrypted portrait image for portrait verification, and the portrait verification result is output.
[0022] In a third aspect, the present application provides a portrait encryption device, the device comprising:
[0023] An acquisition module is used to acquire the portrait image to be encrypted;
[0024] An encryption module, used for encrypting the portrait image to be encrypted by using a preset white box encryption system to obtain the encrypted portrait image;
[0025] The transmission module is used to send the encrypted portrait image to the server so that the server can perform portrait verification based on the encrypted portrait image.
[0026] In an optional implementation, after acquiring the portrait picture to be encrypted, the acquisition module is further used to: add a traceability mark to the portrait picture to be encrypted, and record a first timestamp corresponding to the portrait picture to be encrypted.
[0027] In an optional implementation, after recording the first timestamp corresponding to the portrait image to be encrypted, the acquisition module is further used to:
[0028] A preprocessing operation is performed on the portrait image to be encrypted, wherein the preprocessing operation at least includes: image enhancement processing, image denoising processing and image alignment processing.
[0029] In a fourth aspect, the present application provides a portrait decryption device, the device comprising:
[0030] A receiving module, used for receiving the encrypted portrait image;
[0031] A decryption module, used to decrypt the encrypted portrait image using a preset key to obtain a decrypted portrait image;
[0032] An extraction module, configured to extract a second timestamp corresponding to the decrypted portrait image in response to successful tracing of the decrypted portrait image;
[0033] The processing module is used to extract the portrait features corresponding to the decrypted portrait image using a preset feature extraction algorithm to perform portrait verification if the second timestamp is consistent with the first timestamp, and output the portrait verification result.
[0034] In a fifth aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores a program code, and when the program code is executed by the processor, the processor executes the steps of the portrait encryption and decryption method described in the first and second aspects above.
[0035] In a sixth aspect, the present application provides a computer-readable storage medium, which includes a program code. When the program code is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the portrait encryption and decryption methods described in the first and second aspects above.
[0036] In a seventh aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the portrait encryption and decryption method as described in the first and second aspects.
[0037] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0039] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0040] Figure 2 A schematic diagram of an implementation flow of a portrait encryption method provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of an implementation flow of a portrait decryption method provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of a portrait encryption device provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a portrait decryption device provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0046] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A and B are connected, which can represent two situations: A and B are directly connected and A and B are connected through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0047] In addition, the collection, dissemination, and use of data in the technical solution of this application comply with the requirements of relevant national laws and regulations.
[0048] The following is a brief introduction to the design concept of the embodiment of the present application:
[0049] With the rapid development of information technology, biometric technology is increasingly used in daily life. Among them, portrait verification, as an important part of biometric technology, is widely used in identity authentication, financial payment and other fields.
[0050] At present, the main method of portrait verification is to perform liveness detection and collect corresponding portrait pictures through terminal equipment, and then transmit the portrait pictures to the client, which then compares and verifies the portrait pictures.
[0051] However, the traditional way of transmitting portrait images is mainly based on black box encryption. That is, black box encryption only knows the relationship between input and output, but does not know the specific encryption and decryption process. Although black box encryption solves the security problem in the process of portrait transmission to a certain extent, attackers can bypass the client and directly use the portrait to call the server to complete the portrait verification, thus causing data leakage.
[0052] In view of this, the embodiment of the present application provides a portrait encryption method, which includes: first, obtaining a portrait image to be encrypted; then, using a preset white box encryption system to encrypt the portrait image to be encrypted, and obtaining an encrypted portrait image; finally, sending the encrypted portrait image to a server, so that the server performs portrait verification based on the encrypted portrait image. Through the above method, the portrait image is encrypted by using a preset white box encryption system on the client, which fully ensures that the encryption key and encryption algorithm are not visible to the outside, improves the security of the portrait data during transmission and storage, and effectively prevents malicious attacks.
[0053] The following describes a method for encrypting and decrypting a human portrait provided by an exemplary embodiment of the present application with reference to the accompanying drawings.
[0054] See also Figure 1 , which is a schematic diagram of a possible application scenario in an embodiment of the present application. The application scenario diagram includes a server 11 and a terminal device 12 (including a terminal device 121, a terminal device 122 ... a terminal device 12n).
[0055] The server 11 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device 12 may be directly or indirectly connected to the server 11 via wired or wireless communication, which is not limited in this application.
[0056] The terminal device 12 includes but is not limited to mobile phones, tablet computers, laptop computers, desktop computers, electronic reading books, intelligent voice interaction devices, smart home appliances, car terminals and other devices; various software can be installed on the terminal device, such as applications and applets.
[0057] It should be noted that Figure 1 The figure is only an example. In fact, the number of terminal devices 12 and servers 11 is not limited and is not specifically limited in the embodiments of the present application.
[0058] Exemplarily, the terminal device 12 can access the network through cellular mobile communication technology, thereby communicating with the server 11, and then sending the encrypted portrait image to the server, wherein the cellular mobile communication technology, for example, includes the fifth generation mobile communication (5th Generation Mobile Networks, 5G) technology.
[0059] Optionally, the terminal 12 can access the network through short-range wireless communication to communicate with the server 11, and then send the encrypted portrait image to the server, wherein the short-range wireless communication method, for example, includes Wireless Fidelity (Wi-Fi) technology.
[0060] See also Figure 2 As shown, it is a schematic diagram of an implementation process of a portrait encryption method provided in an embodiment of the present application. The specific implementation process of the method is as follows:
[0061] S201: Obtain a portrait image to be encrypted.
[0062] In an embodiment of the present application, when applying the portrait recognition technology, the portrait image to be encrypted can be acquired, so that the acquired portrait image can be applied to the subsequent portrait verification process.
[0063] Specifically, when a portrait image acquisition instruction is received, the camera can be controlled to capture the corresponding portrait image, for example, using the camera configured on a terminal device such as a computer or a mobile phone to complete the acquisition of the portrait image. When acquiring the portrait image, it is also necessary to perform a liveness detection on the person being acquired based on a preset modality face liveness detection algorithm to ensure that a real portrait image is acquired.
[0064] When collecting portrait images, key features can be extracted from the collected portrait images, such as facial contours, facial features, texture information and other key features, and then the preset modal face liveness detection algorithm is used for analysis based on the extracted key features to determine whether the portrait image is from a real living body. In addition, when collecting portrait images, two modes of interaction are supported: action interaction and non-action interaction. Action interaction means that the person being collected needs to complete the corresponding actions according to the prompts, such as blinking, turning the head and other actions. Without action interaction, portrait image collection can be completed in a static state. After the liveness detection is passed, the portrait image to be encrypted can be obtained.
[0065] In an optional implementation, when the portrait image to be encrypted is obtained, it is also necessary to add a traceability mark to the portrait image to be encrypted.
[0066] For example, in an embodiment of the present application, a digital watermark can be added to the portrait image to be encrypted. By adding a digital watermark to the portrait image to be encrypted, the traceability information such as the acquisition time, location, and device ID corresponding to the portrait image to be encrypted can be clarified. Alternatively, metadata (such as acquisition time, location, device ID, etc.) can be added to the encrypted portrait image and embedded in the image file. Alternatively, an indirect mark can be added to achieve the addition of a traceability mark to the encrypted portrait image. For example, a unique identifier (such as a file name, a hash value, etc.) is set for the collected portrait image to be encrypted, and then the unique identifier corresponding to each portrait image to be encrypted is stored in the database together with the corresponding traceability information. The corresponding traceability information can be queried in the database later through the unique identifier corresponding to the portrait image to be encrypted.
[0067] In addition, it is also necessary to record the first timestamp corresponding to the portrait image to be encrypted. The first timestamp is the timestamp corresponding to when the portrait image to be encrypted is obtained, which can be used for subsequent verification to prevent attackers from using the same portrait image to perform replay attacks.
[0068] Furthermore, in an optional implementation manner, after recording the first timestamp corresponding to the portrait image to be encrypted, a preprocessing operation may be performed on the portrait image to be encrypted.
[0069] Specifically, in the embodiment of the present application, the preprocessing operations performed on the portrait image to be encrypted include at least: image enhancement processing, image denoising processing, and image alignment processing.
[0070] By performing image enhancement processing on the encrypted portrait image, the contrast and brightness of the encrypted portrait image can be improved, and the image quality and visualization effect can be significantly improved. For example, the encrypted portrait image can be enhanced by using methods such as histogram equalization, contrast stretching, and grayscale transformation.
[0071] Performing image denoising on the encrypted portrait image can remove noise in the encrypted portrait image, thereby improving the clarity and quality of the encrypted portrait image. For example, the encrypted portrait image can be denoised by using a mean filter, a Gaussian filter, a median filter, or the like.
[0072] Then, the portrait images to be encrypted are subjected to image alignment processing, so that the feature positions of the portrait images to be encrypted at different angles of the same target can be consistent, thereby improving the accuracy of subsequent portrait verification.
[0073] Through the above method, the portrait picture to be encrypted can be obtained, and the quality of the portrait picture to be encrypted can be significantly improved after preprocessing the portrait picture to be encrypted, ensuring that the obtained portrait picture is clear, complete and authentic.
[0074] S202: Encrypt the portrait image to be encrypted using a preset white box encryption system to obtain an encrypted portrait image.
[0075] In the embodiment of the present application, when encrypting the portrait image to be encrypted, the pre-processed portrait image to be encrypted can be white-box encrypted on the client. The encryption operation of the portrait image to be encrypted is performed on the client using white-box encryption, so that the encryption key and encryption algorithm are invisible to the outside, thereby improving the security of the portrait image during transmission and use.
[0076] Specifically, in the embodiment of the present application, a preset white box encryption system is provided on the client. When the encrypted portrait image needs to be encrypted, the white box encryption system can be called to encrypt the portrait image, and the encrypted portrait image is encrypted by the white box key in the white box encryption system to obtain the encrypted portrait image. The purpose of encrypting the encrypted portrait image by the white box algorithm is achieved, and the security of the portrait image is ensured.
[0077] S203: Send the encrypted portrait image to the server, so that the server performs portrait verification based on the encrypted portrait image.
[0078] In an embodiment of the present application, after obtaining the encrypted portrait image through the above steps, the encrypted portrait image can be sent to the server, so that the server can perform portrait verification after receiving the encrypted portrait image.
[0079] See also Figure 3 As shown, it is a schematic diagram of an implementation process of a portrait decryption method provided in an embodiment of the present application. The specific implementation process of the method is as follows:
[0080] S301: receiving an encrypted portrait image.
[0081] S302: Decrypting the encrypted portrait image using a preset key to obtain a decrypted portrait image.
[0082] S303: In response to successful tracing of the decrypted portrait image, extracting a second timestamp corresponding to the decrypted portrait image.
[0083] S304: If the second timestamp is consistent with the first timestamp, a preset feature extraction algorithm is used to extract the portrait features corresponding to the decrypted portrait image for portrait verification, and the portrait verification result is output.
[0084] In an embodiment of the present application, the client can encrypt the acquired portrait picture, and then send the encrypted portrait picture to the server. After receiving the encrypted portrait picture, the server uses a preset key stored in a database to decrypt the encrypted portrait picture, thereby obtaining a decrypted portrait picture.
[0085] Furthermore, after obtaining the decrypted portrait image, it is also necessary to trace the decrypted portrait image, that is, obtain the traceability identifier corresponding to the decrypted portrait image, and determine whether the traceability identifier is consistent with the traceability identifier corresponding to the portrait image to be encrypted. If they are consistent, it means that the traceability is successful. Then, extract the second timestamp corresponding to the decrypted portrait image, and compare the second timestamp with the first timestamp corresponding to the portrait image to be encrypted to determine whether the second timestamp is the same as the first timestamp to prevent attackers from using the same image to perform replay attacks. After the timestamp comparison is consistent, the preset feature extraction algorithm is used to extract the portrait features corresponding to the decrypted portrait image, and perform portrait verification. Specifically, the extracted portrait features can be compared with the portrait features corresponding to the portrait image in the preset database. For example, by calculating the cosine similarity, Euclidean distance, etc. between the extracted portrait features and the portrait features corresponding to the portrait image in the preset database, and based on the preset similarity threshold, complete the portrait verification. Finally, the portrait verification result is output, which can be a successful verification, a failed verification, etc.
[0086] Further, based on the same technical concept, the embodiment of the present application provides a portrait encryption device, which is used to implement the portrait encryption method process of the embodiment of the present application. Figure 4 As shown, the device includes: an acquisition module 401, an encryption module 402 and a transmission module 403, wherein:
[0087] An acquisition module 401 is used to acquire a portrait image to be encrypted;
[0088] The encryption module 402 is used to encrypt the portrait image to be encrypted by using a preset white box encryption system to obtain the encrypted portrait image;
[0089] The transmission module 403 is used to send the encrypted portrait image to the server, so that the server performs portrait verification based on the encrypted portrait image.
[0090] In an optional implementation, after acquiring the portrait picture to be encrypted, the acquisition module 401 is further used to: add a traceability mark to the portrait picture to be encrypted, and record a first timestamp corresponding to the portrait picture to be encrypted.
[0091] In an optional implementation, after recording the first timestamp corresponding to the portrait image to be encrypted, the acquisition module 401 is further used to:
[0092] A preprocessing operation is performed on the portrait image to be encrypted, wherein the preprocessing operation at least includes: image enhancement processing, image denoising processing and image alignment processing.
[0093] Based on the same technical concept, the embodiment of the present application also provides a portrait decryption device, which is used to implement the portrait decryption method process of the embodiment of the present application. Figure 5 As shown, the device includes: a receiving module 501, a decryption module 502, an extraction module 503 and a processing module 504, wherein:
[0094] Receiving module 501, used for receiving the encrypted portrait image;
[0095] The decryption module 502 is used to decrypt the encrypted portrait image using a preset key to obtain a decrypted portrait image;
[0096] An extraction module 503 is used to extract a second timestamp corresponding to the decrypted portrait image in response to successful tracing of the decrypted portrait image;
[0097] The processing module 504 is used to extract the portrait features corresponding to the decrypted portrait image using a preset feature extraction algorithm to perform portrait verification if the second timestamp is consistent with the first timestamp, and output the portrait verification result.
[0098] Based on the same technical concept, the embodiment of the present application also provides an electronic device, which can implement the portrait encryption and decryption method provided in the above embodiment of the present application. In one embodiment, the electronic device can be a server, or a terminal device or other electronic device. Figure 6 As shown, the electronic device may include:
[0099] At least one processor 601, and a memory 602 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and there is no limitation on the name.
[0100] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute a portrait encryption and decryption method discussed above by executing the instructions stored in the memory 602. The processor 601 can implement Figure 4 , 5 The functions of each module in the device shown.
[0101] Among them, the processor 601 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 602 and calling the data stored in the memory 602, the various functions of the device and processing data, the device can be monitored as a whole.
[0102] In one possible design, the processor 501 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0103] Processor 601 can be a general-purpose processor, such as a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of a portrait encryption and decryption method disclosed in the embodiments of the present application can be directly embodied as a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0104] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0105] By programming the processor 601, the code corresponding to the method for encrypting and decrypting a portrait described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 , 3 The steps of a method for encrypting and decrypting a human portrait in the embodiment shown are as follows: How to design and program the processor 601 is a technique known to those skilled in the art and will not be described in detail here.
[0106] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes a portrait encryption and decryption method discussed above.
[0107] In some possible implementations, the present application also provides various aspects of a portrait encryption and decryption method that can also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a portrait encryption and decryption method described above in this specification according to various exemplary implementations of the present application.
[0108] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0109] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0111] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a server, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] Program code for performing the operations of the present application may be written using any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0114] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A portrait encryption method, characterized in that: The method comprises: Get the portrait image to be encrypted; Encrypting the portrait image to be encrypted by using a preset white box encryption system to obtain an encrypted portrait image; The encrypted portrait image is sent to the server, so that the server performs portrait verification based on the encrypted portrait image.
2. The method according to claim 1, characterized in that After obtaining the portrait image to be encrypted, the method further includes: A traceability mark is added to the portrait image to be encrypted, and a first timestamp corresponding to the portrait image to be encrypted is recorded.
3. The method according to claim 2, characterized in that After recording the first timestamp corresponding to the portrait image to be encrypted, the method further includes: A preprocessing operation is performed on the portrait image to be encrypted, wherein the preprocessing operation at least includes: image enhancement processing, image denoising processing and image alignment processing.
4. A method for decrypting a portrait, characterized in that: The method comprises: Receive the encrypted portrait image; Decrypting the encrypted portrait image using a preset key to obtain a decrypted portrait image; In response to successfully tracing the decrypted portrait image, extracting a second timestamp corresponding to the decrypted portrait image; If the second timestamp is consistent with the first timestamp, a preset feature extraction algorithm is used to extract the portrait features corresponding to the decrypted portrait image for portrait verification, and the portrait verification result is output.
5. A portrait encryption device, characterized in that: The device comprises: An acquisition module is used to acquire the portrait image to be encrypted; An encryption module, used for encrypting the portrait image to be encrypted by using a preset white box encryption system to obtain the encrypted portrait image; The transmission module is used to send the encrypted portrait image to the server, so that the server performs portrait verification based on the encrypted portrait image.
6. The device according to claim 5, characterized in that After obtaining the portrait image to be encrypted, the obtaining module is further used to: A traceability mark is added to the portrait image to be encrypted, and a first timestamp corresponding to the portrait image to be encrypted is recorded.
7. The device according to claim 6, characterized in that After recording the first timestamp corresponding to the portrait image to be encrypted, the acquisition module is further used to: A preprocessing operation is performed on the portrait image to be encrypted, wherein the preprocessing operation at least includes: image enhancement processing, image denoising processing and image alignment processing.
8. A portrait decryption device, characterized in that: The device comprises: A receiving module, used for receiving the encrypted portrait image; A decryption module, used to decrypt the encrypted portrait image using a preset key to obtain a decrypted portrait image; An extraction module, configured to extract a second timestamp corresponding to the decrypted portrait image in response to successful tracing of the decrypted portrait image; The processing module is used to extract the portrait features corresponding to the decrypted portrait image by using a preset feature extraction algorithm to perform portrait verification if the second timestamp is consistent with the first timestamp, and output the portrait verification result.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.