Efficient and secure encryption processing method for cloud photo storage
Through the additive secret sharing of public modulus and Fenwick tree algorithm, the conflict between privacy protection and availability in cloud photo storage is solved, efficient image encryption and editing is achieved, and the security of cloud photo storage is improved. and computational efficiency.
Patent Information
- Application Number
- CN202411123917.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
AI Technical Summary
Existing cloud photo storage solutions conflict between privacy protection and availability. Traditional encryption methods will change the image structure and increase storage overhead. Thumbnail retention encryption technology cannot perform image editing.
The image is encrypted and segmented by the additive secret sharing public modulus and Fenwick tree algorithm, and two ciphertext values are generated, and parallel calculations are performed through the cloud server to realize the editing of the encrypted image and thumbnail generation.
It improves image encryption processing efficiency, ensures image privacy and security, and supports editing operations in an encrypted state, optimizing the privacy protection and computing efficiency of cloud photo storage.
Smart Images

Figure CN119031081A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an efficient and secure encryption processing method for cloud photo storage. Background Art
[0002] With the popularity of smartphones, the number of photos taken by users in their daily lives has increased dramatically, and traditional local storage methods can no longer meet users' demand for storage space. To alleviate this problem, cloud photo storage has gradually become a flexible and potential solution. Users can store captured photos in cloud servers and manage and view photos by browsing photo thumbnails. Currently, almost all smartphone manufacturers support cloud photo storage services, such as Apple's iCloud and Google's Google Photos.
[0003] Cloud photo storage significantly reduces the storage burden of local devices and improves the availability of photos. However, with the development of cloud storage technology, image privacy issues have also emerged. In recent years, frequent cloud storage service leaks, such as the leak of a large number of celebrity private photos due to iCloud account theft, have highlighted the shortcomings of existing cloud photo storage solutions in terms of privacy protection.
[0004] Traditional image encryption methods usually encrypt or add noise to each pixel of the image, but this operation not only changes the image structure, but also increases storage overhead, making it difficult for cloud storage providers to store encrypted images. To this end, thumbnail-preserving encryption technology is proposed as a method to alleviate the conflict between privacy and availability of cloud photo storage. This technology can ensure that the ciphertext obtained after encryption is still an image, and the ciphertext has the same thumbnail as the original image, which balances the privacy protection and availability of cloud photo storage to a certain extent.
[0005] Although thumbnail-preserving encryption technology protects the original image, the generated ciphertext thumbnail may still leak the image content. In addition, thumbnail-preserving encryption technology is limited to generating image thumbnails and cannot perform operations such as cropping and brightness adjustment. It also increases the computation and upload burden of uploading encrypted images and thumbnails on the client. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides an efficient and secure encryption processing method for cloud photo storage, which can improve the efficiency of image encryption processing, effectively protect the privacy of images stored in cloud photo storage, and realize the editing of images in an encrypted state.
[0007] The technical solution of the present invention is achieved in this way:
[0008] An efficient and secure encryption processing method for cloud photo storage includes the following steps:
[0009] Step 1, system initialization: the data owner generates an additive secret sharing public modulus sk; the data owner recruits a first cloud server and a second cloud server that are not related to each other;
[0010] Step 2, image encryption segmentation: the data owner uses the encryption function ε to perform encryption segmentation operations on each pixel of the original image, and obtains two ciphertext values, namely the first ciphertext cp1 and the second ciphertext cp2; the original image is an RGB three-channel image; the number of pixels in the height and width of the original image are n and m respectively; the encryption function ε is expressed as: ε(sk, cp)→(cp1, cp2); where c∈{R, G, B}, respectively represents the RED channel, the GREEN channel and the BLUE channel; cp represents the single-channel pixel value of the pixel, and cp∈[0, 255]; the three channels correspond to three pairs of (cp1, cp2);
[0011] Step 3: Image encryption segmentation acceleration: For the same channel, multiple first ciphertexts or multiple second ciphertexts form a two-dimensional ciphertext array d c,index The data owner uses the Fenwick tree to calculate the prefix sum of the ciphertext array and obtains a tree array BIT c,index ; That is, BIT is essentially a Fenwick tree; where index is 1 or 2; BIT c,index Indicates that in a single channel, according to the prefix and array calculated from the ciphertext array; the data owner will BIT c,1 and BIT c,2 As an encrypted image, it is sent to the first cloud server and the second cloud server respectively; it is equivalent to each channel including two ciphertext arrays, thereby obtaining BIT R,1 、BIT G,1 、BIT B,1 and BIT R,2 、BIT G,2 、BIT B,2 There are 6 tree arrays in total;
[0012] Step 4: Generate image thumbnails: The first cloud server and the second cloud server generate thumbnails based on BIT c,index Calculate the thumbnail share [TPM] c,index and sends the two thumbnail shares to the data owner; the data owner decrypts the two thumbnail shares to obtain a visible thumbnail.
[0013] The encryption function ε can be used to segment and encrypt the original image. The data uploaded to the first server and the second server is encrypted data, so that users can ensure the privacy and security of image data while making full use of cloud resources. The Fenwick tree construction algorithm can accelerate the encryption segmentation operation, significantly improve the calculation speed of the encrypted image in the subsequent calculation process, and optimize the processing efficiency of the encrypted image.
[0014] As a further optimization of the above scheme, the additive secret sharing public modulus is sk=2 8 .
[0015] As a further optimization of the above scheme, the encryption function ε is expressed as:
[0016]
[0017] in, This means that cp1 is from [0,2 8 ) is a number randomly selected from .
[0018] As a further optimization of the above scheme, a decryption function D is also included, which is used to restore the first ciphertext and the second ciphertext to the pixel value cp, that is: cp = D (sk, cp1, cp2) = cp1 + cp2 mod sk.
[0019] As a further optimization of the above solution, in step 3, the tree array is constructed as follows:
[0020] Step 31: construct four two-dimensional arrays W, X, Y, and Z according to the ciphertext array; respectively used to store pixel information of the original image; and initialize the two-dimensional arrays, namely:
[0021]
[0022] Here, i is the variable of the outer loop, which is used to traverse the rows of the two-dimensional array. j is the variable of the inner loop, which is used to traverse the columns of the current row.
[0023] Similarly, x is the variable of the outer loop, used to traverse the rows of the two-dimensional array. y is the variable of the inner loop, used to traverse the columns of the current row.
[0024] The above four two-dimensional data are all based on the prefix sum calculation of the (x, y)th point, and (i, j) is a point less than or equal to (x, y).
[0025] Step 32: for a pixel with coordinates (x, y), generate a random value v;
[0026] Step 33, use the add function add(BIT,x,y,v) to update the two-dimensional arrays W, X, Y, and Z; the calculation of the add function add(BIT,x,y,v) is as follows:
[0027]
[0028] Among them, the initialization values of i and j are x and y respectively; [v]1 and [v]2 are two ciphertext values obtained after v is divided using the encryption function ε; a group of W, X, Y, Z corresponds to a BIT.
[0029] According to the calculation process of BIT←d, BIT can be realized c,index ←d c,index , that is, calculate the BIT corresponding to each channel under each ciphertext share, a total of 6 BITs. [v]1 corresponds to participating in W c,1 , X c,1 , Y c,1 , Z c,1 , [v]2 corresponds to the update of W c,2 , X c,2 , Y c,2 , Z c,2 Updates.
[0030] For the random change v provided by the coordinates (x, y) on the cloud server, the restored original image will get the same change. V is used to further encrypt the ciphertext BIT to enhance the privacy of the image ciphertext.
[0031] i is the index of the outer loop, j is the index of the inner loop; the result of i=i+(i&-i) is to find the power of 2 numbers that are larger than i and closest to i, that is, the high-order operation is applied; if the initial value of i is 3, the subsequent changes are 4, 8, 16, 32, etc. The same is true for j=j+(j&-j).
[0032] All coordinates mentioned in this solution actually correspond to the index of the two-dimensional array; in particular, they refer to logical indexes, that is, the logical index is 1 as the initial value, rather than 0 as the initial value in the programming array.
[0033] As a further optimization of the above scheme, it also includes the editing operation of the encrypted image; the editing operation includes adjusting the brightness of the image. If the change in the original image is bc, the adding function add(BIT,x,y,bc) is executed, where (x,y) corresponds to the coordinates of each pixel in the original image.
[0034] If bc is greater than 0, it means increasing the brightness, and if it is less than 0, it means decreasing the brightness.
[0035] As a further optimization of the above solution, in step 4, the image thumbnail generation process is:
[0036] Step 41, set the zoom ratio, calculate the height and width of the visual thumbnail as n' and m' respectively; the zoom ratio is an integer; n' and m' correspond to n and m respectively, both refer to the number of pixels.
[0037] Step 42: Segment the encrypted image according to the scaling ratio, and obtain the coordinates of the upper left corner (x lt ,y lt ) and the lower right corner coordinate (x rb ,y rb );
[0038] Step 43, calculate the scaling factor, that is:
[0039]
[0040] Where H is the height scaling factor and W is the width scaling factor;
[0041] Step 44: Map the specified coordinates of the visible zoom image to the zoom area of the encrypted image according to the zoom factor, and use the rangeQuery algorithm to calculate the sum of the ciphertexts of all pixels in the zoom area, which is the ciphertext value of the specified coordinates, that is:
[0042]
[0043] Wherein, (x1, y1) and (x2, y2) are the coordinates of the upper left corner and the lower right corner of the zoom area respectively;
[0044] (i, j) is the specified coordinate; rangeQuery(BIT c,index ,x1,y1,x2,y2) is the sum of the ciphertext values in the scaling area; TPM c,index [i][j] is the ciphertext value of the specified coordinates; include wait.
[0045] The formula corresponding to the rangeQuery algorithm is:
[0046]
[0047] Among them, Query(BIT,x,y) is the query function, that is:
[0048]
[0049] Where (x, y) is the coordinate of the query, BIT←{W, X, Y, Z}; the initial value of ret is 0; traverse i and j to update ret; the final value of ret is the return value of the query function; ret is a variable used to accumulate results. The final ret represents the result of the accumulated query from the Fenwick tree;
[0050] Step 45: TPM based on the ciphertext value c,index [i][j], using the decryption function D to calculate the pixel value of the specified coordinate;
[0051] The ciphertext value includes the first ciphertext and the second ciphertext. According to step 44, the pixel value can be calculated. For example, the first ciphertext cp1 and the second ciphertext cp2 include Rp1, Gp1, Bp1 and Rp2, Gp2, Bp2 respectively. Then, according to the decryption function D, the three-channel pixel value of the image at the specified point is obtained, and finally the entire original image is restored. That is:
[0052] Rp=D(sk,Rp1,Rp2)=Rp1+Rp2 mod sk,
[0053] Gp=D(sk,Gp1,Gp2)=Gp1+Gp2 mod sk,
[0054] Bp=D(sk,Bp1,Bp2)=Bp1+Bp2 mod sk, and then we get (Rp, Gp, Bp).
[0055] Step 46, traverse each coordinate of the visual zoom image, and repeat step 44 and step 45 to finally obtain the visual zoom image.
[0056] As a further optimization of the above solution, step 5, image decryption, is also included:
[0057] The data owner downloads the tree array from the first cloud server and the second cloud server, and uses the rangeQuery algorithm to calculate the ciphertext value of the original image at each pixel coordinate, that is, for a specified coordinate (x, y), the corresponding ciphertext value is calculated as: cp index =rangeQuery(BIT c,index ,x,y,x,y); then calculate the pixel value of the specified coordinates according to the decryption function to restore the original image.
[0058] When two points in the zoom area coincide, the sum of the calculated ciphertext values is the ciphertext value of the corresponding points.
[0059] As a further optimization of the above solution, the encrypted image may also be edited; the editing operation may also include image cropping; for the encrypted image, the upper left corner coordinate (xlt ,y lt ) and the lower right corner coordinate (x rb ,y rb ); The cropping of the encrypted image includes a left cropping width w1, a right cropping width w2, an upper cropping height h1 and a lower cropping height h2, and the cropped image is:
[0060]
[0061] Among them, (x lt′ ,y lt′ ) and (x rb′ ,y rb′ ) are the coordinates of the upper left corner and lower right corner of the cropped image respectively.
[0062] The cropping result in the encrypted image is directly mapped to the original image, that is, the cropping operation has the same effect on the encrypted image and the original image.
[0063] Compared with the prior art, the present invention achieves the following beneficial effects:
[0064] (1) Overcoming privacy protection barriers: The present invention uses the ε function to encrypt an image into two encrypted images, thereby enhancing the security of the image and solving the problem of privacy protection in cloud photo storage.
[0065] (2) Improve computing efficiency: The image encryption segmentation operation is accelerated by organizing each encrypted image into four Fenwick trees, which significantly improves the computing speed of the encrypted image and optimizes the processing of the encrypted image.
[0066] (3) Supporting encrypted image editing: The image editing mechanism proposed in the present invention allows cloud photo storage providers to directly edit encrypted images, including thumbnail generation, cropping, and brightness adjustment, etc., which overcomes the defect that traditional methods cannot edit images in an encrypted state. It not only improves the security of the system but also enriches its functionality. The enhancement of system security and the expansion of functionality complement each other and can provide users with more comprehensive and reliable services.
[0067] (4) Make full use of cloud computing resources: By taking advantage of the parallel computing and distributed storage characteristics of the cloud computing platform, the computing efficiency of privacy data is effectively improved while fully utilizing cloud resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is a working principle diagram of an efficient and secure encryption processing method for cloud photo storage provided by an embodiment of the present invention;
[0069] Figure 2It is an interactive diagram of an efficient and secure encryption processing method for cloud photo storage provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0071] like Figure 1 , Figure 2 As shown, this embodiment provides an efficient and secure encryption processing method for cloud photo storage, comprising the following steps:
[0072] Step 1: System initialization: The data owner generates an additive secret sharing public modulus sk; in this embodiment, the additive secret sharing public modulus is sk=2 8 The data owner recruits a first cloud server and a second cloud server that are unrelated to each other; the cloud servers have powerful computing capabilities and store encrypted data.
[0073] Step 2, image encryption and segmentation: The data owner uses the encryption function ε to perform encryption and segmentation operations on each pixel of the original image, and obtains two ciphertext values, namely the first ciphertext cp1 and the second ciphertext cp2; the original image is an RGB three-channel image; the number of pixels in the height and width of the original image are n and m respectively; where c∈{R,G,B}, represents the RED channel, GREEN channel and BLUE channel respectively; cp represents the single-channel pixel value of the pixel point, and cp∈[0,255]; the pixel values of the original image on a single channel constitute a pixel matrix; the three channels correspond to three pairs (cp1, cp2) respectively;
[0074] In this embodiment, the encryption function ε is expressed as:
[0075]
[0076] in, This means that cp1 is from [0,2 8 ) is a number randomly selected from .
[0077] Taking the BLUE channel of a 4*4 RGB three-channel image as an example, the corresponding pixels are:
[0078] [[79,9,57,127],[56,168,174,191],[156,138,89,197],[149,26,172,178];
[0079] The first ciphertext and the second ciphertext obtained after segmentation are:
[0080] cp1 (also known as Bp1) = [[50, 6, 36, 72], [32, 110, 170, 126], [156, 106, 28, 156], [106, 8, 140, 146]];
[0081] cp2 (also known as Bp2) = [[29,3,21,55],[24,58,4,65],[0,32,61,41],[43,18,32,32]];
[0082] It also includes a decryption function D, which is used to restore the first ciphertext and the second ciphertext to the pixel value cp, that is: cp = D (sk, cp1, cp2) = cp1 + cp2 mod sk.
[0083] Step 3: Image encryption segmentation acceleration: For the same channel, multiple first ciphertexts or multiple second ciphertexts form a two-dimensional ciphertext array d c,index ; The data owner uses the Fenwick tree to calculate the prefix sum of the ciphertext array and obtains the tree array BIT c,index ; That is, BIT is essentially a Fenwick tree / Fenwick Tree, also known as Binary Indexed Tree (BIT), which is a data structure for efficiently processing numerical data, especially suitable for processing problems involving addition. It was proposed by Peter M. Fenwick in 1994. The main advantage of Fenwick Tree is that it can complete single-point update and interval query operations in logarithmic time.
[0084] Among them, index is 1 or 2; BIT c,index Indicates that in a single channel, based on the prefix and array calculated from the ciphertext array; the data owner will BIT c,1 and BIT c,2 As an encrypted image, it is sent / uploaded to the first cloud server and the second cloud server respectively; it is equivalent to each channel including two ciphertext arrays, thereby obtaining BIT R,1 、BIT G,1 、BIT B,1 and BIT R,2 、BIT G,2 、BIT B,2 There are 6 tree arrays in total;
[0085] In this embodiment, the construction method of the tree array is as follows:
[0086] Step 31: construct four two-dimensional arrays W, X, Y, and Z according to the ciphertext array; respectively used to store the pixel information of the original image; initialize the two-dimensional arrays, namely:
[0087]
[0088] Here, i is the variable of the outer loop, which is used to traverse the rows of the two-dimensional array. j is the variable of the inner loop, which is used to traverse the columns of the current row.
[0089] Similarly, x is the variable of the outer loop, used to traverse the rows of the two-dimensional array. y is the variable of the inner loop, used to traverse the columns of the current row.
[0090] The above four two-dimensional data are all based on the prefix sum calculation of the (x, y)th point, and (i, j) is a point less than or equal to (x, y).
[0091] Step 32: for a pixel with coordinates (x, y), generate a random value v;
[0092] Step 33, use the add function add(BIT,x,y,v) to update the two-dimensional arrays W, X, Y, and Z; the calculation of the add function add(BIT,x,y,v) is as follows:
[0093]
[0094] Among them, the initialization values of i and j are x and y respectively; [v]1 and [v]2 are two ciphertext values obtained after v is split using the encryption function ε; a group of W, X, Y, Z corresponds to a BIT.
[0095] According to the calculation process of BIT←d, BIT can be realized c,index ←d c,index , that is, calculate the BIT corresponding to each channel under each ciphertext share, a total of 6 BITs.
[0096] That is, cp index →d c,index →BIT c,index (W c,index ,X c,index ,Y c,index ,Z c,index ); Then, for the same color channel, we can get cp1→BIT(W1,X1,Y1,Z1) and cp2→BIT(W2,X2,Y2,Z2);
[0097] [v]1 corresponds to participating in W c,1 , X c,1 , Yc,1 , Z c,1 , [v]2 corresponds to the update of W c,2 , X c,2 , Y c,2 , Z c,2 Updates.
[0098] Taking the above Bp1 and Bp2 as examples, we can calculate BIT B,1 and BIT B,2 ,Right now:
[0099] BIT B,1 ={
[0100] W B,1 =[[50,6,30,72],[32,110,60,126],[124,-4,-138,30],[106,8,132,146]],
[0101] X B,1 =[[0,0,0,0],[-18,104,30,54],[248,-8,-276,60],[80,-198,384,84]],
[0102] Y B,1 =[[0,-44,60,124],[0,78,120,66],[0,-128,-276,112],[0,-98,264,184]],
[0103] Z B,1 =[[0,0,0,0],[0,122,60,-58],[0,-256,-552,224],[0,-278,768,184]]};
[0104] BIT B,2 ={
[0105] W B,2 =[[29,3,18,55],[24,58,-54,65],[-24,-26,83,-24],[43,18,14,32]],
[0106] X B,2 =[[0,0,0,0],[-5,55,-72,10],[-48,-52,166,-48],[76,-39,49,-65]],
[0107] Y B,2 =[[0,-26,36,112],[0,34,-108,109],[0,-2,166,-79],[0,-25,28,3]],
[0108] Z B,2 =[[0,0,0,0],[0,60,-144,-3],[0,-4,332,-158],[0,-115,98,-242]]};
[0109] For the random change v provided by the coordinates (x, y) on the cloud server, the restored original image will get the same change. V is used to further encrypt the ciphertext BIT to enhance the privacy of the image ciphertext.
[0110] i is the index of the outer loop, j is the index of the inner loop; the result of i=i+(i&-i) is to find the power of 2 numbers that are larger than i and closest to i, that is, the high-order operation is applied; if the initial value of i is 3, the subsequent changes are 4, 8, 16, 32, etc. The same is true for j=j+(j&-j).
[0111] All coordinates mentioned in this solution actually correspond to the index of the two-dimensional array; in particular, they refer to logical indexes, that is, the logical index is 1 as the initial value, rather than 0 as the initial value in the programming array.
[0112] Step 4: Image thumbnail generation: The first cloud server and the second cloud server generate thumbnails based on BIT c,index Calculate the thumbnail share [TPM] c,index , and send the two thumbnail shares to the data owner; the data owner decrypts the two thumbnail shares to obtain visible thumbnails.
[0113] The specific process is:
[0114] Step 41, set the zoom ratio, calculate the height and width of the visible thumbnail as n' and m' respectively; the zoom ratio is an integer; n' and m' correspond to n and m respectively, both refer to the number of pixels.
[0115] Step 42: Segment the encrypted image according to the scaling ratio, and obtain the coordinates of the upper left corner (x lt ,y lt ) and the lower right corner coordinate (x rb ,y rb );
[0116] Step 43, calculate the scaling factor, that is:
[0117]
[0118] Where H is the height scaling factor and W is the width scaling factor;
[0119] Step 44: Map the specified coordinates of the visible zoom image to the zoom area of the encrypted image according to the zoom factor, and use the rangeQuery algorithm to calculate the sum of the ciphertexts of all pixels in the zoom area, which is the ciphertext value of the specified coordinates, that is:
[0120]
[0121] Where (x1, y1) and (x2, y2) are the coordinates of the upper left corner and lower right corner of the zoom area respectively; (i, j) are the specified coordinates; rangeQuery(BIT c,index ,x1,y1,x2,y2) is the sum of the ciphertext values in the zoom area;
[0122] TPM c,index [i][j] is the ciphertext value of the specified coordinate; include wait.
[0123] TPM c,index That is, thumbnail share / ciphertext thumbnail.
[0124] The formula corresponding to the rangeQuery algorithm is:
[0125]
[0126] Among them, Query(BIT,x,y) is the query function, that is:
[0127]
[0128] Among them, (x, y) is the coordinate of the query, BIT←{W,X,Y,Z}; the initial value of ret is 0; traverse i and j to update ret; the final value of ret is the return value of the query function; ret is a variable used to accumulate results. The final ret represents the accumulated query results from the Fenwick tree;
[0129] Step 45: According to the ciphertext value TPM c,index [i][j], use the decryption function D to calculate the pixel value of the specified coordinate;
[0130] The ciphertext value includes the first ciphertext and the second ciphertext. According to step 44, the pixel value can be calculated. For example, the first ciphertext cp1 and the second ciphertext cp2 include Rp1, Gp1, Bp1 and Rp2, Gp2, Bp2 respectively. Then, according to the decryption function D, the three-channel pixel value of the image at the specified point is obtained, and finally the entire original image is restored. That is:
[0131] Rp=D(sk,Rp1,Rp2)=Rp1+Rp2 mod sk,
[0132] Gp=D(sk,Gp1,Gp2)=Gp1+Gp2 mod sk,
[0133] Bp=D(sk,Bp1,Bp2)=Bp1+Bp2 mod sk, and then we get (Rp, Gp, Bp).
[0134] Therefore, the data owner obtains the ciphertext thumbnail from the first cloud server and the second cloud server Figure 1 and ciphertext abbreviation Figure 2 After that, the final visual thumbnail (single channel) can be synthesized.
[0135] Step 46, traverse each coordinate of the visual zoom image, and repeat steps 44 and 45 to finally obtain the visual zoom image.
[0136] The encryption function ε can be used to segment and encrypt the original image. The data uploaded to the first server and the second server is encrypted data, so that users can ensure the privacy and security of image data while making full use of cloud resources. The Fenwick tree construction algorithm can accelerate the encryption segmentation operation, significantly improve the calculation speed of the encrypted image in the subsequent calculation process, and optimize the processing efficiency of the encrypted image.
[0137] It also includes step 5, image decryption:
[0138] The data owner downloads the tree array from the first cloud server and the second cloud server, and uses the rangeQuery algorithm to calculate the ciphertext value of the original image at each pixel coordinate, that is, for the specified coordinate (x, y), the corresponding ciphertext value is calculated as: cp index =rangeQuery(BIT c,index ,x,y,x,y); then calculate the pixel value of the specified coordinates according to the decryption function to restore the original image. When two points in the zoom area coincide, the sum of the calculated ciphertext values is the ciphertext value of the corresponding point.
[0139] In this embodiment, it also includes an editing operation of the encrypted image;
[0140] The editing operation includes adjusting the brightness of the image. If the change in the original image is bc, the adding function add(BIT,x,y,bc) is executed, where (x,y) corresponds to the coordinates of each pixel in the original image.
[0141] At this time, if bc=0, the two ciphertexts (brightness adjustment values) after segmentation are [bc]1=5 and [bc]2=4 respectively; then the updated BIT B,1 and BIT B,2 They are:
[0142] BIT B,1 ={
[0143] W B,1
[0144] =[[55,11,30,77],[37,115,60,131],[124,-4,-138,30],[111,13,132,151]],
[0145] X B,1 =[[0,0,0,0],[-18,104,30,54],[248,-8,-276,60],[80,-198,384,84]],
[0146] Y B,1 =[[0,-44,60,124],[0,78,120,66],[0,-128,-276,112],[0,-98,264,184]],
[0147] Z B,1 =[[0,-44,60,124],[0,78,120,66],[0,-128,-276,112],[0,-98,264,184]};
[0148] BIT B,2 ={
[0149] W B,2 =[[25,-1,18,51],[20,54,-54,61],[-24,-26,83,-24],[39,14,14,28]],
[0150] X B,2 =[[0,0,0,0],[-5,55,-72,10],[-48,-52,166,-48],[76,-39,49,-65]],
[0151] Y B,2 =[[0,-26,36,112],[0,34,-108,109],[0,-2,166,-79],[0,-25,28,3]],
[0152] Z B,2 =[[0,0,0,0],[0,60,-144,-3],[0,-4,332,-158],[0,-115,98,-242]]};
[0153] If bc is greater than 0, it indicates increasing the brightness, and if it is less than 0, it indicates decreasing the brightness. After adjusting the brightness of the encrypted image, the data owner re-downloads the two encrypted images from the two cloud servers, and the original image after brightness adjustment can be synthesized.
[0154] Editing operations also include image cropping; for encrypted images, this includes the upper left corner coordinates (x lt ,y lt ) and the lower right corner coordinate (x rb ,y rb ); The cropping of the encrypted image includes the left cropping width w1, the right cropping width w2, the upper cropping height h1 and the lower cropping height h2, and the cropped image is:
[0155]
[0156] Among them, (x lt′ ,y lt′ ) and (x rb′ ,y rb′ ) are the coordinates of the upper left corner and lower right corner of the cropped image respectively.
[0157] The cropping result in the encrypted image is directly mapped to the original image, that is, the cropping operation has the same effect on the encrypted image and the original image.
[0158] According to the disclosure and teaching of the above description, those skilled in the art to which the present invention belongs may also make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the scope of protection of the claims of the present invention. In addition, although some specific terms are used in this specification, these terms are only for the convenience of description and do not constitute any limitation to the present invention.
Claims
1. An efficient and secure encryption processing method for cloud photo storage, It is characterized in that The following steps are involved: Step 1: System initialization: The data owner generates an additive secret sharing public modulus sk; The data owner recruits a first cloud server and a second cloud server that are not related to each other; Step 2: Image encryption and segmentation: The data owner uses the encryption function ε to perform encryption and segmentation operations on each pixel of the original image to obtain two ciphertext values, namely the first ciphertext cp and 1 and the second ciphertext cp 2 ; The original image is an RGB three-channel image; the number of pixels in the height and width of the original image are n and m respectively; the encryption function ε is expressed as: ε(sk, cp)→(cp 1 ,cp 2 ); where c∈{R,G,B}, respectively represent RED channel, GREEN channel and BLUE channel; cp represents the single-channel pixel value of the pixel point, and cp∈[0,255]; Step 3: Image encryption segmentation acceleration: For the same channel, multiple first ciphertexts or multiple second ciphertexts form a two-dimensional ciphertext array d c,index The data owner uses the Fenwick tree to calculate the prefix sum of the ciphertext array and obtains a tree array BIT c,index ; Where index is 1 or 2; BIT c,index Indicates that in a single channel, according to the prefix and array calculated from the ciphertext array; the data owner will BIT c,1 and BIT c,2 sending the encrypted images to the first cloud server and the second cloud server respectively; Step 4: Generate image thumbnails: The first cloud server and the second cloud server generate thumbnails based on BIT c,index Calculate the thumbnail share [TPM] c,index and sends the two thumbnail shares to the data owner; the data owner decrypts the two thumbnail shares to obtain a visible thumbnail.
2. According to claim 1, an efficient and secure encryption processing method for cloud photo storage, It is characterized in that The public modulus of the additive secret sharing is sk=2 8 .
3. According to claim 2, an efficient and secure encryption processing method for cloud photo storage, It is characterized in that The encryption function ε is expressed as: in, That means cp 1 is from [0,2 8 ) is a number randomly selected from .
4. According to claim 3, an efficient and secure encryption processing method for cloud photo storage, It is characterized in that It also includes a decryption function D, which is used to restore the first ciphertext and the second ciphertext to a pixel value cp, that is: cp = D (sk, cp 1 ,cp 2 )=cp 1 +cp 2 mod sk.
5. According to claim 4, an efficient and secure encryption processing method for cloud photo storage, It is characterized in that In step 3, the tree array is constructed as follows: Step 31: construct four two-dimensional arrays W, X, Y, and Z according to the ciphertext array; initialize the two-dimensional arrays, namely: Step 32: for a pixel with coordinates (x, y), generate a random value v; Step 33, use the add function add(BIT,x,y,v) to update the two-dimensional arrays W, X, Y, and Z; the calculation of the add function add(BIT,x,y,v) is as follows: Where i and j are initialized to x and y respectively; [v] 1 and [v] 2 are two ciphertext values obtained by dividing v using the encryption function ε; a set of W, X, Y, and Z corresponds to a BIT.
6. The efficient and secure encryption processing method for cloud photo storage according to claim 5, It is characterized in that It also includes editing operations for the encrypted image; the editing operations include adjusting the brightness of the image. If the amount of change in the original image is bc, the adding function add(BIT,x,y,bc) is executed, where (x,y) corresponds to the coordinates of each pixel in the original image.
7. The efficient and secure encryption processing method for cloud photo storage according to claim 5, It is characterized in that In step 4, the image thumbnail generation process is as follows: Step 41, setting a zoom ratio, calculating the height and width of the visual thumbnail as n' and m' respectively; the zoom ratio is an integer; Step 42: Segment the encrypted image according to the scaling ratio, and obtain the coordinates of the upper left corner (x lt ,y lt ) and the lower right corner coordinate (x rb ,y rb ); Step 43: Calculate the scaling factor, namely: Where H is the height scaling factor and W is the width scaling factor; Step 44: Map the specified coordinates of the visible zoom image to the zoom area of the encrypted image according to the zoom factor, and use the rangeQuery algorithm to calculate the sum of the ciphertexts of all pixels in the zoom area, which is the ciphertext value of the specified coordinates, that is: Among them, (x 1 ,y 1 ) and (x 2 ,y 2 ) are respectively the upper left corner coordinates and the lower right corner coordinates of the zoom area; (i, j) is the specified coordinate; rangeQuery(BIT c,index ,x 1 ,y 1 ,x 2 ,y 2 ) is the sum of the ciphertext values in the scaling area; TPM c,index [i][j] is the ciphertext value of the specified coordinates; The formula corresponding to the rangeQuery algorithm is: Among them, Query(BIT,x,y) is the query function, that is: Where (x, y) is the coordinate of the query, BIT←{W, X, Y, Z}; the initial value of ret is 0; traverse i and j to update ret; the final value of ret is the return value of the query function; Step 45: TPM based on the ciphertext value c,index [i][j], using the decryption function D to calculate the pixel value of the specified coordinate; Step 46, traverse each coordinate of the visual zoom image, and repeat step 44 and step 45 to finally obtain the visual zoom image.
8. According to claim 7, a highly efficient and secure encryption processing method for cloud photo storage, It is characterized in that It also includes step 5, image decryption: The data owner downloads the tree array from the first cloud server and the second cloud server, and uses the rangeQuery algorithm to calculate the ciphertext value of the original image at each pixel coordinate, that is, for a specified coordinate (x, y), the corresponding ciphertext value is calculated as: cp index =rangeQuery(BIT c,index ,x,y,x,y); then calculate the pixel value of the specified coordinates according to the decryption function to restore the original image.
9. The efficient and secure encryption processing method for cloud photo storage according to claim 1, It is characterized in that The encrypted image also includes an editing operation; the editing operation also includes image cropping; for the encrypted image, the upper left corner coordinates (x lt ,y lt ) and the lower right corner coordinate (x rb ,y rb ); The cropping of the encrypted image includes a left cropping width w 1 , right crop width w 2 , upper cutting height h 1 and lower cutting height h 2 , then the cropped image is: Among them, (x lt′ ,y lt′ ) and (x rb′ ,y rb′ ) are the coordinates of the upper left corner and lower right corner of the cropped image.
Citation Information
Cited By
Editable image encryption storage method
CN119740243A
