A privacy-protected image data secure storage and secure modification method and device

Through homomorphic encryption and secret sharing technology, encrypted images are generated and distributed on multi-cloud storage servers, which solves the problems of unavailability of ciphertext image data and high complexity of encryption calculations, realizes the secure storage and modification of image data, and improves the security and efficiency of cloud storage.

CN118536157BActive Publication Date: 2025-09-30SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410613660.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-09-30
Estimated Expiration
2044-05-17

AI Technical Summary

Technical Problem

Existing privacy-preserving image data cloud storage and cloud computing solutions have problems such as unavailability of ciphertext image data, leakage of image privacy information, and high complexity of encryption calculations, making it difficult to strike a balance between security and efficiency.

Method used

Homomorphic encryption technology is used to generate encrypted images, and combined with secret sharing technology, the ciphertext images are stored on multiple cloud storage servers. The key images generated by the encryption operation are modified and previewed locally, and overflow detection and processing are performed during decryption.

Benefits of technology

It achieves the availability and security of encrypted image data, reduces the complexity of encryption calculations, avoids privacy leaks caused by single point failures, and supports viewing and modifying images on cloud servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536157B_ABST
    Figure CN118536157B_ABST
Patent Text Reader

Abstract

The present invention relates to the fields of cloud services and cloud computing, and is a method and device for securely storing and modifying privacy-protected image data. The method comprises the following steps: initializing encryption parameters on a local client device; initializing a cloud storage service to obtain a cloud storage password; performing an encryption operation on the original image according to the encryption parameters and the number of cloud storage servers to obtain a ciphertext image and a key image; uploading the ciphertext image to the cloud storage server; performing a brightness modification operation on each pixel of the key image in a ciphertext state; downloading the ciphertext image from the cloud storage server, and performing a decryption operation on the downloaded ciphertext image and the key image on the user device according to the encryption parameters to obtain a decrypted image. By combining a secret sharing technique, the present invention enables encrypted image data to still support calculation and modification, thereby resolving the issues of unavailability of ciphertext image data, leakage of image privacy information, loss of image quality due to encryption operations, and high encryption computational complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of cloud services and cloud computing, and in particular to a method and device for securely storing and securely modifying image data with privacy protection. Background Art

[0002] With the development and promotion of cloud storage and cloud computing technologies, more and more people are uploading images to the cloud and enjoying the convenience of cloud services. However, cloud storage relies on the Internet to connect users with third-party cloud storage providers. This means that user-stored data can be directly viewed or even deleted by the service providers, posing significant data security risks. This poses privacy compliance challenges for enterprises as they strive to effectively protect the private information of individual data users.

[0003] Currently, existing solutions for privacy-preserving image data cloud storage and cloud computing suffer from the following issues: ciphertext image data is unavailable, leaking private image information, encryption operations degrade image quality, and encryption computational complexity is high, making it difficult to implement in practice. Currently, no effective solution can simultaneously address these issues.

[0004] Homomorphic encryption is a class of encryption methods with a unique natural property: the decrypted result of homomorphically encrypted data is consistent with the result of processing the original, unencrypted data using the same method. Homomorphic encryption not only provides security but also, to a certain extent, guarantees the availability of secret data. Secret sharing is a cryptographic technique that divides and stores secrets to prevent their over-centralization, thereby distributing risk and tolerating intrusions. It is a key tool in information security and data confidentiality. Currently, combining homomorphic encryption and secret sharing with image cloud storage is a highly exploratory and challenging new approach that balances image data security and availability. Therefore, to address the challenges of existing technologies and solutions, there is an urgent need for a privacy-preserving method for secure storage and modification of image data that balances security and efficiency while maintaining the inherent availability of cloud storage. Summary of the Invention

[0005] In order to solve the technical problems existing in the prior art, the present invention provides a privacy-protected image data secure storage and secure modification method and device. By adopting a secret image generated by an encryption operation with homomorphic encryption characteristics, the secret image data can still support calculation and modification, which can solve the problems of unavailability of ciphertext image data and leakage of image privacy information; by combining secret sharing technology, the problems of encryption operation loss of image quality and high complexity of encryption calculation are solved.

[0006] The purpose of the present invention can be achieved by taking the following technical solutions:

[0007] A privacy-protected image data secure storage and secure modification method comprises the following steps:

[0008] S1. Initialize encryption parameters on the local client device, including the random number used for encryption, the resolution of the key image, and the threshold for overflow detection during decryption;

[0009] S2. Initialize n cloud storage services to obtain n cloud storage passwords, where n is greater than or equal to 2;

[0010] S3. After selecting the original image, the local client device issues a start encryption instruction. The original image is encrypted according to the encryption parameters and the number n of cloud storage servers, obtaining n ciphertext images and a key image generated during the encryption process. The key image is stored in the local client device.

[0011] S4. Log in to the cloud server using the initialized cloud storage password and upload n encrypted images to n cloud storage servers respectively;

[0012] S5. For each pixel of the key image, modify the brightness in the ciphertext state;

[0013] S6. Download the ciphertext image from the cloud storage server, and perform a decryption operation on the downloaded ciphertext image and the key image on the user device according to the encryption parameters to obtain a decrypted image.

[0014] Specifically, the cloud storage password is formalized as:

[0015] token={node,fileDir,id,key,…}

[0016] Among them, token represents the cloud storage login password, node represents the cloud storage service node, fileDir represents the target folder on the cloud storage, id represents the cloud storage login account, key represents the cloud storage login key, ... represents other necessary information for logging into the cloud storage service.

[0017] Specifically, step S3 includes:

[0018] Generate a key image based on the resolution of the original image and the encryption parameter key image;

[0019] A random number is selected, and then based on the random number and the key image, an encryption operation is performed on each pixel of the original image Img to be encrypted to generate a ciphertext image.

[0020] Specifically, the execution of the encryption operation for each pixel of the original image Img to be encrypted is formally expressed as:

[0021]

[0022] Among them, pixel0 represents a pixel in the original image Img, pixel1 and pixel2 represent the corresponding pixels in the two ciphertext images respectively, and Rnd(256) represents a randomly generated integer in the range [0,255]. represents the key image generated during the encryption process, and π represents the encryption operation performed on each pixel of the two ciphertext images. π is formally represented as:

[0023]

[0024] in, Indicates that the following operations are performed on all channels of the original image Img. Channel0 represents a channel of a pixel in the original image Img. Channel key , channel1 and channel2 represent the key images Cipher image and The corresponding channel of the pixel at the corresponding position, r represents the generated random number.

[0025] Specifically, the execution of the brightness modification operation in the ciphertext state is formally expressed as:

[0026] pixel←pixel+brightness

[0027] ifpixel<0thenpixel=0

[0028] else if pixel>255then pixel=255

[0029] Among them, pixel refers to the key image For a pixel, brightness refers to the brightness that needs to be increased.

[0030] Specifically, step S6 includes the following steps:

[0031] Perform decryption on the ciphertext image, calculate each pixel of the original image Img, and obtain the decrypted original image;

[0032] Overflow pixels are detected and processed on the decrypted original image. When the absolute value of the difference between a certain channel of a certain pixel of the decrypted original image and the corresponding channel of the pixel at the corresponding position in the ciphertext image is greater than the overflow detection threshold during decryption, the corresponding brightness of the decrypted original image is modified according to the ciphertext image. Otherwise, the corresponding brightness of the decrypted original image is not modified according to the ciphertext image, and the brightness of the decrypted original image is maintained.

[0033] Specifically, the decryption operation is performed on the ciphertext image, each pixel of the original image Img is calculated, and the decrypted original image is obtained, including: calculating each pixel value of the three channels R, G, and B of the original image according to n ciphertext images and the key image.

[0034] A computer device comprises a processor and a memory for storing a program executable by the processor, wherein when the processor executes the program stored in the memory, the method for secure storage and secure modification of image data with privacy protection as claimed in claim 1 is implemented.

[0035] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0036] The present invention provides a privacy-protected image data security storage and security modification method. By combining secret sharing and homomorphic encryption theory to design encryption operations, it solves the problems of unavailability of ciphertext image data and high complexity of encryption calculations that make it difficult to put into practical application. It can realize encrypted storage of images with extremely small storage overhead and extremely high efficiency. At the same time, in order to facilitate users to view stored images on cloud servers, the project innovatively proposes that encrypted images are still in standard image formats, and realizes the calculation of encrypted image thumbnails without modifying any configuration of the cloud server. In addition, in order to further ensure the privacy security of images, a distributed image cloud storage architecture based on multiple servers is proposed, and the ciphertext images generated by image data encryption operations are stored on multiple servers respectively, breaking through the limitation of single point failure of a single cloud server, and any server can come from different cloud service providers, which minimizes the problem of privacy leakage. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0038] Figure 1 This is a flowchart of steps of a privacy-protected image data secure storage and secure modification method according to an embodiment of the present invention;

[0039] Figure 2 The present invention is a schematic diagram of an application process of a privacy-protected image data secure storage and secure modification method in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is obvious that the embodiments described are only some embodiments of the present invention, not all embodiments, and the implementation of the present invention is not limited to these. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0041] Example 1:

[0042] This method involves entities such as user client devices and multiple distributed cloud storage servers. Taking cloud storage based on a dual-server architecture as an example, the present invention provides a privacy-protected image data security storage and security modification method based on a privacy-protected image cloud storage system, which includes a client device for encrypting images and multiple distributed image cloud storage servers. Among them, the client device is responsible for interacting with the user, encrypting image data and uploading it to the cloud storage server respectively, and the cloud storage server is used to provide image storage services and other image-based related operations. The client device is responsible for encrypting and uploading the image, and multiple distributed cloud storage servers collaborate on storage and calculation, together forming a privacy-protected image data security storage system. Utilizing homomorphic encryption and secret sharing technology, secure and efficient secret distribution and storage of image information is achieved.

[0043] like Figure 1 and Figure 2 As shown, the privacy-protected image data secure storage and secure modification method of the present invention specifically includes the following steps:

[0044] S1. Initialize encryption parameters on the local client device. The encryption parameters include the random number seed used for encryption, the resolution size of the key image, and the threshold for overflow detection during decryption.

[0045] The user initializes encryption parameters on the local client device:

[0046] parm={Rnd,SecParm,threshold};

[0047] Among them, Rnd represents the random number used for encryption. Here, 0 is used as the random number. SecParm represents the resolution size of the key image, which is the parameter to be encrypted and is used to control the clarity of the user preview image. Threshold represents the overflow threshold during decryption, which is used to determine whether overflow occurs during modification and execute the overflow recovery strategy.

[0048] S2. Initialize the cloud storage password. Initialize n cloud storage services to obtain n cloud storage passwords, where n is greater than or equal to 2.

[0049] Among them, cloud storage passwords can be used to implement identity authentication, access control, secure transmission and other functions. In the system, cloud storage passwords are needed to implement functions such as logging into the cloud server and uploading and downloading pictures.

[0050] The cloud storage password is in the form of:

[0051] token={node,fileDir,id,key,…}

[0052] Among them, token represents the cloud storage login password, node represents the cloud storage service node, fileDir represents the target folder on the cloud storage, id represents the cloud storage login account, Key represents the cloud storage login key, ... represents other necessary information for logging into the cloud storage service.

[0053] In this step, users must initialize at least two cloud storage services and obtain at least two cloud storage passwords, token 1 and token 2. Users can initialize as many cloud storage services as needed, distributed across different regions or cloud storage service providers. This invention can tolerate the leakage of information from up to n-1 of n cloud storage servers without leaking any original image information.

[0054] Each server in the multi-cloud server storage system based on a distributed architecture holds only one copy of the original image information secret. Among n cloud storage servers, even if any n-1 copies of the original image information secret are leaked, no original image information will be leaked.

[0055] The user initializes two cloud storage tokens, token1 and token2, on the local client device. Token1 = {"iCloud"," / encryptedImage / ","liuks@icloud.com","passwd1"}, and token2 = {"DropBox"," / encryptedImage / ","liuks@outlook.com","passwd2"}.

[0056] S3. Execute the encryption operation. After selecting the original image through the local client device, issue a start encryption instruction. Perform the encryption operation on the original image according to the encryption parameters and the number n of cloud storage servers to obtain n ciphertext images and the key image generated during the encryption process.

[0057] After receiving the user's start instruction, the encryption operation is performed according to the encryption parameters and the number of cloud storage servers. The start instruction refers to the instruction sent by the user to the system to start the encryption operation. The user selects the picture on the local client device and clicks the APP application to issue the start encryption instruction. After receiving the user's start instruction, the encryption operation is performed according to the encryption parameters and the number of cloud storage servers. Figure 1 As shown, after the encryption operation is completed, two ciphertext images are returned to obtain two ciphertext images. and And the key image generated during the encryption process The key image will be saved locally on the client device.

[0058] The encryption operation is based on secret sharing and has the characteristics of additive homomorphism. The encryption process based on dual cloud storage is formally expressed as follows:

[0059]

[0060] in, and Respectively represent the two encrypted ciphertext images, Represents the key image generated during the encryption process. Enc(Img,parm) means calling the encryption operation Enc to encrypt Img using the encryption parameter parm.

[0061] Among them, the encryption operation Enc refers to the encryption operation of the image. After the original image Img is encrypted, two ciphertext images will be obtained. Specifically, the encryption operation is based on the principle of secret sharing. First, the key image is generated according to the parm parameter. And select a random number Rnd, and then based on the random number Rnd and the key image Calculate each pixel value of the three channels R, G, and B of the two ciphertext images respectively to obtain two ciphertext images.

[0062] Step 3.1, generate a key image, generate a key image based on the original image Img and the key image of the encryption parameter The original image Img is uploaded by the user through a client device.

[0063] Specifically, the process of generating the key image is as follows: using the summing and averaging method, all pixels of the original image are divided into blocks of the SecParm resolution size, and the average value of the pixel values ​​in each block is calculated and set as The pixel value of the corresponding position,the key image is saved in the local client device.

[0064] Step 3.2: Select a random number Rnd, and then perform an encryption operation on each pixel of the original image Img to be encrypted based on the random number Rnd and the key image to generate a ciphertext image.

[0065] The execution of the encryption operation for each pixel of the original image Img to be encrypted is formally expressed as:

[0066]

[0067] Among them, pixel0 represents a pixel in the original image Img, pixel1 and pixel2 represent the corresponding pixels in the two ciphertext images respectively, and Rnd(256) represents a randomly generated integer in the range [0,255]. represents the key image generated during the encryption process, and π represents the encryption operation performed on each pixel of the two ciphertext images. π is formally represented as:

[0068]

[0069] in, Indicates that the following operations are performed on all channels of the original image Img. Channel0 represents a channel of a pixel in the original image Img (any one of the red, green, blue or transparency channels). key , channel1 and channel2 represent the key image Cipher image and The corresponding channel of the pixel at the corresponding position, r represents the random number generated above.

[0070] After the encryption process is complete, two ciphertext images and a key image are returned. The key image is saved locally on the user's device for preview, image editing, and decryption. The original image's encryption result and key remain in standard image format, and image-related operations, such as adjusting contrast, are still supported. The pixels in the original image correspond one-to-one with those in the ciphertext image. Damaging or cropping some pixels in the ciphertext image does not affect the lossless decryption of the remaining pixels.

[0071] S4. Upload to cloud storage. Use the initialized cloud storage password to log in to the cloud server and upload the n ciphertext images generated by the encryption operation to n cloud storage servers respectively.

[0072] After the encryption operation is completed, the system uploads the ciphertext images generated by the encryption operation to the cloud storage server and uses the cloud storage login password initialized in step 2. The upload steps based on the dual cloud storage architecture are formally expressed as follows:

[0073]

[0074] Among them, cloud(token) means using token to log in to cloud service. Indicates uploading the encrypted image to the cloud service.

[0075] After the encryption operation is completed, the cloud storage password initialized in step 2 will be used to log in to the cloud server and the two ciphertext images generated by the encryption operation will be uploaded to the cloud storage server. At this point, the entire process of initialization, encryption, and upload is completed.

[0076] S5. For each pixel of the key image, a brightness modification operation is performed in the ciphertext state, thereby achieving a brightness modification operation on the encrypted image.

[0077] The execution of the brightness modification operation in the ciphertext state is formally expressed as:

[0078] pixel←pixel+brightness;

[0079] if pixel<0then pixel=0;

[0080] else if pixel>255then pixel=255;

[0081] Among them, pixel refers to the key image A pixel, brightness refers to the brightness that needs to be increased. Specifically, the user selects the brightness that needs to be increased, and then Add brightness to each pixel. If pixel < 0, set pixel = 0; if pixel > 255, set pixel = 255.

[0082] After modifying the key image, the user can immediately preview the effect. During the decryption process, the modified image is automatically applied to the original image. Users can modify the image's brightness offline without interacting with the cloud server. By adjusting the brightness of the key image generated in step S3, the brightness adjustment is completed in the encrypted state. During the subsequent decryption process, the brightness adjustment is automatically applied to the original image.

[0083] S6. Execute a decryption operation, download the ciphertext image from the cloud storage server, and perform a decryption operation on the downloaded ciphertext image and the key image on the user device according to the encryption parameters to obtain a decrypted image.

[0084] Based on the principle of secret sharing, after downloading the encrypted image from the cloud, the decryption operation is performed according to the encryption parameters:

[0085]

[0086] in, and Respectively represent the two encrypted ciphertext images, Represents the key image generated during the encryption process, and Dnc(Img,parm) indicates calling the decryption operation Dec to decrypt Img using the encryption parameter parm.

[0087] The decryption operation Dec refers to the decryption operation of the image, performing the decryption operation on the two ciphertext images, and obtaining the original image after overflow detection and processing.

[0088] S6.1. Perform a decryption operation on the ciphertext image, calculate each pixel of the original image Img, and obtain the decrypted original image.

[0089] Specifically, the encryption operation is based on the principle of secret sharing. First, according to n ciphertext images and key images Calculate the value of each pixel of the R, G, and B channels of the original image.

[0090] The execution of the decryption operation is formally represented as:

[0091]

[0092] Among them, pixel0 represents a pixel in the original image Img, pixel1 and pixel2 represent the corresponding pixels in the two ciphertext images respectively. represents the key image generated during the encryption process, and Υ represents the decryption operation performed on each pixel of the two ciphertext images. Υ is formally expressed as:

[0093]

[0094] in, Indicates that the following operations are performed on all channels of the original image Img. Channel0 represents a channel of a pixel in the original image Img (any one of the red, green, blue or transparency channels). key , channel1 and channel2 represent the key image Cipher image and The corresponding channel of the pixel at the corresponding position, the maximum value of an R, G, or B channel is 255.

[0095] S6.2. Detect and process overflow pixels in the decrypted original image. When the absolute value of the difference between a certain channel of a pixel in the decrypted original image and the corresponding channel of a pixel at the corresponding position in the ciphertext image exceeds the overflow detection threshold during decryption, modify the brightness of the decrypted original image based on the ciphertext image. Otherwise, do not modify the brightness of the decrypted original image based on the ciphertext image, and maintain the brightness of the decrypted original image. This is because after performing the brightness modification operation on the ciphertext image, the decrypted image may experience overflow, which requires detection and processing.

[0096] The execution form of detecting and processing overflow pixels of the decrypted original image is as follows:

[0097]

[0098] then channel0=channel key ;

[0099] in, Indicates that the following operations are performed on all channels of the original image Img. Channel0 represents a channel (any of the red, green, blue or transparency channels) of a pixel in the original image Img. key Represents a key image The corresponding channel of the pixel at the corresponding position. param.threshold represents the threshold for overflow detection in the encryption parameter.

[0100] In this example, param.threshold is set to 200. When the absolute value of the difference between a certain channel of a certain pixel in the decrypted original image and the corresponding channel of the pixel at the corresponding position in the ciphertext image is greater than 200, overflow is determined to have occurred, and the corresponding brightness of the decrypted original image is modified according to the ciphertext image. When the absolute value of the difference between a certain channel of a certain pixel in the decrypted original image and the corresponding channel of the pixel at the corresponding position in the ciphertext image is less than or equal to 200, the corresponding brightness of the decrypted original image is not modified according to the ciphertext image, and the brightness of the decrypted original image is maintained.

[0101] After downloading the encrypted image from the cloud, the decryption algorithm is executed on the downloaded encrypted image and the key image on the user's device based on the encryption parameters. The brightness adjustment made in step S5 is automatically applied to the original image. To address overflow issues caused by the ciphertext brightness adjustment, overflow detection and processing are performed based on the encryption parameters initialized in step 1 to complete the image decryption operation.

[0102] This invention provides a privacy-preserving method for secure storage and modification of image data. By combining secret sharing and homomorphic encryption theory to design encryption operations, it addresses the issues of unavailability of ciphertext image data and the high complexity of encryption computations, which hinder practical application. This method enables encrypted image storage with minimal storage overhead and high efficiency. Furthermore, to facilitate user access to stored images on cloud servers, the project innovatively proposes that encrypted images remain in a standard image format, enabling the calculation of encrypted image thumbnails without modifying any cloud server configuration. Furthermore, to further ensure image privacy, the project innovatively proposes a multi-server distributed image cloud storage architecture. Ciphertext images generated through image data encryption operations are stored on multiple servers, overcoming the single point of failure limitations of a single cloud server. Furthermore, any server can be from a different cloud service provider, minimizing privacy leaks. In summary, this proposed method for secure storage and modification of privacy-preserving image data effectively overcomes the shortcomings of existing methods while improving the practicality of existing systems, offering broad application prospects.

[0103] Example 2:

[0104] This embodiment provides a computer device, which may be a server, a computer, or the like, and includes a processor, a memory, an input device, a display, and a network interface connected via a system bus. The processor is configured to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the processor executes the computer program stored in the memory, a privacy-protected image data secure storage and secure modification method according to the first embodiment is implemented as follows:

[0105] S1. Initialize encryption parameters on the local client device, including the random number used for encryption, the resolution of the key image, and the threshold for overflow detection during decryption;

[0106] S2. Initialize n cloud storage services to obtain n cloud storage passwords, where n is greater than or equal to 2;

[0107] S3. After selecting the original image, the local client device issues a start encryption instruction. The original image is encrypted according to the encryption parameters and the number n of cloud storage servers, obtaining n ciphertext images and a key image generated during the encryption process. The key image is stored in the local client device.

[0108] S4. Log in to the cloud server using the initialized cloud storage password and upload n encrypted images to n cloud storage servers respectively;

[0109] S5. For each pixel of the key image, modify the brightness in the ciphertext state;

[0110] S6. Download the ciphertext image from the cloud storage server, and perform a decryption operation on the downloaded ciphertext image and the key image on the user device according to the encryption parameters to obtain a decrypted image.

[0111] Specifically, the cloud storage password is formalized as:

[0112] token={node,fileDir,id,key,…}

[0113] Among them, token represents the cloud storage login password, node represents the cloud storage service node, fileDir represents the target folder on the cloud storage, id represents the cloud storage login account, key represents the cloud storage login key, ... represents other necessary information for logging into the cloud storage service.

[0114] Specifically, step S3 includes:

[0115] Generate a key image based on the resolution of the original image and the encryption parameter key image;

[0116] A random number is selected, and an encryption operation is performed on each pixel of the original image to be encrypted based on the random number and the key image to generate a ciphertext image.

[0117] Specifically, the execution of the encryption operation for each pixel of the original image Img to be encrypted is formally expressed as:

[0118]

[0119] Among them, pixel0 represents a pixel in the original image Img, pixel1 and pixel2 represent the corresponding pixels in the two ciphertext images respectively, and Rnd(256) represents a randomly generated integer in the range [0,255]. represents the key image generated during the encryption process, and π represents the encryption operation performed on each pixel of the two ciphertext images. π is formally represented as:

[0120]

[0121] in, Indicates that the following operations are performed on all channels of the original image Img. Channel0 represents a channel of a pixel in the original image Img. Channel key , channel1 and channel2 represent the key images Cipher image and The corresponding channel of the pixel at the corresponding position, r represents the generated random number.

[0122] Specifically, step S6 includes the following steps:

[0123] Perform decryption on the ciphertext image, calculate each pixel of the original image Img, and obtain the decrypted original image;

[0124] Overflow pixels are detected and processed on the decrypted original image. When the absolute value of the difference between a certain channel of a certain pixel of the decrypted original image and the corresponding channel of the pixel at the corresponding position in the ciphertext image is greater than the overflow detection threshold during decryption, the corresponding brightness of the decrypted original image is modified according to the ciphertext image. Otherwise, the corresponding brightness of the decrypted original image is not modified according to the ciphertext image, and the brightness of the decrypted original image is maintained.

[0125] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A privacy-protected image data secure storage and secure modification method, characterized by: The following steps are involved: S1. Initialize encryption parameters on the local client device, including the random number used for encryption, the resolution of the key image, and the threshold for overflow detection during decryption; S2. Initialize n cloud storage services to obtain n cloud storage passwords, where n is greater than or equal to 2; S3. After selecting the original image, the local client device issues a start encryption instruction. The original image is encrypted according to the encryption parameters and the number n of cloud storage servers, obtaining n ciphertext images and a key image generated during the encryption process. The key image is stored in the local client device. The step S3 comprises: Generate a key image based on the resolution of the original image and the encryption parameter key image; Select a random number, and then based on the random number and the key image, perform an encryption operation on each pixel of the original image Img to generate a ciphertext image; The execution of the encryption operation for each pixel of the original image Img to be encrypted is formally expressed as: {pixel1, pixel2}⟵Π(pixel0, Rnd (256), ⟦imgKey⟧); Where pixel0 represents a pixel in the original image Img, pixel1 and pixel2 represent the corresponding pixels in the two ciphertext images respectively, Rnd(256) represents a randomly generated integer in the range [0, 255], ⟦imgKey⟧ represents the key image generated during the encryption process, and Π represents the encryption operation performed on each pixel of the two ciphertext images; π is formally expressed as: ; Among them, ∀channel means that the following operations are performed on all channels of the original image Img, channel0 represents a channel of a pixel in the original image Img, key , channel1 and channel2 represent the corresponding channels of the pixels at the corresponding positions of the key image ⟦imgKey⟧, the ciphertext images ⟦eImg1⟧ and ⟦eImg2⟧, respectively, and r represents the random number generated by Rnd(256); S4. Log in to the cloud server using the initialized cloud storage password and upload n encrypted images to n cloud storage servers respectively; S5. For each pixel of the key image, modify the brightness in the ciphertext state; The execution of the brightness modification operation in the ciphertext state is formally expressed as: pixel ⟵ pixel + brightness; Where pixel refers to a pixel in the key image ⟦imgKey⟧, and brightness refers to the brightness to be increased. Select the brightness to be increased and add the brightness to each pixel in the key image ⟦imgKey⟧. If pixel < 0, set pixel = 0; if pixel > 255, set pixel = 255. S6. Download the ciphertext image from the cloud storage server, and perform a decryption operation on the downloaded ciphertext image and the key image on the user device according to the encryption parameters to obtain a decrypted image.

2. The privacy-protected image data secure storage and secure modification method according to claim 1, characterized in that: The cloud storage password is formalized as follows: Token = {node, fileDir, id, key,…}; Among them, Token represents the cloud storage login password, node represents the cloud storage service node, fileDir represents the target folder on the cloud storage, id represents the cloud storage login account, key represents the cloud storage login key, ... represents other necessary information for logging into the cloud storage service.

3. The privacy-protected image data secure storage and secure modification method according to claim 1, characterized in that: The step S6 comprises the steps of: Perform decryption on the ciphertext image, calculate each pixel of the original image, and obtain the decrypted original image; Overflow pixels are detected and processed on the decrypted original image. When the absolute value of the difference between a certain channel of a certain pixel of the decrypted original image and the corresponding channel of the pixel at the corresponding position in the ciphertext image is greater than the overflow detection threshold during decryption, the corresponding brightness of the decrypted original image is modified according to the ciphertext image. Otherwise, the corresponding brightness of the decrypted original image is not modified according to the ciphertext image, and the brightness of the decrypted original image is maintained.

4. The privacy-protected image data secure storage and secure modification method according to claim 3, characterized in that: The decryption operation is performed on the ciphertext image, and each pixel of the original image is calculated to obtain the decrypted original image, including: calculating each pixel value of the three R, G, and B channels of the original image according to n ciphertext images and the key image.

5. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the method for secure storage and secure modification of privacy-protected image data as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Picture encryption method, terminal and computer readable storage medium

    CN106993198A

  • Plaintext correlation-based full-connection-like network image encryption method

    CN112887075A