Image filtering method and device

Image data is encrypted and processed through fully homomorphic encryption technology, which solves the problem of privacy and security risks during image filtering, and realizes image filtering in a ciphertext environment, ensuring the security of user data.

CN119210676APending Publication Date: 2024-12-27ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310754572.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

During image filtering, the user's privacy and security are threatened because image data may be leaked during transmission, storage and calculation, especially when the original image contains sensitive information.

Method used

The image data is encrypted using all-homomorphic encryption technology, and the encrypted data is processed in a ciphertext environment. The decomposition filter algorithm is used to process multiple linear operators, so as to complete the plaintext data without leaking it. Image filtering.

Benefits of technology

It effectively protects the privacy and security of user image data, prevents sensitive data leakage, and ensures the privacy and security of image filtering processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119210676A_ABST
    Figure CN119210676A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image filtering method and device, and the method comprises the steps: a client side determines a fully homomorphic encryption mode according to an original image, carries out the encryption of the original image according to the fully homomorphic encryption mode, obtains ciphertext data, and transmits the ciphertext data to a server side, the filtering ciphertext is decrypted according to a fully homomorphic encryption mode, a filtered target image is obtained, the filtering ciphertext is obtained by decomposing a filter algorithm corresponding to an image filtering function into a plurality of linear operators by the server, and the linear operators are used for filtering the target image. And processing the ciphertext data according to a fully homomorphic encryption mode and a plurality of linear operators. According to the embodiment of the invention, the problem that the privacy security risk exists in the image filtering processing in the related technology can be solved, the image is subjected to fully homomorphic encryption, data transmission, storage and calculation in a plaintext environment are avoided on the premise that the filtering function is met, the image security of a user can be effectively protected, and sensitive data leakage is prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image filtering method and device. Background Art

[0002] With the gradual popularization and rapid growth of 5G networks, users' demand for image and video data is growing exponentially, and large-scale image data processing has put a great test on computing power. In recent years, with the development of cloud computing technology and the construction of cloud computing platforms and computing power networks, there is huge application value in processing image data by remotely calling the cloud with rich computing power.

[0003] Image filtering is an image processing technology that uses filters to perform grayscale, rotation, blur, sharpening and other image filtering. It has a wide range of usage scenarios and many user needs. Currently, image filtering based on cloud platforms requires users to transmit image data in plain text and store it in plain text on the cloud platform. The calculation of image data on the cloud is also performed in plain text, and leakage may occur during data transmission, storage and calculation. During the image filtering process, if the original image contains iconic information such as portraits or residences, once the data is leaked, there will be huge risks to the privacy and security of users.

[0004] Therefore, under the premise of satisfying the filtering function, how to achieve secure transmission, storage and calculation is the current technical problem to be solved. Summary of the invention

[0005] The embodiments of the present application provide an image filtering method and device to at least solve the problem of privacy and security risks in image filtering processing in the related art.

[0006] According to an embodiment of the present application, an image filtering method is provided, which is applied to a client, and the method includes:

[0007] Determine a fully homomorphic encryption method according to the original image, and encrypt the original image according to the fully homomorphic encryption method to obtain ciphertext data;

[0008] Sending the ciphertext data to the server, and receiving the filtered ciphertext returned by the server, wherein the filtered ciphertext is obtained by the server decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators, and processing the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators;

[0009] The filtered ciphertext is decrypted according to the fully homomorphic encryption method to obtain a filtered target image.

[0010] According to another embodiment of the present application, an image filtering method is provided, which is applied to a server, and the method includes:

[0011] Receiving ciphertext data sent by a client, wherein the ciphertext data is obtained by the client determining a fully homomorphic encryption method according to an original image and encrypting the original image according to the fully homomorphic encryption method;

[0012] Decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators;

[0013] Processing the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators to obtain a filtered ciphertext;

[0014] The filtered ciphertext is sent to the client, wherein the client is used to decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image.

[0015] According to another embodiment of the present application, there is provided an image filtering system, the system comprising:

[0016] The client is used to determine a fully homomorphic encryption method according to the original image, and encrypt the original image according to the fully homomorphic encryption method to obtain ciphertext data; send the ciphertext data to the server, and receive the filtered ciphertext returned by the server; decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image;

[0017] The server is used to receive the ciphertext data sent by the client; decompose the filter algorithm corresponding to the image filtering function into multiple linear operators; process the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators to obtain the filtered ciphertext; and send the filtered ciphertext to the client.

[0018] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps of any of the above method embodiments when executed by a processor.

[0019] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0020] In the embodiment of the present application, the plaintext data is converted into ciphertext data by performing fully homomorphic encryption on the image. Under the premise of satisfying the image filtering function, data transmission, storage and calculation in a plaintext environment are avoided, which can effectively protect the user's image security and prevent sensitive data leakage, thereby solving the problem of privacy and security risks in image filtering processing in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a hardware structure block diagram of the image filtering method of an embodiment of the present application;

[0022] Figure 2 is a flowchart of an image filtering method of a client according to an embodiment of the present application;

[0023] Figure 3 is a flow chart of an image filtering method at a server according to an embodiment of the present application;

[0024] Figure 4 is a flow chart of an image filtering service based on fully homomorphic encryption according to an embodiment of the present application;

[0025] Figure 5 is a structural diagram of an image filtering service based on fully homomorphic encryption according to an embodiment of the present application;

[0026] Figure 6 is a schematic diagram of an image filtering system based on fully homomorphic encryption according to an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of an image filtering device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a hardware structure diagram of the image filtering method of the embodiment of the present application, such as Figure 1 As shown, the hardware board may include one or more ( Figure 1 Only one is shown in the figure) a processor 12 (the processor 12 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device) and a memory 14 for storing data, wherein the mobile terminal may also include a transmission device 16 for communication functions and an input and output device 18. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0031] The memory 14 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image filtering method in the embodiment of the present application. The processor 12 executes various functional applications and image filtering methods by running the computer program stored in the memory 14, that is, the above method is implemented. The memory 14 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 14 may further include a memory remotely arranged relative to the processor 12, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 16 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider. In one example, the transmission device 16 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 16 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0033] In one embodiment of the present application, an image filtering method is provided, which is applied to a client. Figure 2 is a flowchart of an image filtering method of a client according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0034] Step S202, determining a fully homomorphic encryption method according to the original image, and encrypting the original image according to the fully homomorphic encryption method to obtain ciphertext data;

[0035] Step S204, sending the ciphertext data to the server, and receiving the filtered ciphertext returned by the server;

[0036] Step S206, decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain the filtered target image.

[0037] In this embodiment, the filtered ciphertext in step S204 is obtained by the server decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators, and processing the ciphertext data according to the fully homomorphic encryption method and multiple linear operators.

[0038] In an embodiment of the present application, through steps S202 to S206, the image data can be fully homomorphic encrypted (Fully Homomorphic Encryption, abbreviated as FHE). Based on the characteristic that fully homomorphic encryption allows arbitrarily complex operations to be performed on ciphertext, data transmission, storage and filtering processing in a ciphertext environment are realized. While satisfying the filtering function, the privacy and security of user data are effectively protected, and the problem of privacy and security risks in image filtering processing in related technologies can be solved.

[0039] In an exemplary embodiment, step S202 may include the following steps:

[0040] Step S2022, converting the original image into feature text data;

[0041] Step S2024, determining the fully homomorphic encryption method according to the data type and data size of the characteristic text data;

[0042] Step S2026, encrypt the characteristic text data according to the pre-generated key and the fully homomorphic encryption method to obtain the ciphertext data.

[0043] In an exemplary embodiment, the fully homomorphic encryption method may include TFHE fully homomorphic encryption (The Torus Fully Homomorphic Encryption), BFV fully homomorphic encryption (Brakerski-Fan-Vercauteren Fully Homomorphic Encryption) and CKKS fully homomorphic encryption (Cheon-Kim-Kim-Song Fully Homomorphic Encryption).

[0044] Furthermore, TFHE-type fully homomorphic encryption can only encode one data at a time and can only process small amounts of data, usually less than 100K; BFV-type fully homomorphic encryption and CKKS-type fully homomorphic encryption are based on the Single Instruction Multiple Data (SIMD) encoding method, which can encode multiple data at a time according to the security level and the degree of the cyclomatic polynomial. The difference is that BFV-type fully homomorphic encryption is used to encrypt integer type data, and CKKS-type fully homomorphic encryption is used to encrypt floating-point type data.

[0045] In an exemplary embodiment, step S2024 may include one or more of the following situations:

[0046] Case 1: when the data size of the characteristic text data is less than or equal to a preset value, determining that the fully homomorphic encryption method is TFHE-type fully homomorphic encryption;

[0047] Case 2: when the data size of the characteristic text data is greater than the preset value and the data type of the characteristic text data is an integer type, it is determined that the fully homomorphic encryption method is BFV-type fully homomorphic encryption;

[0048] Case three, when the data size of the characteristic text data is greater than the preset value and the data type of the characteristic text data is a floating point type, it is determined that the fully homomorphic encryption method is CKKS-type fully homomorphic encryption.

[0049] Specifically, the preset value in case 1 can be set to 100K or a smaller value, and this application does not impose any limitation on this.

[0050] In an exemplary embodiment, before step S2026, the method may further include the following steps:

[0051] Step S2025, determining a key generation algorithm according to a predetermined key generation method, wherein the key generation method includes symmetric encryption and asymmetric encryption; and generating one or a pair of keys corresponding to the key generation method through the key generation algorithm.

[0052] Furthermore, the key generation method can be set in the client's visual interface. Symmetric encryption only needs to generate a private key, which is used to complete encryption and decryption. Asymmetric encryption generates a public-private key pair, with the public key used for encryption and the private key used for decryption. This application does not limit the key generation algorithm.

[0053] In an exemplary embodiment, step S2026 may include the following steps: encoding the characteristic text data according to a fully homomorphic encryption method to obtain a plaintext polynomial; encrypting the plaintext polynomial according to a key to obtain a ciphertext polynomial (i.e., ciphertext data).

[0054] Furthermore, the key may be in the form of a random polynomial within a polynomial ring.

[0055] In an exemplary embodiment, step S206 may include the following steps:

[0056] Step S2062, decrypting the filtered ciphertext according to the pre-generated key and the fully homomorphic encryption method to obtain filtered text data;

[0057] Step S2064: convert the filtered text data into the target image.

[0058] Furthermore, the key used for decryption in step S2062 corresponds to the key used for encryption in step S2026. In symmetric encryption, the private key is used for decryption, and in asymmetric encryption, the private key corresponding to the public key is used for decryption.

[0059] In an exemplary embodiment, step S2062 may include the following steps: decrypting the filtered ciphertext polynomial (i.e., filtered ciphertext) according to the key to obtain the filtered plaintext polynomial; decoding the filtered plaintext polynomial according to the fully homomorphic encryption method to obtain filtered text data.

[0060] In an exemplary embodiment, the method further comprises the following steps:

[0061] Step S2052, receiving first intermediate ciphertext data sent by the server, wherein the first intermediate ciphertext data is a processing result of some linear operators among the multiple linear operators obtained by the server when the noise budget is zero, an initial value of the noise budget is greater than zero, and the noise budget gradually decreases to zero in the process of processing the ciphertext data;

[0062] Step S2054, decrypting and re-encrypting the first intermediate ciphertext data according to the fully homomorphic encryption method to obtain second intermediate ciphertext data;

[0063] Step S2056: Send the second intermediate ciphertext data to the server so that the server resets the noise budget, wherein the server continues to process the second intermediate ciphertext data according to the remaining linear operators in the multiple linear operators except the partial linear operators to obtain the filtered ciphertext.

[0064] In this embodiment, steps S2052 to S2056 occur during the filtering process of the ciphertext data at the server end. In the process of operating the ciphertext data according to the fully homomorphic encryption method, the noise budget will be consumed, and the operation will be stopped when the noise budget is zero. The embodiment of the present application can reset the noise budget to ensure the complete operation of the image filtering algorithm.

[0065] According to another embodiment of the present application, an image filtering method is provided, which is applied to a server.

[0066] Figure 3 is a flow chart of an image filtering method at a server side according to an embodiment of the present application. Figure 3 As shown, the process includes the following steps:

[0067] Step S302, receiving ciphertext data sent by the client;

[0068] Step S304, decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators;

[0069] Step S306, processing the ciphertext data according to the fully homomorphic encryption method and multiple linear operators to obtain filtered ciphertext;

[0070] Step S308: Send the filtered ciphertext to the client.

[0071] In this embodiment, the ciphertext data in step S302 is obtained by the client determining a fully homomorphic encryption method based on the original image and encrypting the original image according to the fully homomorphic encryption method. The client is also used to decrypt the filtered ciphertext according to the fully homomorphic encryption method after step S308 to obtain the filtered target image.

[0072] In an embodiment of the present application, through steps S302 to S308, data transmission, storage and calculation in the entire image filtering processing flow are implemented in a ciphertext environment, which can effectively protect user image security, prevent sensitive data leakage, and solve the problem of privacy and security risks in image filtering processing in related technologies.

[0073] In an exemplary embodiment, the image filtering function in step S304 may include but is not limited to filtering processes such as grayscale, rotation, blurring, and sharpening. The image filtering function may be displayed in a visual interface of the client, and the user may select one or more of the multiple filtering functions.

[0074] Furthermore, multiple filter algorithms can be used in combination, and the present application does not limit the filter algorithm corresponding to each image filtering function.

[0075] In an exemplary embodiment, step S304 may include: decomposing the filter algorithm into linear operators and nonlinear operators, and expanding the nonlinear operator into a polynomial composed of linear operators according to a Taylor series to obtain the multiple linear operators, wherein the linear operators include addition operations, subtraction operations, multiplication operations, division operations, and power operations.

[0076] Furthermore, nonlinear operators may include exponential operations, logarithmic operations, trigonometric functions, and inverse trigonometric functions. The nonlinear operators may be approximately expanded into low-order polynomials through Taylor expansion, and the low-order polynomials may be expressed as a combination of multiple addition, subtraction, multiplication, and division operations, thereby realizing the conversion of nonlinear operators into linear operators.

[0077] In an exemplary embodiment, the operation of linear operators can be realized using ciphertext data encrypted using fully homomorphic encryption, but the specific operation methods of the linear operators corresponding to different fully homomorphic encryption methods may be different. The actual operation method corresponding to the linear operator can be set according to the fully homomorphic encryption method used.

[0078] The fully homomorphic encryption in the embodiment of the present application is a finite-order fully homomorphic encryption. When step S306 performs ciphertext operation, if the noise budget upper limit of the fully homomorphic scheme is reached, the current ciphertext needs to be decrypted and then re-encrypted to refresh the noise.

[0079] In an exemplary embodiment, the method may further include: step S303, when receiving the ciphertext data, setting an initial value of the noise budget according to the ciphertext data, wherein the initial value of the noise budget is greater than zero, and the noise budget gradually decreases to zero during the process of processing the ciphertext data.

[0080] In an exemplary embodiment, the method may further include the following steps:

[0081] Step S3072, when the noise budget is zero, determining that processing results of some linear operators among the multiple linear operators are first intermediate ciphertext data;

[0082] Step S3074: sending the first intermediate ciphertext data to the client, and receiving second intermediate ciphertext data returned by the client, wherein the second intermediate ciphertext data is obtained by the client decrypting and re-encrypting the first intermediate ciphertext data according to the fully homomorphic encryption method;

[0083] Step S3076: reset the noise budget according to the second intermediate ciphertext data, and continue to process the second intermediate ciphertext data according to the remaining linear operators among the multiple linear operators except the partial linear operators to obtain the filtered ciphertext.

[0084] In the embodiment of the present application, through steps S3072 to S3076, the noise budget can be reset when the noise budget is insufficient, thereby ensuring the complete operation of the image filtering algorithm.

[0085] Figure 4 is a flowchart of an image filtering service based on fully homomorphic encryption according to an embodiment of the present application. Figure 4 As shown, the process includes the following steps:

[0086] Step S401, the user enters the client platform and selects a filtering function in the image filtering service as needed;

[0087] Step S402, inputting the original image data for data pre-processing, and converting the image information into text information;

[0088] Step S403, determine a fully homomorphic encryption scheme and key, encrypt the text data, and send the ciphertext data to the cloud server;

[0089] Step S404, the cloud server executes the ciphertext image filtering algorithm according to the image filtering function and the fully homomorphic encryption scheme selected by the user;

[0090] Step S4041: The noise budget is insufficient, and the current ciphertext data is sent to the client;

[0091] Step S4042, the client uses the key to decrypt the ciphertext data and then re-encrypts it, and sends the re-encrypted data to the server;

[0092] Step S405, the server executes the ciphertext image filtering algorithm and sends the filtered ciphertext to the client;

[0093] Step S406, the client uses the key to decrypt and obtain the filtered text information;

[0094] Step S407: image post-processing, converting the filtered text information into a filtered target image.

[0095] In an embodiment of the present application, the image filtering service applies the image filtering method based on fully homomorphic encryption to the outsourced computing model of the client and the cloud server.

[0096] In an exemplary embodiment, the method in step S404 is the same as step S202 in any of the above embodiments, which is used to determine a fully homomorphic encryption scheme, a key generation algorithm, generate a key, and encrypt text data to obtain ciphertext data.

[0097] In an exemplary embodiment, the method in step S405 is the same as step S306 in any of the above embodiments, which is used to operate the ciphertext data according to multiple linear operators decomposed by the filtering algorithm to achieve filtering processing.

[0098] In an exemplary embodiment, the noise budget is used to determine the computing power of the ciphertext data. Each newly encrypted ciphertext data has a certain amount of noise budget, which will be consumed during the ciphertext operation. Once the noise budget is completely consumed, the ciphertext data can no longer be correctly decrypted.

[0099] Furthermore, the execution of the cloud server filter algorithm requires the management of the noise budget of the ciphertext space. If the noise budget reaches the upper limit (i.e., the noise budget is zero), the current ciphertext data is sent to the client, which decrypts and re-encrypts the data to refresh the noise. The client sends the ciphertext data with refreshed noise to the cloud server to continue to perform subsequent operations. After steps S4041 and S4042, the noise budget is full, and the server can continue to perform ciphertext operations.

[0100] Figure 5is a schematic diagram of the structure of an image filtering service based on fully homomorphic encryption according to an embodiment of the present application. Figure 5 As shown, the image filtering service is an outsourced computing model between the client and the cloud server.

[0101] The client can provide the following services: image filtering function selection, data processing, fully homomorphic encryption and decryption, and data transmission.

[0102] The cloud server can provide the following services: fully homomorphic encryption computing filtering algorithm, data transmission.

[0103] In an exemplary embodiment, the image filtering functions include but are not limited to grayscale, blur, sharpen, and transparent. A user can select one or more of the various image filtering functions.

[0104] In an exemplary embodiment, data processing includes pre-processing and post-processing, the pre-processing is used to convert the original image into text feature information, and the post-processing is used to convert the decrypted text feature information into an image.

[0105] In an exemplary embodiment, fully homomorphic encryption and decryption include: TFHE-type fully homomorphic encryption and decryption, BFV-type fully homomorphic encryption and decryption, and CKKS-type fully homomorphic encryption and decryption.

[0106] Furthermore, TFHE type fully homomorphic encryption and decryption allows the calculation of any Boolean circuit composed of binary gates on encrypted data without leaking any original data information, and can achieve very fast gate-by-gate bootstrapping. BFV type fully homomorphic encryption and decryption is a fully homomorphic encryption scheme based on the difficulty problem of Ring Learning with Error (RLWE). Its main idea is to put the plaintext in the high position of the ciphertext and remove the low-order noise by integer division. BFV supports encryption and decryption of integer data. CKKS type fully homomorphic encryption and decryption have similar ciphertext operation rules as the BFV scheme, but it supports floating-point number operations in the ciphertext space.

[0107] In an exemplary embodiment, data transmission includes sending and receiving, which is used to package and send ciphertext data, and receive ciphertext data. The ciphertext data here includes the first intermediate ciphertext data, the second intermediate ciphertext data, the filtered ciphertext, etc. in the above-mentioned embodiment.

[0108] In an exemplary embodiment, the cloud service end may provide a filter algorithm corresponding to the image filtering function, and decompose the filter algorithm into a linear filter and a nonlinear filter, and further decompose it into multiple linear operators, including: "addition" operation and "multiplication" operation. Furthermore, the actual operation process of the "addition" operation and the "multiplication" operation corresponding to different fully homomorphic encryption methods may be different.

[0109] In an exemplary embodiment, the image filtering service may be provided to the user by performing the following steps:

[0110] Step S1, the user enters the client platform and selects a filtering function in the image filtering service as needed;

[0111] Step S2, inputting the original image data for data pre-processing, and converting the image information into feature text information;

[0112] Step S3: Select a fully homomorphic encryption scheme based on the text data type and data size. The client generates a key locally and uses the key to encrypt the text data, and then sends the ciphertext data to the cloud server.

[0113] Step S4: the cloud server executes the ciphertext image filtering algorithm according to the image filtering function and the fully homomorphic solution selected by the user, and packages the ciphertext image filtering results and sends them to the client;

[0114] Step S5: The client uses the key to decrypt and post-process the data, converting the decrypted text result into an image.

[0115] In the embodiment of the present application, an image filtering method based on fully homomorphic encryption proposes an "out-of-the-box" image filtering service, which can reduce the complexity of user operations and improve the user experience. It can also complete the filtering operation of the image with the help of the powerful computing power of the cloud server without leaking any data.

[0116] According to another embodiment of the present application, an image filtering system is provided.

[0117] Figure 6 is a schematic diagram of an image filtering system based on fully homomorphic encryption according to an embodiment of the present application. Figure 6 As shown, the system includes a client and a cloud server.

[0118] The client can include the following structures:

[0119] Data processing module 61 , encryption and decryption module 62 , communication module 63 and data storage module 64 .

[0120] The cloud server can include the following structures:

[0121] Ciphertext operation module 65 , communication module 63 and data storage module 64 .

[0122] The data processing module 61 is used for converting between image data and text data.

[0123] The encryption and decryption module 62 is used for fully homomorphic encryption and decryption operations performed by client users.

[0124] The communication module 63 is used to send and receive ciphertext data stored in the form of polynomials.

[0125] The data storage module 64 is used to store image data, text data and polynomial data used by the data processing module, encryption and decryption module and ciphertext operation module.

[0126] The ciphertext operation module 65 is used by the cloud server to perform image filtering ciphertext operation on the data encrypted by the client.

[0127] In an exemplary embodiment, the data processing module 61 may include the following structure:

[0128] A pre-processing unit, used for converting the image data into text data, and the text data is used as input of the encryption module;

[0129] The post-processing unit is used to convert text data into image data, wherein the text data is the output of the decryption module.

[0130] In an exemplary embodiment, the encryption / decryption module 62 may include the following structure:

[0131] The encryption unit performs three steps: key generation, encoding, and encryption. According to the selected encryption method, a random polynomial in the polynomial ring is generated as the key; encoding converts the original text data into a plaintext polynomial; encryption uses a public key (asymmetric encryption) or a private key (symmetric encryption) to convert the plaintext polynomial into a ciphertext polynomial;

[0132] The decryption unit performs two steps: ciphertext decryption and plaintext decoding. Ciphertext decryption converts the ciphertext polynomial into a plaintext polynomial; plaintext decoding converts the plaintext polynomial into text data.

[0133] In an exemplary embodiment, the ciphertext operation module 65 may include the following structure:

[0134] An "addition" operation unit, used to perform an "addition" operation, wherein the "addition" operation includes an "addition" of a plaintext polynomial to a ciphertext polynomial and an "addition" of a ciphertext polynomial to a plaintext polynomial;

[0135] A "multiplication" operation unit, used to perform a "multiplication" operation, wherein the "multiplication" operation includes a plaintext polynomial "multiplying" a ciphertext polynomial, and a ciphertext polynomial "multiplying" a ciphertext polynomial;

[0136] The noise management unit is used to evaluate the current ciphertext space noise budget and communicate with the client to refresh the noise when the noise budget is zero.

[0137] In an exemplary embodiment, the communication module 63 may include the following structure:

[0138] A sending unit, used for the client to send encrypted polynomial data to the cloud server or the cloud server to send polynomial data of the image filtering ciphertext operation result to the client;

[0139] The receiving unit is used for the client to receive the ciphertext operation result sent by the cloud server or the cloud server to receive the ciphertext polynomial data sent by the client.

[0140] In the embodiments of the present application, fully homomorphic encryption makes it possible to apply cloud computing scenarios such as cloud privacy computing due to the characteristic of "data available but invisible". Users can use powerful but untrusted servers to complete any calculations and obtain results without leaking any data. The embodiments of the present application can support customized processing of various image filtering tasks including grayscale, rotation, blurring, sharpening, etc.

[0141] Figure 7 is a schematic diagram of an image filtering device according to an embodiment of the present application, such as Figure 7 As shown, the image filtering device can be divided into a client device 72 and a cloud server device 74, and the client device 72 and the cloud server device 74 can constitute an image filtering system.

[0142] In this embodiment, the image filtering device includes a memory, a processor, and a computer program, wherein the computer program is stored in the memory and executed by the processor to implement the image filtering method and service based on fully homomorphic encryption in any of the above embodiments.

[0143] In this embodiment, the client device 72 and the cloud server device 74 can communicate via a wired network or a wireless network.

[0144] Furthermore, the processor includes a central processing unit (CPU) and a graphics processing unit (GPU). The CPU is used to execute all computer programs; the GPU is used to accelerate the polynomial operations of the encryption and decryption modules and the ciphertext operation modules.

[0145] In an exemplary embodiment, the client device 72 (i.e., the client) is used to determine a fully homomorphic encryption method based on an original image, and encrypt the original image according to the fully homomorphic encryption method to obtain ciphertext data; send the ciphertext data to a server, and receive a filtered ciphertext returned by the server; decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image.

[0146] In an exemplary embodiment, the cloud server device 74 (i.e., the server) is used to receive the ciphertext data sent by the client; decompose the filter algorithm corresponding to the image filtering function into multiple linear operators; process the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators to obtain the filtered ciphertext; and send the filtered ciphertext to the client.

[0147] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program executes the steps of any of the above method embodiments when executed by a processor.

[0148] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0149] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0150] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0151] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0152] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0153] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. An image filtering method, characterized in that: Applied to a client, the method comprises: Determine a fully homomorphic encryption method according to the original image, and encrypt the original image according to the fully homomorphic encryption method to obtain ciphertext data; Sending the ciphertext data to the server, and receiving the filtered ciphertext returned by the server, wherein the filtered ciphertext is obtained by the server decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators, and processing the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators; The filtered ciphertext is decrypted according to the fully homomorphic encryption method to obtain a filtered target image.

2. The method according to claim 1, characterized in that: Determining a fully homomorphic encryption method according to the original image, and encrypting the original image according to the fully homomorphic encryption method to obtain ciphertext data, including: Converting the original image into feature text data; Determine the fully homomorphic encryption method according to the data type and data size of the characteristic text data; The characteristic text data is encrypted according to a pre-generated key and the fully homomorphic encryption method to obtain the ciphertext data.

3. The method according to claim 2, characterized in that Determining the fully homomorphic encryption method according to the data type and data size of the characteristic text data includes: When the data size of the characteristic text data is less than or equal to a preset value, determining that the fully homomorphic encryption method is TFHE-type fully homomorphic encryption; When the data size of the characteristic text data is greater than the preset value and the data type of the characteristic text data is an integer type, determining that the fully homomorphic encryption method is BFV-type fully homomorphic encryption; When the data size of the characteristic text data is greater than the preset value and the data type of the characteristic text data is a floating point type, determining that the fully homomorphic encryption method is CKKS-type fully homomorphic encryption; Among them, the fully homomorphic encryption method includes the TFHE type fully homomorphic encryption, the BFV type fully homomorphic encryption and the CKKS type fully homomorphic encryption.

4. The method according to claim 2, characterized in that: Before encrypting the characteristic text data according to the pre-generated key and the fully homomorphic encryption method to obtain the ciphertext data, the method further includes: Determining a key generation algorithm according to a predetermined key generation method, wherein the key generation method includes symmetric encryption and asymmetric encryption; One or a pair of keys corresponding to the key generation method is generated by the key generation algorithm.

5. The method according to claim 1, characterized in that Decrypting the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image includes: Decrypting the filtered ciphertext according to the pre-generated key and the fully homomorphic encryption method to obtain filtered text data; The filtered text data is converted into the target image.

6. The method according to claim 1, characterized in that The method further comprises: Receiving first intermediate ciphertext data sent by the server, wherein the first intermediate ciphertext data is a processing result of some linear operators among the multiple linear operators obtained by the server when the noise budget is zero, an initial value of the noise budget is greater than zero, and the noise budget gradually decreases to zero in the process of processing the ciphertext data; Decrypting and re-encrypting the first intermediate ciphertext data according to the fully homomorphic encryption method to obtain second intermediate ciphertext data; The second intermediate ciphertext data is sent to the server so that the server resets the noise budget, wherein the server continues to process the second intermediate ciphertext data according to the remaining linear operators among the multiple linear operators except the partial linear operators to obtain the filtered ciphertext.

7. An image filtering method, characterized in that: Applied to the server, the method includes: Receiving ciphertext data sent by a client, wherein the ciphertext data is obtained by the client determining a fully homomorphic encryption method according to an original image and encrypting the original image according to the fully homomorphic encryption method; Decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators; Processing the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators to obtain a filtered ciphertext; The filtered ciphertext is sent to the client, wherein the client is used to decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image.

8. The method according to claim 7, characterized in that The filter algorithm corresponding to the image filtering function is decomposed into multiple linear operators, including: The filter algorithm is decomposed into a linear operator and a nonlinear operator, and the nonlinear operator is expanded into a polynomial composed of linear operators according to a Taylor series to obtain the multiple linear operators, wherein the linear operators include addition, subtraction, multiplication, division and power operations.

9. The method according to claim 7, characterized in that: The method further comprises: When receiving the ciphertext data, setting an initial value of a noise budget according to the ciphertext data, wherein the initial value of the noise budget is greater than zero, and the noise budget gradually decreases to zero during the process of processing the ciphertext data; When the noise budget is zero, determining processing results of some linear operators among the multiple linear operators as first intermediate ciphertext data; Sending the first intermediate ciphertext data to the client, and receiving second intermediate ciphertext data returned by the client, wherein the second intermediate ciphertext data is obtained by the client decrypting and re-encrypting the first intermediate ciphertext data according to the fully homomorphic encryption method; The noise budget is reset according to the second intermediate ciphertext data, and the second intermediate ciphertext data is continuously processed according to the remaining linear operators among the multiple linear operators except the partial linear operators to obtain the filtered ciphertext.

10. An image filtering system, characterized in that: The system comprises: The client is used to determine a fully homomorphic encryption method according to the original image, and encrypt the original image according to the fully homomorphic encryption method to obtain ciphertext data; send the ciphertext data to the server, and receive the filtered ciphertext returned by the server; decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image; The server is used to receive the ciphertext data sent by the client; decompose the filter algorithm corresponding to the image filtering function into multiple linear operators; process the ciphertext data according to the fully homomorphic encryption method and the multiple linear operators to obtain the filtered ciphertext; and send the filtered ciphertext to the client.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program executes the method described in any one of claims 1 to 9 when executed by a processor.

12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 9.