Data encryption and decryption method based on DNA coding, intelligent terminal and medium

By constructing a DNA coding table and optimizing the DNA sequence structure, combined with chaotic mapping technology, the problem of small amount of DNA information storage and unsatisfactory encryption effect is solved, and efficient data encryption and information density improvement are achieved.

CN118659874APending Publication Date: 2024-09-17SHENZHEN INST OF ADVANCED TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311653624.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The amount of information stored in DNA information in the existing technology is small and the encryption effect is not ideal, which cannot effectively meet the needs of storing large amounts of information based on DNA encoding.

Method used

A mixed code table based on four bases and five bases is used to construct a DNA coding table. Encryption and chaotic mapping technology are used to encrypt the coded data, optimize the DNA sequence structure, avoid the generation of oligonucleotides, and improve the information density and encryption effect.

Benefits of technology

It improves the information density and security of DNA sequences, reduces storage space requirements, and at the same time enhances the attack resistance and stability of encrypted data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659874A
    Figure CN118659874A
Patent Text Reader

Abstract

The invention provides a data encryption and decryption method based on DNA coding, an intelligent terminal and a medium, and particularly relates to the technical field of data storage, and the scheme comprises the following steps: encrypting obtained to-be-coded data to obtain to-be-coded encrypted data; based on a pre-constructed DNA coding table, each byte of the to-be-coded encrypted data is subjected to DNA coding, an initial base sequence is obtained, and the DNA coding table is constructed by a four-base unit and a five-base unit; and carrying out chaotic mapping adjustment and rearrangement on the initial base sequence by adopting a preset DNA sequence structure optimization rule so as to obtain an encrypted DNA sequence. According to the scheme, the GC content in the DNA sequence generated by encryption can be kept in a balanced state, the information density of the encrypted data is improved, and the encryption effect is effectively improved, so that the storage space occupied by the to-be-coded data is reduced, the security and attack prevention of the to-be-coded data are improved, and the stability of the encrypted DNA sequence can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a data encryption and decryption method, an intelligent terminal and a medium based on DNA coding. Background Art

[0002] In the existing technology, DNA information storage, as an emerging information storage technology, has attracted not only a large number of biologists but also many experts in the field of computer information communication. DNA information storage has also evolved from simple DNA information encoding to more in-depth fields such as DNA information error correction, automated DNA information storage systems, and DNA encryption. As a method of information storage that is expected to become an important method in the future, DNA information storage not only needs to have the characteristics of low cost and low energy consumption, but also good security properties.

[0003] Although there are many studies on DNA information storage in the prior art, there are fewer studies on the combination of DNA encryption and DNA coding. In general, DNA encryption and DNA coding are integrated by establishing a simple mapping relationship of one to one (adenine A-00, thymine T-01, cytosine C-10, guanine G-11) or two to one (A, T=0, C, G=1). However, using only a simple mapping relationship cannot well meet the demand for storing a large amount of information based on DNA coding, which leads to the problem of unsatisfactory DNA information encryption effect. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a data encryption and decryption method, intelligent terminal and medium based on DNA coding, aiming to solve the problems in the prior art that the amount of information stored based on DNA coding is small and the DNA information encryption effect is not ideal.

[0005] In order to achieve the above object, the present invention provides a data encryption method based on DNA coding in a first aspect, comprising:

[0006] Get the data to be encoded;

[0007] Encrypting the data to be encoded to obtain encrypted data to be encoded;

[0008] Based on a pre-constructed DNA encoding table, each byte of the encrypted data to be encoded is DNA encoded to obtain an initial base sequence, wherein the DNA encoding table is constructed from four-base units and five-base units;

[0009] Using a preset DNA sequence structure optimization rule, the initial base sequence is adjusted to obtain an optimized base sequence;

[0010] The optimized base sequence is rearranged by chaotic mapping to obtain an encrypted DNA sequence.

[0011] Optionally, the step of performing DNA encoding on each byte of the encrypted data to be encoded based on a pre-constructed DNA encoding table to obtain an initial base sequence includes:

[0012] Based on the encrypted data to be encoded, a byte sequence is obtained, wherein the byte sequence includes a plurality of bytes;

[0013] Based on the mapping rules between bytes and base units in the pre-constructed DNA encoding table, base units corresponding to each byte in the byte sequence are respectively obtained to obtain an initial base sequence.

[0014] Optionally, the process of constructing the DNA coding table includes:

[0015] According to the preset code table design principle, a mixed code table is constructed using four-base units and five-base units;

[0016] Based on the mixed code table, a one-to-one correspondence between bytes and base units is established to obtain a mapping rule between bytes and base units.

[0017] Optionally, the method of constructing a mixed code table using four-base units and five-base units according to a preset code table design principle includes:

[0018] Based on the four single bases, several four-base units and five-base units were constructed;

[0019] If the first base of the four-base unit is A or T, the fourth base is C or G;

[0020] If the first base of the four-base unit is C or G, the fourth base is A or T;

[0021] If the first base of the five-base unit is A, the fourth base and the fifth base are both TC or TG;

[0022] If the first base of the five-base unit is T, the fourth base and the fifth base are both AC or AG;

[0023] If the first base of the five-base unit is C, the fourth base and the fifth base are both GA or GT;

[0024] If the first base of the five-base unit is G, the fourth base and the fifth base are both CA or CT.

[0025] Optionally, when the previous base unit of two adjacent bases is a four-base unit, the initial base sequence is adjusted according to a preset DNA sequence structure optimization rule to obtain an optimized base sequence, including:

[0026] If the last three bases of the previous base unit are the same as the first base of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit;

[0027] If the last two bases of the previous base unit are the same as the first two bases of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit;

[0028] If the last single base of the previous base unit is the same as the first three single bases of the adjacent next base unit, the last single base of the previous base unit is replaced by a preset complementary base and one complementary base is added.

[0029] Optionally, when the first base unit of two adjacent bases is a five-base unit, the initial base sequence is adjusted according to a preset DNA sequence structure optimization rule to obtain an optimized base sequence, including:

[0030] If the last single base of the previous base unit is the same as the first three single bases of the adjacent next base unit, the last single base of the previous base unit is replaced by the first single base of the previous base unit.

[0031] The second aspect of the present invention provides a data decryption method based on DNA coding, which is applied to decrypt the encrypted DNA sequence obtained by any of the above-mentioned data encryption methods based on DNA coding, and comprises:

[0032] The encrypted DNA sequence is rearranged in reverse based on the sequence information obtained by the initial setting of the chaotic map to restore the optimized base sequence;

[0033] Based on the preset DNA sequence structure optimization rules and the pre-constructed DNA encoding table, the optimized base sequence is subjected to DNA decoding to restore the decoded base sequence;

[0034] The decoded base sequence is decrypted to obtain restored data.

[0035] Optionally, the step of performing DNA decoding on the optimized base sequence based on a preset DNA sequence structure optimization rule and a pre-constructed DNA encoding table to restore the decoded base sequence comprises:

[0036] Based on a preset DNA sequence structure optimization rule, adjusting the base units in the optimized base sequence to obtain a quasi-base sequence;

[0037] Based on a pre-constructed DNA coding table, the quasi-base sequence is subjected to DNA decoding to restore the decoded base sequence.

[0038] The third aspect of the present invention provides an intelligent terminal, which includes a memory, a processor, and a DNA-encoded data encryption program stored in the memory and executable on the processor, wherein the DNA-encoded data encryption program implements any one of the steps of the above-mentioned DNA-encoded data encryption method when executed by the processor.

[0039] A fourth aspect of the present invention provides a computer-readable storage medium, on which a data encryption program based on DNA coding is stored. When the data encryption program based on DNA coding is executed by a processor, the steps of any one of the above-mentioned data encryption methods based on DNA coding are implemented.

[0040] Compared with the prior art, the beneficial effects of this solution are as follows:

[0041] The present invention encrypts the data to be encoded to obtain the encrypted data to be encoded, constructs a new DNA encoding table using four-base units and five-base units, forms a unique DNA encoding mapping rule, converts the encrypted data to be encoded into a unique initial base sequence, and on this basis, in order to avoid the generation of oligonucleotides and improve the information density, adopts the designed DNA sequence structure optimization rule to adjust the initial base sequence to obtain the optimized base sequence; and rearranges the optimized base sequence using chaotic mapping, so that the GC content in the generated encrypted DNA sequence is kept in a balanced state and the information density of the encrypted data is improved, the encryption effect is effectively improved, which is beneficial to reducing the storage space occupied by the data to be encoded, and is beneficial to improving the security and anti-attack of the data to be encoded, thereby ensuring the stability of the encrypted DNA sequence. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0043] Figure 1 This is a flow chart of the data encryption method based on DNA coding of the present invention;

[0044] Figure 2 This is a schematic diagram of the data encryption method based on DNA coding of the present invention;

[0045] Figure 3 A schematic diagram of the DNA sequence structure optimization rule of the present invention;

[0046] Figure 4 is the character image before encryption;

[0047] Figure 5 This is a simulation diagram of GC content distribution after the character picture is encrypted by AES in the present invention;

[0048] Figure 6 This is a simulation diagram of GC content distribution after the character picture is encrypted by RSA in the present invention;

[0049] Figure 7 is the Cameraman image before encryption;

[0050] Figure 8 This is a simulation diagram of the GC content distribution after the Cameraman image is encrypted using AES in the present invention;

[0051] Fig. 9 This is a simulation diagram of the GC content distribution after the Cameraman image is encrypted using RSA in the present invention;

[0052] Fig.10 It is a structural schematic diagram of the intelligent terminal of the present invention. DETAILED DESCRIPTION

[0053] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0054] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0055] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0056] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0057] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0058] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0060] In view of the problems in the prior art that the amount of information stored based on DNA coding is small and the DNA information encryption effect is not ideal, the present invention proposes a data encryption method based on DNA coding, which mainly includes four key steps: byte encryption, DNA coding, optimized coding and chaotic mapping, specifically: in the byte encryption stage, symmetric encryption or asymmetric encryption is used for encryption respectively for different data to obtain various types of data to be encoded in the form of byte sequences; in the DNA coding stage, a DNA coding table is constructed based on a mixed code table of four bases and five bases, and the coding rules of the DNA coding table can effectively avoid the occurrence of extreme GC content and lay a good foundation for subsequent optimized coding; in the optimized coding stage, the main purpose is to optimize the generated initial DNA sequence structure, replace and interrupt oligonucleotides; in the chaotic mapping stage, a chaotic function is used to generate an index sequence, and the DNA sequence after the structure is adjusted is rearranged to make the distribution of each base in the sequence more uniform.

[0061] Exemplary Methods

[0062] The embodiment of the present invention provides a data encryption method based on DNA coding, which can be deployed on computer devices such as computers, smart phones, servers and portable wearable devices, and is applied to data that needs to be compressed and / or encrypted. The present invention does not limit the type of target data, which can be various types of data such as voice, pictures, videos and text data. Specifically, Figure 1 and Figure 2 As shown, the steps of the method in this embodiment include:

[0063] Step S1000: obtaining data to be encoded;

[0064] Specifically, data to be encoded is obtained, such as various types of data such as voice, picture, video or text data.

[0065] Step S2000: encrypting the data to be encoded to obtain encrypted data to be encoded;

[0066] Specifically, symmetric encryption or asymmetric encryption is used to select appropriate encryption forms for different data to be encoded. Symmetric encryption, such as the AES encryption algorithm, is used for large files and data that require identity authentication; asymmetric encryption, such as the RSA encryption algorithm, is used for small files and data used for signatures.

[0067] It should be noted that this embodiment uses the AES encryption algorithm and the RSA encryption algorithm as the symmetric encryption algorithm and the asymmetric encryption algorithm respectively. As other preferred implementation modes, other types of symmetric encryption algorithms and asymmetric encryption algorithms can be flexibly selected according to actual application conditions. The present invention does not make any specific restrictions.

[0068] Step S3000: Based on a pre-constructed DNA encoding table, DNA encoding is performed on each byte of the encrypted data to obtain an initial base sequence, wherein the DNA encoding table is constructed from four-base units and five-base units;

[0069] Specifically, since there are four nitrogenous bases constituting DNA, namely adenine (A), guanine (G), thymine (T) and cytosine (C), this embodiment constructs several types of four-base units and five-base units based on these four types of bases, and constructs a DNA encoding table based on these four-base units and five-base units to perform DNA encoding on the encrypted data to be encoded. Among them, the four-base unit and the five-base unit represent base units composed of four and five single bases, respectively.

[0070] Step S4000: using a preset DNA sequence structure optimization rule to adjust the initial base sequence to obtain an optimized base sequence;

[0071] Specifically, in order to avoid problems such as the occurrence of oligonucleotides, the present embodiment utilizes preset DNA sequence structure optimization rules to check each base unit (also called codeword) in the initial base sequence, and adjusts the type or quantity of bases in the base units that meet the base sequence rules, so that oligonucleotides are not formed within or between base units, so as to obtain an optimized base sequence.

[0072] Step S5000: performing chaotic mapping rearrangement on the optimized base sequence to obtain an encrypted DNA sequence.

[0073] Specifically, chaotic mapping is used to reorder and randomize the optimized base sequence, so that the distribution of various single bases in the base sequence is more random, thereby achieving a balanced distribution of GC content.

[0074] For example, using the piecewise linear chaos map (PWLCM) function, the function is as follows:

[0075]

[0076] Where k represents the length of the generated DNA sequence, z k Represents the randomly generated iteration value, z k ∈(0,1),z k+1 Represents a randomly generated pseudo-random sequence, p represents a constant, p∈(0,1).

[0077] By randomly generating values ​​of constant p and z kThe initial value of is denoted as z0, and a set of numbers with a length equal to the length of the DNA sequence is initialized and generated, and this set of numbers is arranged in ascending order, and its index value is taken as sequence S. Sequence S is used as the DNA sequence index to rearrange the DNA sequence to generate an encrypted DNA sequence as the final target DNA sequence. Since the numbers generated by the PWLCM function are ergodic and random, the generated pseudo-random sequence is uniform, so that the various single bases in the base sequence after the optimized base sequence is rearranged are evenly distributed.

[0078] It should be noted that this embodiment uses the PWLCM function for chaotic mapping. As other preferred implementations, other types of chaotic mapping algorithms or random number generation algorithms can be flexibly selected according to actual application conditions to rearrange the optimized base sequence. The present invention does not make specific limitations.

[0079] In this embodiment, a unique DNA coding mapping rule is formed by using a designed DNA coding table constructed by four base units and five base units, and a designed DNA sequence structure optimization rule is adopted, which can avoid the formation of oligonucleotides within and between base units and improve information density, and then combined with encryption and chaotic mapping, so that the GC content in the generated encrypted DNA sequence is maintained in a balanced state, and the encryption effect of the data to be encoded is improved, which is beneficial to reducing the storage space occupied by the data to be encoded, and at the same time is beneficial to improving the security and anti-attack ability of the data to be encoded, thereby ensuring the stability of the encrypted DNA sequence.

[0080] like Figure 2 As shown, in one embodiment, the step S3000 performs DNA encoding on each byte of the encrypted data to be encoded based on the pre-constructed DNA encoding table to obtain an initial base sequence, including:

[0081] Step S3100: obtaining a byte sequence based on the encrypted data to be encoded, wherein the byte sequence includes a plurality of bytes;

[0082] Specifically, using quaternary encoding to perform encoding conversion on the encrypted data to obtain quaternary bytes can improve the fault tolerance and accuracy of the obtained byte sequence.

[0083] For example, if the encrypted data to be encoded is a picture file, after encoding the picture file, the data to be processed represented by a binary sequence is obtained, wherein each eight-bit binary unit represents a byte of the picture data, then a byte sequence consisting of several bytes can be used to represent the original picture data.

[0084] Step S3200: Based on the mapping rules between bytes and base units in the pre-constructed DNA encoding table, the base units corresponding to the bytes in the byte sequence are respectively obtained to obtain an initial base sequence.

[0085] Specifically, the mapping rules between bytes and base units in the pre-constructed DNA coding table can correspond bytes representing different sizes to different base units one by one. In practical applications, the base unit corresponding to each byte can be found by looking up the DNA coding table to ensure the accuracy of the initial base sequence.

[0086] For example, through the preset mapping rules, each byte in the byte sequence used to represent the original image data is converted into a corresponding base unit. For example, three consecutive bytes are converted into 66, 77 and 88 by quaternary encoding respectively. In the pre-constructed DNA coding table, the byte data 66, 77 and 88 correspond to AAGG, ATCG and CGAT respectively. Then, the base sequence generated after these three consecutive bytes are encoded is AAGGATCGCGAT.

[0087] In this embodiment, by encoding the encrypted data to be encoded to generate a byte sequence, and using a unique DNA coding table to convert the byte sequence into a base sequence according to a one-to-one mapping relationship, the accuracy of converting various types of encrypted data to be encoded into a unique base sequence can be effectively improved.

[0088] In one embodiment, the process of constructing the DNA coding table in step S3000 includes:

[0089] Step S3300: constructing a mixed code table using four-base units and five-base units according to a preset code table design principle;

[0090] Specifically, the code table design principle needs to comply with the GC balanced distribution principle and the principle of avoiding oligonucleotide generation. By constraining the types of single bases at different positions in the base unit, a mixed code table consisting of several four-base units and five-base units is designed.

[0091] Step S3400: Based on the mixed code table, a one-to-one correspondence between bytes and base units is established to obtain a mapping rule between bytes and base units.

[0092] In this embodiment, the designed mapping rule can ensure that each byte of data corresponds to a unique base unit, and complies with the GC balanced distribution principle and the principle of avoiding oligonucleotide generation, thereby ensuring that the constructed DNA coding table is rigorous, scientific and accurate.

[0093] In one embodiment, the step S3300 uses four-base units and five-base units to construct a mixed code table according to a preset code table design principle, including:

[0094] Based on the four single bases, several four-base units and five-base units were constructed;

[0095] If the first base of the four-base unit is A or T, the fourth base is C or G;

[0096] If the first base of the four-base unit is C or G, the fourth base is A or T;

[0097] If the first base of the five-base unit is A, the fourth base and the fifth base are both TC or TG;

[0098] If the first base of the five-base unit is T, the fourth base and the fifth base are both AC or AG;

[0099] If the first base of the five-base unit is C, the fourth base and the fifth base are both GA or GT;

[0100] If the first base of the five-base unit is G, the fourth base and the fifth base are both CA or CT.

[0101] Specifically, a mixed code table is constructed using 128 four-base units and 128 five-base units, and each base unit corresponds to 0 to 255 bytes of data. The type of the first base of the four-base unit is used to restrict the type of the fourth base, and the type of the first base of the five-base unit is used to restrict the types of the fourth base and the fifth base, so as to design a DNA coding table that conforms to the GC balanced distribution principle and avoids the principle of oligonucleotide generation. The designed DNA coding table is specifically shown in Table 1. The DNA coding table increases the information density to 1.8 bit / nt, and the GC content distribution is about 50%.

[0102] Table 1 DNA coding table

[0103]

[0104]

[0105] In one embodiment, when the previous base unit of two adjacent bases is a four-base unit, the step S4000 uses a preset DNA sequence structure optimization rule to adjust the initial base sequence to obtain an optimized base sequence, including:

[0106] Step S4100: if the last three bases of the previous base unit are the same as the first base of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit;

[0107] Step S4200: if the last two bases of the previous base unit are the same as the first two bases of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit;

[0108] Step S4300: If the last single base of the previous base unit is the same as the first three single bases of the adjacent next base unit, the last single base of the previous base unit is replaced with a preset complementary base and one complementary base is added.

[0109] Specifically, by constraining the type or quantity of single bases at different positions in the codeword in the DNA coding table, it is effectively avoided that oligonucleotides are formed within the codeword (i.e., base unit) and between two consecutive codewords, that is, the same single base is avoided to be repeated more than three times. The complementary bases preset in this embodiment refer to cytosine C and guanine G as complementary bases to each other, and adenine A and thymine T as complementary bases to each other. As other preferred embodiments, other similar complementary bases can also be set, which are not limited here.

[0110] For example, Figure 3 As shown, when the first base unit of two adjacent bases is a four-base unit, for case a, if the first base of the first base unit is adenine A, the next three bases and the first base of the next base unit are all cytosine C, then an oligonucleotide with four consecutive bases being cytosine C is formed. At this time, the fourth base of the first base unit is replaced with adenine A, which is the same as the first base of the first base unit, and then the oligonucleotide is eliminated; similarly, for case b, if the first base of the first base unit is adenine A, the next two bases and the first two bases of the next base unit are all cytosine C. Cytosine C, the fourth base of the previous base unit is replaced by adenine A, which is the same as the first base of the previous base unit; for case c, if the first base of the previous base unit is adenine A, and the last base and the first three bases of the adjacent next base unit are all cytosine C, an oligonucleotide in which four consecutive bases are all cytosine C is formed. At this time, in order to avoid the previous base unit becoming an oligonucleotide after the last base of the previous base unit is replaced by adenine A, the fourth base of the previous base unit is replaced by thymine T, the complementary base of adenine A, and a thymine T is added.

[0111] In this embodiment, for the case where the first base unit of two adjacent base units is a four-base unit, according to the DNA encoding table designed in the above embodiment, only the above three situations where oligonucleotides appear may appear. This embodiment takes into account all possible situations of oligonucleotides, and designs corresponding substitution and complementation rules for each situation, thereby ensuring that in the case where the first base unit of two adjacent base units is a four-base unit, oligonucleotides will not appear in the corresponding generated DNA sequence fragments.

[0112] In one embodiment, when the previous base unit of two adjacent bases is a five-base unit, the step S4000 uses a preset DNA sequence structure optimization rule to adjust the initial base sequence to obtain an optimized base sequence, including:

[0113] Step S4400: If the last base of the previous base unit is the same as the first three bases of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit.

[0114] For example, Figure 3 As shown, when the previous base unit of two adjacent bases is a five-base unit, for case d, if the first base of the previous base unit is adenine A, and the last single base and the first three single bases of the adjacent next base unit are all cytosine C, then an oligonucleotide in which four consecutive single bases are all cytosine C is formed, then the last single base cytosine C of the previous base unit is replaced by adenine A which is the same as the first single base of the previous base unit, thereby eliminating the oligonucleotide.

[0115] In this embodiment, for the case where the first base unit of two adjacent base units is a five-base unit, according to the DNA encoding table designed in the above embodiment, only the above-mentioned one situation of the presence of oligonucleotides may occur. This embodiment takes into account the only one possible situation of constituting an oligonucleotide, and designs a corresponding replacement rule for this situation, thereby ensuring that when the first base unit of two adjacent base units is a five-base unit, no oligonucleotide will appear in the corresponding generated DNA sequence fragment.

[0116] It should be noted that the two adjacent base units referred to in the present invention only limit the first base unit to a four-base unit, and do not limit the type of the second base unit, that is, the type of the second base unit can be a four-base unit or a five-base unit.

[0117] Since the entire DNA sequence is composed of two types of base units, four-base units and five-base units, there is only a situation where the first base unit in adjacent base units is a four-base unit or a five-base unit. Therefore, by using the above-mentioned overall DNA sequence structure optimization rules to adjust the initial base sequence, the optimized base sequence without oligonucleotides can be obtained.

[0118] In order to verify the feasibility and effectiveness of the encryption algorithm of the present invention, the present invention uses two classic pictures for experimental simulation. Figure 4 is the character image before encryption, Figure 5 This is a simulation diagram of the GC content distribution after the character image is encrypted using AES. Figure 6 This is a simulation diagram of GC content distribution after RSA encryption of a person's picture; Figure 7 is the Cameraman image before encryption, Figure 8 This is a simulation diagram of the GC content distribution of the Cameraman image after AES encryption. Fig. 9 This is a simulation diagram of the GC content distribution after the Cameraman image is encrypted using RSA. The horizontal axis in each simulation diagram represents the position of each base in the encrypted DNA sequence, and the vertical axis represents the GC content percentage of each base position in the encrypted DNA sequence.

[0119] Comparative analysis of the simulation diagram of GC content distribution in the DNA sequence obtained after the image data is encrypted using the AES algorithm and the RSA algorithm shows that the GC content distribution in the diagram is consistent with the biological characteristics of DNA sequence synthesis and sequencing, thereby verifying the effectiveness of the method of the present invention. In practical applications, symmetric encryption or asymmetric encryption can be flexibly selected to perform reasonable encryption processing on files based on factors such as the required encryption degree, encryption speed, and encrypted file size.

[0120] In one embodiment, the encrypted DNA sequence obtained by the DNA encoding data encryption method also provides a DNA encoding data decryption method, comprising:

[0121] The encrypted DNA sequence is rearranged in reverse based on the sequence information obtained by the initial setting of the chaotic map to restore the optimized base sequence;

[0122] Based on the preset DNA sequence structure optimization rules and the pre-constructed DNA encoding table, the optimized base sequence is subjected to DNA decoding to restore the decoded base sequence;

[0123] The decoded base sequence is decrypted to obtain restored data.

[0124] In this embodiment, the decryption process of the decryption method is the inverse process of the encryption process in the encryption method. By adopting the criteria adopted in the corresponding encryption stage in different decryption stages, after the encrypted DNA sequence is decrypted, the restored data generated is exactly the same as the data information contained in the original data to be encoded.

[0125] Furthermore, the decryption method further includes, based on a preset DNA sequence structure optimization rule and a pre-constructed DNA encoding table, performing DNA decoding on the optimized base sequence to restore the decoded base sequence, including:

[0126] Based on a preset DNA sequence structure optimization rule, adjusting the base units in the optimized base sequence to obtain a quasi-base sequence;

[0127] Based on a pre-constructed DNA coding table, the quasi-base sequence is subjected to DNA decoding to restore the decoded base sequence.

[0128] In this embodiment, in the encryption stage, after the initial base sequence generated based on the DNA coding table is adjusted according to the preset DNA sequence structure optimization rules, abnormal base units that do not exist in the DNA coding table will be generated. Therefore, in order to avoid decryption errors, the abnormal base units are first restored to generate a quasi-base sequence, and then DNA decoding is performed on the quasi-base sequence through the DNA coding table to restore the decoded base sequence, thereby ensuring that the restored base sequence is completely correct, thereby ensuring that the data information contained in the original data to be encoded can be accurately restored.

[0129] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Fig.10 As shown. The above-mentioned intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a data encryption program based on DNA coding. The internal memory provides an environment for the operation of the operating system and the data encryption program based on DNA coding in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the data encryption program based on DNA coding is executed by the processor, the steps of any one of the above-mentioned data encryption methods based on DNA coding are implemented. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.

[0130] Those skilled in the art will understand that Fig.10The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the smart terminal to which the scheme of the present invention is applied. The specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0131] In one embodiment, a smart terminal is provided, which includes a memory, a processor, and a DNA-encoded data encryption program stored in the memory and executable on the processor. When the DNA-encoded data encryption program is executed by the processor, the steps of any one of the DNA-encoded data encryption methods provided in the embodiments of the present invention are implemented.

[0132] An embodiment of the present invention further provides a computer-readable storage medium, on which a data encryption program based on DNA coding is stored. When the data encryption program based on DNA coding is executed by a processor, the steps of any one of the data encryption methods based on DNA coding provided by the embodiment of the present invention are implemented.

[0133] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0134] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0135] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0136] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0137] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal equipment and method can be implemented in other ways. For example, the apparatus / terminal equipment embodiments described above are only illustrative, for example, the division of the above modules or units is only a logical function division, and in actual implementation, other division methods can be used, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0138] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features therein may be replaced by equivalents. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A data encryption method based on DNA coding, characterized in that: include: Get the data to be encoded; Encrypting the data to be encoded to obtain encrypted data to be encoded; Based on a pre-constructed DNA encoding table, each byte of the encrypted data to be encoded is DNA encoded to obtain an initial base sequence, wherein the DNA encoding table is constructed from four-base units and five-base units; Using a preset DNA sequence structure optimization rule, the initial base sequence is adjusted to obtain an optimized base sequence; The optimized base sequence is rearranged by chaotic mapping to obtain an encrypted DNA sequence.

2. The data encryption method based on DNA coding according to claim 1, characterized in that: The method of performing DNA encoding on each byte of the encrypted data to be encoded based on the pre-constructed DNA encoding table to obtain an initial base sequence includes: Based on the encrypted data to be encoded, a byte sequence is obtained, wherein the byte sequence includes a plurality of bytes; Based on the mapping rules between bytes and base units in the pre-constructed DNA encoding table, base units corresponding to each byte in the byte sequence are respectively obtained to obtain an initial base sequence.

3. The data encryption method based on DNA coding according to claim 1, characterized in that: The construction process of the DNA coding table includes: According to the preset code table design principle, a mixed code table is constructed using four-base units and five-base units; Based on the mixed code table, a one-to-one correspondence between bytes and base units is established to obtain a mapping rule between bytes and base units.

4. The data encryption method based on DNA coding according to claim 3 is characterized in that: According to the preset code table design principle, a mixed code table is constructed using four-base units and five-base units, including: Based on the four single bases, several four-base units and five-base units were constructed; If the first base of the four-base unit is A or T, the fourth base is C or G; If the first base of the four-base unit is C or G, the fourth base is A or T; If the first base of the five-base unit is A, the fourth base and the fifth base are both TC or TG; If the first base of the five-base unit is T, the fourth base and the fifth base are both AC or AG; If the first base of the five-base unit is C, the fourth base and the fifth base are both GA or GT; If the first base of the five-base unit is G, the fourth base and the fifth base are both CA or CT.

5. The data encryption method based on DNA coding according to claim 3, characterized in that: When the previous base unit of two adjacent bases is a four-base unit, the initial base sequence is adjusted by using a preset DNA sequence structure optimization rule to obtain an optimized base sequence, including: If the last three bases of the previous base unit are the same as the first base of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit; If the last two bases of the previous base unit are the same as the first two bases of the adjacent next base unit, the last base of the previous base unit is replaced by the first base of the previous base unit; If the last single base of the previous base unit is the same as the first three single bases of the adjacent next base unit, the last single base of the previous base unit is replaced by a preset complementary base and one complementary base is added.

6. The data encryption method based on DNA coding according to claim 3, characterized in that: When the first base unit of two adjacent bases is a five-base unit, the initial base sequence is adjusted by using a preset DNA sequence structure optimization rule to obtain an optimized base sequence, including: If the last single base of the previous base unit is the same as the first three single bases of the adjacent next base unit, the last single base of the previous base unit is replaced by the first single base of the previous base unit.

7. A data decryption method based on DNA coding, characterized in that: The method is applied to decrypt the encrypted DNA sequence obtained by the DNA coding-based data encryption method according to any one of claims 1 to 6, comprising: The encrypted DNA sequence is rearranged in reverse based on the sequence information obtained by the initial setting of the chaotic map to restore the optimized base sequence; Based on the preset DNA sequence structure optimization rules and the pre-constructed DNA encoding table, the optimized base sequence is subjected to DNA decoding to restore the decoded base sequence; The decoded base sequence is decrypted to obtain restored data.

8. The data decryption method based on DNA coding according to claim 7, characterized in that: The method of performing DNA decoding on the optimized base sequence based on the preset DNA sequence structure optimization rules and the pre-constructed DNA encoding table to restore the decoded base sequence includes: Based on a preset DNA sequence structure optimization rule, adjusting the base units in the optimized base sequence to obtain a quasi-base sequence; Based on a pre-constructed DNA coding table, the quasi-base sequence is subjected to DNA decoding to restore the decoded base sequence.

9. Intelligent terminal, characterized in that: The intelligent terminal includes a memory, a processor, and a DNA-encoded data encryption program stored in the memory and executable on the processor. When the DNA-encoded data encryption program is executed by the processor, the steps of the DNA-encoded data encryption method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a data encryption program based on DNA coding, and when the data encryption program based on DNA coding is executed by a processor, the steps of the data encryption method based on DNA coding as described in any one of claims 1 to 6 are implemented.