Color grading thumbnail save encryption method based on block space adjustment strategy
Through the color grading thumbnail preservation encryption method based on the block space adjustment strategy, the problem of balancing color grading and privacy protection in the existing technology is solved, and the color vividness of the encrypted image is gradually transitioned and the visual information is retained, which is suitable for Internet of Things scenarios.
Patent Information
- Application Number
- CN202411995366.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing thumbnail storage encryption methods cannot achieve color grading, which limits the application of encrypted images in color-rich scenarios. In addition, existing schemes find it difficult to strike a balance between privacy protection and usability.
A color-graded thumbnail preservation encryption method based on block space adjustment strategy is adopted. Each channel of the image is decomposed into two parts. A pseudo-random key stream is generated using a 2D-LSM chaotic system. A two-pixel sum-and-keep replacement operation is performed on part II. The block space of part I is adjusted, and the permutation table generated by the 2D-LSM chaotic system is applied to permutate and sort the pixel values to ensure a gradual transition in the color vividness of the encrypted image.
The color grading of encrypted images is achieved, which maintains the usability and visual information of the images, has strong adaptability, and the encryption and decryption costs are comparable to existing schemes.
Smart Images

Figure CN119854424B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information security, and particularly relates to a color hierarchical thumbnail saving encryption method based on a block space adjustment strategy. BACKGROUND
[0002] Nowadays, deploying visual perception capabilities in industrial IoT has become an important application, managers can perceive the information inside the industrial environment and provide the basis for decision-making. But on the other hand, it also leads to serious privacy risks, because visual content often contains sensitive information, which may expose personal information, industrial secrets, location data, etc. Secondly, cloud storage adopts centralized data management, which also brings risks when removing privacy-sensitive information. At the same time, visual content is also crucial because it contains rich visual content. Therefore, after collecting visual content, necessary processing is required. Therefore, to maintain basic usability in the industrial environment, it is crucial to retain an appropriate amount of visual information.
[0003] In order to achieve the best balance between privacy and usability, some privacy protection schemes, object substitution and selective encryption. There are also schemes that focus on encrypting specific data by identifying privacy within the image. However, these schemes have great limitations because they usually do not encrypt the entire image object or only selectively encrypt part of the data. Although the resulting encrypted image is still usable, the inaccuracy in describing the privacy area and the improper selection of privacy objects may cause the original information contained in the encrypted image to be accidentally leaked. Therefore, there is an urgent need for a comprehensive privacy protection scheme that can guarantee full encryption of images while maintaining usability.
[0004] In recent years, an image privacy protection scheme called thumbnail saving encryption (TPE) has been proposed, which can meet the above requirements. These schemes ensure the global encryption of images without missing any area. In terms of security, they use substitution and permutation encryption to ensure the confidentiality of the image. In addition, they maintain their usability by adjusting the size of the thumbnail block and keeping the encryption method.
[0005] However, none of the current schemes can achieve color hierarchy in encrypted images. Color hierarchy is important for thumbnails because color can directly affect people's understanding of the meaning of the image. For example, in many images where intuitive impressions can be quickly established through color elements, these elements can be better hidden if the liveliness of the colors is reduced. It should be noted that although there are some TPE schemes that can encrypt color images into images that are visually perceived as grayscale images, they still do not allow color hierarchy, which makes it difficult to apply to scenarios that rely on high color richness. SUMMARY
[0006] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent.
[0007] An object of the present invention is to provide a color-graded thumbnail storage encryption method based on a block space adjustment strategy, which can gradually transition the color vividness of the encrypted image from dim or distorted to bright or realistic regardless of how the size of the thumbnail block changes, thereby achieving color grading.
[0008] In order to achieve the above-mentioned object, the present invention provides a method for preserving and encrypting color-graded thumbnails based on a block space adjustment strategy, comprising the following steps:
[0009] S100, preprocessing the input image;
[0010] S200, decomposing each channel of the image into two parts, namely, part I containing the highest bit plane and part II containing the remaining bit planes, wherein the highest bit plane is responsible for carrying the main color information of the image, and the remaining bit planes contain detail information;
[0011] S300, using the 2D-LSM chaotic system to generate a 256-bit pseudo-random key stream;
[0012] S400, performing a two-pixel sum-keeping replacement operation on the portion II, by calculating the sum of pixel values of the pixel group and replacing the pixel group with a pixel group having an equal or similar sum;
[0013] S500, adjusting the block space of the portion I, including compressing the space when elements in the block are consistent, and filling the vacant space with 1 or 0 to approximate the sum of the elements in the original bit plane;
[0014] S600, applying the permutation table generated by the 2D-LSM chaotic system to permutate and sort the pixel values of the reorganized image block to construct a complete encrypted image block;
[0015] S700: Reorganize the processed blocks according to the original bit order to form a final encrypted image.
[0016] A further preferred technical solution of the present invention is that the input image is preprocessed in step S100, and the specific method includes:
[0017] S110, selecting an image format using lossless compression;
[0018] S120, the image is a single-channel grayscale image or a multi-channel color map; when the image is a multi-channel color image, each channel is regarded as a two-dimensional digital matrix, and the value of the element in the channel is less than or equal to 2d-1, where d=128;
[0019] S130, defining a unique identifier for each image, denoted as ρ;
[0020] S140: Divide the image into blocks, and record them as data blocks B. m,n , the components of the first part of the block are integrable with respect to the first part.
[0021] Preferably, the step S300 of generating a 256-bit pseudo-random key stream by using a 2D-LSM chaotic system includes:
[0022] S310, record the key stream as Where μ represents the number of bits in the key, which is 256, and w represents the random selector;
[0023] S320, using the 2D-LSM chaotic system to generate a large number of 256-bit key streams, expressed as:
[0024] K s =round(abs(2D-LSM(X1, Y1, τ, σ, 256)));
[0025] Wherein, round means rounding, abs means taking the absolute value, 2D-LSM means the pseudo-random number algorithm generated based on the two-dimensional chaotic mapping system, X1, Y1 represent the input initial values of the two-dimensional chaotic mapping system, X1, Y1∈(0,1), τ, σ represent the control parameters of the two-dimensional chaotic system, τ∈(0,4), σ∈(0,1);
[0026] S330: Connect the image to the corresponding identifier ρ. The connection is denoted as ρ||c, and its length Len is less than or equal to 256 bits:
[0027] S340, will be in K s The last Len bit in is replaced by ρ||c to obtain the encryption key.
[0028] Preferably, in step S400, a two-pixel sum-and-keep replacement operation is performed on the portion II, and the specific method is:
[0029] S410, organizing pixels in a block into pixel groups consisting of two pixels, represented as f = {f1, f2};
[0030] S420, calculate the sum of the pixel values of the pixel group f={f1, f2}, denoted as f s ;
[0031] S430, calculate all sums to be f s The pixel groups form a set θ s , expressed as:
[0032]
[0033] S440, using R s (·) equation determines the label of the pixel group f = {f1, f2}, denoted by ε f , expressed as:
[0034]
[0035] S450, the encrypted pixel group is represented as ε e , expressed as:
[0036] ε e =(ε f +β)mod|θ s |;
[0037] Where β≥2|θ s |;
[0038] S460, Utilization The function labels ε e Convert to encrypted pixel group f e , completing the process of substitution encryption of pixel groups.
[0039] Preferably, the step S500 of adjusting the block space of the portion I includes:
[0040] S510, Evacuation Space:
[0041] Find data blocks with consistent elements, that is, identify data blocks where all elements are 1 or all elements are 0;
[0042] Compress the space within the found data block to create additional space for subsequent adjustments;
[0043] S520, Adjustment:
[0044] Fill the vacated space with 1 or 0 to approximate the sum of the elements in the original bit plane;
[0045] The first and second elements of the compressed block have values, and the other elements are left empty. The first element represents the compressible element in the original block, and the second element is set to 0, indicating that it has been compressed.
[0046] Preferably, the permutation table generated by the 2D-LSM chaotic system is applied in step S600 to perform pixel value permutation sorting on the image blocks of part I and part II, and the specific method includes:
[0047] S610: converting the one-dimensional sequence generated by the 2D-LSM chaotic system into a two-dimensional matrix to form a permutation table;
[0048] S620: According to the permutation table, the pixel values of the image block are sorted, and the block-by-block permutation encryption is realized.
[0049] S630: The index of the permutation table is arranged in descending order by the elements in the chaotic block.
[0050] As preferred, the processed block is reorganized in the original bit order according to step S700, and a complete encrypted image block is constructed, specifically:
[0051] According to the bit order when the image is divided into parts I and II, the adjusted highest bit plane and the remaining bit planes are recombined; ensure that the recombined image block is continuous in space, and obtain the final encrypted image.
[0052] Another aspect of the present application provides a non-transitory computer readable storage medium having computer instructions stored thereon, the computer instructions causing a computer to execute the color-graded thumbnail saving encryption method based on the block space adjustment strategy described above.
[0053] Still another aspect of the present application provides an electronic device comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus, and the processor calls the logical instructions in the memory to execute the color-graded thumbnail saving encryption method based on the block space adjustment strategy described above.
[0054] Still another aspect of the present application provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program being executed by a processor, the computer executing the color-graded thumbnail saving encryption method based on the block space adjustment strategy described above.
[0055] Beneficial effects: The color-graded thumbnail saving encryption method based on the block space adjustment strategy of the present application can gradually transition the color vitality of the encrypted image from dull or distorted to bright or real, regardless of the size of the thumbnail block.
[0056] The color-graded thumbnail saving encryption method based on the block space adjustment strategy designed by the present application ensures that the encrypted image retains similar rough visual information as the original image, thereby meeting the usability.
[0057] The color-graded thumbnail saving encryption method based on the block space adjustment strategy designed by the present application encrypts the image by adjusting the block space, successfully realizes the color grading of color images. Moreover, the size expansion multiple and time overhead of the encrypted and decrypted images are comparable to current similar schemes, without increasing additional costs.
[0058] The color-grading thumbnail storage encryption method based on the block space adjustment strategy designed in the present invention greatly improves the adaptability of the scheme to different Internet of Things scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 The figure is a flow chart of the method for preserving and encrypting color-graded thumbnails based on the block space adjustment strategy of the present invention.
[0060] Figure 2 It is the overall framework diagram of the encryption method of the present invention.
[0061] Figure 3 It is a framework diagram of the two-pixel replacement method in step S400 of the present invention.
[0062] Figure 4 It is a framework diagram of the block space adjustment method in step S500 of the present invention.
[0063] Figure 5 It is a framework diagram of the permutation encryption operation in step S600 of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the embodiments described are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. 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. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0065] The following combination Figure 1-Figure 5 The present invention describes a color graded thumbnail storage and encryption method based on a block space adjustment strategy.
[0066] Example 1: This example provides a color-graded thumbnail storage encryption method based on a block space adjustment strategy. The overall processing framework is as follows: Figure 2 As shown, by fine-tuning the sum of element values in the block space to gradually align it with the element values in the original block pixels, the encrypted image and its thumbnail achieve a graded level of color vividness. As the adjustment ratio increases, the color vividness also increases. This method ensures that the encrypted image retains similar coarse visual information as the original image, thus meeting usability requirements and significantly improving adaptability to various IoT scenarios.
[0067] The encryption method includes the following specific steps: Figure 1 Shown, including:
[0068] S100: Preprocess the input image.
[0069] In this embodiment, RGB images are taken as an example, and a lossless compressed image format such as PNG or BMP is selected.
[0070] In a multi-channel color image, each channel is regarded as a two-dimensional digital matrix, and the value of the elements in the channel is less than or equal to 2d-1, where d = 128; each image is defined with a unique identifier, denoted as ρ; the image is processed in blocks, denoted as B m,n , dimension d l ×d l ; Component DB of part I in block i,j For part I, it is integrable.
[0071] S200, decompose each channel of the image into two parts, namely part I containing the highest bit plane and part II containing the remaining bit planes, wherein the highest bit plane is responsible for carrying the main color information of the image, and the remaining bit planes contain detail information.
[0072] S300. Generate a 256-bit pseudo-random key stream using the 2D-LSM chaotic system.
[0073] Before encryption, a secure key stream needs to be constructed. The high-performance chaotic system 2D-LSM is used to generate a sequence and construct a pseudo-random key stream. The process is as follows:
[0074] The key stream is recorded as μ represents the number of bits in the key, which is 256, and w represents the random selector;
[0075] A 2D-LSM chaotic system is used instead of a PRG to generate a large number of 256-bit key streams, which can be expressed as:
[0076] K s =round(abs(2D-LSM(X1, Y1, τ, σ, 256)));
[0077] Among them, round means rounding, abs means taking the absolute value, 2D-LSM means the pseudo-random number algorithm generated based on the two-dimensional chaotic mapping system, X1, Y1 represent the initial input values of the two-dimensional chaotic mapping system, X1, Y1∈(0,1), τ, σ represent the control parameters of the two-dimensional chaotic system, τ∈(0,4), σ∈(0,1).
[0078] To prevent the use of the same key to encrypt different registration times, the key stream needs to be replaced in Section II before encryption. To achieve this, each image is concatenated with an identifier ρ, which is uniquely defined for each image and the number of channels in the image. This concatenation is denoted as ρ||c, and its length Len is less than or equal to 256 bits. Finally, the K s The last Len bit in is replaced by ρ||c to obtain the encryption key.
[0079] S400 , performing a two-pixel sum-and-keep replacement operation on part II.
[0080] This step ensures that the sum of the elements of the encrypted pixel group is equal to or close to that of the original group, maintaining the usability of the image.
[0081] The image is divided into part I and part II, and the corresponding blocks are marked as B m,n , dimension d l ×d l . Two-pixel and keep replacement encryption method, such as Figure 3 As shown, the process is outlined as follows:
[0082] S410, organizing pixels in a block into pixel groups consisting of two pixels, represented as f = {f1, f2};
[0083] S420, calculate the sum of the pixel values of the pixel group f={f1, f2}, denoted as f s ;
[0084] S430, calculate all sums to be f s The pixel groups form a set θ s , expressed as:
[0085]
[0086] S440, using R s (·) equation determines the label of the pixel group f = {f1, f2}, denoted by ε f , expressed as:
[0087]
[0088] S450, the encrypted pixel group is represented as ε e , expressed as:
[0089] ε e =(ε f +β)mod|θ s |;
[0090] Among them, β is a sufficiently large number, and here it is stipulated that β≥2|θ s |;
[0091] S460, using The function converts the label ε e to encrypted pixel group f e , completes the process of replacement encryption of pixel groups.
[0092] S500, adjust the block space of part I.
[0093] This step is divided into two parts: space scattering and adjustment. The specific process is as follows:
[0094] S510, space scattering:
[0095] There are two cases when the highest bit plane of the image channel is divided into blocks. The first case occurs when the elements in the block are different, that is, they are composed of both 1 and 0, in which case the block cannot create additional space through compression, so it cannot be adjusted; the second case occurs when all elements in the data block are the same, that is, all 1 or all 0, in which case the block can be compressed to create space that can be used for subsequent adjustment. This step mainly targets the second case.
[0096] S520, adjustment:
[0097] Adjustment refers to the process of filling the vacated space with 1 or 0 to approximate the sum of the elements in the original bit plane. This makes the thumbnail of the encrypted image closer to the original version. Before any adjustment is made, it is necessary to determine whether the elements in the block can be compressed. If they can be compressed, only the first and second elements of the compressed block have values, while the other elements are vacated. The first element in the compressed block represents the compressible elements in the original block, and the second element is set to 0 to indicate compression.
[0098] By adjusting the sum of the element values in the block space to gradually align with the element values in the original block pixels, the color liveliness is graded. As the adjustment ratio increases, the color liveliness also increases. This means that by controlling the degree of block space adjustment, the color liveliness of the encrypted image can be controlled, thereby achieving color grading. This will be explained in detail by Figure 4 .
[0099] Figure 4 shows a block size of 4x4.
[0100] Figure 4 (a) describes a block where all elements are 1, which is compressible. In this case, the first element in the compressed block is 1 and the second element is 0, indicating that compression is possible.
[0101] Figure 4 (b) illustrates the block after vacating space, where the first and second elements are retained, while the remaining elements are vacated for subsequent adjustment.
[0102] Figure 4 (c) represents a block without any adjustments. The remaining space in the compressed block is filled with elements that are different from the original block, i.e., 0. Therefore, the sum of the element values in the block deviates more from the value of the original block, resulting in darker colors for the encrypted image and thumbnail.
[0103] Figure 4 (d) shows a compressed block that has been adjusted by 50%. At this stage, the sum of the element values in the block is half of the original block. As the adjustment proceeds, the colors of the encrypted image and thumbnail gradually approach the original version.
[0104] S600 , using the permutation table generated by the 2D-LSM chaotic system to perform pixel value permutation sorting on the image blocks of part I and part II respectively.
[0105] Permutation encryption is performed on the image blocks of Part I and Part II respectively. Permutation encryption is slightly different from substitution encryption. The former performs encryption operation on each block, while the latter performs encryption operation on a group of pixels within the block. Figure 5 As shown in Figure 2, permutation encryption requires a permutation table that can transform the one-dimensional sequence generated by the 2D-LSM chaotic system into a two-dimensional matrix, as shown below.
[0106] Use the same operation as for the image to divide the chaotic matrix M into blocks, denoted as M m,n .
[0107] Chaos Block M m,n The elements in the array are arranged in descending order to obtain the sorted chaotic block M′ m,n .
[0108] Extract chaotic block M′ m,n The corresponding index is used to obtain the permutation table G.
[0109] According to the permutation table G, the pixel values of the image blocks are sorted.
[0110] S700: Reorganize the processed blocks according to the original bit order to construct a complete encrypted image block.
[0111] Embodiment 2: This embodiment provides a non-transitory computer-readable storage medium having computer instructions stored thereon. The computer instructions enable a computer to execute a color-graded thumbnail storage and encryption method based on a block space adjustment strategy. The method includes the following steps:
[0112] S100, preprocessing the input image;
[0113] S200, decomposing each channel of the image into two parts, namely, part I containing the highest bit plane and part II containing the remaining bit planes, wherein the highest bit plane is responsible for carrying the main color information of the image, and the remaining bit planes contain detail information;
[0114] S300, using the 2D-LSM chaotic system to generate a 256-bit pseudo-random key stream;
[0115] S400, performing a two-pixel sum-keeping replacement operation on the portion II, by calculating the sum of pixel values of the pixel group and replacing the pixel group with a pixel group having an equal or similar sum;
[0116] S500, adjusting the block space of the portion I, including compressing the space when elements in the block are consistent, and filling the vacant space with 1 or 0 to approximate the sum of the elements in the original bit plane;
[0117] S600, applying the permutation table generated by the 2D-LSM chaotic system to permutate and sort the pixel values of the reorganized image block to construct a complete encrypted image block;
[0118] S700: Reorganize the processed blocks according to the original bit order to form a final encrypted image.
[0119] Embodiment 3: This embodiment provides an electronic device, which may include: a processor, a communications interface, a memory, and a communications bus, wherein the processor, the communications interface, and the memory communicate with each other via the communications bus. The processor may invoke logic instructions in the memory to execute a color-graded thumbnail storage encryption method based on a block space adjustment strategy, the method comprising the following steps:
[0120] S100, preprocessing the input image;
[0121] S200, decomposing each channel of the image into two parts, namely, part I containing the highest bit plane and part II containing the remaining bit planes, wherein the highest bit plane is responsible for carrying the main color information of the image, and the remaining bit planes contain detail information;
[0122] S300, using the 2D-LSM chaotic system to generate a 256-bit pseudo-random key stream;
[0123] S400, performing a two-pixel sum-keeping replacement operation on the portion II, by calculating the sum of pixel values of the pixel group and replacing the pixel group with a pixel group having an equal or similar sum;
[0124] S500, adjusting the block space of the portion I, including compressing the space when elements in the block are consistent, and filling the vacant space with 1 or 0 to approximate the sum of the elements in the original bit plane;
[0125] S600, applying the permutation table generated by the 2D-LSM chaotic system to permutate and sort the pixel values of the reorganized image block to construct a complete encrypted image block;
[0126] S700: Reorganize the processed blocks according to the original bit order to form a final encrypted image.
[0127] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0128] Embodiment 4: This embodiment provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform a color-graded thumbnail storage and encryption method based on a block space adjustment strategy. The method includes the following steps:
[0129] S100, preprocessing the input image;
[0130] S200, decomposing each channel of the image into two parts, namely, part I containing the highest bit plane and part II containing the remaining bit planes, wherein the highest bit plane is responsible for carrying the main color information of the image, and the remaining bit planes contain detail information;
[0131] S300, using the 2D-LSM chaotic system to generate a 256-bit pseudo-random key stream;
[0132] S400, performing a two-pixel sum-keeping replacement operation on the portion II, by calculating the sum of pixel values of the pixel group and replacing the pixel group with a pixel group having an equal or similar sum;
[0133] S500, adjusting the block space of the portion I, including compressing the space when elements in the block are consistent, and filling the vacant space with 1 or 0 to approximate the sum of the elements in the original bit plane;
[0134] S600, applying the permutation table generated by the 2D-LSM chaotic system to permutate and sort the pixel values of the reorganized image block to construct a complete encrypted image block;
[0135] S700: Reorganize the processed blocks according to the original bit order to form a final encrypted image.
[0136] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0137] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A color-graded thumbnail storage and encryption method based on a block space adjustment strategy, characterized in that: The following steps are involved: S100, preprocessing the input image; S200, decomposing each channel of the image into two parts, namely, part I containing the highest bit plane and part II containing the remaining bit planes, wherein the highest bit plane is responsible for carrying the main color information of the image, and the remaining bit planes contain detail information; S300, using the 2D-LSM chaotic system to generate a 256-bit pseudo-random key stream; S400, performing a two-pixel sum-keeping replacement operation on the portion II, by calculating the sum of pixel values of the pixel group and replacing the pixel group with a pixel group having an equal or similar sum; S500, adjusting the block space of the portion I, including compressing the space when elements in the block are consistent, and filling the vacant space with 1 or 0 to approximate the sum of the elements in the original bit plane; S600, applying the permutation table generated by the 2D-LSM chaotic system to permutate and sort the pixel values of the reorganized image block to construct a complete encrypted image block; S700: Reorganize the processed blocks according to the original bit order to form a final encrypted image.
2. The color-graded thumbnail storage and encryption method based on block space adjustment strategy according to claim 1, characterized in that: In step S100, the input image is preprocessed, and the specific method includes: S110, selecting an image format using lossless compression; S120, the image is a single-channel grayscale image or a multi-channel color map; when the image is a multi-channel color image, each channel is regarded as a two-dimensional digital matrix, and the value of the element in the channel is less than or equal to 2d-1, where d=128; S130, defining a unique identifier for each image, denoted as ρ; S140: Divide the image into blocks, and record them as data blocks B. m,n , the components of the first part of the block are integrable with respect to the first part.
3. The color-graded thumbnail storage and encryption method based on block space adjustment strategy according to claim 2, characterized in that: The step S300 uses the 2D-LSM chaotic system to generate a 256-bit pseudo-random key stream, including: S310, record the key stream as Where μ represents the number of bits in the key, which is 256, and w represents the random selector; S320, using the 2D-LSM chaotic system to generate a large number of 256-bit key streams, expressed as: K s =round(abs(2D-LSM(X1,Y1,τ,σ,256))); Wherein, round means rounding, abs means taking the absolute value, 2D-LSM means the pseudo-random number algorithm generated based on the two-dimensional chaotic mapping system, X1, Y1 represent the input initial values of the two-dimensional chaotic mapping system, X1, Y1∈(0,1), τ, σ represent the control parameters of the two-dimensional chaotic system, τ∈(0,4), σ∈(0,1); S330, concatenate the image with the corresponding identifier ρ, where the concatenation is denoted as ρ||c, and the length Len is less than or equal to 256 bits; S340, will be in K s The last Len bit in is replaced by ρ||c to obtain the encryption key.
4. The color-graded thumbnail storage and encryption method based on block space adjustment strategy according to claim 2, characterized in that: In step S400, a two-pixel sum-and-keep replacement operation is performed on the portion II. The specific method is: S410, organizing pixels in a block into pixel groups consisting of two pixels, represented as f = {f1, f2}; S420, calculate the sum of the pixel values of the pixel group f={f1, f2}, denoted as f s ; S430, calculate all sums to be f s The pixel groups form a set θ s , expressed as: S440, using R s (·) equation determines the label of the pixel group f = {f1, f2}, denoted by ε f , expressed as: S450, the encrypted pixel group is represented as ε e , expressed as: e e =(e f +β)mod|θ s |; Where β≥2|θ s |; S460, Utilization The function labels ε e Convert to encrypted pixel group f e , completing the process of substitution encryption of pixel groups.
5. The color-graded thumbnail storage and encryption method based on block space adjustment strategy according to claim 1, characterized in that: It is characterized in that In step S500, the block space of the portion I is adjusted, including: S510, Evacuation Space: Find data blocks with consistent elements, that is, identify data blocks where all elements are 1 or all elements are 0; Compress the space within the found data block to create additional space for subsequent adjustments; S520, Adjustment: Fill the vacated space with 1 or 0 to approximate the sum of the elements in the original bit plane; The first and second elements of the compressed block have values, and the other elements are left empty. The first element represents the compressible element in the original block, and the second element is set to 0, indicating that it has been compressed.
6. The color-graded thumbnail storage and encryption method based on block space adjustment strategy according to claim 1, characterized in that: The method of applying the permutation table generated by the 2D-LSM chaotic system in step S600 to permutate and sort the pixel values of the image blocks of part I and part II includes: S610: converting the one-dimensional sequence generated by the 2D-LSM chaotic system into a two-dimensional matrix to form a permutation table; S620: Sort the pixel values of the image blocks according to the substitution table to implement block-by-block substitution encryption; S630: The index of the substitution table is obtained by arranging the elements in the chaotic block in descending order.
7. The color-graded thumbnail storage and encryption method based on block space adjustment strategy according to claim 1, characterized in that: Step S700 reconstructs the encrypted blocks after substitution according to the original bit order to construct a complete encrypted image block, specifically: The adjusted highest bit plane and the remaining bit planes are reassembled according to the bit order when parts I and II are divided; ensuring that the reassembled image blocks are spatially continuous, and obtaining the final encrypted image.
8. A non-transitory computer-readable storage medium, characterized in that Computer instructions are stored thereon, and the computer instructions enable the computer to execute the color-grading thumbnail storage and encryption method based on the block space adjustment strategy according to any one of claims 1 to 7.
9. An electronic device, characterized in that: include: A processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus, and the processor calls logic instructions in the memory to execute the color grading thumbnail storage and encryption method based on the block space adjustment strategy according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the color grading thumbnail storage and encryption method based on the block space adjustment strategy according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for steganography of the digital watermarks through the channel end values
CN110570341A
Image encryption method based on chaotic mapping and bit-level replacement
CN112084517A