Video Encryption Method and System Based on DNA Encoding Technology
By constructing a DNA operation matrix to perform row and column two-dimensional permutation and cross-frame sequence splicing and recombination, the problems of single permutation method and independent inter-frame encryption in existing DNA-encoded video encryption schemes are solved, achieving high-efficiency video encryption strength and decryption reversibility.
Patent Information
- Application Number
- CN202611259693.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-10
AI Technical Summary
Existing DNA-encoded video encryption schemes suffer from insufficient encryption strength due to their simplistic permutation methods, inadequate obfuscation of base symbols, and lack of sequence cascade diffusion in the independent encryption of each keyframe. This makes them vulnerable to statistical analysis and differential attacks.
By constructing a DNA operation matrix and performing two-dimensional permutations of rows and columns, combined with complementary base pairing and rotation operations, a DNA sequence after two-dimensional matrix permutation is generated. Then, multiple keyframes are chained together and recombined to form a long-chain DNA sequence, breaking the inter-frame independence and enhancing the encryption strength.
It significantly improves the overall strength of video encryption, effectively resisting statistical analysis and differential attacks, ensuring that the decryption end can reversibly recover the original video content, and enhancing the ability to resist chosen plaintext and known plaintext attacks.
Smart Images

Figure CN123075138A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video encryption technology, specifically to a video encryption method and system based on DNA encoding technology. Background Technology
[0002] Video data faces the risk of theft or tampering during transmission and storage, and encryption algorithms are typically used to scramble the video stream. Classic video encryption methods rely on mathematical transformations and block ciphers, such as encrypting video data frame by frame using the AES algorithm. Their security rests on key length and algorithm complexity. However, with advancements in computing power and cryptanalysis techniques, encryption systems relying solely on traditional mathematical problems have become vulnerable to differential and linear attacks. To further enhance the unpredictability of video encryption, some schemes incorporate DNA encoding concepts, using base pairing rules to convert pixel values into DNA sequences, and then performing base-level substitution or shift operations. These schemes combine bio-information processing with image encryption, increasing the difficulty of cracking to some extent. Most existing DNA-encoding-based video or image encryption schemes remain at the stage of using static mapping tables to perform base conversions, then shifting, XORing, or scrambling the one-dimensional DNA sequence based on chaotic sequences. Their substitution operation patterns are relatively fixed, typically only indexing and rearranging the sequence in a single direction, without structuring the DNA sequence into a two-dimensional matrix and introducing key-driven multi-step cyclic shifts based on row and column dimensions. During the substitution process, the base symbols themselves retain their original type, only their positions change, lacking any obfuscation or transformation of the base content. This means that the statistical distribution of symbols in the encrypted sequence may still have exploitable characteristics. Furthermore, these schemes employ a frame-by-frame independent processing approach when encrypting video, with each frame's DNA sequence generated and scrambled separately, resulting in no correlation at the base sequence level between frames. Attackers can perform exhaustive or statistical attacks on individual keyframes without considering the constraints of preceding and following frames, meaning the overall encryption strength of the video does not significantly increase with the number of frames.
[0003] To address the aforementioned shortcomings, it is necessary to solve the problems of how to break statistical regularities through multidimensional DNA operation matrix permutation in video encryption, and how to cross-recombine the DNA sequences of multiple keyframes to form overall obfuscation. Summary of the Invention
[0004] This invention provides a video encryption method and system based on DNA encoding technology, aiming to solve the technical problems of existing DNA-encoded video encryption schemes, such as the single substitution method, insufficient obfuscation of base symbols themselves, and lack of sequence cascade diffusion in the independent encryption of each key frame.
[0005] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a video encryption method based on DNA encoding technology, comprising: acquiring a video stream to be encrypted, extracting keyframe sequences frame by frame; dividing each keyframe into blocks to generate a fixed-size set of pixel blocks; for each pixel block, converting its pixel values into DNA base symbols according to a preset base mapping table to generate an initial DNA sequence; constructing a DNA operation matrix, wherein the DNA operation matrix contains the base types corresponding to rows and columns, and performing row and column permutations on the initial DNA sequence according to key generation permutation rules to generate a permuted DNA sequence; converting the permuted DNA sequence into pixel values through an inverse mapping table, and assembling it into encrypted video frames according to the original block positions. By mapping the pixel information of the video frames to the DNA base space and using a two-dimensional matrix permutation method for obfuscation and diffusion, the encryption strength can be significantly improved without losing the video compression structure, effectively resisting statistical analysis and differential attacks, while ensuring that the decryption end can reversibly recover the original video content.
[0006] Preferably, the step of converting the pixel values into DNA base symbols according to a preset base mapping table to generate an initial DNA sequence includes: extracting the grayscale or chroma value of each pixel in the pixel block, mapping the grayscale or chroma value into a binary code stream; converting every two binary digits in the binary code stream into a corresponding DNA base symbol according to the preset base mapping table, where the base mapping table defines a mapping relationship of 00 corresponding to A, 01 corresponding to T, 10 corresponding to C, and 11 corresponding to G; and concatenating all the converted DNA base symbols in pixel order to form the initial DNA sequence. This conversion method establishes a simple bijective relationship between pixel values and base symbols, facilitating subsequent use of the four states of DNA to achieve rich nonlinear transformations and amplifying the impact of plaintext perturbations on ciphertext.
[0007] Preferably, the construction of the DNA operation matrix, which includes the base types corresponding to rows and columns, involves performing row and column permutations on the initial DNA sequence according to the key generation permutation rules. This includes: splitting the initial DNA sequence into a two-dimensional matrix according to a preset row and column dimension, where each matrix element is a single DNA base symbol; generating row and column permutation vectors according to the key, where the row permutation vector specifies the movement step size for each row of base symbols, and the column permutation vector specifies the movement step size for each column of base symbols; performing a cyclic shift on each row of the two-dimensional matrix according to the row permutation vector to generate a row-permuted matrix; performing a cyclic shift on each column of the row-permuted matrix according to the column permutation vector to generate a column-permuted matrix; and expanding the column-permuted matrix by rows to obtain the permuted DNA sequence. This bidirectional cyclic shifting of rows and columns ensures that any change in the position of a base symbol can cause a chain reaction in the row and column directions, breaking the neighborhood correlation within and between pixel blocks and enhancing the scrambling effect.
[0008] Preferably, the step of converting the replaced DNA sequence into pixel values using an inverse mapping table and assembling it into an encrypted video frame according to the original block position includes: grouping the replaced DNA sequence into fixed-length groups, each group corresponding to a pixel in the original pixel block; for each group of DNA base symbols, sequentially converting each base symbol into a two-bit binary number according to the inverse mapping table, where the inverse mapping table defines the conversion relationship of A corresponding to 00, T to 01, C to 10, and G to 11; synthesizing the two-bit binary arrays into pixel values of the original bit width to recover the grayscale or chroma value of each pixel; and filling all pixel values into corresponding coordinates according to the original block position to generate the encrypted video frame. The inverse mapping process is strictly inverse of the mapping process, ensuring complete restoration of the decrypted pixel values and achieving lossless encryption of the video content.
[0009] As a technical solution of the present invention, the method further includes: chain-splitting the initial DNA sequences of multiple consecutive keyframes in the keyframe sequence to form a long-chain DNA sequence; segmenting the long-chain DNA sequence according to a preset cutting length to generate multiple sub-segment DNA sequences; scrambling and recombinating the sub-segment DNA sequences to generate a recombined DNA sequence set; and using the recombined DNA sequence set as input for subsequent permutation operations to replace the initial DNA sequence of a single keyframe. By chain-splitting and recombinating DNA sequences across frames, the independent encryption characteristics between different video frames are destroyed, preventing attackers from cracking the entire video through single-frame analysis, thus significantly improving the global protection capability of the video sequence.
[0010] Furthermore, the chain splicing process includes: extracting a fixed-length base sequence from the end of the initial DNA sequence of the previous keyframe as a primer sequence; extracting a fixed-length base sequence from the beginning of the initial DNA sequence of the subsequent keyframe as a complementary primer sequence; performing base-complementary pairing between the primer sequence and the complementary primer sequence to form a sticky end connection; and merging the two single strands in the resulting double-stranded structure as two parts of a new sequence to generate the long DNA sequence, wherein the primer sequence and the complementary primer sequence are retained after ligation. This splicing process simulates the connection method of biological DNA, introducing a base-complementary pairing relationship between the sequences of two keyframes, so that the spliced long sequence has both obfuscation and integrity identification functions, enhancing the coupling between the key and the content.
[0011] As a further improvement of the present invention, the method further includes: calculating the hash value of the keyframe and using the hash value as an initial key; performing base counting on the initial key to count the number of A, T, C, and G bases in the initial key and generating a base counting vector; adjusting the step size parameters of the row permutation vector and column permutation vector in the permutation rule according to the base counting vector, wherein the step size parameter is the modulo operation result of each component of the base counting vector. This method directly encodes the keyframe content features into permutation step size control parameters, achieving a high degree of correlation between the encryption process and the plaintext. Each frame generates a unique permutation rule, which can effectively resist known-plaintext attacks and selective-plaintext attacks.
[0012] As a preferred embodiment of the present invention, before converting each DNA base symbol into a two-bit binary number according to the inverse mapping table for each group of DNA base symbols, the method further includes: performing parity checking on each group of DNA base symbols; if the check fails, error correction is performed based on the base sequences of adjacent groups, wherein the error correction adopts the Hamming distance minimum principle to select the closest valid code. The introduction of parity checking and adjacent sequence-assisted error correction mechanisms enables automatic recovery from minor errors that occur during encrypted transmission or storage, improving the robustness and practicality of the encryption method.
[0013] Preferably, the initial DNA sequence is subjected to row and column permutations according to the key generation permutation rules. These permutation rules include permutation operations based on the complementary base pairing principle, comprising: during the cyclic shifting process of the row and column permutations, performing a complementary base operation on each shifted base symbol, converting A to T, T to A, C to G, and G to C; further performing a rotation operation on the base symbols after the complementary base operation, rotating base pair AT by 180 degrees to convert it to TA, and rotating base pair CG by 180 degrees to convert it to GC. By superimposing complementary base operations and rotation operations on the row and column shifting diffusion, the dual nonlinear transformation expands a single base permutation into a planar recombination of base pairs, further increasing the key space and cracking complexity.
[0014] This invention also provides a video encryption system based on DNA encoding technology, including a processor and a memory connected together. The memory stores programs, instructions, or code, and the processor executes the programs, instructions, or code stored in the memory to implement the aforementioned video encryption method based on DNA encoding technology. This system can convert video streams frame by frame into DNA sequence fields for multidimensional permutation encryption, possessing both high security and lossless recovery characteristics, making it suitable for video transmission and storage scenarios with high confidentiality requirements.
[0015] The technical effects and advantages provided by the present invention in the above technical solution are as follows: By constructing a DNA operation matrix, the initial DNA sequence is split into a two-dimensional base matrix according to a preset dimension, and row permutation vectors and column permutation vectors are generated according to the key. The row permutation vector specifies the cyclic shift step size for each row of base symbols, and the column permutation vector specifies the cyclic shift step size for each column of base symbols. The permutation process is as follows: first, each row of the matrix is cyclically shifted according to the corresponding step size to generate the matrix after row permutation; then, each column of the matrix is cyclically shifted according to the corresponding step size to generate the matrix after column permutation. Unlike the simple index rearrangement of conventional one-dimensional sequences, this two-dimensional row and column cross permutation makes the horizontal and vertical coordinates of the original base symbols in the matrix change simultaneously, and a single permutation can cause long-distance position migration. Especially when the permutation operation of the complementary base pairing principle is introduced in the cyclic shift, the shifted base symbols further perform complementary operations, converting A to T, T to A, C to G, and G to C, and optionally performing rotation operations on the base pairs, rotating AT to TA and CG to GC. This mechanism superimposes dynamic changes in base symbol content on top of position scrambling, altering the distribution characteristics of base symbols in the ciphertext space and eliminating the direct mapping between the original pixel statistical features and the ciphertext base frequencies. The key is generated by modulo the base count vector from the keyframe hash value to obtain the shift step size, ensuring that the permutation parameters used for different frames and different content in the video are different. This significantly expands the key space and enhances resistance to chosen-plaintext attacks and statistical attacks. The initial DNA sequences of multiple consecutive keyframes are chained together. A fixed-length base from the end of the initial sequence of the previous frame is used as the primer sequence, and a fixed-length base from the beginning of the initial sequence of the next frame is used as the complementary primer sequence. Sticky-end ligations are formed through complementary base pairing, and the ligated structures are merged to generate a long DNA sequence. Subsequently, this long DNA sequence is segmented according to a preset cutting length to generate multiple sub-segment DNA sequences. These sub-segments are scrambled and recombine to obtain a recombined DNA sequence set, which is used as input for subsequent row and column permutation operations to replace the initial DNA sequence of a single frame. The splicing and segmented recombination of multi-frame DNA sequences breaks the encryption independence between keyframes. Even minute changes in the pixel content of any frame are introduced into sequence fragments of adjacent frames during chain splicing, and further diffused into multiple segments of the recombined sequence set after segmentation and scrambling. Subsequent two-dimensional matrix permutation further distributes this cross-frame influence to the coordinates of each block. This cross-frame sequence mixing mechanism means that modifications to a single keyframe will affect the ciphertext of multiple encrypted frames, amplifying the avalanche effect of the encryption system and enhancing the overall resistance of video encryption to difference attacks and known-plaintext attacks. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0017] Figure 1 This is a flowchart of a video encryption method based on DNA encoding technology; Figure 2 This is a flowchart of a DNA sequence row-column cyclic shift encryption method; Figure 3 This is a graph showing the frequency distribution of base A in the encrypted DNA sequence and its normal fit. Figure 4 This is a schematic diagram of the row and column permutation step size distribution in a video encryption method based on DNA encoding technology. Figure 5 This is a comparative analysis chart of Hamming distance distribution before and after parity check error correction; Figure 6 It is a distribution map of the recombination positions of segments of long DNA sequences in continuous keyframes. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] See Figure 1 This invention provides a video encryption method based on DNA encoding technology, comprising: acquiring a video stream to be encrypted and extracting keyframe sequences frame by frame; dividing each keyframe into blocks to generate a fixed-size set of pixel blocks; for each pixel block, converting its pixel values into DNA base symbols according to a preset base mapping table to generate an initial DNA sequence; constructing a DNA operation matrix, wherein the DNA operation matrix contains the base types corresponding to rows and columns, and performing row and column permutations on the initial DNA sequence according to key generation permutation rules to generate a permuted DNA sequence; converting the permuted DNA sequence into pixel values through an inverse mapping table, and assembling it into encrypted video frames according to the original block positions.
[0020] Example 1: In a specific implementation, after extracting the key frames from the video stream to be encrypted, block processing is performed on each key frame to generate a set of pixel blocks consisting of several fixed-size pixel blocks.
[0021] For any pixel block in the pixel block set, the grayscale value of each pixel within the pixel block is obtained. In one implementation for a color video stream, the chromaticity value of each pixel is obtained, and the chromaticity value can be selected from the Cb component or Cr component in the YCbCr color space.
[0022] In practice, the grayscale value of each pixel within a pixel block is converted into a binary bitstream. For each pixel's grayscale value, if the grayscale value is represented by 8 bits, an 8-bit binary bitstream is generated; if the grayscale value is represented by 10 bits, a 10-bit binary bitstream is generated.
[0023] In practice, according to a pre-defined base mapping table, each two bits of the binary code stream corresponding to each pixel are sequentially mapped to a DNA base symbol. The mapping relationship defined in the base mapping table is as follows: binary number 00 corresponds to base symbol A, binary number 01 corresponds to base symbol T, binary number 10 corresponds to base symbol C, and binary number 11 corresponds to base symbol G. Taking the mapping process of an 8-bit binary code stream "01110010" as an example: "01110010" is divided into four groups of two bits each: "01", "11", "00", and "10". According to the base mapping table, "01" is mapped to base symbol T, "11" is mapped to base symbol G, "00" is mapped to base symbol A, and "10" is mapped to base symbol C. The DNA base symbol sequence corresponding to this pixel is TGAC.
[0024] In practice, after mapping all pixels within a pixel block according to their pixel arrangement order, the DNA base symbol sequences corresponding to each pixel are concatenated to generate the initial DNA sequence corresponding to the pixel block. The pixel arrangement order is a scanning sequence starting from the top left pixel of the pixel block, proceeding row by row to the right, and folding back to the beginning of the next row. During the concatenation process, the last base symbol of the DNA base symbol sequence of the current pixel is directly connected to the first base symbol of the DNA base symbol sequence of the next adjacent pixel, and no separator is inserted between the base symbol sequences of adjacent pixels.
[0025] For a pixel block containing N pixels, where each pixel generates M DNA base symbols after mapping, the length of the initial DNA sequence is the product of N and M. The unified mapping rule followed by the base mapping process can be expressed as the formula: ,in, and This indicates the position number in the binary code stream. and Two consecutive binary bits, Indicates the group number, group number Starting from 1, select positive integers, group number The upper limit of the value is determined by dividing the total number of bits in the binary code stream by 2; This represents a function that maps two consecutive binary bits to DNA base symbols. This represents the DNA base symbols obtained from the mapping. The range of values for is the set. .
[0026] In practice, the initial DNA sequence generation process for each pixel block is executed independently. After all pixel blocks in the pixel block set have completed base mapping and generated corresponding initial DNA sequences, each initial DNA sequence is sent to the subsequent DNA operation matrix construction and permutation operation stages.
[0027] See Figure 3 In the figure, the horizontal axis represents the proportion of base A, ranging from approximately 0.21 to 0.30, and the vertical axis represents the frequency density, gradually changing from 0 to approximately 32. The blue bar chart shows the observed frequency density distribution of the proportion of base A after encrypting the video keyframe pixel blocks based on DNA encoding technology in Example 1. Its shape exhibits an approximately normal distribution characteristic, concentrated between 0.24 and 0.27. The red dashed curve is the corresponding normal distribution fitting curve, indicating that the distribution of the proportion of base A conforms to the normal distribution trend, verifying the uniform randomness and the balance of the distribution. The brown dashed line in the figure represents the mean position of the proportion of base A, approximately 0.25, located at the peak of the distribution, reflecting the concentrated mean and symmetrical distribution.
[0028] Example 2: In specific implementation, refer to Figure 2 After obtaining the initial DNA sequence, the initial DNA sequence is converted into a two-dimensional DNA operation matrix according to a preset row and column dimension. The preset row and column dimension includes a row number parameter R and a column number parameter C. The column number parameter C is a preset fixed value, which can be 8, 16, or 32. In one implementation of this embodiment, the column number parameter C is set to 16. The row number parameter R is determined based on the numerical relationship between the total length L of the initial DNA sequence and the column number parameter C. The calculation method for the row number parameter R is as follows: ,in, This represents the floor function. When the total length L of the initial DNA sequence is not an integer multiple of the column number parameter C, the initial DNA sequence is padded with base symbols A, extending the length of the padded sequence to the nearest integer. Each element of the two-dimensional matrix is a DNA base symbol in the filled sequence. The base symbols are filled in the two-dimensional matrix in a row-first, column-second order. That is, the first to the Cth base symbols in the sequence are placed in the first row and column 1 to the first row and column C, the C+1 to the 2Cth base symbols in the sequence are placed in the second row and column 1 to the second row and column C, and so on.
[0029] In practice, row permutation vectors and column permutation vectors are generated based on the encryption key. The row permutation vector is an integer vector of length R, denoted as […]. The column permutation vector is an integer vector of length C, denoted as . Each element in the vector represents the cyclic shift step size of the corresponding row or column. The encryption key serves as the seed for the pseudo-random number generator, which outputs pseudo-random integers sequentially. These pseudo-random integers are then modulo-operated and used to fill the row permutation vector and column permutation vector. Specifically, the row permutation vector is generated... At that time, the r-th random number generated by the pseudo-random number generator is modulo the column number parameter C to obtain the r-th component in the row permutation vector. Where r takes the value of any integer from 1 to R; generate column permutation vectors. At that time, the pseudo-random number generator generates the t-th random number modulo the row number parameter R, and obtains the t-th component in the column permutation vector. Where t takes the value of any integer from 1 to C. The modulo operation uses the column number parameter C and the row number parameter R, respectively, such that the row permutation step size... The value of is an integer from 0 to C-1, and the column permutation step size is... The value of is an integer ranging from 0 to R-1.
[0030] In practice, a circular shift operation is performed on each row of the two-dimensional matrix. The step size of the circular shift operation is specified by the component of the corresponding row in the row permutation vector. When performing a circular shift on the r-th row, all C base symbols in that row are treated as a circular queue and shifted to the right. At each position, bases that extend beyond the rightmost column after being moved are sequentially added to the leftmost column of the row. The calculation process for row substitution is represented by the following formula: ,in, This represents the original two-dimensional matrix before the row circular shift. Represents the base symbol in the r-th row and j-th column of the original two-dimensional matrix; This represents the base symbol in the r-th row and c-th column of the row permutation matrix obtained after row cyclic shifting; r represents the row index, which is an integer ranging from 1 to the row number parameter R; c represents the column index, which is an integer ranging from 1 to the column number parameter C. Represents row permutation vector The value of the r-th component, which is the cyclic shift step size corresponding to the r-th row. The value is an integer ranging from 0 to the column number parameter C-1; This represents the modulo operation; This represents the original column index after the target column position has undergone a cyclic shift mapping. The calculation rule is to first subtract 1 from the column index c and then subtract the step size. Then, take the modulo of the column number parameter C, and finally add 1 to ensure that the mapped column indices are within the range of 1 to C. After all rows have undergone cyclic shifting according to the above formula, the row permutation matrix is obtained. .
[0031] In practical implementation, the row permutation matrix is... Each column undergoes a column circular shift operation. The step size of the column circular shift is determined by the column permutation vector. Components of the corresponding column Specify. When performing a column circular shift on column c, treat all R base symbols in that column as a circular queue and move them downwards. At each position, bases exceeding the bottom row position after shifting are sequentially added to the top row position of the current column. Column permutation operations use the same cyclic shift mechanism as row permutation operations, the difference being that the shift direction of column permutation operations is along the column, and the shift step size is based on the column permutation vector. After all columns have undergone cyclic shifting, the column permutation matrix is obtained. .
[0032] In practical implementation, the column permutation matrix will be used. Expanding the matrix in row-major order generates the final permuted DNA sequence. The expansion order is as follows: take all bases from the first row of the permutation matrix, sequentially extracting from column 1 to column C; then take all bases from the second row, sequentially extracting from column 1 to column C; and so on, until all bases in row R are extracted. All extracted bases are concatenated end-to-end in the extraction order to form the permuted DNA sequence. The length of the permuted DNA sequence is the same as the length of the initial DNA sequence after filling. In subsequent processing, if filler base symbols are present, they are removed based on the position information recorded during filling, restoring the effective data length corresponding to the original initial DNA sequence.
[0033] See Figure 4 The figure illustrates the frequency distribution of row and column permutation step sizes in the two-dimensional matrix of the video encryption method based on DNA encoding technology, as described in Example 2. The horizontal axis represents the cyclic shift step size, ranging from 0 to 16, and the vertical axis represents the frequency of occurrence of the corresponding step size. In the legend, the orange striped bars represent the frequency distribution of row permutation step sizes, and the green solid bars represent the frequency distribution of column permutation step sizes.
[0034] As shown in the figure, the frequency of column permutation step lengths is mainly concentrated in the smaller step length range of 0 to 9, with obvious frequency peaks at step lengths of 1 and 7, reaching approximately 70 and 65 times respectively. This indicates that the column cyclic shift step lengths are more concentrated in the low displacement range during encryption. In contrast, the frequency distribution range of row permutation step lengths is 10 to 15, with a more uniform frequency and a maximum frequency close to 50 times. This shows that the row cyclic shift step length distribution is concentrated in the higher step length range, and there are no obvious single-point peaks, indicating that the step lengths in the row permutation vector are more dispersed.
[0035] Example 3: In specific implementation, after obtaining the DNA sequence after row and column permutation operations in Example 2, the DNA sequence is first subjected to length verification and redundancy removal. The length verification is based on the total number of base symbols generated after base mapping of the grayscale or chroma values of all pixels in the original pixel block, denoted as T. The value of T is equal to the product of the total number of pixels in the original pixel block and the number of base symbols U per pixel. The number of base symbols U per pixel is determined by the binary bit width H of the original pixel value. If the original pixel value is represented by 8 bits, then U equals 4; if the original pixel value is represented by 10 bits, then U equals 5. When the length of the replaced DNA sequence is greater than T, it indicates that filler base symbols were introduced during the matrix construction process. At this time, based on the position information recorded during filling, the excess base symbols are removed from the end of the replaced DNA sequence until the length of the replaced DNA sequence equals T.
[0036] In practice, the length-checked, replaced DNA sequences are grouped into fixed-length groups of U, where U represents the number of base symbols per pixel. The grouping method involves starting with the first base symbol of the replaced DNA sequence, continuously extracting U base symbols as group 1, the next U+1 to 2U base symbols as group 2, and so on, until the entire replaced DNA sequence is divided. The number of groups equals the total number of pixels in the original pixel block. Each group of base symbols corresponds one-to-one with a pixel in the original pixel block, and the correspondence order is consistent with the scanning order of the pixels within the original pixel block: starting from the top-left pixel, moving right row by row, and then folding back to the beginning of the next row.
[0037] In practice, for each group of base symbols obtained from the segmentation, each base symbol within the group is converted into a two-bit binary number according to the inverse mapping table. The conversion relationship defined in the inverse mapping table is as follows: base symbol A corresponds to binary number 00, base symbol T corresponds to binary number 01, base symbol C corresponds to binary number 10, and base symbol G corresponds to binary number 11. The inverse mapping conversion process is as follows: extract the first base symbol in the group, obtain its corresponding two-bit binary number according to the inverse mapping table, and record it as the two highest two bits; extract the second base symbol in the group, obtain its corresponding two-bit binary number according to the inverse mapping table, and record it as the two second highest two bits; process this process until the U-th base symbol in the group is converted into the two lowest two bits. All the two-bit binary numbers generated by the conversion are concatenated in descending order of bit position to form a binary bit string of length H. This H-bit binary bit string is the original binary representation of the corresponding pixel.
[0038] In practice, the process of restoring pixel values is represented by the following formula: ,in, This represents the recovered grayscale or chromaticity value of the x-th pixel, where x is the pixel index, a positive integer ranging from 1 to the total number of pixels N in the original pixel block; y represents the position index within the base symbol group corresponding to a single pixel, a positive integer ranging from 1 to U; U is the number of base symbols in a single pixel, the value of which is determined by the binary bit width H of the original pixel value, satisfying... ; This represents the y-th base symbol in the base symbol group corresponding to the x-th pixel; This indicates the base symbol According to the decimal mapping value obtained by the inverse mapping table, when When it is A Take 0, when When T Take 1, when When it is C Take 2, when When it is G Take 3; This represents the bit weight assigned to the two binary digits corresponding to the y-th base symbol. The shift number is given. Since each group has U base symbols, the first base symbol corresponds to the highest... The U-th base symbol corresponds to the lowest 0 bit, and the bit weight increases in powers of 4. The grayscale or chromaticity values of all N pixels are calculated independently according to the above formula.
[0039] In practice, all recovered pixel values are filled into the corresponding coordinate areas of the encrypted video frame according to the pixel coordinates within the original pixel blocks. The position information of the original pixel blocks in the keyframes is recorded during the block processing stage, including the row and column start coordinates of the top-left corner of the pixel block in the keyframe, as well as the height and width of the pixel block. During filling, the region corresponding to the pixel block in the keyframe image matrix is first located, and the first recovered pixel value is assigned to the first row and first column position within that region, the second recovered pixel value is assigned to the first row and second column position, and so on, pixel by pixel, row by row, until all pixels within the pixel block region are assigned values. Once a pixel block is filled, the position information of the next original pixel block and the set of recovered pixel values are obtained, and the above filling operation is repeated until all pixel blocks are filled, thereby generating a complete encrypted video frame.
[0040] See Figure 5 In the figure, the horizontal axis represents the Hamming distance, ranging from 0 to 4, and the vertical axis represents the frequency of the corresponding Hamming distance. The legend distinguishes two types of sequences: "sequences without errors" are represented by blue bars, and "sequences with errors" are represented by orange bars. The blue bars have the highest frequency (approximately 450) at the Hamming distance of 0, indicating that the vast majority of sequences without errors have a Hamming distance of 0, meaning there are no differences in base symbols, consistent with the expected results of parity check testing of the substituted DNA sequences in Example 3. The orange bars are mainly distributed at Hamming distances of 1 and 2, corresponding to frequencies of approximately 400 and 100 respectively, showing that most errors in the sequences with errors are single or double base substitutions, consistent with the corrective effect of the error correction strategy based on the minimum Hamming distance principle in Example 3 for minor errors. The orange bars at a Hamming distance of 1 have a significantly higher frequency than the blue bars at the same position, indicating that the main differences in the erroneous sequences are concentrated in single base substitutions. Positions with a Hamming distance greater than 2 have almost no frequency, indicating that serious errors are rare or nonexistent.
[0041] Example 4: In a specific implementation, after extracting the keyframe sequence frame by frame from the video stream, the keyframe sequence contains multiple keyframes arranged consecutively on the timeline. For each keyframe in the keyframe sequence, the pixel blocks of each keyframe are converted into initial DNA sequences according to a preset base mapping table, resulting in a set of initial DNA sequences that correspond one-to-one with the keyframe sequence. Multiple consecutive keyframes refer to K keyframes in the keyframe sequence whose timestamps are adjacent, where K is an integer not less than 2, and the specific value of K is determined by key derivation during the encryption initialization stage.
[0042] In practice, the initial DNA sequences of multiple consecutive keyframes are chained together. Starting with the first keyframe in the consecutive keyframe sequence, the initial DNA sequences of adjacent keyframes are spliced sequentially according to their timestamps. Each splicing operation involves one preceding keyframe and one following keyframe.
[0043] In practice, for any pair of adjacent previous and subsequent keyframes, a fixed-length base fragment is extracted from the initial DNA sequence of the previous keyframe as the primer sequence. The fixed-length fragment is denoted as... , These are preset fixed parameters. The value is set to 8. The extraction method is: obtain the total length of the initial DNA sequence from the previous keyframe, and subtract from the total length. Add 1 to the position as the starting extraction position, and extract continuously from the starting extraction position. The primer sequence is obtained by using 1 base symbol. The order of the base symbols in the primer sequence is consistent with the original order of the initial DNA sequence in the previous keyframe.
[0044] In practice, a fixed-length base fragment at the beginning is extracted from the initial DNA sequence of the subsequent keyframe and used as the complementary primer sequence. The fixed-length beginning is also set to... The extraction method is as follows: starting from the first base symbol of the initial DNA sequence in the next keyframe, extract continuously forward. The complementary primer sequence is obtained by using 1 base symbol. The order of the base symbols in the complementary primer sequence is consistent with the original order of the initial DNA sequence in the subsequent keyframe.
[0045] In practice, base pairing is performed between the primer sequence and the complementary primer sequence. Base pairing follows the base pairing principle: base A pairs with base T, base T pairs with base A, base C pairs with base G, and base G pairs with base C. During pairing, the first base in the primer sequence is compared with the first base in the complementary primer sequence. If the first base in the primer sequence is A and the first base in the complementary primer sequence is T, the pairing is successful. If the first base in the primer sequence is A but the first base in the complementary primer sequence is not T, a mismatch is identified. Bases with the same position number in the primer and complementary primer sequences are paired one by one, and all such pairs are counted. The pairing results at each position.
[0046] In practice, base correction is performed at mismatched positions to ensure a complete sticky end connection between the primer sequence and the complementary primer sequence. The correction method involves retaining the base symbols in the primer sequence and replacing the corresponding base symbols in the complementary primer sequence with base symbols complementary to those in the primer sequence, according to the base pairing principle. After correction, the primer sequence and complementary primer sequence will be perfectly aligned in all... All positions satisfy the complementary base pairing relationship, at which point the primer sequence and the complementary primer sequence constitute a sequence of length [length missing]. The complementary double-stranded structure. In the complementary double-stranded structure, the single strand containing the primer sequence is connected to the single strand containing the complementary primer sequence by hydrogen bonds formed by complementary base pairing. This connection region is the sticky end connection.
[0047] In practice, the two single strands in the ligated double-stranded structure are extracted separately and merged to generate a long DNA sequence. During extraction, the first single strand containing the primer sequence is extracted entirely, followed by the second single strand containing the complementary primer sequence. The end of the first single strand is joined to the beginning of the second single strand. During ligation, the primer and complementary primer sequences are preserved in the long DNA sequence without deletion. The resulting sequence structure is as follows: the non-primer portion of the first single strand comes first, the primer sequence is in the middle, the complementary primer sequence is in the middle and then the non-complementary primer portion of the second single strand comes last. The resulting long DNA sequence is the ligation product of the aforementioned previous and subsequent keyframes at the DNA level.
[0048] In practice, when the number of consecutive keyframes K is greater than 2, the chain splicing result of the first keyframe and the second keyframe is regarded as the long DNA sequence corresponding to the new first keyframe. The above primer sequence extraction, complementary primer sequence extraction, base complementary pairing, sticky end ligation and merging operations are repeated with the initial DNA sequence of the third keyframe, and so on, until the initial DNA sequence of the Kth keyframe is spliced into the accumulated long DNA sequence to obtain the final long DNA sequence.
[0049] In practice, the final long DNA sequence is segmented according to a preset cutting length. The preset cutting length is denoted as... , Derived from the encryption key, The value of is a positive integer greater than 0 and not greater than the total length of the final long DNA sequence. The segmentation method is as follows: starting from the first base of the final long DNA sequence, consecutive segments are extracted... The first base symbol is used as the first segment of the DNA sequence; the next base symbol is used as the second base symbol. To the Each base symbol is used as the second segment of the DNA sequence; this process continues until the final long DNA sequence contains less than [number missing] base symbols. The remaining base symbols are treated as the last DNA segment sequence. After segmentation, a set of DNA segment sequences is obtained, and the total number of DNA segment sequences in the set is [number missing]. ,in, Indicates the total length of the final long DNA sequence. This represents the function for rounding up.
[0050] In practice, the set of sub-DNA sequences is scrambled and recombined. This scrambling and recombination is performed based on a scrambling sequence vector generated by the encryption key. This vector is an integer vector of length equal to the total number of sub-DNA sequences, and its elements are a random permutation of all integers from 1 to the total number of sub-DNA sequences. The scrambling sequence vector is generated by using the encryption key as a seed for a pseudo-random number generator. The pseudo-random sequence output by the generator is processed using a sorting index mapping algorithm to generate a non-repeating permutation. During scrambling and recombination, an empty recombination sequence list is created. Sub-DNA sequences with corresponding numbers are sequentially retrieved from the set of sub-DNA sequences according to the order of their appearance in the scrambling sequence vector and added to the recombination sequence list. After all sub-DNA sequences have been retrieved, the recombination sequence list stores the recombined DNA sequence set. The order of the sub-DNA sequences in the recombined DNA sequence set is the same as their scrambled order.
[0051] In practice, the process of segmentation, scrambling, and recombination of long DNA sequences is described by the following formula: ,in, This represents the sub-DNA sequence at position w in the recombined DNA sequence set, where w is the position index after recombination, and w is a positive integer ranging from 1 to the total number of sub-DNA sequences V. This represents the u-th sub-segment DNA sequence in the set of sub-segment DNA sequences, where u is the original position index after segmentation, and u is a positive integer with a value range from 1 to V; This represents the inverse mapping function for shuffling the index vector. The output value is an integer representing the original segment index u corresponding to the w-th position after scrambling; V represents the total number of sub-segments of DNA sequence, and the value of V is equal to... ,in, The total length of the final long DNA sequence. The preset cutting length. Shuffle the sequence vector. Derived from the encryption key, Let V be a permutation vector of length V. The elements in the set are integers from 1 to V, and each element is distinct. for The inverse mapping of .
[0052] In practice, the recombined DNA sequence set is used as input for subsequent permutation operations. These operations include row and column permutations. When passed to the permutation module, the individual DNA sequences in the recombined DNA sequence set are concatenated end-to-end according to their order in the recombined sequence list, forming a continuous merged DNA sequence. This merged DNA sequence replaces the initial DNA sequence of a single keyframe and participates in subsequent two-dimensional matrix splitting, row permutation vector cyclic shifting, and column permutation vector cyclic shifting operations. The length of the merged DNA sequence is compared to the total length of the final long-chain DNA sequence. They are equal, which meets the requirements for the length of the input sequence in row permutation and column permutation operations.
[0053] See Figure 6 In the figure, the horizontal axis represents the index position of the recombined DNA segment sequence, ranging from 0 to 400, and the vertical axis represents the starting index position of the corresponding DNA segment sequence in the original long DNA sequence, also ranging from 0 to 400. In the legend, "Long Sequence 1" and "Long Sequence 2" are represented by different colors and markers to indicate the recombination mapping relationship of the long DNA sequence sets obtained after chaining together two sets of consecutive keyframes to be encrypted.
[0054] As shown in the figure, the recombination points of the two long-chain sequences are relatively evenly distributed in the two-dimensional coordinate system without obvious continuity or clustering trend. This indicates that the segmented recombination operation of the long-chain DNA sequence based on the scrambled index vector derived from the encryption key described in Example 4 effectively achieves the randomization of segment positions. Specifically, the recombination index on the horizontal axis and the original starting index on the vertical axis are scattered, showing neither a linear relationship nor obvious local continuous segments, reflecting the sufficient perturbation of the original segment positions by the segmented recombination process.
[0055] Furthermore, the recombination distribution of the two long-chain sequences in the figure covers the entire index range, with no instances of recombination positions concentrated in a certain interval or loss of the original index. This verifies the integrity and effectiveness of the segmentation of the final long-chain DNA sequence according to the preset cutting length and the subsequent segment recombination based on the permutation vector derived from the pseudo-random number generator in Example 4. The distribution points of the two curves intersect but do not overlap, indicating that the recombination process of synthesizing long-chain DNA sequences from different keyframe sequences maintains independence and difference, further enhancing the security of the video encryption method.
[0056] Example 5: In specific implementation, for each keyframe extracted from the video stream, the hash value of the keyframe is calculated. The hash value calculation uses a secure hash algorithm, taking all pixel data of the keyframe as the input message. The hash algorithm iteratively fills, blocks, and compresses the input message, outputting a fixed-length hash value. The hash value is represented as a hexadecimal string. Each hexadecimal character in the hexadecimal hash value is converted into DNA base symbols according to a preset hexadecimal-to-base mapping rule. The resulting sequence of base symbols is the initial key. The hexadecimal-to-base mapping rule is defined as follows: hexadecimal characters 0 to 3 correspond to base symbols A, T, C, and G respectively; hexadecimal characters 4 to 7 correspond to base symbols A, T, C, and G respectively; hexadecimal characters 8 to B correspond to base symbols A, T, C, and G respectively; and hexadecimal characters C to F correspond to base symbols A, T, C, and G respectively. According to the above mapping rules, each character of the hexadecimal hash value is uniquely mapped to a base symbol, and the length of the initial key after mapping is equal to the character length of the hexadecimal hash value.
[0057] In practice, base counting is performed on the initial key to count the number of occurrences of each of the four DNA base symbols. The four DNA base symbols to be counted are A, T, C, and G. Each base symbol in the initial key is iterated over. If the current base symbol is A, the count of A is incremented by 1; if the current base symbol is T, the count of T is incremented by 1; if the current base symbol is C, the count of C is incremented by 1; and if the current base symbol is G, the count of G is incremented by 1. After this iteration, four count values are obtained. These four count values are combined into a four-dimensional integer vector in the order A, T, C, G, denoted as the base counting vector. The base counting vector is represented as... ,in, Indicates the number of base symbols A. Indicates the number of base symbols T. Indicates the number of base symbols C. The number of base symbols G is represented by four components, all of which are non-negative integers, and the sum of the four components equals the total length of the initial key.
[0058] In practice, the row permutation vector step size parameter and column permutation vector step size parameter in the permutation rule are adjusted according to the base counting vector. The original step size of the row permutation vector... The original step size of the column permutation vector is generated by a pseudo-random number generator based on the master encryption key. Similarly, the numbers are generated by a pseudo-random number generator based on the master encryption key. During adjustment, each component of the base counting vector is modulo-merged with the original step size of the row permutation vector and the original step size of the column permutation vector to generate the adjusted row permutation vector step size parameters and column permutation vector step size parameters. The calculation process for the adjusted step size parameters is expressed by the following formula: ,in, This represents the step size parameter of the r-th row in the adjusted row permutation vector, where r is the row index and r is a positive integer. The value of r ranges from 1 to the row number parameter R. Let represent the original step size of the r-th row in the row permutation vector before adjustment. It is a pseudo-random integer derived from the master encryption key; Indices represent the base counting vector Z with index 1. The components, where the modulo operation The results are 0, 1, 2, and 3, corresponding to the 0th, 1st, 2nd, and 3rd components of the base counting vector Z, respectively. The 0th component is... The first component is taken The second component is taken The third component is taken C represents the column count parameter, i.e., the total number of columns in the two-dimensional matrix; addition is integer addition, and modulo operation... Limit the step size parameter to an integer range of 0 to C-1. The adjustment method for the column permutation vector step size parameter is the same as that for the row permutation vector step size parameter; the original step size of the column permutation vector is used. The corresponding component of the base counting vector is added and modulo the row number parameter R. The selection method for the corresponding component of the column permutation vector step size parameter adjustment is based on the column index t. The component value corresponding to the index in the base counting vector Z is selected. The adjusted row permutation vector step size parameter and column permutation vector step size parameter replace the original step size and are applied to the row circular shift operation and the column circular shift operation.
[0059] In practice, before converting the replaced DNA sequence into pixel values using a reverse mapping table, parity checking is performed on each group of DNA base symbols. The parity bit is pre-defined to occupy a fixed position within each group of DNA base symbols. In one specific implementation, the parity bit is set as the last base symbol in each group of DNA base symbols. Parity checking uses an even parity rule, requiring that the total number of 1s in the binary bits corresponding to all base symbols in each group of DNA base symbols, including the parity bit, is even. Corresponding to the binary representation of the DNA base symbols, the number of 1s in the binary number 00 corresponding to base symbol A is 0, the number of 1s in the binary number 01 corresponding to base symbol T is 1, the number of 1s in the binary number 10 corresponding to base symbol C is 1, and the number of 1s in the binary number 11 corresponding to base symbol G is 2. When performing parity checking on a group of DNA base symbols, the number of 1s in the binary bits corresponding to each base symbol within the group is counted and summed; the sum is then determined to be either odd or even. If the summation result is even, the parity check passes, indicating that no errors occurred during the transmission or substitution of the DNA base symbols. If the summation result is odd, the parity check fails, indicating that at least one base symbol in the DNA base symbols is incorrect.
[0060] In practice, when a parity check of a group of DNA base symbols fails, error correction is performed based on the base sequences of adjacent groups. The selection rule for adjacent groups is as follows: if the group that failed the check is not the first group in the grouped sequence, the preceding adjacent group is selected as the reference group; if the group that failed the check is the first group in the grouped sequence, the following adjacent group is selected as the reference group. Error correction adopts the principle of minimum Hamming distance, which is defined as the number of positions where two base symbol sequences have different base symbols at the same location. The error correction process is as follows: for each base symbol position in the group that failed the check, an attempt is made to replace the base symbol at that position with one of the other three base symbols in the set {A, T, C, G}, which together with the remaining unreplaced base symbols in the group constitutes a candidate base sequence. The Hamming distance between the candidate base sequence and the base sequences of the adjacent reference groups is calculated. After traversing all possible single base substitution combinations, the candidate base sequence with the smallest Hamming distance is selected as the corrected base sequence. When multiple candidate base sequences have the same minimum Hamming distance, the first candidate base sequence is selected according to the order of the base symbol set {A, T, C, G}. If a single base substitution cannot form any valid base sequence that satisfies parity checking, the substitution range is extended to two base symbol positions, employing a two-base substitution strategy, again determining the error correction result based on the minimum Hamming distance principle. After error correction, groups that failed the check are replaced by the corrected valid base sequence, and subsequent inverse mapping and pixel value recovery operations are performed based on the corrected base sequence.
[0061] In practice, during the cyclic shifting process of row and column permutations, a base complementation operation is performed on each shifted base symbol. The base complementation operation is triggered after each step of the row or column cyclic shift, and acts on the target base symbol. The rules for the base complementation operation are: if the shifted base symbol is A, then the base symbol is replaced with T; if the shifted base symbol is T, then the base symbol is replaced with A; if the shifted base symbol is C, then the base symbol is replaced with G; if the shifted base symbol is G, then the base symbol is replaced with C. The base complementation operation is performed immediately after each matrix element in the two-dimensional matrix is shifted, ensuring that the shifted matrix elements not only change position but also undergo a complementary transformation of base types.
[0062] In practice, a rotation operation is further performed on the base symbols after the base complementation operation. This rotation operation is also performed after the base complementation operation is completed in each element of the two-dimensional matrix. The rule for the rotation operation is based on the concept of base pairs formed by complementary base pairing: the two complementary base symbols are treated as a single base pair unit, and a 180-degree rotation is performed on each base pair unit. Specifically, if a base symbol, after a base complementation operation, forms an AT base pair with another base symbol shifted to an adjacent position in the same row or column, then the AT base pair is rotated 180 degrees to form a TA base pair. That is, the A in the original base pair is replaced with T, and the T in the original base pair is replaced with A, and the order of the two base symbols in their original positions is interchanged. If a base symbol, after a base complementation operation, forms a CG base pair with another base symbol shifted to an adjacent position in the same row or column, then the CG base pair is rotated 180 degrees to form a GC base pair. That is, the C in the original base pair is replaced with G, and the G in the original base pair is replaced with C, and the order of the two base symbols in their original positions is interchanged. The two base symbols forming a base pair must satisfy an adjacency relationship in a two-dimensional matrix. The adjacency relationship is determined by the following conditions: the two base symbols belong to the same row and have adjacent column indices in a row cyclic shift, or belong to the same column and have adjacent row indices in a column cyclic shift. If the shifted base symbol cannot form an AT or CG base pair with an adjacent base symbol, then no rotation operation is performed on the base symbol, and only the result of the base complementation operation is retained.
[0063] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A video encryption method based on DNA encoding technology, characterized in that, include: Acquire the video stream to be encrypted and extract the keyframe sequence frame by frame; Each keyframe is divided into blocks to generate a fixed-size set of pixel blocks; For each pixel block, its pixel value is converted into DNA base symbols according to a preset base mapping table to generate an initial DNA sequence; A DNA operation matrix is constructed, which contains the base types corresponding to rows and columns. According to the key generation permutation rules, the initial DNA sequence is permuted in rows and columns to generate a permuted DNA sequence. The replaced DNA sequence is converted into pixel values using a reverse mapping table and assembled into encrypted video frames according to the original block positions.
2. The video encryption method based on DNA encoding technology according to claim 1, characterized in that, The step of converting the pixel values into DNA base symbols according to a preset base mapping table to generate an initial DNA sequence includes: Extract the grayscale value or chroma value of each pixel in the pixel block, and map the grayscale value or chroma value into a binary bitstream; According to the preset base mapping table, each two binary digits in the binary code stream are converted into a DNA base symbol. The base mapping table defines the mapping relationship of 00 corresponding to A, 01 corresponding to T, 10 corresponding to C, and 11 corresponding to G. All the converted DNA base symbols are concatenated in pixel order to form the initial DNA sequence.
3. The video encryption method based on DNA encoding technology according to claim 1, characterized in that, The construction of the DNA operation matrix, which contains the base types corresponding to rows and columns, involves performing row and column permutations on the initial DNA sequence according to the key generation permutation rules, including: The initial DNA sequence is split into a two-dimensional matrix according to a preset row and column dimension, and the matrix element is a single DNA base symbol; Based on the key, a row permutation vector and a column permutation vector are generated, wherein the row permutation vector specifies the movement step size for each row of base symbols, and the column permutation vector specifies the movement step size for each column of base symbols. For each row of the two-dimensional matrix, perform a cyclic shift according to the row permutation vector to generate a matrix with row permutation; For each column of the matrix after row permutation, perform a cyclic shift according to the column permutation vector to generate a matrix after column permutation; Expand the matrix after column permutation by rows to obtain the permuted DNA sequence.
4. The video encryption method based on DNA encoding technology according to claim 1, characterized in that, The step of converting the replaced DNA sequence into pixel values using a reverse mapping table and assembling it into encrypted video frames according to the original block positions includes: The replaced DNA sequences are grouped into fixed lengths, with each group corresponding to a pixel in the original pixel block; For each group of DNA base symbols, each base symbol is converted into a two-bit binary number in sequence according to the inverse mapping table. The inverse mapping table defines the conversion relationship between A and 00, T and 01, C and 10, and G and 11. The two binary arrays are combined to form the pixel value of the original bit width, and the grayscale value or chroma value of each pixel is recovered. The encrypted video frame is generated by filling all pixel values into the corresponding coordinates according to the original block position.
5. The video encryption method based on DNA encoding technology according to claim 1, characterized in that, Also includes: The initial DNA sequences of multiple consecutive keyframes in the keyframe sequence are chained together to form a long DNA sequence. The long DNA sequence is segmented according to a preset cutting length to generate multiple sub-segment DNA sequences; The sub-DNA sequence is scrambled and recombinated to generate a recombinant DNA sequence set. The recombined DNA sequence set is used as input for subsequent permutation operations, replacing the initial DNA sequence of a single keyframe.
6. The video encryption method based on DNA encoding technology according to claim 5, characterized in that, The chain splicing includes: Extract the fixed-length bases at the end of the initial DNA sequence of the previous keyframe as primer sequences; The initial DNA sequence of the next keyframe is extracted and fixed-length bases are used as complementary primer sequences. The primer sequence is base-paired with the complementary primer sequence to form a sticky end connection; The two single strands in the ligated double-stranded structure are used as two parts of a new sequence and merged to generate the long DNA sequence, wherein the primer sequence and the complementary primer sequence are retained after ligation.
7. The video encryption method based on DNA encoding technology according to claim 1, characterized in that, Also includes: Calculate the hash value of the keyframe and use the hash value as the initial key; The initial key is base-counted to count the number of A, T, C, and G bases in the initial key, and a base-count vector is generated. The step size parameters of the row and column permutation vectors in the permutation rule are adjusted according to the base counting vector, and the step size parameters are the modulo operation results of each component of the base counting vector.
8. The video encryption method based on DNA encoding technology according to claim 4, characterized in that, Before converting each DNA base symbol into a two-bit binary number according to the inverse mapping table for each group of DNA base symbols, the process also includes: Parity checks are performed on each group of DNA base symbols. If the check fails, error correction is performed based on the base sequences of adjacent groups. The error correction adopts the Hamming distance principle to select the closest effective code.
9. The video encryption method based on DNA encoding technology according to claim 1, characterized in that, The initial DNA sequence is subjected to row and column permutations according to the key generation permutation rules, wherein the permutation rules include permutation operations based on the base pairing principle, including: During the cyclic shifting process of the row and column permutations, a base complementation operation is performed on each shifted base symbol, converting A to T, T to A, C to G, and G to C; The base symbols after the base complementation operation are further rotated to convert the base pair AT to TA by rotating it by 180 degrees, and the base pair CG to GC by rotating it by 180 degrees.
10. A video encryption system based on DNA encoding technology, characterized in that, The device includes a processor and a memory, the memory and the processor being connected. The memory is used to store programs, instructions, or code, and the processor is used to execute the programs, instructions, or code in the memory to implement the video encryption method based on DNA encoding technology as described in any one of claims 1-9.
