Image filtering methods and apparatus
Image data is encrypted and decrypted through fully homomorphic encryption technology, and the image filtering algorithm is decomposed in a ciphertext environment, solving the problem of privacy and security risks in the image filtering process and realizing the security of data transmission, storage and computing.
Patent Information
- Application Number
- PCT/CN2024/099942
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-25
- Filing Date
- 2024-06-18
- Publication Date
- 2025-01-02
AI Technical Summary
During image filtering, users' privacy and security are threatened because image data may be leaked during transmission, storage and calculation, especially when it contains iconic information such as portraits or residences.
The image data is encrypted and decrypted using all-homomorphic encryption technology. By decomposing the image filtering algorithm into multiple linear operators for processing in a ciphertext environment, the security of the data during transmission and storage is ensured.
It realizes that on the premise of satisfying the image filtering function, effectively protects the privacy and security of user data, prevents sensitive data leakage, and solves the privacy and security hidden dangers in image filtering processing.
Smart Images

Figure CN2024099942_02012025_PF_FP_ABST
Abstract
Description
Image filtering method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure is based on Chinese patent application CN202310754572.8, filed on June 25, 2023, entitled “A Method and Device for Image Filtering”, and claims the priority of the patent application, all the contents disclosed therein are incorporated into this disclosure by reference. Technical Field
[0003] The present disclosure relates to the field of image processing, and in particular to an image filtering method and device. Background Art
[0004] With the increasing popularity and rapid growth of 5G networks, user demand for image and video data is increasing exponentially. Large-scale image data processing is placing a significant strain on computing power. In recent years, with the development of cloud computing technology and the construction of cloud computing platforms and computing networks, remotely accessing the computing power of the cloud to process image data holds enormous potential.
[0005] Image filtering, as an image processing technique, uses filters to perform grayscale, rotation, blur, and sharpening on images. It has a wide range of applications and user needs. Currently, cloud-based image filtering requires users to transmit and store image data in plaintext on the cloud. Computation on image data in the cloud is also performed in plaintext, potentially leading to data leaks during transmission, storage, and computation. During the image filtering process, if the original image contains iconic information such as portraits or residences, any data leak poses a significant risk to user privacy.
[0006] 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.
[0007] Summary of the Invention
[0008] The embodiments of the present disclosure provide an image filtering method and apparatus to at least address the problem of potential privacy and security risks in image filtering processing in related technologies.
[0009] According to one embodiment of the present disclosure, an image filtering method is provided, which is applied to a client, and the method includes: determining a fully homomorphic encryption method based on an original image, and encrypting the original image according to the fully homomorphic encryption method to obtain ciphertext data; sending the ciphertext data to a server, and receiving a filtered ciphertext returned by the server, wherein the filtered ciphertext is obtained by the server decomposing a 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; decrypting the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image.
[0010] According to another embodiment of the present disclosure, an image filtering method is provided, which is applied to a server, and 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 based on an original image and encrypting the original image according to the fully homomorphic encryption method; decomposing a 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; sending the filtered ciphertext 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.
[0011] According to another embodiment of the present disclosure, an image filtering system is provided, which includes: a client, 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; sending the ciphertext data to a server, and receiving a filtered ciphertext returned by the server; decrypting the filtered ciphertext according to the fully homomorphic encryption method to obtain a filtered target image; a server, used to receive the ciphertext data sent by the client; decomposing a filter algorithm corresponding to an image filtering function into multiple linear operators; processing the ciphertext data according to the fully homomorphic encryption method and multiple linear operators to obtain a filtered ciphertext; and sending the filtered ciphertext to the client.
[0012] According to another embodiment of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above method embodiments are executed.
[0013] According to another embodiment of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] FIG1 is a block diagram of the hardware structure of the image filtering method according to an embodiment of the present disclosure;
[0015] FIG2 is a flow chart of an image filtering method of a client according to an embodiment of the present disclosure;
[0016] FIG3 is a flow chart of an image filtering method at a server according to an embodiment of the present disclosure;
[0017] FIG4 is a flowchart of an image filtering service based on fully homomorphic encryption according to an embodiment of the present disclosure;
[0018] FIG5 is a schematic diagram of the structure of an image filtering service based on fully homomorphic encryption according to an embodiment of the present disclosure;
[0019] FIG6 is a schematic diagram of an image filtering system based on fully homomorphic encryption according to an embodiment of the present disclosure;
[0020] FIG7 is a schematic diagram of an image filtering device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0023] The method embodiments provided in the embodiments of the present disclosure can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, FIG1 is a hardware structure block diagram of the image filtering method of the embodiment of the present disclosure. As shown in FIG1 , the hardware board may include one or more (only one is shown in FIG1 ) processors 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 above-mentioned mobile terminal may also include a transmission device 16 and an input and output device 18 for communication functions. It can be understood by those skilled in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may also include more or fewer components than those shown in FIG1 , or have a configuration different from that shown in FIG1 .
[0024] 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 disclosure. The processor 12 executes various functional applications and image filtering methods by running the computer programs stored in the memory 14, that is, implements the above-mentioned method. 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 located 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.
[0025] The transmission device 16 is used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by a communications provider. In one embodiment, the transmission device 16 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 16 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0026] In one embodiment of the present disclosure, an image filtering method is provided, which is applied to a client. FIG2 is a flow chart of the image filtering method of the client according to an embodiment of the present disclosure. As shown in FIG2 , the process includes the following steps:
[0027] Step S202: determining a fully homomorphic encryption method based on the original image, and encrypting the original image according to the fully homomorphic encryption method to obtain ciphertext data;
[0028] Step S204: Send the encrypted data to the server and receive the filtered encrypted data returned by the server;
[0029] Step S206: decrypt the filtered ciphertext according to the fully homomorphic encryption method to obtain the filtered target image.
[0030] 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.
[0031] In the embodiment of the present disclosure, through steps S202 to S206, the image data can be fully homomorphic encrypted (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.
[0032] In an exemplary embodiment, step S202 may include the following steps:
[0033] Step S2022, converting the original image into feature text data;
[0034] Step S2024: determining the fully homomorphic encryption method according to the data type and data size of the characteristic text data;
[0035] Step S2026: Encrypt the characteristic text data according to the pre-generated key and the fully homomorphic encryption method to obtain the ciphertext data.
[0036] 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).
[0037] 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 cyclotomic 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.
[0038] In an exemplary embodiment, step S2024 may include one or more of the following situations:
[0039] 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;
[0040] 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, determining that the fully homomorphic encryption method is BFV-type fully homomorphic encryption;
[0041] 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.
[0042] Specifically, the preset value in case 1 can be set to 100K or a smaller value, which is not limited in the present disclosure.
[0043] In an exemplary embodiment, before step S2026, the method may further include the following steps:
[0044] 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.
[0045] Furthermore, the key generation method can be configured in the client's visual interface. Symmetric encryption only requires the generation of a private key, which is used for 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 disclosure does not restrict the key generation algorithm.
[0046] 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).
[0047] Furthermore, the key may be in the form of a random polynomial within a polynomial ring.
[0048] In an exemplary embodiment, step S206 may include the following steps:
[0049] Step S2062: decrypt the filtered ciphertext using the pre-generated key and the fully homomorphic encryption method to obtain filtered text data;
[0050] Step S2064: convert the filtered text data into the target image.
[0051] 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.
[0052] 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.
[0053] In an exemplary embodiment, the method further comprises the following steps:
[0054] Step S2052: Receive 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 under a noise budget of zero, an 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.
[0055] Step S2054: decrypt and re-encrypt the first intermediate ciphertext data according to the fully homomorphic encryption method to obtain second intermediate ciphertext data;
[0056] Step S2056: Send the second intermediate ciphertext data to the server so that the server resets the noise budget, wherein the server is configured to continue processing 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.
[0057] In this embodiment, steps S2052 through S2056 occur during the server-side filtering of the ciphertext data. The noise budget is consumed during operations on the ciphertext data using fully homomorphic encryption. Operations cease when the noise budget reaches zero. This disclosed embodiment allows for resetting the noise budget, ensuring the complete operation of the image filtering algorithm.
[0058] According to another embodiment of the present disclosure, an image filtering method is provided, which is applied to a server.
[0059] FIG3 is a flow chart of an image filtering method on a server side according to an embodiment of the present disclosure. As shown in FIG3 , the flow includes the following steps:
[0060] Step S302, receiving the encrypted data sent by the client;
[0061] Step S304, decomposing the filter algorithm corresponding to the image filtering function into multiple linear operators;
[0062] Step S306: Process the ciphertext data according to the fully homomorphic encryption method and multiple linear operators to obtain filtered ciphertext;
[0063] Step S308: Send the filtered ciphertext to the client.
[0064] 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 using the fully homomorphic encryption method. The client is also configured to decrypt the filtered ciphertext using the fully homomorphic encryption method after step S308 to obtain the filtered target image.
[0065] In the embodiment of the present disclosure, through steps S302 to S308, data transmission, storage and calculation in the entire image filtering processing process are realized 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.
[0066] In an exemplary embodiment, the image filtering function in step S304 may include but is not limited to grayscale, rotation, blur, sharpening and other filtering processes. The image filtering function may be displayed in the visual interface of the client, and the user may select one or more of the multiple filtering functions.
[0067] Furthermore, multiple filter algorithms can be used in combination, and the present disclosure does not limit the filter algorithm corresponding to each image filtering function.
[0068] In an exemplary embodiment, step S304 may include: decomposing the filter algorithm into linear operators and nonlinear operators, and expanding the nonlinear operators into polynomials composed of linear operators according to Taylor series to obtain the multiple linear operators, wherein the linear operators include addition operations, subtraction operations, multiplication operations, division operations, and power operations.
[0069] Furthermore, nonlinear operators can include exponential operations, logarithmic operations, trigonometric functions, and inverse trigonometric functions. Nonlinear operators can be approximately expanded into low-order polynomials through Taylor expansion, and low-order polynomials can be expressed as a combination of multiple addition, subtraction, multiplication, and division operations, thereby realizing the conversion of nonlinear operators into linear operators.
[0070] 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.
[0071] The fully homomorphic encryption in the disclosed embodiment is a finite-order fully homomorphic encryption. When executing the ciphertext operation in step S306, 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.
[0072] 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.
[0073] In an exemplary embodiment, the method may further include the following steps:
[0074] 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;
[0075] Step S3074: Send the first intermediate ciphertext data to the client, and receive 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;
[0076] 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 in the multiple linear operators except the partial linear operators to obtain the filtered ciphertext.
[0077] In the embodiment of the present disclosure, 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.
[0078] FIG4 is a flow chart of an image filtering service based on fully homomorphic encryption according to an embodiment of the present disclosure. As shown in FIG4 , the flow includes the following steps:
[0079] Step S401: The user enters the client platform and selects a filtering function in the image filtering service as needed;
[0080] Step S402: inputting the original image data for data pre-processing to convert the image information into text information;
[0081] Step S403: Determine a fully homomorphic encryption scheme and key, encrypt the text data, and send the ciphertext data to the cloud server;
[0082] Step S404: The cloud server executes the ciphertext image filtering algorithm based on the image filtering function and fully homomorphic encryption scheme selected by the user;
[0083] Step S4041: The noise budget is insufficient, and the current ciphertext data is sent to the client;
[0084] Step S4042: The client decrypts the ciphertext data using the key and then re-encrypts it, and sends the re-encrypted data to the server.
[0085] Step S405: The server executes the ciphertext image filtering algorithm and sends the filtered ciphertext to the client;
[0086] Step S406: The client uses the key to decrypt and obtain the filtered text information;
[0087] Step S407: image post-processing, converting the filtered text information into a filtered target image.
[0088] In an embodiment of the present disclosure, the image filtering service applies an image filtering method based on fully homomorphic encryption to an outsourced computing model between a client and a cloud server.
[0089] 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.
[0090] 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 on the ciphertext data according to multiple linear operators decomposed by the filtering algorithm to achieve filtering processing.
[0091] In one exemplary embodiment, a noise budget is used to determine the computational power of ciphertext data. Each newly encrypted ciphertext data has a certain amount of noise budget, which is consumed during the ciphertext operation. Once the noise budget is completely consumed, the ciphertext data can no longer be correctly decrypted.
[0092] Furthermore, the cloud server's filter algorithm requires managing the noise budget of the ciphertext space. If the noise budget reaches its upper limit (i.e., zero), the current ciphertext data is sent to the client, which decrypts and re-encrypts it to refresh the noise. The client then sends the refreshed ciphertext data to the cloud server to continue subsequent operations. After steps S4041 and S4042, the noise budget is fully utilized, and the server can continue to perform ciphertext operations.
[0093] FIG5 is a structural diagram of an image filtering service based on fully homomorphic encryption according to an embodiment of the present disclosure. As shown in FIG5 , the image filtering service is an outsourced computing mode between the client and the cloud server.
[0094] The client can provide the following services: image filtering function selection, data processing, fully homomorphic encryption and decryption, and data transmission.
[0095] The cloud server can provide the following services: fully homomorphic encryption computing filtering algorithm, data transmission.
[0096] In an exemplary embodiment, the image filtering functions include but are not limited to grayscale, blur, sharpen, and transparency. A user can select one or more of the various image filtering functions.
[0097] In an exemplary embodiment, data processing includes pre-processing and post-processing, wherein 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.
[0098] 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.
[0099] Furthermore, TFHE-type fully homomorphic encryption and decryption allows the computation of arbitrary Boolean circuits composed of binary gates on encrypted data without leaking any information about the original data, enabling extremely fast gate-by-gate bootstrapping. BFV-type fully homomorphic encryption and decryption is a fully homomorphic encryption scheme based on the difficulty of the Ring Learning with Error (RLWE) problem. Its key idea is to place the plaintext in the high-order bits of the ciphertext and remove noise in the low-order bits through integer division. BFV supports encryption and decryption of integer data. CKKS-type fully homomorphic encryption and decryption share similar ciphertext operation rules as the BFV scheme, but supports floating-point operations in the ciphertext space.
[0100] 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 embodiment.
[0101] In one exemplary embodiment, the cloud service can provide a filter algorithm corresponding to the image filtering function, decompose the filter algorithm into a linear filter and a nonlinear filter, and further decompose it into multiple linear operators, including "addition" and "multiplication". Furthermore, the actual operation process of the "addition" and "multiplication" operations corresponding to different fully homomorphic encryption methods may vary.
[0102] In an exemplary embodiment, an image filtering service may be provided to a user by performing the following steps:
[0103] Step S1: The user enters the client platform and selects a filtering function in the image filtering service as needed;
[0104] Step S2: inputting the original image data for data pre-processing to convert the image information into feature text information;
[0105] 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.
[0106] Step S4: The cloud server executes the ciphertext image filtering algorithm based on the image filtering function and fully homomorphic solution selected by the user, and packages the ciphertext image filtering results and sends them to the client;
[0107] In step S5, the client uses the key to decrypt and post-process the data, converting the decrypted text result into an image.
[0108] In the disclosed embodiments, a fully homomorphic encryption-based image filtering method provides an out-of-the-box image filtering service, reducing user operation complexity and improving the user experience. Image filtering operations can also be completed without leaking any data, leveraging the powerful computing power of cloud servers.
[0109] According to another embodiment of the present disclosure, an image filtering system is provided.
[0110] FIG6 is a schematic diagram of an image filtering system based on fully homomorphic encryption according to an embodiment of the present disclosure. As shown in FIG6 , the system includes a client and a cloud server.
[0111] The client can include the following structures:
[0112] Data processing module 61 , encryption and decryption module 62 , communication module 63 and data storage module 64 .
[0113] The cloud server can include the following structures:
[0114] Ciphertext operation module 65 , communication module 63 and data storage module 64 .
[0115] The data processing module 61 is used for converting between image data and text data.
[0116] The encryption and decryption module 62 is used for fully homomorphic encryption and decryption operations performed by client users.
[0117] The communication module 63 is used to send and receive ciphertext data stored in the form of polynomials.
[0118] 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.
[0119] The ciphertext operation module 65 is used by the cloud server to perform image filtering ciphertext operation on the data encrypted by the client.
[0120] In an exemplary embodiment, the data processing module 61 may include the following structure:
[0121] A pre-processing unit, configured to convert image data into text data, the text data being used as input to an encryption module;
[0122] The post-processing unit is used to convert text data into image data, where the text data is the output of the decryption module.
[0123] In an exemplary embodiment, the encryption / decryption module 62 may include the following structure:
[0124] The encryption unit performs three steps: key generation, encoding, and encryption. Depending on the selected encryption method, a random polynomial within the polynomial ring is generated as the key; encoding converts the original text data into a plaintext polynomial; encryption uses the public key (asymmetric encryption) or private key (symmetric encryption) to convert the plaintext polynomial into a ciphertext polynomial.
[0125] 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.
[0126] In an exemplary embodiment, the ciphertext operation module 65 may include the following structure:
[0127] An "addition" operation unit, configured 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;
[0128] A "multiplication" operation unit, configured 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;
[0129] 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.
[0130] In an exemplary embodiment, the communication module 63 may include the following structures:
[0131] A sending unit, configured for the client to send encrypted polynomial data to the cloud server or for the cloud server to send polynomial data of the image filtering ciphertext operation result to the client;
[0132] 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.
[0133] In the disclosed embodiments, fully homomorphic encryption, due to its "data available but invisible" nature, enables applications in cloud computing scenarios, such as cloud privacy computing. Users can use powerful but untrusted servers to complete arbitrary calculations and obtain results without leaking any data. The disclosed embodiments can also support customized processing for various image filtering tasks, including grayscale, rotation, blurring, and sharpening.
[0134] FIG7 is a schematic diagram of an image filtering device according to an embodiment of the present disclosure. As shown in FIG7 , the image filtering device can be divided into a client device 72 and a cloud server device 74 . The client device 72 and the cloud server device 74 can constitute an image filtering system.
[0135] 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.
[0136] In this embodiment, the client device 72 and the cloud server device 74 can communicate through a wired network or a wireless network.
[0137] 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 polynomial operations in the encryption and decryption modules and the ciphertext operation module.
[0138] In an exemplary embodiment, the client device 72 (i.e., the client) is used to determine a fully homomorphic encryption method based on 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.
[0139] 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.
[0140] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above method embodiments are executed.
[0141] 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.
[0142] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0143] 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.
[0144] 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 here.
[0145] Obviously, those skilled in the art should understand that the modules or steps of the present disclosure described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, 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 performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present disclosure is not limited to any particular combination of hardware and software.
[0146] The foregoing description is merely a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations of the present disclosure are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present disclosure shall be included within the scope of protection of the present disclosure.
Claims
1. An image filtering method, applied to a client, comprising: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, further comprising: 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, applied to a server, comprising: 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, wherein: 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, further comprising: 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, the system comprising: 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; A server, used for receiving the ciphertext data sent by the client; 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 the filtered ciphertext; and sending the filtered ciphertext to the client.
11. A computer-readable storage medium, wherein a computer program is stored in the storage medium, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is executed.
12. An electronic device comprising 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 perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Preserving image privacy when manipulated by cloud services
CN104040934A
Encryption domain image segmentation optimization method based on data packaging technology
CN112288757A
Method and circuit for processing encrypted data and related product
CN114168991A
Pre-processing model building system and pre-processing model building method for speech recognition function
KR1020240016032A
Personal identification method and system using homomorphically encrypted image
WO2023128345A1