DNA encryption method, device and equipment based on random combination code table and storage medium

Through the DNA encryption method based on random combination code tables, the problem of poor effectiveness of existing DNA encryption technology is solved, efficient encryption of encoded files is achieved, and the security and efficiency of encryption are improved.

CN120165830AActive Publication Date: 2025-06-17SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311720940.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-06-17
Estimated Expiration
2043-12-14

AI Technical Summary

Technical Problem

The existing DNA encryption technology is poor in effect and cannot effectively cope with the growth of information storage demand.

Method used

Using a DNA encryption method based on a random combination code table, a code table composed of screened bases is obtained, and random numbers are generated according to the file type of the file to be encoded for code table selection, encoding conversion and base order adjustment are performed to obtain a DNA encryption sequence.

Benefits of technology

It improves the security and efficiency of DNA encryption, realizes effective encryption of encoded files, and enhances the security of information storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120165830A_ABST
    Figure CN120165830A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of DNA encryption, and discloses a DNA encryption method and device based on a random combination code table, equipment and a storage medium, and the method comprises the steps: obtaining seven designed code tables with different sizes and a to-be-coded file; generating a random number according to the file type of the to-be-coded file; carrying out code table selection in each code table based on the random number, taking the selected code table as a target code table, then carrying out coding conversion according to the target code table and the to-be-coded file to obtain a DNA coding result, and generating a random sequence by using chaotic mapping based on the length corresponding to the DNA coding result; and adjusting the sequence of the bases in the DNA coding result according to the random sequence to obtain a randomized DNA encryption sequence, and performing code conversion on the to-be-coded file through the code table composed of the screened bases to obtain the DNA encryption sequence, thereby realizing DNA encryption of the to-be-coded file, and improving the security and efficiency of encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of DNA encryption, and in particular, to a DNA encryption method, device, equipment and storage medium based on a random combination code table. Background Art

[0002] With the continuous development of the information technology field, the lives of human beings have undergone earth-shaking changes. The distance between people is no longer limited by physical distance, and people communicate more frequently, thus generating a large amount of data information. The explosion of data information has imposed higher requirements on the media for information storage, and traditional media such as magnetic disks and optical discs can no longer cope with the growth rate of information.

[0003] Therefore, DNA information storage technology has gradually come into people's view. As a storage medium, DNA has the advantages of high density, easy preservation, long storage period, etc. 1g of DNA can store the information of the whole world. Although DNA information storage has many advantages as above, at present, due to less research on DNA encryption, the encryption effect is poor. Summary of the Invention

[0004] Based on this, in view of the technical problem of the poor DNA encryption effect in the prior art, a DNA encryption method, device, equipment and storage medium based on a random combination code table are proposed.

[0005] In a first aspect, a DNA encryption method based on a random combination code table is provided. The method includes:

[0006] Obtain each code table and the file to be encoded, wherein the code table is composed of bases screened according to preset screening conditions;

[0007] Generate a random number according to the file type of the file to be encoded, and perform code table selection in each of the code tables based on the random number, and use the selected code table as the target code table;

[0008] Perform encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result;

[0009] Adjust the base order in the DNA encoding result according to the random sequence to obtain a DNA encryption sequence.

[0010] In a second aspect, a DNA encryption device based on a random combination code table is provided. The device includes:

[0011] An obtaining module, configured to obtain each code table and the file to be encoded, wherein the code table is composed of bases screened according to preset screening conditions;

[0012] A selection module, configured to generate a random number according to the file type of the file to be encoded, and perform code table selection in each of the code tables based on the random number, and use the selected code table as the target code table;

[0013] An encoding conversion module, configured to perform encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result;

[0014] An adjustment module, configured to adjust the base order in the DNA encoding result according to the random sequence to obtain a DNA encrypted sequence.

[0015] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above DNA encryption method based on a randomly combined code table are implemented.

[0016] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above DNA encryption method based on a randomly combined code table are implemented.

[0017] The DNA encryption method based on a randomly combined code table proposed by the present invention obtains each code table and the file to be encoded. Among them, the code table is composed of bases screened according to preset screening conditions. Then, a random number is generated according to the file type of the file to be encoded, and code table selection is performed in each of the code tables based on the random number, and the selected code table is used as the target code table. Then, encoding conversion is performed according to the target code table and the file to be encoded to obtain a DNA encoding result, and a random sequence is generated based on the length corresponding to the DNA encoding result. Finally, the base order in the DNA encoding result is adjusted according to the random sequence to obtain a DNA encrypted sequence. It can perform encoding conversion on the file to be encoded through the code table composed of the screened bases, so as to obtain a DNA encrypted sequence, realizing the DNA encryption of the file to be encoded, and improving the security and efficiency of encryption. Description of the Drawings

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Among them:

[0020] Figure 1 Applied environment diagram of the DNA encryption method based on a random combination code table in one embodiment;

[0021] Figure 2 Flowchart of the DNA encryption method based on a random combination code table in one embodiment;

[0022] Figure 3 Schematic diagram of coding conversion of the DNA encryption method based on a random combination code table in one embodiment;

[0023] Figure 4 Another schematic diagram of coding conversion of the DNA encryption method based on a random combination code table in one embodiment;

[0024] Figure 5 Picture Lena of the DNA encryption method based on a random combination code table in one embodiment;

[0025] Figure 6 Picture Peppers of the DNA encryption method based on a random combination code table in one embodiment;

[0026] Figure 7 Encrypted image of picture Lena of the DNA encryption method based on a random combination code table in one embodiment;

[0027] Figure 8 Encrypted image of picture Peppers of the DNA encryption method based on a random combination code table in one embodiment;

[0028] Figure 9 Structural block diagram of the DNA encryption device based on a random combination code table in one embodiment;

[0029] Figure 10 Structural block diagram of a computer device in one embodiment;

[0030] Figure 11 Structural block diagram of a computer device in another embodiment. Detailed implementation manners

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the specification and claims of this application or the above drawings are used to distinguish different objects and not to describe a specific order.

[0032] As used herein, the mention of "embodiment" means that the specific features, structures, or characteristics described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears at various positions in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.

[0033] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0034] The DNA encryption method based on a random combination code table provided by an embodiment of the present invention can be applied in an application environment such as Figure 1 , where the client 110 communicates with the server 120 through a network. The server 120 can receive the DNA encryption method based on the random combination code table proposed in this embodiment through the client 110, and by obtaining each code table and the file to be encoded. Among them, the code table is composed of bases screened according to preset screening conditions. Then, the server 120 generates a random number according to the file type of the file to be encoded, and selects a code table from each of the code tables based on the random number, and uses the selected code table as the target code table. Next, the server 120 performs encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generates a random sequence based on the length corresponding to the DNA encoding result. Finally, the server 120 adjusts the base order in the DNA encoding result according to the random sequence to obtain a DNA encryption sequence, which can perform encoding conversion on the file to be encoded through the code table composed of the screened bases, so as to obtain a DNA encryption sequence, realizing the DNA encryption of the file to be encoded, and improving the security and efficiency of encryption. Among them, the client 110 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server 120 can be implemented by an independent server or a server cluster composed of multiple servers. The present invention will be described in detail below through specific embodiments.

[0035] Please refer to Figure 2 as shown in Figure 2 which is a schematic flowchart of a DNA encryption method based on a random combination code table provided by an embodiment of the present invention, and includes the following steps:

[0036] Step S101: Obtain each code table and the file to be encoded, where the code table is composed of bases screened according to preset screening conditions;

[0037] Among them, the code table can be designed according to the preset screening conditions of GC content and oligonucleotide (GC content is about 50%, and the length of oligonucleotide is less than or equal to 3).

[0038] As an example, 7 code tables, namely code table a, code table b, code table c, code table d, code table e, code table f, and code table g, are designed.

[0039] As an example: Code table a: The length of 2 can be expressed as 2 1 , and code table a includes two base combinations, r1 and r2. For example, r1 = (A or T), r2 = (C or G), where A, T, C, and G represent bases;

[0040] As an example: The length of code table b is 4 and can be expressed as 2 2 , and code table b includes four base combinations, r1 to r4. For example, r1 = A, r2 = T, r3 = C, r4 = G;

[0041] As an example: The length of code table c is 8 and can be expressed as 2 3 , and code table c includes eight base combinations, r1 to r8. For example, r1 = AC, r2 = AG, r3 = TC, r4 = TG, r5 = CA, r6 = CT, r7 = GA, r8 = GT

[0042] As an example: The length of code table d is 16 and can be expressed as 2 4 , and code table d includes 16 base combinations, r1 to r16. For example, r1 to r16 are shown in the following table:

[0043] AA TA CA GA AT TT CT GT AC TC CC GC AG TG CG GG

[0044] As an example: The length of code table e is 32 and can be expressed as 2 5 , and code table e includes 32 base combinations, r1 to r32. For example, r1 to r32 are shown in the following table:

[0045] ACA ACT ACC ACG AGA AGT AGC AGG TCA TCT TCC TCG TGA TGT TGC TGG CAA CAT CAC CAG CTA CTT CTC CTG GAA GAT GAC GAG GTA GTT GTC GTG

[0046] As an example: The length of code table f is 64 and can be expressed as 2 6 , and code table e includes 64 base combinations, r1 to r64. For example, r1 to r64 are shown in the following table:

[0047] ACTC ACTG AGAC AGAG TCAG TCAC TGTC TGTG CACA CACT CTCA CTCT GACA GACT GTCA GTCT ACAC ACAG AGTC AGTG TCTC TCTG TGAG TGAC CAGA CAGT CTGA CTGT GAGA GAGT GTGA GTGT ACCA ACCT TCCA TCCT AGCT ACGT AGCA ACGA CAAG CAAC GAAC GAAG TCGA TGCA TGCT TCGT CTTC CTTG GTTC GTTG CATG CTAG GATG GTAG AGGA AGGT TGGA TGGT GATC GTAC CATC CTAC

[0048] As an example: The length of code table g is 128 and can be expressed as 27 , the code table g includes 128 base combinations from r1 to r128. For example, r1 to r128 are shown in the following table:

[0049]

[0050]

[0051] Step S102: Generate a random number according to the file type of the file to be encoded, and perform code table selection in each of the code tables based on the random number, and use the selected code table as the target code table;

[0052] Among them, the file type can be text type, image type, and other types.

[0053] In this embodiment, according to the file type of different files to be encoded, a random number corresponding to the file type is generated, and then code table selection is performed in each code table according to the random number, and the selected code table is used as the target code table. For example, if the random number is 7, then the seventh code table is selected from each code table, and the seventh code table is used as the target code table.

[0054] In one embodiment, the step of performing code table selection in each of the code tables according to the preset selection rule corresponding to the file type of the file to be encoded and using the selected code table as the target code table includes:

[0055] Step S1021: Generate a random number based on the number of the code tables as the first random number;

[0056] Among them, the number refers to the total number of code tables, and the maximum value of the first random number can be equal to the value of the total number. For example, if the number is 7, then the first random number can be any number from 0 to 7.

[0057] Step S1022: Generate a random number based on the first random number and the file type of the file to be encoded as the second random number;

[0058] For example, when a random number from 0 to 7 is randomly generated as the first random number n1, if the file type of the file to be encoded is text, then the second random number n2 = 7 - n1; if the file type of the file to be encoded is an image, then the second random number n2 satisfies n1 + n2 = 8; if the file type of the file to be encoded is other types, then the second random number n2 satisfies n1 + n2 = 8, where n1 refers to the first random number and n2 refers to the second random number.

[0059] Step S1023: Select the code table corresponding to the first random number as the target code table from each of the code tables, and select the code table corresponding to the second random number as the target code table from each of the code tables.

[0060] For example, when the file type of the file to be encoded is text, the first random number is 1 and the second random number is 6. Then, select the first code table corresponding to the first random number and the sixth code table corresponding to the second random number from each code table. Take the first code table as the target code table and the sixth code table as the target code table.

[0061] Step S103: Perform encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result;

[0062] For example, if the data in the file to be encoded is character data, each character data corresponds to a base combination in the target code table, and the same character data corresponds to only one base combination. Finally, after all the data in the file to be encoded is converted into each base combination, the DNA encoding result is obtained.

[0063] As an example, generate a random sequence based on the length corresponding to the DNA encoding result, where the length can be the number of base combinations in the DNA encoding result.

[0064] Step S104: Adjust the base order in the DNA encoding result according to the random sequence to obtain a DNA encrypted sequence.

[0065] Adjust the base order in the DNA encoding result through each random number in the random sequence, and take the adjusted DNA encoding result as the DNA encrypted sequence. For example, if the largest random number in the random sequence is 10, then in the DNA encoding result, move the tenth base combination in the DNA encoding result to the first position in ascending order.

[0066] The DNA encryption method based on a randomly combined code table proposed in this embodiment obtains each code table and the file to be encoded. Among them, the code table is composed of bases screened according to preset screening conditions. Then, a random number is generated according to the file type of the file to be encoded, and based on the random number, a code table is selected from each of the code tables. The selected code table is used as the target code table. Then, encoding conversion is performed according to the target code table and the file to be encoded to obtain a DNA encoding result, and a random sequence is generated based on the length corresponding to the DNA encoding result. Finally, the base order in the DNA encoding result is adjusted according to the random sequence to obtain a DNA encrypted sequence. It can perform encoding conversion on the file to be encoded through the code table composed of the screened bases, thereby obtaining a DNA encrypted sequence, realizing the DNA encryption of the file to be encoded, and improving the security and efficiency of encryption.

[0067] In one embodiment, the step of performing encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result and generating a random sequence based on the length corresponding to the DNA encoding result includes:

[0068] Step 201: When there is only one target code table, perform encoding conversion on the file to be encoded according to each base combination in the target code table in the order of the data in the file to be encoded to obtain a first DNA sequence, and use the first DNA sequence as the DNA encoding result.

[0069] When there is only one target code table, it means that only one code table is selected as the target code table. Through the target code table, encoding conversion is performed on the file to be encoded in the order of the data in the file to be encoded to obtain a first DNA sequence. It should be noted that for text files, characters are directly read for code table mapping encoding, for image files, the pixel values of each pixel point are also directly encoded for code table mapping encoding, and for other types of files, the byte data is encoded by reading binary information.

[0070] As an example, as Figure 3 shown, the data in the file to be encoded are the strings a, b, c, a, 1, 2, and the code table t0 is the target code table. In the order of the data in the file to be encoded, a is encoded as ATC, b is encoded as TAC, c is encoded as TGA, a is encoded as ATC, 1 is encoded as ATA, and 2 is encoded as CAA.

[0071] In one embodiment, the step of performing encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result and generating a random sequence based on the length corresponding to the DNA encoding result further includes:

[0072] Step S301: When there are two target codon tables, construct a matrix based on each base combination in one of the target codon tables and each base combination in the other target codon table to obtain a matrix;

[0073] Step S302: Perform encoding conversion based on the matrix and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result.

[0074] When there are two target codon tables, it means that two codon tables are selected as the target codon tables respectively. Construct a matrix based on each base combination in one of the target codon tables and each base combination in the other target codon table to obtain a matrix.

[0075] As an example, as Figure 4 shown, codon table t1 is one target codon table, codon table t2 is the other target codon table, and a matrix is constructed through the two target codon tables. Among them, codon table t1 includes base combinations TTA, CCA, ATC, GAC, ACC, ATT, and codon table t2 includes base combinations ATC, TAC, TGA, CAG, TAT, CAA.

[0076] In one embodiment, the DNA encoding result includes a second DNA sequence and a third DNA sequence. The step of performing encoding conversion based on the matrix and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result includes:

[0077] Step S401: Store the data in the file to be encoded into the matrix in the order of the data in the file to be encoded to determine a first base combination and a second base combination, where the first base combination refers to the base combination in the matrix corresponding to the data in the file to be encoded in one of the target codon tables, and the second base combination refers to the base combination in the matrix corresponding to the data in the file to be encoded in the other target codon table;

[0078] For example, as Figure 4 shown, the data in the file to be encoded is a, the first base combination corresponding to a is CCA, and the second base combination corresponding to a is TGA.

[0079] Step S402: According to the position order of the data in the file to be encoded in the matrix, use each of the first base combinations as the second DNA sequence and each of the second base combinations as the third DNA sequence;

[0080] Specifically, according to the position order of the data in the file to be encoded in the matrix, the first base combinations corresponding to all the data in the file to be encoded are used as the second DNA sequence, and the second base combinations corresponding to all the data in the file to be encoded are used as the third DNA sequence.

[0081] Step S403: Generate a random sequence based on the second DNA sequence and the third DNA sequence.

[0082] For example, generate a random sequence based on the number of the first base combinations in the second DNA sequence and the number of the second base combinations in the third DNA sequence.

[0083] In one embodiment, the random sequence includes a first random sequence and a second random sequence. The step of generating a random sequence based on the second DNA sequence and the third DNA sequence includes:

[0084] Step S501: Generate a first random sequence through a Sine chaotic mapping function, where the length of the first random sequence is the same as that of the second DNA sequence;

[0085] Step S502: Generate a second random sequence through a Sine chaotic mapping function, where the length of the second random sequence is the same as that of the third DNA sequence.

[0086] As an example, use the Sine chaotic mapping function to generate a random sequence, the first random sequence S1, and save the starting value s1 and a. The Sine chaotic mapping function is shown as follows:

[0087] S1 = {s1, s2, …, s n}

[0088]

[0089] n = length(second DNA sequence)

[0090] It should be noted that the generation method of the second random sequence S2 is the same as that of the first random sequence, and will not be elaborated here.

[0091] In one embodiment, the step of adjusting the base order in the DNA encoding result according to the random sequence to obtain a DNA encryption sequence includes:

[0092] Step S601: Sort the first random sequence according to a preset sorting rule, and perform indexing according to the sorted first random sequence to adjust the order of each of the first base combinations in the second DNA sequence;

[0093] As an example, sort the first random sequence in descending order, and index through the sorted first random sequence to adjust the order of each of the first base combinations in the second DNA sequence. For example, if the sorted first random sequence is {1, 2, 3, 4}, then in the second DNA sequence, the 4th first base combination is adjusted to the first position, the 1st first base combination is adjusted to the last position, and the 2nd first base combination and the 3rd first base combination are swapped in position in the second DNA sequence.

[0094] Step S602: Sort the second random sequence according to a preset sorting rule, and index through the sorted second random sequence to adjust the order of each of the second base combinations in the third DNA sequence;

[0095] As an example, sort the second random sequence in descending order, and index through the sorted second random sequence to adjust the order of each of the second base combinations in the third DNA sequence. For example, if the sorted second random sequence is {1, 2, 3, 4}, then in the third DNA sequence, the 4th second base combination is adjusted to the first position, the 1st second base combination is adjusted to the last position, and the 2nd second base combination and the 3rd second base combination are swapped in position in the third DNA sequence.

[0096] Step S603: Use the adjusted second DNA sequence and the adjusted third DNA sequence as the DNA encryption sequence.

[0097] As an example, the decryption process is the reverse process of encryption. By generating the first random sequence, the second random sequence, the recorded random numbers n1 and n2, and selecting the code table using the starting value and parameter a of the recorded Sine function, the DNA encryption sequence can be converted into the file to be encrypted.

[0098] As another example, as Figure 5 , Figure 6 shown, they are respectively two classic pictures Lena and Peppers commonly used in computer vision. Using these two images as the files to be encrypted, the DNA encryption method based on the random combination code table of the present invention is used for file encryption. The encrypted image of picture Lena is as Figure 7 shown, and the encrypted image of picture Peppers is as Figure 8 shown. The pixel distribution of the encrypted images is uniform and has good randomness, and the encryption performance is good. There are no overly long oligonucleotides in the encrypted DNA encryption sequence, and the GC content is between 45% and 60%, and the total average GC content is about 50%, having good biochemical properties.

[0099] Please refer to Figure 9 As shown, in one embodiment, a DNA encryption device based on a random combination code table is provided. The device includes:

[0100] An acquisition module 10, configured to acquire each code table and the file to be encoded, where the code table is composed of bases screened according to a preset screening condition;

[0101] A selection module 20, configured to generate a random number according to the file type of the file to be encoded, and perform code table selection in each of the code tables based on the random number, and use the selected code table as the target code table;

[0102] An encoding conversion module 30, configured to perform encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result;

[0103] An adjustment module 40, configured to adjust the base order in the DNA encoding result according to the random sequence to obtain a DNA encryption sequence.

[0104] In one embodiment, the selection module 20 is configured to: generate a random number based on the number of the code tables as the first random number;

[0105] Generate a random number based on the first random number and the file type of the file to be encoded as the second random number;

[0106] Select the code table corresponding to the first random number in each of the code tables as the target code table, and select the code table corresponding to the second random number in each of the code tables as the target code table.

[0107] In one embodiment, the encoding conversion module 30 is configured to: when there is only one target code table, perform encoding conversion on the file to be encoded according to each base combination in the target code table in the order of the data in the file to be encoded to obtain a first DNA sequence, and use the first DNA sequence as the DNA encoding result.

[0108] In one embodiment, the encoding conversion module 30 is configured to: when there are two target code tables, construct a matrix according to each base combination in one target code table and each base combination in the other target code table to obtain a matrix;

[0109] Perform encoding conversion based on the matrix and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result.

[0110] In one embodiment, the encoding conversion module 30 is configured to: store the data in the file to be encoded into the matrix in the order of the data in the file to be encoded, so as to determine a first base combination and a second base combination, where the first base combination refers to the base combination of the data in the file to be encoded corresponding to one of the target code tables in the matrix, and the second base combination refers to the base combination of the data in the file to be encoded corresponding to another target code table in the matrix;

[0111] According to the position order of the data in the file to be encoded in the matrix, use each of the first base combinations as a second DNA sequence, and use each of the second base combinations as a third DNA sequence;

[0112] Generate a random sequence based on the second DNA sequence and the third DNA sequence.

[0113] In one embodiment, the encoding conversion module 30 is configured to: generate a first random sequence through a Sine chaotic mapping function, where the length of the first random sequence is the same as that of the second DNA sequence;

[0114] Generate a second random sequence through a Sine chaotic mapping function, where the length of the second random sequence is the same as that of the third DNA sequence.

[0115] In one embodiment, the adjustment module 40 is configured to: sort the first random sequence according to a preset sorting rule, and perform indexing according to the sorted first random sequence to adjust the order of each of the first base combinations in the second DNA sequence;

[0116] Sort the second random sequence according to a preset sorting rule, and perform indexing according to the sorted second random sequence to adjust the order of each of the second base combinations in the third DNA sequence;

[0117] Use the adjusted second DNA sequence and the adjusted third DNA sequence as the DNA encryption sequence.

[0118] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 10As shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of a DNA encryption method based on a random combination code table.

[0119] In one embodiment, a computer device is provided. The computer device can be a client, and its internal structure diagram can be as Figure 11 shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the client side of a DNA encryption method based on a random combination code table.

[0120] In one embodiment, a computer device is proposed, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0121] Obtain each code table and the file to be encoded, where the code table is composed of bases screened according to preset screening conditions;

[0122] Generate a random number according to the file type of the file to be encoded, and perform code table selection in each of the code tables based on the random number, and use the selected code table as the target code table;

[0123] Perform encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result;

[0124] Adjust the base order in the DNA encoding result according to the random sequence to obtain a DNA encryption sequence.

[0125] The DNA encryption method based on a randomly combined code table proposed in this embodiment obtains each code table and the file to be encoded. Among them, the code table is composed of bases screened according to preset screening conditions. Then, a random number is generated according to the file type of the file to be encoded, and code table selection is performed in each code table based on the random number. The selected code table is used as the target code table. Next, encoding conversion is performed according to the target code table and the file to be encoded to obtain a DNA encoding result, and a random sequence is generated based on the length corresponding to the DNA encoding result. Finally, the base order in the DNA encoding result is adjusted according to the random sequence to obtain a DNA encrypted sequence. It can perform encoding conversion on the file to be encoded through the code table composed of the screened bases, thereby obtaining a DNA encrypted sequence, realizing the DNA encryption of the file to be encoded, and improving the security and efficiency of encryption.

[0126] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0127] Obtain each code table and the file to be encoded, where the code table is composed of bases screened according to preset screening conditions;

[0128] Generate a random number according to the file type of the file to be encoded, and perform code table selection in each code table based on the random number. The selected code table is used as the target code table;

[0129] Perform encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generate a random sequence based on the length corresponding to the DNA encoding result;

[0130] Adjust the base order in the DNA encoding result according to the random sequence to obtain a DNA encrypted sequence.

[0131] The DNA encryption method based on a randomly combined code table proposed in this embodiment obtains each code table and the file to be encoded. Among them, the code table is composed of bases screened according to preset screening conditions. Then, a random number is generated according to the file type of the file to be encoded, and code table selection is performed in each code table based on the random number. The selected code table is used as the target code table. Next, encoding conversion is performed according to the target code table and the file to be encoded to obtain a DNA encoding result, and a random sequence is generated based on the length corresponding to the DNA encoding result. Finally, the base order in the DNA encoding result is adjusted according to the random sequence to obtain a DNA encrypted sequence. It can perform encoding conversion on the file to be encoded through the code table composed of the screened bases, thereby obtaining a DNA encrypted sequence, realizing the DNA encryption of the file to be encoded, and improving the security and efficiency of encryption.

[0132] It should be noted that for the functions or steps that can be achieved by the above computer-readable storage medium or computer device, reference can be made to the relevant descriptions on the server side and the client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0133] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0134] Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0135] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A DNA encryption method based on a random combination code table, characterized in that, The DNA encryption method based on a random combination code table includes: Obtaining each code table and the file to be encoded, where the code table is composed of bases screened according to a preset screening condition; Generating a random number according to the file type of the file to be encoded, and performing code table selection in each of the code tables based on the random number, and taking the selected code table as the target code table; Performing encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result; Adjusting the base order in the DNA encoding result according to the random sequence to obtain a DNA encrypted sequence.

2. The DNA encryption method based on a random combination code table according to claim 1, characterized in that, The step of generating a random number according to the file type of the file to be encoded, and performing code table selection in each of the code tables based on the random number, and taking the selected code table as the target code table includes: Generating a random number based on the number of the code tables as the first random number; Generating a random number based on the first random number and the file type of the file to be encoded as the second random number; Selecting the code table corresponding to the first random number in each of the code tables as the target code table, and selecting the code table corresponding to the second random number in each of the code tables as the target code table.

3. The DNA encryption method based on a random combination code table according to claim 2, characterized in that, The step of performing encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result includes: When there is only one target code table, performing encoding conversion on the file to be encoded according to each base combination in the target code table in the order of the data in the file to be encoded to obtain a first DNA sequence, and taking the first DNA sequence as the DNA encoding result.

4. The DNA encryption method based on a random combination code table according to claim 2, characterized in that, The step of performing encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result further includes: When there are two target code tables, constructing a matrix according to each base combination in one target code table and each base combination in the other target code table to obtain a matrix; Performing encoding conversion based on the matrix and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result.

5. The DNA encryption method based on a random combination code table according to claim 4, characterized in that, The DNA encoding result includes a second DNA sequence and a third DNA sequence. The step of performing encoding conversion based on the matrix and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result includes: Storing the data in the file to be encoded into the matrix in the order of the data in the file to be encoded to determine a first base combination and a second base combination, where the first base combination refers to the base combination corresponding to the data in the file to be encoded in one target code table in the matrix, and the second base combination refers to the base combination corresponding to the data in the file to be encoded in the other target code table in the matrix; According to the position order of the data in the file to be encoded in the matrix, each of the first base combinations is used as the second DNA sequence, and the second base combination is used as the third DNA sequence; Based on the second DNA sequence and the third DNA sequence, a random sequence is generated.

6. The DNA encryption method based on a random combination code table according to claim 5, characterized in that, The random sequence includes a first random sequence and a second random sequence. The step of generating a random sequence based on the second DNA sequence and the third DNA sequence includes: Generating a first random sequence through a Sine chaotic mapping function, where the length of the first random sequence is the same as that of the second DNA sequence; Generating a second random sequence through a Sine chaotic mapping function, where the length of the second random sequence is the same as that of the third DNA sequence.

7. The DNA encryption method based on a random combination code table according to claim 6, characterized in that, The step of adjusting the base order in the DNA encoding result according to the random sequence to obtain a DNA encrypted sequence includes: Sorting the first random sequence according to a preset sorting rule, and indexing according to the sorted first random sequence to adjust the order of each of the first base combinations in the second DNA sequence; Sorting the second random sequence according to a preset sorting rule, and indexing according to the sorted second random sequence to adjust the order of each of the second base combinations in the third DNA sequence; Taking the adjusted second DNA sequence and the adjusted third DNA sequence as the DNA encrypted sequence.

8. A DNA encryption device based on a random combination code table, characterized in that, The DNA encryption device based on a random combination code table includes: An acquisition module for acquiring each code table and the file to be encoded, where the code table is composed of bases screened according to preset screening conditions; A selection module for generating a random number according to the file type of the file to be encoded, and selecting a code table from each of the code tables based on the random number, and taking the selected code table as the target code table; An encoding conversion module for performing encoding conversion according to the target code table and the file to be encoded to obtain a DNA encoding result, and generating a random sequence based on the length corresponding to the DNA encoding result; An adjustment module for adjusting the base order in the DNA encoding result according to the random sequence to obtain a DNA encrypted sequence.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, the steps of the DNA encryption method based on a random combination code table according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, wherein, When the computer program is executed by a processor, the steps of the DNA encryption method based on a random combination code table according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image encryption algorithm based on DNA encoding and chaotic mapping

    CN103473733A

  • DNA technology based encryption method

    CN106817218A

  • Sequence password generation method, data encryption method and data decryption method

    CN111464296A

  • Image encryption method and system based on DNA triploid variation

    CN115103080A

  • Data security storage method

    CN115694784A