Image encryption methods and encrypted image sharing methods based on blockchain and zero watermarking
By constructing a new integer extraction model, key conversion, and three-dimensional discrete chaotic mapping model, combined with adaptive threshold sparsity and matrix coding techniques, plaintext images are encrypted. Image sharing is achieved using blockchain and zero-watermarking technology, which solves the problems of small key space and low visual security in existing technologies, and improves the security and robustness of image encryption.
Patent Information
- Application Number
- CN202311504703.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-11-10
AI Technical Summary
Existing image encryption methods have small key spaces and low encryption complexity, resulting in insufficient visual security and resistance to attacks for encrypted images. This is particularly true in remote medical image protection schemes based on compressed sensing and zero watermarking, which present security and complexity issues.
A newly constructed integer extraction model (NewIEM), a key transformation model (NewKTM), and a three-dimensional discrete chaotic mapping model (NewTDH) are used, combined with an adaptive threshold sparse model (ATS) and matrix coding technology, to encrypt plaintext images. Image sharing is achieved through blockchain and zero-watermarking technology, thereby improving the visual security and robustness of encrypted images.
The generated encrypted images have higher visual security and robustness, reducing the risk of attacks. At the same time, blockchain technology avoids trusted third-party storage, providing better security and copyright protection.
Smart Images

Figure CN117729291B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of blockchain and image encryption technology, and more specifically, to an image encryption method and an encrypted image sharing method based on blockchain and zero watermark. Background Technology
[0002] With the rapid development of computers, mobile communication devices, and multimedia information technology, an increasing amount of multimedia data (such as digital images, audio, and video) is widely disseminated on the Internet. Digital images, benefiting from their visualization capabilities, have applications spanning medical, political, military, and commercial activities. As an important carrier of multimedia information, digital images have made a significant contribution to modern network information exchange. However, digital images transmitted over public networks may involve trade secrets or personal privacy, facing security risks such as unauthorized access. Therefore, how to protect digital images has become an urgent problem to solve. Due to the inherent characteristics of digital images, such as data redundancy, two-dimensional spatial structure, and uneven energy distribution, researching and designing methods to provide security for digital images is essential.
[0003] To design secure and reliable encryption methods, increasingly diverse technologies from various fields are being applied to image encryption, such as optical methods, compressed sensing, DNA coding, and chaotic systems. Among these, chaotic systems, being mathematical dynamic systems with complex behavior and characteristics like initial value sensitivity, ergodicity, and aperiodicity, are highly suitable for generating pseudo-random numbers. Therefore, image encryption methods based on chaotic systems have become a research hotspot. In recent years, compressed sensing theory has broken the Nyquist sampling theorem's constraint on sampling frequency, allowing for the reconstruction of the original signal with lower sampling frequencies and higher probabilities. In particular, compressed sensing technology can simultaneously encrypt and compress images. Therefore, compressed sensing technology is also widely used in the field of image encryption. However, in some compressed sensing-based image encryption methods, the encryptor (sender) needs to transmit the measurement matrix as a key to the decryptor (receiver), thus increasing unnecessary data transmission. Additionally, some other image encryption methods utilize techniques such as quantum cellular automata, optical transformations, and neural networks to transform naturally occurring secret images containing a large amount of information into noise-like or texture-like ciphertext images. These methods effectively hide the original image information. However, ciphertext images resembling noise or texture are more likely to attract the attention of attackers, thus necessitating a significant improvement in their security. Currently, lossless copyright protection technologies such as zero-watermarking methods are a research hotspot in the field of data security. However, zero-watermarked images often require copyright registration with a trusted third-party management agency, which presents certain limitations in practical applications. Blockchain technology, with its decentralized, permanent storage, and transparent characteristics, can meet the requirement of a trusted third party in zero-watermarking methods.
[0004] Existing technologies disclose a zero-watermark telemedicine image protection scheme based on federated learning and blockchain, which can provide secure and effective copyright protection without distorting the host image or leaking data. This scheme trains the encoder network through federated learning; it can effectively extract robust features from medical images to obtain zero-watermark images; and it stores the zero-watermark images on the InterPlanetary File System (IPFS) through blockchain to achieve secure, decentralized, and tamper-proof file sharing. However, the encryption complexity of this existing technology is low, the key space is small, and the ability to resist known-plaintext attacks and chosen-plaintext attacks is weak. In addition, the visual security of the encrypted ciphertext image in this existing technology is also low. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, such as low randomness of encryption sequences, small key space, and low visual security of ciphertext images, this invention provides an image encryption method and an encrypted image sharing method based on blockchain and zero watermark. This method can improve the visual security and robustness of ciphertext images by hiding secret images in visually meaningful carrier images, thereby significantly reducing the risk of attacks.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: An image encryption method includes the following steps: S1.1: Obtain plaintext image Calculate plaintext images The variance; NewIEM, an integer extraction model, is established using plaintext images. The variances of the plaintext images are calculated separately. eigenvalues , and ; S1.2: Establish a key transformation model NewKTM and a three-dimensional discrete chaotic mapping model NewTDH. Use the key transformation model NewKTM to transform the plaintext image. eigenvalues , and The initial values are converted into the initial values of the three-dimensional discrete chaotic mapping model NewTDH, and the chaotic random sequence is obtained by iterating through the three-dimensional discrete chaotic mapping model NewTDH. , and ; S1.3: For plaintext images Perform a three-level discrete wavelet transform (DWT) to obtain the wavelet coefficient matrix. ; For chaotic random sequences Sort in ascending order and obtain the index sequence. ; wavelet coefficient matrix Convert to a one-dimensional vector and using index sequences right Scramble the sequence to obtain the scrambled one-dimensional sequence. and the scrambled one-dimensional sequence Convert to matrix ; S1.4: Establish the Adaptive Threshold Sparsity Model (ATS) and apply it to the matrix. Perform sparsity processing to obtain a sparse matrix. ; Using chaotic random sequences The generated measurement matrix is a sparse matrix Perform compression measurements and obtain measurement values. For the measured value Quantization to generate intermediate ciphertext image and the intermediate encrypted image Perform block division operation; S1.5: The chaotic random sequence Perform interval normalization on the elements to obtain the sequence. Using sequences For the intermediate ciphertext image after segmentation Perform inter-block XOR diffusion and intra-block spiral scan diffusion operations to acquire plaintext images. Corresponding secret image ; S1.6: Acquire carrier image Chaotic random sequence Transformed into two sequences and ; Use sequences For carrier images Perform row scrambling to obtain the image. Use sequences For images Image obtained by scrambling columns ; Secret images are encoded using matrix coding techniques. Embedded Image In the process, a reverse scrambling operation is performed to obtain a dense carrier image containing visual meaning. Complete the plaintext image Encryption.
[0007] Preferably, the specific steps of step S1.1 are as follows: Get size plaintext images Calculate plaintext images variance ; Establish the integer extraction model NewIEM and utilize plaintext images. variance Calculate the plaintext image for each of the 15 decimal places. The three eigenvalues , and ; The integer extraction model NewIEM is specifically as follows:
[0008] in, This represents the floor function.
[0009] Preferably, the specific steps of step S1.2 are as follows: Establish the key conversion model NewKTM and the three-dimensional discrete chaotic mapping model NewTDH; The key conversion model NewKTM is specifically as follows:
[0010] in, , and These are the initial values for the three-dimensional discrete chaotic mapping model NewTDH; , , ,in, , and These are the first, second, and third random numbers, respectively. The three-dimensional discrete chaotic mapping model NewTDH is specifically as follows:
[0011] in, , and These are the nth iterations of the three-dimensional discrete chaotic mapping model NewTDH. , and value; , , , and These are the first, second, third, fourth, and fifth parameters, respectively. The summation result is obtained using the NewKTM key transformation model. , and Initial values for converting to the three-dimensional discrete chaotic mapping model NewTDH , and and n from 0 to Iteratively iterate through the three-dimensional discrete chaotic mapping model NewTDH to obtain chaotic random sequences. , and .
[0012] Preferably, the specific steps of step S1.3 are as follows: plaintext images Perform a three-level discrete wavelet transform (DWT) to obtain the wavelet coefficient matrix. ; For chaotic random sequences Sort in ascending order and obtain the index sequence. The ascending sorting process is represented as follows: ; wavelet coefficient matrix Convert to a one-dimensional vector and using index sequences right Scramble the sequence to obtain the scrambled one-dimensional sequence. and the scrambled one-dimensional sequence Convert to size matrix The scrambling process is represented as follows: .
[0013] Preferably, the specific steps of step S1.4 are as follows: Establish an adaptive threshold sparse model (ATS) and apply it to the matrix. Perform sparsity processing to obtain a sparse matrix. ; The Adaptive Threshold Sparse Model (ATS) is specifically as follows:
[0014]
[0015] in, , , The sixth parameter, For the Euclidean norm, The sum of the elements For matrix The Column threshold, For matrix The A column contains more than 80% of its elements; in a matrix The In the column, less than The elements will be set to zero; Using chaotic random sequences The generated measurement matrix is a sparse matrix Perform compression measurements and obtain measurement values. The specific method is as follows: Constructing the Hadamard matrix Specifically:
[0016] in, , ; Set compression ratio and calculate Select a chaotic random sequence The former sort the values and generate corresponding indexes. According to the index Selecting the Hadamard matrix Partial rows form the measurement matrix The measurement matrix Specifically:
[0017] For sparse matrices ,calculate Get the size as Measured values ; Measured values Quantize to integers in the range [0, 255] to generate an intermediate ciphertext image. Specifically:
[0018] in, Indicates the measured value The minimum value in, Indicates the measured value The maximum value in; For the obtained intermediate ciphertext image Perform block segmentation operation to extract the intermediate ciphertext image. Divided into There are several sub-blocks, among which... , , and They are the first and second positive integers, respectively.
[0019] Preferably, the specific steps of step S1.5 are as follows: Chaotic random sequence The elements are range-normalized to transform the chaotic random sequence. Convert the elements to integers in the range [0, 255] to obtain the sequence. Specifically:
[0020] will sequence The former Each value is converted to a size of matrix Using matrices For the intermediate ciphertext image after segmentation Perform inter-block XOR diffusion operation:
[0021] in, , Represents the intermediate ciphertext image after block division. The first in Each block; Use sequences For each XOR-spread sub-block Perform a spiral scan within the block to obtain the array. ;Change the sequence The former Convert each value to contain A length of array of sequences Perform the following diffusion operation and obtain :
[0022] in, , ; Will Reorganized into size Secret Images Obtain plaintext images Corresponding secret image .
[0023] Preferably, the specific steps of step S1.6 are as follows: Get size carrier image Chaotic random sequence Transformed into two sequences and Specifically:
[0024] Extract sequence The former Given a set of values, generate a sequence. ; Extract sequence The former 1 value, generate sequence Use sequences For carrier images Perform row scrambling to obtain the image. Use sequences For images Image obtained by scrambling columns ; Secret Image Convert to 8-bit binary form: ,in, It is a secret image The highest plane, It is a secret image The lowest plane; Image Convert to 8-bit binary form: ,in, It is an image The highest plane, It is an image The lowest plane; Will The 8 bits are divided into 4 groups of secret information, with each group consisting of 2 bits: , , and ; Four sets of secret information were embedded using matrix encoding techniques. In the lower three bits, the method is as follows:
[0025]
[0026] according to , and right Modifying the lower three bits can be divided into four cases: if , If so, no changes are needed; if , ,but ,~ represents the binary inversion operation; if , ,but ;if , ,but Thus complete , Embedding; Using the method described above, sequentially... , and Embedded Image In the process, obtain the matrix in binary form. ; to matrix Convert to decimal to obtain the matrix Then, for the matrix Perform a reverse scrambling operation to obtain a dense carrier image containing visual meaning. Complete the plaintext image Encryption.
[0027] This invention also provides an encrypted image sharing method based on blockchain technology and zero-watermark authentication, used to share encrypted carrier images obtained by the above-mentioned image encryption method between the encrypting party and the decrypting party. This includes the following steps: S2.1: Zero Watermark Generation: Obtain a QR code containing copyright information. The encryptor uses the Arnold mapping to scramble the QR code containing copyright information, generating a scrambling matrix. ; plaintext images Corresponding secret image Perform a discrete cosine transform to obtain the coefficient matrix. ; intercept The area of preset size in the upper left corner is used as the region of interest. And based on the region of interest Generate feature matrix ; Scramble the matrix With characteristic matrix Perform an XOR operation to generate a zero-watermark matrix. ; The crypto party uses a pre-set smart contract , zero watermark matrix Stored on the Ethereum blockchain; S2.2: Restore QR code and verify: The cryptographic party will use the smart contract The address is sent to the decryptor; the decryptor then queries the corresponding smart contract in the Ethereum blockchain. And obtain the zero watermark matrix. and secret images ; The decryption party will use the zero-watermark matrix With secret images Feature matrix Perform an XOR operation to obtain the scrambling matrix. and the scrambled matrix Perform reverse Arnold mapping, recover the QR code, and complete identity authentication; S2.3: The decryptor receives the image containing the encrypted carrier. Then, the encrypting party will give the key. , and Send the key to the decryptor; the decryptor will then use the key. , and Input the three-dimensional discrete chaotic mapping model NewTDH and generate chaotic random sequences. , and ; The decryption method uses chaotic random sequences , and For dense carrier images Extract and decrypt to obtain the decrypted image. Decryption complete.
[0028] Preferably, the QR code containing copyright information can also be a trademark image containing copyright information, in which case the smart contract in steps S2.1 and S2.2... Transform into smart contracts ; The smart contract Used to compare the similarity of two sequences and verify the validity of trademark images; the smart contract The Levenshtein distance is used to determine the similarity between two sequences, two strings. and The Levenshtein distance can be calculated using the following formula:
[0029] in, Represents a string and The Levenshtein distance between them and They represent strings respectively and Length, This indicates that the first character of the string has been removed. The cryptographic party converts the trademark image into a one-dimensional string and writes it into a smart contract. ; Crypto parties will use smart contracts Send to the decryptor; The decryption party will use the smart contract After deployment to the Ethereum blockchain, during identity verification, the decryptor uses a zero-watermark matrix. After restoring the trademark image, convert it into a one-dimensional string and input the converted one-dimensional string into the smart contract. Similarity verification is performed in the process.
[0030] Preferably, the specific steps of step S2.3 are as follows: The decryptor receives the image containing the encrypted carrier. Then, the encrypting party will give the key. , and Send the key to the decryptor; the decryptor will then use the key. , and Input the three-dimensional discrete chaotic mapping model NewTDH and generate chaotic random sequences. , and ; Decryption of chaotic random sequences Preprocessing is performed to generate sequences. and The decryptor uses the sequence For dense carrier images Perform row scrambling to generate an image. ;use For images Perform column scrambling to generate an image. ; Image Converted to 8-bit binary form, it is denoted as: Extract secret information using the following formulas. , , and :
[0031]
[0032] The decryption team reassembled the four sets of secret information into an 8-bit binary matrix. Then Convert to decimal form to obtain the secret image. ; The decryption method uses chaotic random sequences Secret Images Perform inverse diffusion to obtain the matrix. ; The decryptor uses the OMP algorithm to analyze the matrix. Reconstruct the matrix to obtain the matrix. Using chaotic random sequences For matrix Perform the inverse scrambling operation to obtain the coefficient matrix. ; Decryption of the matrix Perform inverse discrete wavelet transform to obtain the final decrypted image. Decryption complete.
[0033] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention provides an image encryption method and an encrypted image sharing method based on blockchain and zero watermarking. First, the variance of the plaintext image is calculated, and a new integer extraction model, NewIEM, is established to calculate three feature values. Then, a new key transformation model, NewKTM, is constructed, and the feature values are converted into initial values for a new three-dimensional discrete chaotic mapping, NewTDH. Next, NewTDH is iterated to generate a chaotic sequence. Then, Discrete Wavelet Transform (DWT) is performed on the plaintext image, and an Adaptive Threshold Sparse Model (ATS) is established to sparsify the wavelet coefficient matrix, generating a sparse matrix. Next, a measurement matrix controlled by the chaotic sequence is used to compress and measure the sparse matrix to obtain an intermediate ciphertext image. Then, the intermediate ciphertext image is divided into blocks, and inter-block XOR diffusion and intra-block spiral scan diffusion operations are performed to generate a secret image. Next, to improve the visual security of the image, a chaotic sequence is used to scramble the carrier image, and the secret image is embedded within it using matrix encoding technology. Finally, the scrambled carrier image containing the secret information is inversely scrambled to obtain a visually meaningful ciphertext carrier image. Furthermore, to achieve image copyright authentication, this invention proposes an authentication framework based on blockchain technology and zero-watermarking technology. The image feature matrix of the secret image is XORed with a QR code containing copyright information to generate a zero-watermark matrix. Then, a smart contract for storing data and using it for authentication is designed. The encrypting party initiates a transaction, deploying the smart contract onto the Ethereum blockchain. The zero-watermark matrix is stored in the Ethereum blockchain as additional information of the contract. The decrypting party can extract the zero-watermark matrix from the blockchain and use it for authentication. This framework avoids the need for a trusted third party to store the zero-watermark matrix. Compared with existing image encryption methods, the advantages of this invention are: 1) A novel three-dimensional discrete chaotic mapping, NewTDH, is constructed, which generates sequences with better randomness. The generation of the measurement matrix depends on the chaotic sequence, and the reconstruction stage no longer requires the additional transmission of the measurement matrix. The initial value of NewTDH depends on random numbers and plaintext images. Furthermore, the designed NewKTM can control the initial value range of NewTDH between [0,1], ensuring that the sequence generated by NewTDH has sufficient randomness. Through the addition of random numbers and NewKTM, this invention has a sufficiently large key space and the ability to resist known-plaintext attacks and chosen-plaintext attacks. 2) This invention designs an adaptive threshold sparse model (ATS), which improves the sparsity of the sparse matrix and ensures the quality of the reconstructed image. 3) By using chaotic encryption technology and matrix coding technology, the secret image is embedded in the carrier image, and the extraction of the secret image does not depend on the original carrier image. Therefore, the present invention can make the encrypted image have sufficient visual security. 4) Combining blockchain technology and zero-watermarking technology, a copyright protection framework is proposed that does not require a trusted third party to store zero-watermark information, thus providing better security; The image encryption method and the encrypted image sharing method based on blockchain and zero watermark proposed in this invention can provide valuable reference for image encryption technology research. Attached Figure Description
[0034] Figure 1 This is a diagram illustrating the architecture of an image encryption method provided in Example 1.
[0035] Figure 2 This is the intra-block spiral scan path diagram provided in Example 1.
[0036] Figure 3 The image provided in Example 1 is a plaintext image.
[0037] Figure 4 The image shown is of the carrier provided in Example 1.
[0038] Figure 5 The image shows a dense carrier provided in Example 1.
[0039] Figure 6 This is a statistical histogram of the carrier image provided in Example 1.
[0040] Figure 7 This is a statistical histogram of the dense carrier image provided in Example 1.
[0041] Figure 8 This is an architecture diagram of an encrypted image sharing method based on blockchain technology and zero watermark authentication provided in Example 2.
[0042] Figure 9 This is a schematic diagram of a QR code containing copyright information provided in Example 2.
[0043] Figure 10 This is a schematic diagram of the zero watermark matrix provided in Example 2.
[0044] Figure 11 This is a schematic diagram of the decrypted image provided in Example 2. Detailed Implementation
[0045] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent. To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions; It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.
[0046] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0047] Example 1 This embodiment provides an image encryption method, including the following steps: S1.1: Obtain plaintext image Calculate plaintext images The variance; NewIEM, an integer extraction model, is established using plaintext images. The variances of the plaintext images are calculated separately. eigenvalues , and ; S1.2: Establish a key transformation model NewKTM and a three-dimensional discrete chaotic mapping model NewTDH. Use the key transformation model NewKTM to transform the plaintext image. eigenvalues , and The initial values are converted into the initial values of the three-dimensional discrete chaotic mapping model NewTDH, and the chaotic random sequence is obtained by iterating through the three-dimensional discrete chaotic mapping model NewTDH. , and ; S1.3: For plaintext images Perform a three-level discrete wavelet transform (DWT) to obtain the wavelet coefficient matrix. ; For chaotic random sequences Sort in ascending order and obtain the index sequence. ; wavelet coefficient matrix Convert to a one-dimensional vector and using index sequences right Scramble the sequence to obtain the scrambled one-dimensional sequence. and the scrambled one-dimensional sequence Convert to matrix ; S1.4: Establish the Adaptive Threshold Sparsity Model (ATS) and apply it to the matrix. Perform sparsity processing to obtain a sparse matrix. ; Using chaotic random sequences The generated measurement matrix is a sparse matrix Perform compression measurements and obtain measurement values. For the measured value Quantization to generate intermediate ciphertext image and the intermediate encrypted image Perform block division operation; S1.5: The chaotic random sequence Perform interval normalization on the elements to obtain the sequence. Using sequences For the intermediate ciphertext image after segmentation Perform inter-block XOR diffusion and intra-block spiral scan diffusion operations to acquire plaintext images. Corresponding secret image ; S1.6: Acquire carrier image Chaotic random sequence Transformed into two sequences and ; Use sequences For carrier images Perform row scrambling to obtain the image. Use sequences For images Image obtained by scrambling columns ; Secret images are encoded using matrix coding techniques. Embedded Image In the process, a reverse scrambling operation is performed to obtain a dense carrier image containing visual meaning. Complete the plaintext image Encryption.
[0048] In the specific implementation process, such as Figure 1 As shown, first input the size as plaintext images and size are carrier image Set the parameters of the newly constructed chaotic map NewTDH to , , , and Select random numbers , and ; Calculate plaintext images variance We established the integer extraction model NewIEM and utilized plaintext images. variance Calculate the plaintext image for each of the 15 decimal places. The three eigenvalues , and ; The integer extraction model NewIEM is specifically as follows:
[0049] in, This represents the floor function; Establish the key conversion model NewKTM and the three-dimensional discrete chaotic mapping model NewTDH; The key conversion model NewKTM is specifically as follows:
[0050] in, , and These are the initial values for the three-dimensional discrete chaotic mapping model NewTDH; , , ,in, , and These are the first, second, and third random numbers, respectively. The three-dimensional discrete chaotic mapping model NewTDH is specifically as follows:
[0051] in, , and These are the nth iterations of the three-dimensional discrete chaotic mapping model NewTDH. , and value; The summation result is obtained using the NewKTM key transformation model. , and Initial values for converting to the three-dimensional discrete chaotic mapping model NewTDH , and and n from 0 to Iteratively iterate through the three-dimensional discrete chaotic mapping model NewTDH to obtain chaotic random sequences. , and ; plaintext images Perform a three-level discrete wavelet transform (DWT) to obtain the wavelet coefficient matrix. The low-frequency components in the wavelet coefficient matrix carry more information, while the high-frequency components carry less information. To improve the quality of the reconstructed image, the wavelet coefficient matrix needs to be scrambled. For chaotic random sequences Sort in ascending order and obtain the index sequence. The ascending sorting process is represented as follows: ; wavelet coefficient matrix Convert to a one-dimensional vector and using index sequences right Scramble the sequence to obtain the scrambled one-dimensional sequence. and the scrambled one-dimensional sequence Convert to size matrix The scrambling process is represented as follows: At this point, the low-frequency and high-frequency components are evenly distributed in the matrix. middle; Establish an adaptive threshold sparse model (ATS) and apply it to the matrix. Perform sparsity processing to obtain a sparse matrix. ; The Adaptive Threshold Sparse Model (ATS) is specifically as follows:
[0052]
[0053] in, , , The sixth parameter, For the Euclidean norm, The sum of the elements For matrix The Column threshold, For matrix The A column contains more than 80% of its elements; in a matrix The In the column, less than The elements will be set to zero; Using chaotic random sequences The generated measurement matrix is a sparse matrix Perform compression measurements and obtain measurement values. The specific method is as follows: Constructing the Hadamard matrix Specifically:
[0054] in, , ; Set compression ratio and calculate Select a chaotic random sequence The former sort the values and generate corresponding indexes. According to the index Selecting the Hadamard matrix Partial rows form the measurement matrix The measurement matrix Specifically:
[0055] For sparse matrices ,calculate Get the size as Measured values ; Measured values Quantize to integers in the range [0, 255] to generate an intermediate ciphertext image. Specifically:
[0056] in, Indicates the measured value The minimum value in, Indicates the measured value The maximum value in; For the obtained intermediate ciphertext image Perform block segmentation operation to extract the intermediate ciphertext image. Divided into There are several sub-blocks, among which... , , and They are the first and second positive integers, respectively; Then the chaotic random sequence The elements are range-normalized to transform the chaotic random sequence. Convert the elements to integers in the range [0, 255] to obtain the sequence. Specifically:
[0057] will sequence The former Each value is converted to a size of matrix Using matrices For the intermediate ciphertext image after segmentation Perform inter-block XOR diffusion operation:
[0058] in, , Represents the intermediate ciphertext image after block division. The first in Each block; Use sequences For each XOR-spread sub-block Perform an intra-block spiral scan; the spiral scan path is as follows: Figure 2 As shown, obtain the array ;Change the sequence The former Convert each value to contain A length of array of sequences Perform the following diffusion operation and obtain :
[0059] in, , ; Will Reorganized into size Secret Images Obtain plaintext images Corresponding secret image ; Chaotic random sequence Transformed into two sequences and Specifically:
[0060] Cut The former 1 value, generate sequence Similarly, intercept The former 1 value, generate sequence Use sequences For carrier images Perform row scrambling to obtain the image. The formula is:
[0061] in, ; Use sequences For images Image obtained by scrambling columns The formula is:
[0062] in, ; Secret Image Convert to 8-bit binary form: ,in, It is a secret image The highest plane, It is a secret image The lowest plane; Image Convert to 8-bit binary form: ,in, It is an image The highest plane, It is an image The lowest plane; Will The 8 bits are divided into 4 groups of secret information, with each group consisting of 2 bits: , , and ; Four sets of secret information were embedded using matrix encoding techniques. In the lower three bits, the method is as follows:
[0063]
[0064] according to , and right Modifying the lower three bits can be divided into four cases: if , If so, no changes are needed; if , ,but ,~ represents the binary inversion operation; if , ,but ;if , ,but Thus complete , Embedding; Using the method described above, sequentially... , and Embedded Image In the process, obtain the matrix in binary form. ; to matrix Convert to decimal to obtain the matrix Then, for the matrix Perform a reverse scrambling operation to obtain a dense carrier image containing visual meaning. Complete the plaintext image Encryption; This embodiment also demonstrates the effectiveness of the method through experiments, such as... Figures 3-5 As shown, Figure 3 Plaintext images used in the experiment. Figure 4 The image of the carrier used in the experiment. Figure 5 To utilize the dense carrier image containing visual meaning generated by this method; in terms of statistical properties, Figure 6 and Figure 7 The histograms of the carrier image and the image containing the secret carrier are shown respectively. It can be seen that the image containing the secret carrier is visually similar to the carrier image, which effectively hides the secret information. This method constructs a novel chaotic map, NewTDM, with more complex chaotic behavior. Then, it uses the chaotic sequence generated by this map to control the generation of the measurement matrix, reducing additional data transmission. Secondly, an adaptive threshold sparsity model (ATS) is designed to make compression performance more stable and computationally more convenient. Finally, the chaotic sequence is used to scramble the carrier image, and the secret matrix is embedded within it using matrix encoding techniques to generate a visually meaningful encrypted carrier image. This method effectively improves the visual security and robustness of encrypted images by hiding the secret image within a visually meaningful carrier image, thus significantly reducing the risk of attack.
[0065] Example 2 This embodiment provides an encrypted image sharing method based on blockchain technology and zero-watermark authentication, used to share the encrypted carrier image obtained in Embodiment 1 between the encrypting party and the decrypting party. This includes the following steps: S2.1: Zero Watermark Generation: Obtain a QR code containing copyright information. The encryptor uses the Arnold mapping to scramble the QR code containing copyright information, generating a scrambling matrix. ; plaintext images Corresponding secret image Perform a discrete cosine transform to obtain the coefficient matrix. ; intercept The area of preset size in the upper left corner is used as the region of interest. And based on the region of interest Generate feature matrix ; Scramble the matrix With characteristic matrix Perform an XOR operation to generate a zero-watermark matrix. ; The crypto party uses a pre-set smart contract , zero watermark matrix Stored on the Ethereum blockchain; S2.2: Restore QR code and verify: The cryptographic party will use the smart contract The address is sent to the decryptor; the decryptor then queries the corresponding smart contract in the Ethereum blockchain. And obtain the zero watermark matrix. and secret images ; The decryption party will use the zero-watermark matrix With secret images Feature matrix Perform an XOR operation to obtain the scrambling matrix. and the scrambled matrix Perform reverse Arnold mapping, recover the QR code, and complete identity authentication; S2.3: The decryptor receives the image containing the encrypted carrier. Then, the encrypting party will give the key. , and Send the key to the decryptor; the decryptor will then use the key. , and Input the three-dimensional discrete chaotic mapping model NewTDH and generate chaotic random sequences. , and ; The decryption method uses chaotic random sequences , and For dense carrier images Extract and decrypt to obtain the decrypted image. Decryption complete.
[0066] In the specific implementation process, such as Figure 8 As shown, firstly, during the zero-watermark generation and uploading stage, a QR code containing copyright information is obtained, such as... Figure 9As shown, the QR code size in this embodiment is ; The encryptor uses the Arnold map to scramble the QR code containing copyright information, generating a scrambling matrix. The formula for the Arnold mapping is as follows:
[0067] in, This represents the coordinates of the pixel before the transformation. Represents the coordinates of the transformed pixel. Indicates the number of rows in the image. and Indicates the scrambling parameter; plaintext images Corresponding secret image Perform Discrete Cosine Transform (DCT) to obtain the coefficient matrix. ; intercept The size of the top left corner is The region as the region of interest And based on the region of interest Generate feature matrix The specific method is as follows: [The matrix is then...] In a matrix, if the element value is even, then... Set the element at the corresponding position in the matrix to 1; additionally, set the matrix... In a matrix where the number of elements is odd, The corresponding element is set to 0, thus generating the feature matrix. ; Scramble the matrix With characteristic matrix Perform an XOR operation to generate a zero-watermark matrix. The zero-watermark matrix generated in this embodiment Corresponding to QR codes, zero watermark matrix like Figure 10 As shown; To avoid introducing a third-party management agency as required by traditional zero-watermarking methods, this method designs a new smart contract. The image is deployed on the Ethereum blockchain by the image owner and is primarily used by the image owner; the cryptographic side uses a pre-defined smart contract. , zero watermark matrix Stored on the Ethereum blockchain; During the verification phase, to recover the QR code and verify its validity, the image owner needs to send the contract address to the decryptor; the encryptor will then send the smart contract... After the address is sent to the decryption party, the decryption party queries the corresponding smart contract in the Ethereum blockchain. And obtain the zero watermark matrix. and secret images ; The decryption party will use the zero-watermark matrix With secret images Feature matrix Perform an XOR operation to obtain the scrambling matrix. and the scrambled matrix Perform reverse Arnold mapping, recover the QR code, and complete identity authentication; In some cases, copyright information may be a trademark image instead of a QR code. To verify the validity of the trademark image, this method designs a smart contract that can be used to compare the similarity of two sequences. ; The smart contract Used to compare the similarity of two sequences and verify the validity of trademark images; the smart contract The Levenshtein distance is used to determine the similarity between two sequences. If the similarity is higher than a threshold, copyright authentication succeeds; otherwise, it fails. (Two strings...) and The Levenshtein distance can be calculated using the following formula:
[0068] in, Represents a string and The Levenshtein distance between them and They represent strings respectively and Length, This indicates that the first character of the string has been removed. The sharing process then becomes: the cryptographic party converts the trademark image into a one-dimensional string and writes it into a smart contract. ; Crypto parties will use smart contracts Send to the decryptor; The decryption party will use the smart contract After deployment to the Ethereum blockchain, during identity verification, the decryptor uses a zero-watermark matrix. After restoring the trademark image, convert it into a one-dimensional string and input the converted one-dimensional string into the smart contract. Similarity verification is performed during the process; After successful verification, the decryptor can decrypt the image and receive the encrypted carrier image. Then, the encrypting party will give the key. , and Send the key to the decryptor; the decryptor will then use the key. , and Input the three-dimensional discrete chaotic mapping model NewTDH and generate chaotic random sequences. , and ; Decryption of chaotic random sequences Preprocessing is performed to generate sequences. and The decryptor uses the sequence For dense carrier images Perform row scrambling to generate an image. ;use For images Perform column scrambling to generate an image. ; Image Converted to 8-bit binary form, it is denoted as: Extract secret information using the following formulas. , , and :
[0069]
[0070] The decryption team reassembled the four sets of secret information into an 8-bit binary matrix. Then Convert to decimal form to obtain the secret image. ; The decryption method uses chaotic random sequences Secret Images Perform inverse diffusion to obtain the matrix. ; The decryptor uses the OMP algorithm to analyze the matrix. Reconstruct the matrix to obtain the matrix. Using chaotic random sequences For matrix Perform the inverse scrambling operation to obtain the coefficient matrix. ; Decryption of the matrix Perform inverse discrete wavelet transform to obtain the final decrypted image. Decryption is completed; the encrypted carrier image of Example 1 is decrypted using this method. Decryption, the final decrypted image like Figure 11 As shown; This method utilizes blockchain technology to address the issue of trusted third parties in image copyright protection. By combining blockchain and zero-watermarking technologies, a copyright protection framework is proposed that eliminates the need for a trusted third party to store zero-watermark information, thus providing enhanced security. Furthermore, the extraction of secret information in this method relies solely on the image containing the secret carrier, enabling the recovery of secret information even without the original carrier image.
[0071] The same or similar labels correspond to the same or similar parts; The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent. Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. An image encryption method, characterized in that, Includes the following steps: S1.1: Obtain plaintext image Calculate plaintext images The variance; NewIEM, an integer extraction model, is established using plaintext images. The variances of the plaintext images are calculated separately. eigenvalues , and ; S1.2: Establish the key transformation model NewKTM and the three-dimensional discrete chaotic mapping model NewTDH, and use the key transformation model NewKTM to transform the plaintext image. eigenvalues , and The initial values are converted into the initial values of the three-dimensional discrete chaotic mapping model NewTDH, and the chaotic random sequence is obtained by iterating through the three-dimensional discrete chaotic mapping model NewTDH. , and ; S1.3: For plaintext images Perform a three-level discrete wavelet transform (DWT) to obtain the wavelet coefficient matrix. ; For chaotic random sequences Sort in ascending order and obtain the index sequence. ; wavelet coefficient matrix Convert to a one-dimensional vector and using index sequences right Scramble the sequence to obtain the scrambled one-dimensional sequence. and the scrambled one-dimensional sequence Convert to matrix ; S1.4: Establish the Adaptive Threshold Sparsity Model (ATS) and apply it to the matrix. Perform sparsity processing to obtain a sparse matrix. ; Using chaotic random sequences The generated measurement matrix is a sparse matrix Perform compression measurements and obtain measurement values. For the measured value Quantization to generate intermediate ciphertext image and the intermediate encrypted image Perform block division operation; S1.5: The chaotic random sequence Perform interval normalization on the elements to obtain the sequence. Using sequences For the intermediate ciphertext image after segmentation Perform inter-block XOR diffusion and intra-block spiral scan diffusion operations to acquire plaintext images. Corresponding secret image ; S1.6: Acquire carrier image Chaotic random sequence Transformed into two sequences and ; Use sequences For carrier images Perform row scrambling to obtain the image. Use sequences For images Image obtained by scrambling columns ; Secret images are encoded using matrix coding techniques. Embedded Image In the process, a reverse scrambling operation is performed to obtain a dense carrier image containing visual meaning. Complete the plaintext image Encryption.
2. The image encryption method according to claim 1, characterized in that, The specific steps of step S1.1 are as follows: Get size plaintext images Calculate plaintext images variance ; Establish the integer extraction model NewIEM and utilize plaintext images. variance Calculate the plaintext image for each of the 15 decimal places. The three eigenvalues , and ; The integer extraction model NewIEM is specifically as follows: in, This represents the floor function.
3. The image encryption method according to claim 2, characterized in that, The specific steps of step S1.2 are as follows: Establish the key conversion model NewKTM and the three-dimensional discrete chaotic mapping model NewTDH; The key conversion model NewKTM is specifically as follows: in, , and These are the initial values for the three-dimensional discrete chaotic mapping model NewTDH; , , ,in, , and These are the first, second, and third random numbers, respectively. The three-dimensional discrete chaotic mapping model NewTDH is specifically as follows: in, , and These are the nth iterations of the three-dimensional discrete chaotic mapping model NewTDH. , and value; , , , and These are the first, second, third, fourth, and fifth parameters, respectively. The summation result is obtained using the NewKTM key transformation model. , and Initial values for converting to the three-dimensional discrete chaotic mapping model NewTDH , and and n from 0 to Iteratively iterate through the three-dimensional discrete chaotic mapping model NewTDH to obtain chaotic random sequences. , and .
4. The image encryption method according to claim 3, characterized in that, The specific steps of step S1.3 are as follows: plaintext images Perform a three-level discrete wavelet transform (DWT) to obtain the wavelet coefficient matrix. ; For chaotic random sequences Sort in ascending order and obtain the index sequence. The ascending sorting process is represented as follows: ; wavelet coefficient matrix Convert to a one-dimensional vector and using index sequences right Scramble the sequence to obtain the scrambled one-dimensional sequence. and the scrambled one-dimensional sequence Convert to size matrix The scrambling process is represented as follows: .
5. The image encryption method according to claim 4, characterized in that, The specific steps of step S1.4 are as follows: Establish an adaptive threshold sparse model (ATS) and apply it to the matrix. Perform sparsity processing to obtain a sparse matrix. ; The Adaptive Threshold Sparse Model (ATS) is specifically as follows: in, , , The sixth parameter, For the Euclidean norm, The sum of the elements For matrix The Column threshold, For matrix The A column contains more than 80% of its elements; in a matrix The In the column, less than The elements will be set to zero; Using chaotic random sequences The generated measurement matrix is a sparse matrix Perform compression measurements and obtain measurement values. The specific method is as follows: Constructing the Hadamard matrix Specifically: in, , ; Set compression ratio and calculate Select a chaotic random sequence The former sort the values and generate corresponding indexes. According to the index Selecting the Hadamard matrix Partial rows form the measurement matrix The measurement matrix Specifically: For sparse matrices ,calculate Get the size as Measured values ; Measured values Quantize to integers in the range [0, 255] to generate an intermediate ciphertext image. Specifically: in, Indicates the measured value The minimum value in, Indicates the measured value The maximum value in; For the obtained intermediate ciphertext image Perform block segmentation operation to extract the intermediate ciphertext image. Divided into There are several sub-blocks, among which... , , and They are the first and second positive integers, respectively.
6. The image encryption method according to claim 5, characterized in that, The specific steps of step S1.5 are as follows: Chaotic random sequence The elements are range-normalized to transform the chaotic random sequence. Convert the elements to integers in the range [0, 255] to obtain the sequence. Specifically: will sequence The former Each value is converted to a size of matrix Using matrices For the intermediate ciphertext image after segmentation Perform inter-block XOR diffusion operation: in, , Represents the intermediate ciphertext image after block division. The first in Each block; Use sequences For each XOR-spread sub-block Perform a spiral scan within the block to obtain the array. ;Change the sequence The former Convert each value to contain A length of array of sequences Perform the following diffusion operation and obtain : in, , ; Will Reorganized into size Secret Images Obtain plaintext images Corresponding secret image .
7. The image encryption method according to claim 6, characterized in that, The specific steps of step S1.6 are as follows: Get size carrier image Chaotic random sequence Transformed into two sequences and Specifically: Extract sequence The former 1 value, generate sequence ; Extract sequence The former 1 value, generate sequence Use sequences For carrier images Perform row scrambling to obtain the image. Use sequences For images Image obtained by scrambling columns ; Secret Image Convert to 8-bit binary form: ,in, It is a secret image The highest plane, It is a secret image The lowest plane; Image Convert to 8-bit binary form: ,in, It is an image The highest plane, It is an image The lowest plane; Will The 8 bits are divided into 4 groups of secret information, with each group consisting of 2 bits: , , and ; Four sets of secret information were embedded using matrix encoding techniques. In the lower three bits, the method is as follows: according to , and right Modifying the lower three bits can be divided into four cases: if , If so, no changes are needed; if , ,but ,~ represents the binary inversion operation; if , ,but ;if , ,but Thus complete , Embedding; Using the method described above, sequentially... , and Embedded Image In the process, obtain the matrix in binary form. ; to matrix Convert to decimal to obtain the matrix Then, for the matrix Perform a reverse scrambling operation to obtain a dense carrier image containing visual meaning. Complete the plaintext image Encryption.
8. A method for sharing encrypted images based on blockchain technology and zero-watermark authentication, used to share encrypted carrier images obtained by the image encryption method according to any one of claims 1 to 7 between the encrypting party and the decrypting party. Its characteristics are, Includes the following steps: S2.1: Zero Watermark Generation: Obtain a QR code containing copyright information. The encryptor uses the Arnold mapping to scramble the QR code containing copyright information, generating a scrambling matrix. ; plaintext images Corresponding secret image Perform a discrete cosine transform to obtain the coefficient matrix. ; intercept The area of preset size in the upper left corner is used as the region of interest. And based on the region of interest Generate feature matrix ; Scramble the matrix With characteristic matrix Perform an XOR operation to generate a zero-watermark matrix. ; The crypto party uses a pre-set smart contract , zero watermark matrix Stored on the Ethereum blockchain; S2.2: Restore QR code and verify: The cryptographic party will use the smart contract The address is sent to the decryptor; The decryptor queries the corresponding smart contract in the Ethereum blockchain. And obtain the zero watermark matrix. and secret images ; The decryption party will use the zero-watermark matrix With secret images Feature matrix Perform an XOR operation to obtain the scrambling matrix. and the scrambled matrix Perform reverse Arnold mapping, recover the QR code, and complete identity authentication; S2.3: The decryptor receives the image containing the encrypted carrier. Then, the encrypting party will give the key. , and Send the key to the decryptor; the decryptor will then use the key. , and Input the three-dimensional discrete chaotic mapping model NewTDH and generate chaotic random sequences. , and ; The decryption method uses chaotic random sequences , and For dense carrier images Extract and decrypt to obtain the decrypted image. Decryption complete.
9. A method for sharing encrypted images based on blockchain technology and zero-watermark authentication according to claim 8, characterized in that, The QR code containing copyright information can also be a trademark image containing copyright information, in which case the smart contract in steps S2.1 and S2.2... Transform into smart contracts ; The smart contract Used to compare the similarity of two sequences and verify the validity of trademark images; the smart contract The Levenshtein distance is used to determine the similarity between two sequences, two strings. and The Levenshtein distance can be calculated using the following formula: in, Represents a string and The Levenshtein distance between them and They represent strings respectively and Length, This indicates that the first character of the string has been removed. The cryptographic party converts the trademark image into a one-dimensional string and writes it into a smart contract. ; Crypto parties will use smart contracts Send to the decryptor; The decryption party will use the smart contract After deployment to the Ethereum blockchain, during identity verification, the decryption party uses a zero-watermark matrix. After restoring the trademark image, convert it into a one-dimensional string and input the converted one-dimensional string into the smart contract. Similarity verification is performed in the process.
10. The encrypted image sharing method based on blockchain technology and zero-watermark authentication according to claim 9, characterized in that, The specific steps of step S2.3 are as follows: The decryptor receives the image containing the encrypted carrier. Then, the encrypting party will give the key. , and Send the key to the decryptor; the decryptor will then use the key. , and Input the three-dimensional discrete chaotic mapping model NewTDH and generate chaotic random sequences. , and ; Decryption of chaotic random sequences Preprocessing is performed to generate sequences. and The decryptor uses the sequence For dense carrier images Perform row scrambling to generate an image. ; use For images Perform column scrambling to generate an image. ; Image Converted to 8-bit binary form, it is denoted as: Extract secret information using the following formulas. , , and : The decryption team reassembled the four sets of secret information into an 8-bit binary matrix. Then Convert to decimal form to obtain the secret image. ; The decryption method uses chaotic random sequences Secret Images Perform inverse diffusion to obtain the matrix. ; The decryptor uses the OMP algorithm to analyze the matrix. Reconstruct the matrix to obtain the matrix. Using chaotic random sequences For matrix Perform the inverse scrambling operation to obtain the coefficient matrix. ; Decryption of the matrix Perform inverse discrete wavelet transform to obtain the final decrypted image. Decryption complete.
Citation Information
Patent Citations
Fast image encryption method based on chaos and pseudo-wavelet transform
CN115643346A
Asymmetric vision meaningful image encryption method based on 2D compressed sensing
CN116192360A
