Privacy-protected image data secure storage and secure modification method and device
Through homomorphic encryption and encryption secret sharing technology, the problem of unavailability of ciphertext and privacy leakage in image data cloud storage is solved, efficient and safe image data storage and modification is achieved, and the availability and privacy protection of cloud storage are ensured.
Patent Information
- Application Number
- CN202410613660.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-17
AI Technical Summary
The existing technology has problems such as unavailability of ciphertext image data and leakage of private image information in image data cloud storage. Moreover, the encryption operation causes loss of image quality and high computational complexity, making it difficult to put it into practical applications.
Homomorphic encryption technology is used to generate confidential images, combined with encryption secret sharing technology, to achieve the availability and security of confidential images. Encryption parameters and cloud storage passwords are initialized through local client devices to perform encryption and decryption operations to ensure the security of image data. Security and availability.
It achieves the availability and security of ciphertext image data, avoids the leakage of private image information, and reduces the complexity of encryption calculations. The encrypted images are still in a standard format, support image operations, break through the single point of failure limit, and avoid privacy leakage to the greatest extent.
Smart Images

Figure CN118536157A
Abstract
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] At present, with the development and promotion of cloud storage and cloud computing technologies, more and more people upload pictures to the cloud and enjoy the convenience brought by cloud services. However, cloud storage relies on the network to connect users with third-party cloud storage service providers. The data stored by users can be directly viewed or even deleted by the service provider, which poses a huge data security risk. In order to effectively protect the private information of data individuals, this brings privacy compliance challenges to enterprises.
[0003] At present, the existing solutions for privacy-preserving image data cloud storage and cloud computing have the following problems: ciphertext image data is unavailable, image privacy information is leaked, encryption operation loses image quality, and encryption calculation is too complex to be put into practical application. Currently, there is no effective solution that can solve the above problems at the same time.
[0004] Homomorphic encryption is a type of encryption method with special natural properties. The decrypted result of the homomorphically encrypted data is consistent with the result of the unencrypted original data processed by the same method. Homomorphic encryption is not only secure, but also guarantees the availability of secret data to a certain extent. Secret sharing is a cryptographic technology that stores secrets in a divided manner. The purpose is to prevent secrets from being too concentrated, so as to achieve the purpose of dispersing risks and tolerating intrusions. It is an important means in information security and data confidentiality. At present, combining homomorphic encryption technology and secret sharing with image cloud storage is a new direction with strong exploratory and theoretical and practical difficulties that takes into account both the security and availability of image data. Therefore, in view of the problems existing in existing technologies and solutions, it is urgent to provide a privacy-protected image data secure storage and secure modification method that takes into account both security and efficiency while retaining the availability of cloud storage itself. 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 with 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 adopting 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, where the encryption parameters include a random number used for encryption, a resolution size of a key image, and a 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 through the local client device, an encryption start instruction is issued, and the encryption operation is performed on the original image according to the encryption parameters and the number of cloud storage servers n, to obtain n ciphertext images and a key image generated during the encryption process, and the key image is stored in the local client device;
[0011] S4, using the initialized cloud storage password to log in to the cloud server, and upload n ciphertext 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 follows:
[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 according to the resolution size of the original image and the key image of the encryption parameter;
[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 of 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 of [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 expressed 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. key , channel1 and channel2 represent key images respectively 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 steps of:
[0031] Perform decryption operation on the ciphertext image, calculate each pixel of the original image Img, and obtain the decrypted original image;
[0032] The overflow pixels of the decrypted original image are detected and processed. 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 of the ciphertext image is greater than the threshold of the overflow detection 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, a privacy-protected image data secure storage and secure modification method 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 secure storage and secure modification method. By combining secret sharing and homomorphic encryption theory to design encryption operations, the problem of unavailability of ciphertext image data and high complexity of encryption calculations that make it difficult to put into practical application is solved. The encrypted storage of images can be achieved 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 the calculation of encrypted image thumbnails can be achieved 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 to minimize 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.
[0038] Figure 1 It is a schematic diagram of the steps of a privacy-protected image data secure storage and secure modification method in an embodiment of the present invention;
[0039] Figure 2 It is a schematic diagram of the 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 in conjunction with the accompanying drawings and embodiments. It is obvious that the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and the implementation of the present invention is not limited to this. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] Embodiment 1:
[0042] The method involves entities such as user client devices, multiple distributed architecture cloud storage servers, etc. Taking cloud storage based on a dual-server architecture as an example, the present invention provides a privacy-protected image data secure storage and secure modification method, which is based on a privacy-protected image cloud storage system, which includes a client device for encrypting pictures and multiple distributed picture cloud storage servers. Among them, the client device is responsible for interacting with the user, encrypting the picture data and uploading it to the cloud storage server respectively, and the cloud storage server is used to provide picture storage services and other picture-based related operations. The client device is responsible for encrypting and uploading the picture, and multiple distributed cloud storage servers collaborate in storage and calculation, together forming a privacy-protected image data secure storage system. Using homomorphic encryption and secret sharing technology, safe 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 described in 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 the encryption parameters on the local client device:
[0046] parm={Rnd,SecParm,threshold};
[0047] Among them, Rnd represents the random number used for encryption, where 0 is used as the random number. SecParm represents the resolution 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 threshold for judging overflow 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, the cloud storage password can be used to realize identity authentication, access control, secure transmission and other functions. In the system, the cloud storage password is needed to realize 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, the user needs to complete the initialization of at least two cloud storage services and obtain at least two cloud storage passwords, token1 and token2. The user can initialize as many cloud storage services as needed, distributed in different regions or cloud storage service providers. The present invention can allow the information of n-1 servers out of n cloud storage servers to be leaked at most without leaking any original image information.
[0054] Each server of the multi-cloud server storage system based on a distributed architecture holds only one copy of the original image information secret. Among the n cloud storage servers, even if any n-1 copies of the original image information secret are leaked, no original image information is leaked.
[0055] The user initializes two cloud storage passwords token1 and token2 on the local client device, where token1 = {"iCloud", " / encryptedImage / ", "liuks@icloud.com", "passwd1"}, token2 = {"DropBox", " / encryptedImage / ", "liuks@outlook.com", "passwd2"}.
[0056] S3, execute the encryption operation, select the original image through the local client device and 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, and 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 through 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:
[0059]
[0060] in, and They represent two encrypted ciphertext images respectively. 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] The encryption operation Enc refers to the encryption operation of the image. After the encryption operation is performed on the original image Img, 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 The pixel values of the three channels R, G, and B of the two ciphertext images are calculated respectively to obtain two ciphertext images.
[0062] Step 3.1, Generate a key image, based on the original image Img and the key image of the encryption parameter, generate a key image 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 addition 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 to The pixel value at the corresponding position, the key image is saved in the local client device.
[0064] Step 3.2: Select a random number Rnd, and then based on the random number Rnd and the key image, perform an encryption operation on each pixel of the original image Img to be encrypted 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 of 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 of [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 expressed 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 key images respectively 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 completed, two ciphertext images and a key image are returned. The key image will be saved in the user's local device for preview, photo editing, and decryption operations. The encryption calculation result and key of the original image are still in the standard image format, and related operations of the image are still supported, such as adjusting the contrast. The pixels of the original image correspond one-to-one with the pixels in the ciphertext image. If some pixels of the ciphertext image are damaged or cropped, it will 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 the 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 respectively. 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 realizing 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 the modification of the key image is completed, the user can preview the effect immediately. At the same time, during the decryption process, the image modification operation will be automatically applied to the original image. Users can modify the brightness of the image offline without interacting with the cloud server. By adjusting the brightness of the key image generated in step S3, the brightness adjustment in the ciphertext state is completed. In the subsequent decryption process, the brightness adjustment operation will be 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 images from the cloud, the decryption operation is performed according to the encryption parameters:
[0085]
[0086] in, and They represent two encrypted ciphertext images respectively. It represents the key image generated during the encryption process. Dnc(Img,parm) means calling the decryption operation Dec to decrypt Img using the encryption parameter parm.
[0087] The decryption operation Dec refers to performing a decryption operation on the image, performing a 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 in the three channels of R, G, and B 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 key images respectively 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 of 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 of the ciphertext image is greater than the threshold of overflow detection during decryption, modify the corresponding brightness of the decrypted original image according to the ciphertext image. Otherwise, do not modify the corresponding brightness of the decrypted original image according to the ciphertext image, and maintain the brightness of the decrypted original image. Because after the brightness modification operation is performed on the ciphertext image, the decrypted image may overflow, which needs to be detected and processed.
[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 of 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 of the decrypted original image and the corresponding channel of the pixel at the corresponding position of the ciphertext image is greater than 200, overflow is determined to occur, 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 of the decrypted original image and the corresponding channel of the pixel at the corresponding position of 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 the ciphertext image is downloaded from the cloud, the decryption algorithm is executed on the downloaded ciphertext image and the key image on the user's device according to the encryption parameters, and the brightness adjusted and modified in the above step S5 is automatically applied to the original image. In order to solve the overflow problem caused by the ciphertext brightness adjustment, the overflow detection and processing will be performed according to the encryption parameters initialized in step 1 to complete the image decryption operation.
[0102] The present invention provides a privacy-protected image data secure storage and secure modification method. By combining secret sharing and homomorphic encryption theory to design encryption operations, the problem of unavailability of ciphertext image data and high encryption calculation complexity that makes it difficult to put into practical application is solved. This method 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 the stored images on the cloud server, the project innovatively proposes that the encrypted images are still in the standard image format, and the calculation of encrypted image thumbnails is realized without modifying any configuration of the cloud server. In addition, in order to further ensure the privacy security of the image, the project innovatively proposes a distributed image cloud storage architecture based on multiple servers, and the ciphertext images generated by the image data encryption operation 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. In short, we have proposed a privacy-protected image data secure storage and secure modification method, which is an effective means to overcome the defects of existing methods and improve the practicality of existing systems, and has broad application prospects.
[0103] Embodiment 2:
[0104] This embodiment provides a computer device, which may be a server, a computer, etc., and includes a processor, a memory, an input device, a display, and a network interface connected through a system bus. The processor is used 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 of the above-mentioned embodiment 1 is implemented as follows:
[0105] S1. Initialize encryption parameters on the local client device, where the encryption parameters include a random number used for encryption, a resolution size of a key image, and a 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 through the local client device, an encryption start instruction is issued, and the encryption operation is performed on the original image according to the encryption parameters and the number of cloud storage servers n, to obtain n ciphertext images and a key image generated during the encryption process, and the key image is stored in the local client device;
[0108] S4, using the initialized cloud storage password to log in to the cloud server, and upload n ciphertext 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 follows:
[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 according to the resolution size of the original image and the key image of the encryption parameter;
[0116] A random number is selected, and 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 of 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 of [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 expressed 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. key , channel1 and channel2 represent key images respectively 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 steps of:
[0123] Perform decryption operation on the ciphertext image, calculate each pixel of the original image Img, and obtain the decrypted original image;
[0124] The overflow pixels of the decrypted original image are detected and processed. 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 of the ciphertext image is greater than the threshold of the overflow detection 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 equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A privacy-protected image data secure storage and secure modification method, characterized in that: The following steps are involved: S1. Initialize encryption parameters on the local client device, where the encryption parameters include a random number used for encryption, a resolution size of a key image, and a 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 through the local client device, an encryption start instruction is issued, and the encryption operation is performed on the original image according to the encryption parameters and the number n of cloud storage servers, and n ciphertext images and a key image generated during the encryption process are obtained, and the key image is stored in the local client device; S4, using the initialized cloud storage password to log in to the cloud server, and upload n ciphertext images to n cloud storage servers respectively; S5. For each pixel of the key image, modify the brightness in the ciphertext state; 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: 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 S3 comprises: Generate a key image according to the resolution size of the original image and the key image of the encryption parameter; 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.
4. The privacy-protected image data secure storage and secure modification method according to claim 3, characterized in that: The execution of the encryption operation for each pixel of the original image Img to be encrypted is formally expressed as: Among them, pixel0 represents a pixel of 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 of [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 expressed as: 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. key , channel1 and channel2 represent key images respectively Cipher Image and The corresponding channel of the pixel at the corresponding position, r represents the generated random number.
5. The privacy-protected image data secure storage and secure modification method according to claim 4, characterized in that: The execution of the brightness modification operation in the ciphertext state is formally expressed as: pixel←pixel+brightness; if pixel<0 then pixel=0; else if pixel>255 then pixel=255; Among them, pixel refers to the key image For a pixel, brightness refers to the brightness that needs to be increased.
6. 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 operation on the ciphertext image, calculate each pixel of the original image, and obtain the decrypted original image; The overflow pixels of the decrypted original image are detected and processed. 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 of the ciphertext image is greater than the threshold of the overflow detection 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.
7. The privacy-protected image data secure storage and secure modification method according to claim 6, characterized in that: The decryption operation is performed on the ciphertext image, each pixel of the original image 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.
8. 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 7 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
Data encryption and decryption method and computer storage medium
CN114036542A
Image encryption method
US20060126829A1
Distributed homomorphic image encryption and decryption
US20210211269A1
Cited By
Editable image encryption storage method
CN119740243A
