Image processing method and device

By scrambling and chunking the image matrix, and combining biological encryption methods, the problem of low-dimensional chaotic systems with small key space and low encryption complexity when image data is encrypted, achieving higher image data security.

CN120201136APending Publication Date: 2025-06-24INST OF MEDICAL ROBOTICS & INTELLIGENT SYST TIANJIN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510310775.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

When the existing low-dimensional chaotic system encrypts image data, the secret key space is small and the encryption complexity is low, making it difficult to ensure the data security of image data.

Method used

The encrypted image is obtained by scrambling and chunking the image matrix based on multiple chaotic sequences, and the biological encryption method corresponding to the chunking matrix is ​​used for encryption and layout transformation.

Benefits of technology

It improves the security of image data, enhances the complexity of encryption, and makes the image processing process more difficult to crack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120201136A_ABST
    Figure CN120201136A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device which can be applied to the technical field of image processing and data security. The method comprises the steps of scrambling an image matrix representing a to-be-processed image in a matrix form based on a plurality of chaotic sequences corresponding to the to-be-processed image to obtain an out-of-order matrix; according to a preset size, performing block processing on the out-of-order matrix to obtain a plurality of block matrixes; for each block matrix, scrambling the element layout in the block matrix to obtain an out-of-order sequence; performing encryption and layout transformation on the out-of-order sequence by using a biological encryption method corresponding to the block matrix to obtain an encryption matrix, the biological encryption method corresponding to the block matrix being determined according to image information of sub-images corresponding to the block matrix in the to-be-processed image; and merging the encryption matrixes corresponding to the plurality of block matrixes to obtain an encrypted to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical fields of image processing and data security, and in particular to an image processing method and device. Background Art

[0002] With the development of information technology and communication technology, the "Internet +" technology form has emerged, that is, integrating Internet technology in various production and life fields such as education, finance, transportation, and medical care, giving full play to the optimization and integration role of the Internet in the allocation of production factors, and forming a development form that takes the Internet as a technical facility and implementation tool to develop the field of physical science and technology. Under the "Internet +" technology form, a large amount of image data needs to be stored and transmitted in the network, and these data have security risks of unauthorized access or tampering. In this regard, the security of image data in the process of transmission in the network can be improved by encrypting the image data before storing and transmitting it.

[0003] Since chaotic systems are highly sensitive to initial conditions and have long-term unpredictable iterative trajectories, related technologies use chaotic systems to encrypt image data. In order to fully utilize the efficiency of the Internet and ensure that image data can be transmitted as quickly as possible, it is necessary to improve the timeliness of chaotic systems. Therefore, low-dimensional chaotic systems are usually used to encrypt image data.

[0004] In the process of implementing the present disclosure, the inventors found that there are at least the following problems in the prior art: although the low-dimensional chaotic system has strong real-time performance and high encryption efficiency, the low-dimensional chaotic system has a small key space and low encryption complexity, making it difficult to ensure the data security of image data. Summary of the invention

[0005] In view of the above problems, the present disclosure provides an image processing method and device.

[0006] According to the first aspect of the present disclosure, an image processing method is provided, comprising: based on multiple chaotic sequences corresponding to the image to be processed, scrambling an image matrix representing the image to be processed in matrix form to obtain a random matrix; dividing the random matrix into blocks according to a preset size to obtain multiple block matrices; for each block matrix, scrambling the element layout in the block matrix to obtain a random sequence; using a biological encryption method corresponding to the block matrix, encrypting and transforming the layout of the random sequence to obtain an encrypted matrix, wherein the biological encryption method corresponding to the block matrix is ​​determined based on image information of a sub-image corresponding to the block matrix in the image to be processed; and merging the encryption matrices corresponding to each of the multiple block matrices to obtain an encrypted image to be processed.

[0007] According to an embodiment of the present disclosure, scrambling the element layout in a block matrix to obtain a scrambled sequence includes: determining a scrambling start position and a traversal direction based on the average element value of multiple elements in the block matrix; determining a scrambling step size based on the frequency of occurrence of each element value in the block matrix; and scrambling the element layout in the block matrix according to the traversal direction and the scrambling step size based on the scrambling start position to determine the scrambled sequence.

[0008] According to an embodiment of the present disclosure, determining a scrambling step size based on the frequency of occurrence of each element value in the block matrix includes: determining a maximum value sequence composed of multiple frequency maxima based on a curve graph determined by the frequency and the element value; and determining the scrambling step size based on the maximum value sequence.

[0009] According to an embodiment of the present disclosure, scrambling the element layout in the block matrix according to the traversal direction and the scrambling step size based on the scrambling start position to determine the scrambled sequence includes: traversing multiple elements in the block matrix from the scrambling start position according to the traversal direction to obtain an element sequence of the block matrix; and rearranging multiple elements in the element sequence based on the scrambling step size to obtain the scrambled sequence.

[0010] According to an embodiment of the present disclosure, a biological encryption method includes multiple encoding methods, a target operation method, and a target mutation method; encrypting and performing a layout transformation on the scrambled sequence by using the biological encryption method corresponding to the block matrix to obtain an encrypted matrix, including: determining a first encoding method from multiple encoding methods based on the maximum value sequence; encoding the elements in the scrambled sequence into biological symbols by using the first encoding method to obtain a first biological sequence; determining a minimum value sequence composed of multiple frequency minima based on the curve graph; determining a second encoding method from multiple encoding methods based on the minimum value sequence; encoding the elements in the minimum value sequence into biological symbols by using the second encoding method to obtain a second biological sequence; determining a target operation method from multiple operation methods based on the maximum value sequence; performing an operation on the first biological sequence and the second biological sequence by using the target operation method to obtain a combined biological sequence; determining a target mutation method from multiple mutation methods based on the minimum value sequence; determining a mutated biological sequence obtained after multiple biological symbols in the combined biological sequence mutate based on the target mutation method; decoding multiple biological symbols in the mutated biological sequence by using the first encoding method to obtain a mutated pixel sequence; and performing a layout transformation on the mutated pixel sequence to obtain the encrypted matrix.

[0011] According to an embodiment of the present disclosure, based on a mutation method, a mutant biological sequence obtained after mutations occur in multiple biological symbols in a combined biological sequence is determined, including: determining the probability of mutation of each biological symbol in the combined biological sequence based on a minimum value sequence to obtain a mutation probability sequence, where the mutation probability sequence includes multiple mutation probabilities, and the multiple mutation probabilities correspond one-to-one to multiple elements in the combined biological sequence; and for each element in the combined biological sequence, when it is determined that the value of the mutation probability corresponding to the element is within a preset probability interval, replacing the element with a mutation result corresponding to the element according to the mutation method.

[0012] According to an embodiment of the present disclosure, the sequence length of a chaotic sequence is the same as the number of pixels in an image matrix; based on multiple chaotic sequences corresponding to an image to be processed, scrambling an image matrix representing the image to be processed in matrix form to obtain a scrambled matrix, including: dividing multiple chaotic sequences to obtain multiple subsequences, where the sequence length of each subsequence is the same as the number of columns of the image matrix, the number of multiple subsequences is the same as the number of rows of the image matrix, and the multiple subsequences correspond one-to-one to multiple rows of elements in the image matrix; using each subsequence to determine a scrambling result of a row of elements corresponding to the chaotic subsequence, where the scrambling result is obtained by determining the arrangement manner of a row of elements according to the subsequence and arranging the row of elements using the arrangement manner; and determining the scrambled matrix based on multiple scrambling results.

[0013] According to an embodiment of the present disclosure, the image processing method further includes: processing the image matrix using a hashing algorithm to obtain a hash value of the image to be processed; dividing the hash value to obtain multiple chaotic initial values; and determining multiple chaotic sequences based on the multiple chaotic initial values.

[0014] According to an embodiment of the present disclosure, determining multiple chaotic sequences based on multiple chaotic initial values includes: repeatedly performing the following operations until the lengths of multiple chaotic sequences all reach N, where N is a positive integer and N represents the expected length of a dynamic change sequence: determining the m-th chaotic initial value as the first element of the m-th chaotic sequence, where the number of multiple chaotic initial values is M, M and m are positive integers, and m = 1, …, M - 1; determining a first generated number based on the n-th element in the m-th chaotic sequence using a first chaotic mapping method, where n is a positive integer and n = 1, …, N - 1; determining a second generated number based on the n-th element in the M - 1 remaining chaotic sequences except the m-th chaotic sequence using a second chaotic mapping method; and determining the (n + 1)-th element in the m-th chaotic sequence based on the first generated number and the M - 1 second generated numbers.

[0015] The second aspect of the present disclosure provides an image processing apparatus, including: a first matrix scrambling module configured to scramble an image matrix representing a to-be-processed image in matrix form based on a plurality of chaotic sequences corresponding to the to-be-processed image, to obtain a scrambled matrix; a matrix block division module configured to divide the scrambled matrix into blocks according to a preset size, to obtain a plurality of block matrices; a second matrix scrambling module configured to, for each block matrix, scramble the element layout in the block matrix to obtain a scrambled sequence; a matrix encryption module configured to encrypt and perform a layout transformation on the scrambled sequence by using a biological encryption method corresponding to the block matrix, to obtain an encrypted matrix, where the biological encryption method corresponding to the block matrix is determined according to the image information of the sub-image corresponding to the block matrix in the to-be-processed image; and a matrix merging module configured to merge the encrypted matrices corresponding to the plurality of block matrices respectively, to obtain the encrypted to-be-processed image.

[0016] The third aspect of the present disclosure provides an electronic device, including: one or more processors; a memory configured to store one or more computer programs, where the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0017] The fourth aspect of the present disclosure further provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0018] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0019] According to an embodiment of the present disclosure, the image matrix of the to-be-processed image is scrambled by using a plurality of chaotic sequences corresponding to the to-be-processed image to obtain a scrambled matrix. After the scrambled matrix is divided into a plurality of block matrices, each block matrix is scrambled again, where the scrambling method for each block matrix is determined according to the elements in the block matrix. Therefore, the scrambling methods for different block matrices can be different. Through two scramblings, the element arrangement in the plurality of block matrices of the to-be-processed image can be made more difficult to predict and crack, improving the security of image processing. In addition, by using a biological encryption method corresponding to the block matrix to encrypt the block matrix, since the elements in each block matrix are different, the biological encryption algorithms used for different block matrices can be made as different as possible, thereby increasing the complexity of the biological encryption method used for image processing, further preventing the image processing process from being cracked, and improving the security of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, the above content and other objects, features, and advantages of the present disclosure will become clearer. In the drawings:

[0021] Figure 1 Schematically shows an application scenario diagram of an image processing method and apparatus according to an embodiment of the present disclosure;

[0022] Figure 2 Schematically shows a flowchart of an image processing method according to an embodiment of the present disclosure;

[0023] Figure 3 Schematically shows a flowchart of encrypting a block matrix according to an embodiment of the present disclosure;

[0024] Figure 4 Schematically shows a structural block diagram of an image processing apparatus according to an embodiment of the present disclosure; and

[0025] Figure 5 Schematically shows a block diagram of an electronic device suitable for implementing an image processing method according to an embodiment of the present disclosure. Detailed Embodiments

[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is obvious that one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present disclosure.

[0027] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0029] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning that those skilled in the art usually understand this expression (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0030] In the technical solutions of the present disclosure, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties. Moreover, the processing of relevant data, such as collection, storage, use, processing, transmission, provision, disclosure, and application, all comply with relevant laws, regulations, and standards, adopt necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0031] In the scenario of making automated decisions using personal information, the methods, devices, and systems provided by the embodiments of the present disclosure all provide corresponding operation entrances for users to choose to agree or refuse the results of automated decisions; if the user chooses to refuse, the expert decision-making process will be entered. Here, the expression "automated decision" refers to the activity of automatically analyzing and evaluating an individual's behavior habits, hobbies, or economic, health, credit status, etc. through a computer program and making decisions. Here, the expression "expert decision" refers to the activity of making decisions by personnel who are engaged in work in a certain field, have specialized experience, knowledge, and skills, and reach a certain professional level.

[0032] Embodiments of the present disclosure provide an image processing method, including: scrambling an image matrix representing a to-be-processed image in matrix form based on a plurality of chaotic sequences corresponding to the to-be-processed image to obtain a scrambled matrix; performing block processing on the scrambled matrix according to a preset size to obtain a plurality of block matrices; for each block matrix, scrambling the element layout in the block matrix to obtain a scrambled sequence; encrypting and performing layout transformation on the scrambled sequence by using a biological encryption method corresponding to the block matrix, where the biological encryption method corresponding to the block matrix is determined according to the image information of the sub-image corresponding to the block matrix in the to-be-processed image; and combining the encryption matrices corresponding to the plurality of block matrices respectively to obtain the encrypted to-be-processed image.

[0033] Figure 1 Schematically shows an application scenario diagram of the image processing method and device according to an embodiment of the present disclosure.

[0034] As Figure 1As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0035] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0036] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop portable computers, and desktop computers, etc.

[0037] The server 105 may be a server providing various services, such as a background management server (only for example) that supports the websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process data such as received user requests, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0038] It should be noted that the image processing method provided by the embodiments of the present disclosure can generally be executed by the server 105. Correspondingly, the image processing device provided by the embodiments of the present disclosure can generally be set in the server 105. The image processing method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105. Correspondingly, the image processing device provided by the embodiments of the present disclosure can also be set in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105.

[0039] It should be understood that Figure 1 the numbers of terminal devices, networks, and servers in are merely illustrative. According to the implementation requirements, there may be any number of terminal devices, networks, and servers.

[0040] The following will be based on Figure 1 the described scenario, and will describe in detail the image processing method of the embodiments of the present disclosure through Figure 2~Figure 3 the following content.

[0041] Figure 2 FIG. schematically shows a flowchart of an image processing method according to an embodiment of the present disclosure.

[0042] As Figure 2 shown, the image processing method of this embodiment includes operations S210 to S250.

[0043] In operation S210, based on a plurality of chaotic sequences corresponding to the image to be processed, the image matrix representing the image to be processed in matrix form is scrambled to obtain a scrambled matrix.

[0044] According to an embodiment of the present disclosure, a chaotic sequence is a sequence used to encrypt and transform elements in the information to be processed in a chaotic system. In the embodiments of the present disclosure, the chaotic sequence can be used to scramble a plurality of elements in the image matrix of the image to be processed, so that the element values of a plurality of elements in the scrambled matrix are the same as the element values of a plurality of elements in the image matrix, but the distribution and arrangement order of the elements are different.

[0045] According to an embodiment of the present disclosure, an image matrix can be obtained by determining the respective pixel values of a plurality of pixels in the image to be processed and respectively recording the plurality of pixel values at corresponding positions in the matrix according to the positional relationship of the plurality of pixels in the image to be processed, wherein the number of elements in the matrix is the same as the number of pixels in the image to be processed.

[0046] In operation S220, the scrambled matrix is block-processed according to a preset size to obtain a plurality of block matrices.

[0047] According to an embodiment of the present disclosure, the preset size can be determined according to the size of the image to be processed and the processing requirements, and the preset size is a two-dimensional size. During the block processing, the number of rows and columns of the scrambled matrix can be respectively divided by the number of rows and columns of the preset size to obtain a plurality of block matrices.

[0048] For example, if the scrambled matrix is a 128×128 matrix and the preset size is 8×8, by dividing the number of rows and columns of the scrambled matrix by the number of rows and columns of the preset size respectively, 16 units can be obtained in both the row and column dimensions, and thus 16×16 = 256 block matrices can be obtained after block-processing the scrambled matrix according to the preset size.

[0049] In operation S230, for each block matrix, the element layout in the block matrix is scrambled to obtain a scrambled sequence.

[0050] According to an embodiment of the present disclosure, the elements in the block matrix can be scrambled twice using the element values in each block matrix to obtain a scrambled sequence with higher complexity and encryption level.

[0051] Since the element values of multiple elements in each block matrix are usually different, the block matrix is scrambled twice according to the element values of the multiple elements included in each block matrix. Determining the scrambling method of the block matrix through the element values of the block matrix can make the scrambling methods of different block matrices as different as possible, thereby improving the encryption complexity.

[0052] In operation S240, the scrambled sequence is encrypted and layout-transformed using a bio-encryption method corresponding to the block matrix to obtain an encrypted matrix.

[0053] According to an embodiment of the present disclosure, the bio-encryption method corresponding to the block matrix is determined according to the image information of the sub-image corresponding to the block matrix in the image to be processed. The bio-encryption method can convert the elements in the scrambled sequence into deoxyribonucleic acid (DNA) base pairs and perform calculations and operations on the base pairs for further encryption.

[0054] According to an embodiment of the present disclosure, after encrypting the scrambled sequence using the bio-encryption method, a matrix with the same shape as the block matrix can be constructed, and the values in the encrypted sequence are filled into the matrix in sequence to obtain an encrypted matrix with the same shape as the block matrix.

[0055] After the scrambled matrix is block-processed in operation S220, the multiple block matrices can be processed in parallel until operations S230 and S240 are respectively and parallelly executed for each block matrix. After determining the encrypted matrix of each block matrix, operation S250 can be executed.

[0056] In operation S250, the encrypted matrices corresponding to the multiple block matrices are combined to obtain the encrypted image to be processed.

[0057] According to an embodiment of the present disclosure, the image to be processed includes multiple block matrices, and the encrypted matrices corresponding to the multiple block matrices respectively include partial information of the image to be processed. Combining the multiple encrypted matrices can obtain the encrypted image to be processed including all the image information of the image to be processed.

[0058] According to an embodiment of the present disclosure, a plurality of chaotic sequences corresponding to an image to be processed are used to scramble the image matrix of the image to be processed to obtain a scrambled matrix. After the scrambled matrix is divided into a plurality of block matrices, each block matrix is scrambled again. Among them, the scrambling method for each block matrix is determined according to the elements in the block matrix. Therefore, the scrambling methods for different block matrices can be different. Through two scramblings, it is possible to make the arrangement of elements in the plurality of block matrices of the image to be processed more difficult to predict and crack, thereby improving the security of image processing. In addition, a biological encryption method corresponding to the block matrix is used to encrypt the block matrix. Since the elements in each block matrix are different, it is possible to make the biological encryption algorithms used for different block matrices as different as possible, thereby increasing the complexity of the biological encryption method used in image processing, further preventing the image processing process from being cracked, and improving the security of image processing.

[0059] According to an embodiment of the present disclosure, scrambling the element layout in the block matrix to obtain a scrambled sequence includes: determining a scrambling start position and a traversal direction based on the average element value of a plurality of elements in the block matrix; determining a scrambling step size based on the frequency of occurrence of each element value in the block matrix; and scrambling the element layout in the block matrix based on the scrambling start position, according to the traversal direction and the scrambling step size, to determine the scrambled sequence.

[0060] According to an embodiment of the present disclosure, the block matrix includes a plurality of elements. Determining the scrambling start position and the traversal direction according to the average element value of the plurality of elements can enable traversing and scrambling different block matrices from different positions and in different directions, thereby further increasing the complexity of encryption.

[0061] According to an embodiment of the present disclosure, since the elements in the image matrix are the pixel values of the respective pixels in the image to be processed, the elements in the block matrix are also pixel values. The value range of the pixel value is [0, 255]. The frequency of occurrence of each pixel value in this value range in the block matrix can be counted, and the scrambling step size can be determined.

[0062] Among them, since the value range of the average element value is [0, 255] for the pixel value, the average element value can be mapped to the range (0, 1) by calculating the quotient of the average element value and 256. The scrambling start position a can be determined according to formula (1):

[0063] (1)

[0064] Among them, avg represents the average element value, A and B are the number of rows and columns of the block matrix respectively, and mod(·) represents the modulo operation. The traversal direction can be determined according to the scrambling starting position a. For example, when a is odd, the traversal direction is forward, and when a is even, the traversal direction is backward.

[0065] Since the above scrambling starting position, traversal direction, and scrambling step size are all determined according to the elements in the block matrix, the scrambling method for scrambling the element layout in the block matrix is related to the block matrix. When decrypting, it is necessary to restore the scrambling, and the restoration method for the matrix can be determined according to the elements in the matrix to be restored.

[0066] According to an embodiment of the present disclosure, determining the scrambling step size based on the frequency of each element value appearing in the block matrix includes: determining a maximum value sequence composed of multiple frequency maxima based on a curve graph determined by the frequency and the element value; and determining the scrambling step size based on the maximum value sequence.

[0067] According to an embodiment of the present disclosure, a coordinate system is constructed with the abscissa being the pixel value, the value range being [0, 255], and the ordinate being the frequency. Representing the frequency of each pixel value appearing in the block matrix in the coordinate system in sequence, a curve graph determined by the frequency and the element value can be obtained.

[0068] According to an embodiment of the present disclosure, multiple maxima and multiple minima can be determined according to the curve graph, and the multiple maxima form a maximum value sequence P i . The maximum value sequence can be mapped to the interval [0, 1] through a mapping method to obtain the mapping initial value.

[0069] According to an embodiment of the present disclosure, the method of generating a chaotic sequence in a chaotic system can be used to generate a step size sequence p i , the length of the step size sequence is the same as the number of elements in the block matrix. Among them, a sequence with a length greater than the number of elements in the block matrix can be generated first, and the first several values greater than the number of elements in the block matrix in the sequence can be deleted to obtain the step size sequence.

[0070] For example, in the case of a two-dimensional matrix with A rows and B columns as a block matrix, the number of elements is A * B. A sequence with a length of A * B + P can be generated, and the first P values of the sequence can be deleted, and the last A * B values in the sequence can be retained as the step sequence, so as to further increase the complexity of encryption. Among them, P can represent the additional sequence length determined to increase the randomness of the chaotic sequence. For example, P can be set to 1000. After generating a sequence with a length of N + 1000, the first 1000 elements of each sequence are deleted, and the remaining N elements of each sequence are determined as multiple chaotic sequences, so as to further increase the complexity of the chaotic sequence and improve the complexity and security of image processing.

[0071] According to an embodiment of the present disclosure, according to the step sequence, the scrambling step can be determined. Among them, an element at a preset position can be selected from the step sequence as the scrambling step, or each element in the step sequence can be used as the scrambling step for each scrambling in turn.

[0072] Since the step sequence p i is generated according to the method of generating a chaotic sequence, the elements in the step sequence may not be integers. The elements in the step sequence can be mapped to integers, and the mapped integers can be used as the step M for each step, as shown in formula (2):

[0073] (2)

[0074] where p ij is the j-th element in the step sequence p i

[0075] According to an embodiment of the present disclosure, based on the scrambling starting position, according to the traversal direction and the scrambling step, the element layout in the block matrix is scrambled to determine a scrambled sequence, including: traversing multiple elements in the block matrix from the scrambling starting position according to the traversal direction to obtain an element sequence of the block matrix; and rearranging multiple elements in the element sequence based on the scrambling step to obtain a scrambled sequence.

[0076] According to an embodiment of the present disclosure, the element located at the scrambling starting position can be determined from the block matrix in row-major order, and the block matrix can be traversed starting from this element according to the traversal direction to obtain an element sequence of the block matrix.

[0077] ​According to an embodiment of the present disclosure, at the beginning of rearrangement, the scrambled sequence is an empty sequence. Based on the scrambling step size, elements are selected starting from the first element in the element sequence. After an element is selected, it is added to the scrambled sequence and removed from the element sequence. Then, using the position of this element as the starting position, the next round of selection is carried out until all elements in the element sequence are selected and added to the scrambled sequence, and the current scrambled sequence is determined.

[0078] Since there are multiple ways to determine the scrambling step size. For example, an element at a preset position can be selected from the step size sequence as the scrambling step size, or each element in the step size sequence can be used as the scrambling step size for each scrambling in turn. Therefore, in the case of selecting an element at a preset position from the step size sequence as the scrambling step size, this scrambling step size is used for each element selection. In the case of using each element in the step size sequence as the scrambling step size for each scrambling in turn, the first element in the step size sequence is selected as the scrambling step size when selecting elements for the first time, and the i-th element in the step size sequence is selected as the scrambling step size when selecting elements for the i-th time until the scrambling is completed.

[0079] According to an embodiment of the present disclosure, after initially scrambling the elements in the image matrix and partitioning to obtain a partitioned matrix, the scrambling step size, scrambling starting position, and traversal direction are determined using the average element value in the partitioned matrix and the frequency of occurrence of each element value in the partitioned matrix to scramble the partitioned matrix again. Compared with using the same scrambling method to scramble all partitioned matrices twice, it is possible to determine the scrambling method for a specific partitioned matrix according to the situation of each different partitioned matrix, thereby increasing the cracking difficulty in the image processing process and improving the security of the image.

[0080] According to an embodiment of the present disclosure, the biological encryption method includes multiple encoding methods, a target operation method, and a target mutation method; using the biological encryption method corresponding to the block matrix to encrypt and layout-transform the scrambled sequence to obtain an encrypted matrix, including: determining a first encoding method from multiple encoding methods based on the maximum value sequence; encoding the elements in the scrambled sequence into biological symbols using the first encoding method to obtain a first biological sequence; determining a minimum value sequence composed of multiple frequency minimum values based on the curve graph; determining a second encoding method from multiple encoding methods based on the minimum value sequence; encoding the elements in the minimum value sequence into biological symbols using the second encoding method to obtain a second biological sequence; determining a target operation method from multiple operation methods based on the maximum value sequence; performing an operation on the first biological sequence and the second biological sequence using the target operation method to obtain a combined biological sequence; determining a target mutation method from multiple mutation methods based on the minimum value sequence; determining a mutated biological sequence obtained after multiple biological symbols in the combined biological sequence mutate based on the target mutation method; decoding multiple biological symbols in the mutated biological sequence based on the first encoding method to obtain a mutated pixel sequence; and performing a layout transformation on the mutated pixel sequence to obtain an encrypted matrix.

[0081] According to an embodiment of the present disclosure, since DNA bases include four types: adenine (A), thymine (T), cytosine (C), and guanine (G), and the arrangement patterns of two-bit binary numbers are 4 types: 00, 01, 10, and 11, encoding can be performed by converting each pair of adjacent two-bit binary numbers in the matrix into DNA bases.

[0082] In the field of biology, according to the base complementary pairing principle, there are 8 encoding methods that conform to this principle. Therefore, the preferred categories of encoding methods can be 8, as shown in Table 1 below.

[0083] Table 1

[0084]

[0085] Taking encoding using the first encoding method as an example, read the sequence to be encoded, combine the characters in the sequence to be encoded in pairs, and convert them into bases according to the corresponding relationship of this encoding method. For example, for the sequence to be encoded "00101110", the character pairs obtained by combining in pairs are 00, 10, 11, 10. According to this encoding method, it can be determined that the biological symbols obtained after encoding are AGTG.

[0086] According to an embodiment of the present disclosure, in a manner similar to generating a step length sequence, a first encoding sequence can be generated respectively based on the mapping initial value of the maximum value sequence P i and a second encoding sequence can be generated based on the minimum value sequence V iThe mapping initial value generates a second coding sequence. Since there are 8 coding methods, the first coding sequence and the second coding sequence can be respectively mapped into the interval [1, 8], and the first coding method and the second coding method can be determined according to the mapping results, as shown in formulas (3) and (4):

[0087] (3)

[0088] (4)

[0089] Among them, Q i is the mapping result of the first coding sequence mapped into the interval [1, 8], and W i is the mapping result of the second coding sequence mapped into the interval [1, 8].

[0090] According to the embodiments of the present disclosure, the elements in the scrambled sequence are respectively encoded into biological symbols by using the first coding method to obtain a first biological sequence, and the elements in the minimum value sequence are encoded into biological symbols by using the second coding method to obtain a second biological sequence.

[0091] According to the embodiments of the present disclosure, the DNA operation method may include addition, subtraction, exclusive OR, etc. Taking the above three operation methods as examples, the first coding sequence is mapped into the interval [1, 3], and the target operation method for operating on the first biological sequence and the second biological sequence can be determined according to the mapping result, as shown in formula (5):

[0092] (5)

[0093] Among them, E i is the mapping result of the first coding sequence mapped into the interval [1, 3].

[0094] According to the embodiments of the present disclosure, after determining the target operation method, the target operation method is used to operate on the biological symbols at the corresponding positions of the first biological sequence and the second biological sequence to obtain a combined biological sequence.

[0095] According to the embodiments of the present disclosure, in the biological field, DNA bases will mutate. Taking adenine (A) as an example, there are three mutation directions, that is, it mutates into thymine (T) or cytosine (C) or guanine (G) respectively, and the mutations of other bases are similar. Therefore, there are 3 mutation methods. The second coding sequence is mapped into the interval [1, 3], and the target mutation method of the combined biological sequence can be determined according to the mapping result, as shown in formula (6):

[0096] (6)

[0097] Among them, R iIs the mapping result of the second coding sequence mapped to the interval [1, 3].

[0098] According to an embodiment of the present disclosure, in the biological field, when a base mutation occurs, often only some bases mutate and the remaining bases remain unchanged. Therefore, for each biological symbol in the combined biological sequence, a mutation probability can be determined to obtain a mutation probability sequence, and mutation operations can be performed based on the mutation probability sequence.

[0099] Figure 3 Schematically shows a flowchart for encrypting a block matrix according to an embodiment of the present disclosure.

[0100] Such as Figure 3 As shown, for the block matrix, its scrambled sequence, maximum value sequence, and minimum value sequence are determined. Using the maximum value sequence and the minimum value sequence, a first coding method and a second coding method are respectively determined, and the scrambled sequence is encoded using the first coding method to obtain a first biological sequence, and the minimum value sequence is encoded using the second coding method to obtain a second biological sequence.

[0101] Taking the result of mapping the maximum value sequence to the interval [1, 8] as 1 as an example, it can be determined that the first coding method is coding method 1 in Table 1. The value of the first element in the scrambled sequence is 190, which is converted to an eight-bit binary number 01111110. Encoded according to the first coding method, CTTG is obtained. The value of the last element in the scrambled sequence is 131, which is converted to an eight-bit binary number 10000011. Encoded according to the first coding method, GAAT is obtained. Therefore, the first biological sequence obtained by encoding the scrambled sequence is CTTG…GAAT.

[0102] Similarly, after encoding the minimum value sequence according to the second coding method, the second biological sequence obtained is ACAA…GCAT.

[0103] The result of mapping the maximum value sequence to the interval [1, 3] is 3. Therefore, from the set of operation methods [addition, subtraction, exclusive OR], according to index 3, it can be determined that the operation method used for operating on the first biological sequence and the second biological sequence is exclusive OR. When performing an exclusive OR operation on two biological symbols, it can be determined that two two-bit binary numbers obtained by decoding the two biological symbols according to the first coding method are calculated, and after calculating the exclusive OR result of the two two-bit binary numbers, they are encoded according to the first coding method again.

[0104] For example, the first biological symbol of the first biological sequence is C, which can be decoded to obtain 01 according to the first coding method. The first biological symbol of the second biological sequence is A, which can be decoded to obtain 00 according to the first coding method. Calculate 01 00=01, 01 is encoded according to the first encoding method to obtain the biological symbol C, so the first biological symbol of the joint biological sequence is C.

[0105] After determining the joint biological sequence CGTG…ACAA, the mutation method is determined based on the result of mapping the minimum sequence to the interval [1, 3]. Taking the mutual mutation of A and T and the mutual mutation of C and G as examples, the biological symbol that mutates is determined based on the mutation probability, and then the result of the mutation of the biological symbol that mutates is determined according to the mutation method, and the mutant biological sequence GCTG…TGAA is obtained.

[0106] Using the first encoding method, the mutant biological sequence is decoded to obtain a mutant pixel sequence 10011101 ... 11100000, and each eight-bit binary number in the mutant pixel sequence is converted into a decimal number. For example, the decimal value of the first eight-bit binary number of the mutant pixel sequence is 157, and the decimal value of the last eight-bit binary number is 112. According to the shape of the block matrix, multiple converted decimal values ​​are arranged in rows in sequence to complete the layout transformation, and the encrypted matrix of the block matrix is ​​obtained.

[0107] According to another embodiment of the present disclosure, when the operation method is determined to be addition or subtraction, the biological symbols that need to be summed or subtracted can be decoded separately using the first encoding method, and the operation is performed after obtaining a two-bit binary number, and the operation result is then encoded using the first encoding method.

[0108] According to the embodiments of the present disclosure, the maximum value sequence and the minimum value sequence of the block matrix are used to determine multiple biometric encryption methods applied to the block matrix, thereby ensuring that the biometric encryption method can be obtained and traced, ensuring that the decryption stage can correctly obtain the biometric encryption method according to the maximum value sequence and the minimum value sequence, and perform corresponding decryption. In addition, by using the maximum value sequence and the minimum value sequence of each block matrix to determine the biometric encryption method that needs to be applied to the block matrix, it is possible to ensure that different block matrices use different biometric encryption methods as much as possible, thereby increasing the complexity of encrypting the image matrix.

[0109] According to an embodiment of the present disclosure, based on a mutation method, a mutated biological sequence obtained after mutations of multiple biological symbols in a joint biological sequence is determined, including: based on a minimum value sequence, determining the probability of mutation of each biological symbol in the joint biological sequence to obtain a mutation probability sequence, wherein the mutation probability sequence includes multiple mutation probabilities, and the multiple mutation probabilities correspond one-to-one to multiple elements in the joint biological sequence; and for each element in the joint biological sequence, when it is determined that the value of the mutation probability corresponding to the element is within a preset probability interval, according to the mutation method, replacing the element with a mutation result corresponding to the element.

[0110] According to an embodiment of the present disclosure, each element in the minimum value sequence can be mapped to the interval [-1, 1], and the sequence obtained after the mapping is completed is determined as the mutation probability sequence. The elements in the combined biological sequence are all biological symbols. According to the mutation probability corresponding to each biological symbol in the combined biological sequence, it is determined whether the biological symbol mutates. In the case where it is determined that a mutation occurs, according to the mutation method, the mutation result of the biological symbol is determined.

[0111] According to an embodiment of the present disclosure, it can be determined whether a biological symbol mutates by determining whether the value of the mutation probability is within a preset probability interval. For example, the preset probability interval can be [-0.8, 0.8]. In the case where the mutation probability is 0.9, the biological symbol corresponding to the mutation probability does not mutate. In the case where the mutation probability is -0.3, the biological symbol corresponding to the mutation probability mutates.

[0112] According to an embodiment of the present disclosure, determining whether a biological symbol mutates according to the mutation probability can make the changes of each biological symbol in the combined biological sequence more in line with biological laws, thereby further increasing the complexity of mutation processing and ensuring security.

[0113] According to an embodiment of the present disclosure, the sequence length of the chaotic sequence is the same as the number of pixels in the image matrix; based on a plurality of chaotic sequences corresponding to the image to be processed, the image matrix representing the image to be processed in matrix form is scrambled to obtain a scrambled matrix, including: dividing the plurality of chaotic sequences to obtain a plurality of subsequences, where the sequence length of each subsequence is the same as the number of columns of the image matrix, the number of the plurality of subsequences is the same as the number of rows of the image matrix, and the plurality of subsequences correspond one by one to multiple rows of elements in the image matrix; using each subsequence to determine the scrambling result of a row of elements corresponding to the chaotic subsequence, where the scrambling result is obtained by determining the arrangement manner of a row of elements according to the subsequence and arranging the row of elements using the arrangement manner; and based on the plurality of scrambling results, determining the scrambled matrix.

[0114] According to an embodiment of the present disclosure, the number of chaotic sequences can be the same as the dimension of the image matrix. For example, in the case where the image matrix is a two-dimensional matrix, two chaotic sequences can be used to scramble the image matrix.

[0115] Since the length of each chaotic sequence is the same as the number of pixels in the image matrix, the chaotic sequences can be divided respectively according to the number of pixels in each dimension of the image matrix.

[0116] For example, if the number of rows and columns of a two-dimensional image matrix are X and Y respectively, the sequence lengths of the two chaotic sequences of the image matrix are both X * Y. The two chaotic sequences can be respectively divided into Y chaotic subsequences with a length of X. Use multiple chaotic subsequences in the first chaotic sequence to scramble the elements of a row corresponding to the chaotic subsequence in the image matrix respectively, and complete the first scrambling of the image matrix. Then use multiple chaotic subsequences in the second chaotic sequence to scramble the image matrix obtained after the first scrambling again in the same scrambling manner to obtain a scrambled matrix.

[0117] In another example, the first chaotic sequence can be divided into Y chaotic subsequences with a length of X, and the second chaotic sequence can be divided into X chaotic subsequences with a length of Y. Among them, multiple chaotic subsequences of the second chaotic sequence correspond one by one to multiple columns of elements in the image matrix. Use multiple chaotic subsequences in the first chaotic sequence to scramble the elements of a row corresponding to the chaotic subsequence in the image matrix respectively, and complete the first scrambling of the image matrix. Then use multiple chaotic subsequences in the second chaotic sequence to scramble the elements of a column corresponding to the chaotic subsequence in the image matrix respectively, and complete the second scrambling of the image matrix.

[0118] Among them, in the process of scrambling, for each chaotic subsequence, according to the magnitude relationship between multiple values in the chaotic subsequence, the values in the chaotic subsequence can be replaced with consecutive integers starting from 0, and the replaced chaotic subsequence is used as an index to scramble the elements of a row corresponding to the chaotic subsequence.

[0119] For example, if the chaotic subsequence is {0.78, 0.85, 0.66, 0.94, 0.21}, and the elements of a row corresponding to it are {64, 23, 47, 126, 7}, then in ascending order, the values in the chaotic subsequence are replaced with integers to obtain {2, 3, 1, 4, 0}, and using the permuted chaotic subsequence as an index, the result obtained after scrambling the elements is {47, 126, 23, 7, 64}.

[0120] According to the embodiments of the present disclosure, multiple chaotic subsequences obtained by dividing the chaotic sequence are used to scramble each row or each column of the image matrix respectively, so as to realize scrambling of the entire image matrix. Since different chaotic subsequences are used for scrambling each row or each column, the complexity of scrambling can be ensured. Since the chaotic subsequences are all obtained by dividing the chaotic sequence, the amount of data processing required for scrambling is not high, and the scrambling efficiency can be ensured.

[0121] According to an embodiment of the present disclosure, the image processing method further includes: processing the image matrix using a hash algorithm to obtain a hash value of the image to be processed; splitting the hash value to obtain a plurality of chaotic initial values; and determining a plurality of chaotic sequences based on the plurality of chaotic initial values.

[0122] According to an embodiment of the present disclosure, according to the properties of the hash algorithm, regardless of the dimension of the image matrix and the number of elements, after processing the image matrix using the hash algorithm, the obtained hash value is of a fixed length. Taking the selection of SHA-512 as the hash algorithm to process the image matrix as an example, a 128-bit hexadecimal hash value K can be obtained.

[0123] Since the number of chaotic sequences can be the same as the dimension of the image matrix, after obtaining the hash value K, the expected number of chaotic initial values can be determined according to the image dimension, and the hash value K can be divided into the expected number of chaotic initial values.

[0124] In one embodiment, the hash value K can be evenly divided into a plurality of equal-length strings, and each string is converted into a binary format, where the number of strings is greater than the expected number, and the number of strings is an integer multiple of the expected number. The plurality of strings are evenly divided into the expected number of groups. The plurality of strings in each group are subjected to an exclusive OR operation, and then the result of the exclusive OR operation is mapped into a preset initial value interval to obtain a chaotic initial value.

[0125] For example, after obtaining the 128-bit hexadecimal hash value K, the hash value K is evenly divided into 8 strings with a length of 16, and then each string is converted into a binary format to obtain 64-bit binary numbers K1, K2, K3, K4, K5, K6, K7, and K8. The above eight strings are evenly divided into two groups, where the first group includes K1, K3, K5, K7, and the second group includes K2, K4, K6, K8. The four strings in each group are subjected to an exclusive OR operation to obtain an exclusive OR result. Since the result obtained by performing an exclusive OR operation between multiple 64-bit binary numbers is also a 64-bit binary number, the value range of this result is (0, 2 64 ). In order to map it into the preset initial value interval (0, 1), the exclusive OR result can be converted into a decimal number and then divided by 2 64 . As shown in formula (7):

[0126] (7)

[0127] Wherein, represents the exclusive OR operation, and x0 and y0 are two chaotic initial values respectively.

[0128] In a chaotic system, a chaotic sequence is generated by iterating based on an initial chaotic value. Common methods for iteratively generating chaotic sequences include the Logistic map method, etc. Taking the Logistic map as an example, a chaotic sequence can be generated using formula (8):

[0129] (8)

[0130] where n ≥ 0, r is a control parameter. Preferably, r ∈ (0, 4].

[0131] According to an embodiment of the present disclosure, multiple chaotic mapping methods can also be combined. Moreover, in the process of determining the (n + 1)-th value of each chaotic sequence, the n-th values of multiple chaotic sequences can be used respectively to further improve the encryption complexity.

[0132] According to an embodiment of the present disclosure, based on multiple initial chaotic values, multiple chaotic sequences are determined, including: repeating the following operations until the lengths of multiple chaotic sequences all reach N, where N is a positive integer and represents the expected length of a dynamically changing sequence: determining the m-th initial chaotic value as the first element of the m-th chaotic sequence, where the number of multiple initial chaotic values is M, M and m are positive integers, and m = 1, …, M - 1; based on the n-th element in the m-th chaotic sequence, using a first chaotic mapping method to determine a first generated number, where n is a positive integer and n = 1, …, N - 1; based on the n-th elements in the M - 1 remaining chaotic sequences other than the m-th chaotic sequence, using a second chaotic mapping method to determine a second generated number; and based on the first generated number and the M - 1 second generated numbers, determining the (n + 1)-th element in the m-th chaotic sequence.

[0133] According to an embodiment of the present disclosure, the chaotic mapping method can combine the Logistic map and the trigonometric function map, and introduce a composite cosine function. Therefore, the first chaotic mapping method can use a sine function map, and the second chaotic mapping method can use the Logistic map and the composite cosine function.

[0134] Taking m = 2, that is, two initial chaotic values x0 and y0 as an example, the iterative formula is as shown in formula (9):

[0135] (9)

[0136] where a and b are control parameters respectively, and their value ranges are the same as that of r. In the process of generating the (n + 1)-th element x n+1 of the first chaotic sequence, using the first chaotic mapping method and the n-th element x n of the first chaotic sequence, the first generated number sin(aπx n ) can be determined. Using the second mapping method and the n-th element y nThe second generated number cos(by n (1 - y n )) can be determined. According to the product of the first generated number and the second generated number, the (n + 1)-th element in the first chaotic sequence can be determined. By repeating the above iterative process, the (n + 1)-th element y n+1 of the second chaotic sequence can be obtained. Continuing to repeat the above iterative process until the lengths of both the first chaotic sequence and the second chaotic sequence reach N, the iteration stops.

[0137] According to another embodiment of the present disclosure, the above iterative process can also be repeated until the lengths of multiple chaotic sequences all reach N + P.

[0138] According to the embodiment of the present disclosure, based on the hash value of the image matrix, the chaotic initial value of the image matrix is determined, which can scale the image matrix to a fixed length and ensure that the hash value is related to the image matrix. By combining multiple chaotic mapping methods, the complexity of the chaotic sequence is improved. During the generation process of multiple chaotic sequences, in addition to using the previous elements of each chaotic sequence itself, the elements of other chaotic sequences are also utilized, further improving the complexity of the chaotic sequence. Thereby, the complexity of image processing is improved, the possibility of the processed image being cracked is reduced, and the security is enhanced.

[0139] Based on the above image processing method, the present disclosure also provides an image processing apparatus. The following will be combined with Figure 4 to describe this apparatus in detail.

[0140] Figure 4 FIG. schematically shows a structural block diagram of an image processing apparatus according to an embodiment of the present disclosure.

[0141] As Figure 4 shown, the image processing apparatus 400 of this embodiment includes a first matrix scrambling module 410, a matrix partitioning module 420, a second matrix scrambling module 430, a matrix encryption module 440, and a matrix merging module 450.

[0142] The first matrix scrambling module 410 is configured to scramble an image matrix representing the image to be processed in matrix form based on multiple chaotic sequences corresponding to the image to be processed, so as to obtain a scrambled matrix. In one embodiment, the first matrix scrambling module 410 can be configured to perform the operation S210 described above, which will not be elaborated here.

[0143] The matrix partitioning module 420 is configured to partition the scrambled matrix according to a preset size to obtain multiple partitioned matrices. In one embodiment, the matrix partitioning module 420 can be configured to perform the operation S220 described above, which will not be elaborated here.

[0144] The second matrix scrambling module 430 is used to scramble the element layout in each block matrix to obtain a scrambled sequence. In one embodiment, the second matrix scrambling module 430 can be used to perform the operation S230 described above, which will not be elaborated here.

[0145] The matrix encryption module 440 is used to encrypt and transform the layout of the scrambled sequence by using a biological encryption method corresponding to the block matrix to obtain an encrypted matrix, wherein the biological encryption method corresponding to the block matrix is determined according to the image information of the sub-image corresponding to the block matrix in the image to be processed. In one embodiment, the matrix encryption module 440 can be used to perform the operation S240 described above, which will not be elaborated here.

[0146] The matrix merging module 450 is used to merge the encrypted matrices corresponding to multiple block matrices respectively to obtain the encrypted image to be processed. In one embodiment, the matrix merging module 450 can be used to perform the operation S250 described above, which will not be elaborated here.

[0147] According to an embodiment of the present disclosure, the second matrix scrambling module 430 includes a first scrambling parameter determination sub-module, a second scrambling parameter determination sub-module, and a second matrix scrambling sub-module.

[0148] The first scrambling parameter determination sub-module is used to determine the scrambling starting position and traversal direction based on the average element value of multiple elements in the block matrix.

[0149] The second scrambling parameter determination sub-module is used to determine the scrambling step size based on the frequency of occurrence of each element value in the block matrix.

[0150] The second matrix scrambling sub-module is used to scramble the element layout in the block matrix based on the scrambling starting position according to the traversal direction and the scrambling step size to determine a scrambled sequence.

[0151] According to an embodiment of the present disclosure, the second scrambling parameter determination sub-module includes a first sequence determination unit and a step size determination unit.

[0152] The first sequence determination unit is used to determine a maximum value sequence composed of multiple frequency maximum values based on a curve graph determined by frequency and element value.

[0153] The step size determination unit is used to determine the scrambling step size based on the maximum value sequence.

[0154] According to an embodiment of the present disclosure, the second matrix scrambling sub-module includes a matrix traversal unit and an element rearrangement unit.

[0155] The matrix traversal unit is used to traverse multiple elements in the block matrix from the scrambling starting position according to the traversal direction to obtain an element sequence of the block matrix.

[0156] An element rearrangement unit for rearranging multiple elements in an element sequence based on a scrambling step length to obtain a scrambled sequence.

[0157] According to an embodiment of the present disclosure, the matrix encryption module 440 includes a first method determination sub-module, a first encoding sub-module, a first sequence determination sub-module, a second method determination sub-module, a second encoding sub-module, a third method determination sub-module, an operation sub-module, a fourth method determination sub-module, a mutation sub-module, a decoding sub-module, and a layout transformation sub-module.

[0158] The first method determination sub-module is used to determine a first encoding method from multiple encoding methods based on a maximum value sequence.

[0159] The first encoding sub-module is used to encode the elements in the scrambled sequence into biological symbols by using the first encoding method to obtain a first biological sequence.

[0160] The first sequence determination sub-module is used to determine a minimum value sequence composed of multiple frequency minimum values based on a curve graph.

[0161] The second method determination sub-module is used to determine a second encoding method from multiple encoding methods based on the minimum value sequence.

[0162] The second encoding sub-module is used to encode the elements in the minimum value sequence into biological symbols by using the second encoding method to obtain a second biological sequence.

[0163] The third method determination sub-module is used to determine a target operation method from multiple operation methods based on the maximum value sequence.

[0164] The operation sub-module is used to operate on the first biological sequence and the second biological sequence by using the target operation method to obtain a combined biological sequence.

[0165] The fourth method determination sub-module is used to determine a target mutation method from multiple mutation methods based on the minimum value sequence.

[0166] The mutation sub-module is used to determine a mutated biological sequence obtained after multiple biological symbols in the combined biological sequence mutate based on the target mutation method.

[0167] The decoding sub-module is used to decode multiple biological symbols in the mutated biological sequence based on the first encoding method to obtain a mutated pixel sequence.

[0168] The layout transformation sub-module is used to perform a layout transformation on the mutated pixel sequence to obtain an encrypted matrix.

[0169] According to an embodiment of the present disclosure, the mutation sub-module includes a probability determination unit and an element mutation unit.

[0170] A probability determination unit, configured to determine the probability of mutation of each biological symbol in the combined biological sequence based on the minimum value sequence, and obtain a mutation probability sequence, where the mutation probability sequence includes a plurality of mutation probabilities, and the plurality of mutation probabilities correspond one-to-one to a plurality of elements in the combined biological sequence.

[0171] An element mutation unit, configured to, for each element in the combined biological sequence, when it is determined that the value of the mutation probability corresponding to the element falls within a preset probability interval, replace the element with a mutation result corresponding to the element according to a mutation method.

[0172] According to an embodiment of the present disclosure, the first matrix scrambling module 410 includes a sequence segmentation sub-module, an element scrambling sub-module, and a matrix determination sub-module.

[0173] The sequence segmentation sub-module is configured to divide a plurality of chaotic sequences to obtain a plurality of sub-sequences, where the sequence length of each sub-sequence is the same as the number of columns of the image matrix, the number of the plurality of sub-sequences is the same as the number of rows of the image matrix, and the plurality of sub-sequences correspond one-to-one to multiple rows of elements in the image matrix.

[0174] The element scrambling sub-module is configured to use each sub-sequence to determine the scrambling result of a row of elements corresponding to the chaotic sub-sequence, where the scrambling result is obtained by determining the arrangement manner of a row of elements according to the sub-sequence and arranging the row of elements using the arrangement manner.

[0175] The matrix determination sub-module is configured to determine a scrambled matrix based on a plurality of scrambling results.

[0176] According to an embodiment of the present disclosure, the image processing apparatus 400 further includes a hash processing module, an initial value segmentation module, and a sequence determination module.

[0177] The hash processing module is configured to process the image matrix using a hash algorithm to obtain a hash value of the image to be processed.

[0178] The initial value segmentation module is configured to divide the hash value to obtain a plurality of chaotic initial values.

[0179] The sequence determination module is configured to determine a plurality of chaotic sequences based on the plurality of chaotic initial values.

[0180] According to an embodiment of the present disclosure, the sequence determination module includes an initial value determination sub-module, a first generation sub-module, a second generation sub-module, and an element generation sub-module.

[0181] The initial value determination sub-module, the first generation sub-module, the second generation sub-module, and the element generation sub-module are repeatedly used until the lengths of the plurality of chaotic sequences all reach N, where N is a positive integer, and N represents the expected length of the dynamically changing sequence:

[0182] An initial value determination sub-module, configured to determine the m-th chaotic initial value as the first element of the m-th chaotic sequence, where the number of multiple chaotic initial values is M, M and m are positive integers, and m = 1, …, M - 1.

[0183] A first generation sub-module, configured to determine a first generated number based on the n-th element in the m-th chaotic sequence by using a first chaotic mapping method, where n is a positive integer and n = 1, …, N - 1.

[0184] A second generation sub-module, configured to determine a second generated number based on the n-th elements in the M - 1 remaining chaotic sequences except the m-th chaotic sequence by using a second chaotic mapping method.

[0185] An element generation sub-module, configured to determine the (n + 1)-th element in the m-th chaotic sequence based on the first generated number and the M - 1 second generated numbers.

[0186] According to an embodiment of the present disclosure, any multiple of the first matrix scrambling module 410, the matrix partitioning module 420, the second matrix scrambling module 430, the matrix encryption module 440, and the matrix merging module 450 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first matrix scrambling module 410, the matrix partitioning module 420, the second matrix scrambling module 430, the matrix encryption module 440, and the matrix merging module 450 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or may be implemented by any other reasonable means such as hardware or firmware through integration or packaging of circuits, or may be implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, at least one of the first matrix scrambling module 410, the matrix partitioning module 420, the second matrix scrambling module 430, the matrix encryption module 440, and the matrix merging module 450 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.

[0187] Figure 5 Schematically shows a block diagram of an electronic device suitable for implementing an image processing method according to an embodiment of the present disclosure.

[0188] As Figure 5As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage section 508 into a random access memory (RAM) 503. The processor 501 can include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application-specific integrated circuit (ASIC)), etc. The processor 501 can also include on-board memory for caching purposes. The processor 501 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0189] In the RAM 503, various programs and data required for the operation of the electronic device 500 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. The processor 501 performs various operations of the method flow according to an embodiment of the present disclosure by executing programs in the ROM 502 and / or the RAM 503. It should be noted that the program can also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 can also perform various operations of the method flow according to an embodiment of the present disclosure by executing programs stored in the one or more memories.

[0190] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, and the input / output (I / O) interface 505 is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read from it can be installed into the storage section 508 as needed.

[0191] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist alone without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the methods according to the embodiments of the present disclosure are implemented.

[0192] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the above-described ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503.

[0193] Embodiments of the present disclosure also include a computer program product, which includes a computer program, and the computer program contains program codes for executing the methods shown in the flowcharts. When the computer program product runs in a computer system, the program codes are used to enable the computer system to implement the methods provided by the embodiments of the present disclosure.

[0194] When the computer program is executed by the processor 501, the above functions defined in the system / apparatus of the embodiments of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described systems, apparatuses, modules, units, etc. may be implemented by computer program modules.

[0195] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and be downloaded and installed through the communication part 509, and / or be installed from the removable medium 511. The program codes included in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0196] In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0197] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).

[0198] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0199] Those skilled in the art can understand that the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.

[0200] The embodiments of the present disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present disclosure.

Claims

1. An image processing method, characterized in that: The method comprises: Based on a plurality of chaotic sequences corresponding to the image to be processed, scrambling an image matrix representing the image to be processed in matrix form to obtain a scrambled matrix; According to a preset size, the random matrix is ​​divided into blocks to obtain a plurality of block matrices; For each of the block matrices, scramble the layout of elements in the block matrix to obtain a scrambled sequence; Using a biological encryption method corresponding to the block matrix, the random sequence is encrypted and the layout is transformed to obtain an encrypted matrix, wherein the biological encryption method corresponding to the block matrix is ​​determined based on image information of a sub-image corresponding to the block matrix in the image to be processed; and The encrypted matrices corresponding to the plurality of block matrices are merged to obtain an encrypted image to be processed.

2. The method according to claim 1, characterized in that The step of scrambling the layout of elements in the block matrix to obtain a scrambled sequence includes: Determine a scrambling starting position and a traversal direction based on an average element value of a plurality of elements in the block matrix; Determine a scrambling step length based on the frequency of occurrence of each element value in the block matrix; Based on the scrambling starting position, the element layout in the block matrix is ​​scrambled according to the traversal direction and the scrambling step size to determine the scrambled sequence.

3. The method according to claim 2, characterized in that The determining of the scrambling step length based on the frequency of occurrence of each element value in the block matrix comprises: Determining a maximum value sequence consisting of a plurality of frequency maximum values ​​based on a curve graph determined by the frequency and the element value; and Based on the maximum value sequence, the scrambling step length is determined.

4. The method according to claim 3, characterized in that The step of scrambling the element layout in the block matrix based on the scrambling starting position and according to the traversal direction and the scrambling step length to determine the scrambled sequence includes: From the scrambling starting position, traverse a plurality of elements in the block matrix according to the traversal direction to obtain an element sequence of the block matrix; and Based on the scrambling step length, multiple elements in the element sequence are rearranged to obtain the scrambled sequence.

5. The method according to claim 3, characterized in that: The biological encryption method includes a plurality of encoding methods, target operation methods and target mutation methods; The method of encrypting and transforming the random sequence using the biological encryption method corresponding to the block matrix to obtain an encryption matrix includes: Based on the maximum value sequence, determining a first encoding method from a plurality of encoding methods; Using the first encoding method, encoding the elements in the random sequence into biological symbols to obtain a first biological sequence; Based on the curve graph, determining a minimum value sequence consisting of a plurality of frequency minimum values; Based on the minimum value sequence, determining a second encoding method from a plurality of encoding methods; encoding the elements in the minimum value sequence into biological symbols using the second encoding method to obtain a second biological sequence; Based on the maximum value sequence, determining a target operation method from a plurality of operation methods; Using the target operation method to operate the first biological sequence and the second biological sequence to obtain a joint biological sequence; Based on the minimum value sequence, determining a target mutation method from multiple mutation methods; Based on the target mutation method, determining a mutant biological sequence obtained after mutation of multiple biological symbols in the combined biological sequence; Based on the first encoding method, multiple biological symbols in the mutant biological sequence are decoded to obtain a mutant pixel sequence; and The layout of the mutation pixel sequence is transformed to obtain the encryption matrix.

6. The method according to claim 5, characterized in that The step of determining a mutant biological sequence obtained after mutation of multiple biological symbols in the combined biological sequence based on the mutation method includes: Based on the minimum value sequence, determining the probability of mutation of each biological symbol in the joint biological sequence to obtain a mutation probability sequence, wherein the mutation probability sequence includes a plurality of mutation probabilities, and the plurality of mutation probabilities correspond one-to-one to a plurality of elements in the joint biological sequence; and For each element in the joint biological sequence, when it is determined that the value of the mutation probability corresponding to the element is within a preset probability interval, the element is replaced with a mutation result corresponding to the element according to the mutation method.

7. The method according to claim 1, characterized in that The sequence length of the chaotic sequence is the same as the number of pixels in the image matrix; The method of scrambling an image matrix representing the image to be processed in matrix form based on a plurality of chaotic sequences corresponding to the image to be processed to obtain a scrambled matrix comprises: Dividing the multiple chaotic sequences into multiple subsequences, wherein the sequence length of each of the subsequences is the same as the number of matrix columns of the image matrix, the number of the multiple subsequences is the same as the number of matrix rows of the image matrix, and the multiple subsequences correspond one-to-one to multiple rows of elements in the image matrix; Using each of the subsequences, determining a scrambling result of a row of elements corresponding to the chaotic subsequence, wherein the scrambling result is obtained by determining an arrangement mode of the row of elements according to the subsequence, and arranging the row of elements using the arrangement mode; and Based on the plurality of scrambling results, the scrambled matrix is ​​determined.

8. The method according to claim 1, characterized in that The method further comprises: Processing the image matrix using a hash algorithm to obtain a hash value of the image to be processed; Splitting the hash value to obtain a plurality of chaotic initial values; and Based on the multiple chaotic initial values, the multiple chaotic sequences are determined.

9. The method according to claim 8, characterized in that The step of determining the plurality of chaotic sequences based on the plurality of chaotic initial values ​​comprises: Repeat the following steps until the lengths of the multiple chaotic sequences all reach N, where N is a positive integer and represents the expected length of the dynamically changing sequence: Determine the mth chaotic initial value as the first element of the mth chaotic sequence, wherein the number of the multiple chaotic initial values ​​is M, M and m are positive integers, m=1, ..., M-1; Based on the nth element in the mth chaotic sequence, using a first chaotic mapping method, a first generated number is determined, wherein n is a positive integer, n=1, ..., N-1; Determining a second generated number using a second chaotic mapping method based on an nth element in M-1 remaining chaotic sequences except the mth chaotic sequence; and Based on the first generated number and M-1 second generated numbers, the n+1th element in the mth chaotic sequence is determined.

10. An image processing device, characterized in that: The device comprises: A first matrix scrambling module is used to scramble an image matrix representing the image to be processed in matrix form based on a plurality of chaotic sequences corresponding to the image to be processed, so as to obtain a scrambled matrix; A matrix block module, used for dividing the random matrix into blocks according to a preset size to obtain a plurality of block matrices; A second matrix scrambling module is used to scramble the element layout in each of the block matrices to obtain a scrambled sequence; a matrix encryption module, configured to encrypt and transform the layout of the random sequence using a biological encryption method corresponding to the block matrix to obtain an encrypted matrix, wherein the biological encryption method corresponding to the block matrix is ​​determined based on image information of a sub-image corresponding to the block matrix in the image to be processed; and The matrix merging module is used to merge the encrypted matrices corresponding to the multiple block matrices to obtain an encrypted image to be processed.

Citation Information

Cited By

  • Data sequence out-of-order processing method and device, chip, storage medium and product

    CN121309151A