Figures
Abstract
Classic security methods are becoming vulnerable because of technology advancements. The process of combining cryptography and steganography led to overcoming this, where this combination will save the information from potential attackers. This paper proposed a new text security method by combining the cryptography technique and steganography technique, where cryptography is used to encode the message, while steganography is used to hide the ciphertext within an image. The proposed cryptography system has five steps. The first is done by building an RNA sequences generation table to convert the message to RNA sequences, the next step is done by creating a table to convert RNA sequences to decimal numbers. In the third step, the achieved decimal values are converted to binary numbers; after that, used True Random Number Generators method generates the key, and finally, an XOR operation is applied between achieved binary numbers and the generated key. The results achieved by the XOR operation are considered as the ciphertext. Two steps to the proposed steganography method. The first step is done by building a codebook table to select the part of the pixel to store the bit inside it, where the selection part can be either red, green, or blue, and then used a least significant bit to store the bit with no effects on the image. The proposed method presents an efficient solution to secure data, and this method can be applied in different fields, such as information security and privacy protection.
Citation: Hamad S, Rashid OF, Al-Dabbas HM (2025) Text cryptography and steganography based on RNA sequences generation, true random number generators, and codebook method. PLoS One 20(12): e0338700. https://doi.org/10.1371/journal.pone.0338700
Editor: Mohammed Jasim Mohammed Alfahdawi, University of Anbar, IRAQ
Received: November 5, 2025; Accepted: November 26, 2025; Published: December 9, 2025
Copyright: © 2025 Hamad et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: All relevant data are within the manuscript and its Supporting Information files.
Funding: The author(s) received no specific funding for this work.
Competing interests: The authors have declared that no competing interests exist.
1. Introduction
The process of data transmission has become critical due to the increase of the device’s computational power, leading to more complex attacks; therefore, traditional cryptographic systems can detect a few of these threats. DNA/RNA cryptography uses the concept of the transmission of hereditary information from one generation to another [1]. Where RNA has high storage capacity, fast processing, and high computation capacity, and is more secure than other cryptography algorithms. One of the advantages of using RNA cryptography is can be applied to both symmetric and asymmetric cryptography [2]. RNA includes the genetic information of beings, and it consists of four bases called Adenine (A), Cytosine (C), Guanine (G) and Uracil (U) [3].
Cryptography methods are proposed in different publication researches which are used to secure data to be transmitted over the internet. A new DNA cryptography method is proposed [4], where the proposed method is done by using a DNA encoding table to encode characters into DNA sequences with the using of mathematical series. A novel DNA cryptography method is generated by Beggas & Lounici [5]; this method generates random keys for One Time Pad cryptosystems, where the proposed method uses the structure of the DNA, some mathematical operations and DNA mechanism. A novel cryptosystem method is built by using DNA cryptography and finite automata theory; this method starts by generating a key with a length of 256 bits and uses it for the encryption process, then using the mealy machine method to encode the DNA [6]. Monika and Upadhyaya [7] proposed a new secure communication idea to provide a secure network channel by using DNA cryptography and a secure socket layer. A novel cryptosystem is suggested [8], where this method combines both DNA cryptography and DNA steganography for the cloud; this is done by using a long key to encrypt the information and then hide the encrypted information within an image. A new cryptography idea is proposed [9] based on DNA Cryptography where the proposed method starts by converting the message to ASCII values and then converting these values to binary format; after that, it converts binary to DNA sequences then convert these sequences to RNA sequences, and the last step is converting RNA sequences to the amino acid. A new encryption system is suggested by using both DES and AES [10], where the main idea is done by merges DES keys with AES keys to get 128 bits as a root key. Chiadighikaobi & Katuk [11] reviewed different method for g lightweight cryptography in IoT environment to bridge the gap in the different studies by conducting a systematic scoping study.
On the other hand, the steganography technique is used in various research to hide information within text, images, or video. A new image steganography method is proposed [12] by using adversarial learning theories, where a saliency map is used to add a value to each pixel based on its influence, which gives each pixel its importance in deceiving the steganalysis. A new method to secure transmission was proposed [13] based on two techniques which are compression and steganography, where the compression sensing method is used to compress multiple secret images, then apply encrypted to an image and hide it within the multiple images. Darani et al. [14] proposed a new image steganography method to insert a grayscale secret image into an RGB colour cover image by using a chaos map and 3D shift function. A new method to enhance the steganography method is proposed [15] based on modifying the LSB or 2nd LSB of stego-images; this method generates content-adaptive adversarial perturbations, then uses lossless run-length encoding method for data compression to store it within the image. Yang et al. [16] proposed a novel image steganography method by segmenting the threshold to process the image. They divided the image into two regions, which are foreground and background regions, to improve the embedding capacity. A novel security method is built by using both cryptography and steganography [17]; this method encodes the secret image based on DNA encoding and chaotic maps method, then hides the data within the image. Sharma et al.[18] proposed a new steganography method based on content-adaptive adversarial perturbation, where this method is done by creating a hybrid texture descriptor to describe texture regions and then segmenting the image into different parts by using simple linear iterative clustering. Investigated a new method to transform audio samples to spots on the curve [19] and also change the sample form, which makes the suggested method difficult to guess the curve points by an intruder. A new image steganography system is proposed using Discrete Shearlet Transform algorithm and secret sharing, where the proposed system have been obtained better hiding process and high embedding capacity [20]. Despite there are many efforts that have integrated DNA/RNA cryptography and steganography, most currently used techniques are based on deterministic or fixed key-generation algorithms or do not offer a dynamic embedding algorithm that maintains the quality of an image and is resistant to statistical detection. Also, very little literature combines the use of true random number generation with RNA-based encoding in a single pipeline of text-security. Therefore, this study fills this gap by suggesting a cryptography-steganography hybrid model based on the RNA sequence production, TRNG-based keying, and LSB embedding framework based on codebook.
The rest of this paper is structured in the following manner. Section 2 contains the materials and methods, which outline the proposed RNA-based cryptography and the steganography process which is done by the codebook. Section 3 presents the experimental findings and performance analysis of the two stages cryptography and steganography. Section 4 concludes the paper and provides possible future research on how the proposed security framework can be improved.
2. Materials and methods
The proposed method is applied to secure text transmission over the internet, where the proposed method has two phases. These phases are text cryptography and steganography. In the first phase, Cryptography is utilized to encode messages (plaintext) by using five steps. The proposed cryptography steps are shown in Fig 1.
The first phase of the proposed method is cryptography, where the main idea of this phase is to encode the plaintext. This method is done by building an RNA sequence generating table, where the table contains all possible characters that are used in plaintext. In the proposed method, the input can be a character, number, or special characters. The total possible value of these characters is equal to 72 characters; therefore, four random RNA characters can handle and represent all these values. This table is generated randomly, where each character has its unique RNA sequences, and this table is generated randomly every time a new message is sent. An example of RNA sequence generation for one time is listed in Table 1.
After completing the first step, where the plaintext is converted to RNA sequences, the next step is done by generating a random decimal converting table. Where the total possible number of four RNA sequences is equal to 256 values. Therefore, a decimal conversion table is built where each four RNA characters is converted randomly to a decimal value. The converting RNA sequences to decimal values table is presented in Table 2.
The third cryptography step is converting the decimal numbers achieved from the previous step to binary format by dividing these decimal numbers by two and noting the remainder until you get to zero. After that, used true random number generator method was used to generate a random and non-predictable key, where this method can play a major role in cryptographic systems because it is widely used in cryptographic applications such as key generation, random padding bits, and authentication protocols. The generated key is used for the next step, where this key must be processed before being used; this is done by converting the generated key to ASCII values and then to binary values. In the last cryptography step, an exclusive or (XOR) operation is applied between the achieved binary values and the generated key. The final binary result obtained by the XOR operation is considered as the ciphertext that will used in the next phase of secure transmission. The steps of the proposed cryptography method are illustrated in Fig 2.
The second phase of the proposed method is steganography, where the main idea of this phase is to hide the ciphertext that is achieved by the first phase into the cover image. This method is done by applying the codebook idea and least significant bit (LSB), where the steps of steganography are shown in Fig 3.
In the first step, a codebook table is built to select which part of the pixel to store the message inside it (a component of colour), either in red (R), green (G), or blue (B), where the size of the table depends on images size that used to hide a message inside it, if the image has a size of 1024*1024 then codebook size is also 1024*1024. The codebook table is shown in Fig 4. For example, if you randomly select a pixel number four in an image to store a bit inside it, check the same value (four) in the codebook table to select where this bit is stored, either R, G, or B. The codebook plays a crucial role in the proposed steganography step, where the embedding sites of the colours in the RGB channels are determined. The codebook entries are assigned a pixel index and use one of three colour components (R, G or B) through a uniformly random map. This mapping allows making sure that even in case an attacker realizes that LSBs are being embedded, the probability of the distribution of altered bits will be arbitrary. That the codebook is an image of the same size as the cover image and its creation through randomising its generation every time it is transmitted supports resistance to pattern-based steganalysis.
The second step is using the LSB method to hide the bit within the cover image, where this method is used to hide the message without noticeably affecting the image’s appearance. After finishing the steganography process, this image is sent to a specific person (receiver), which includes a secret message inside it.
When the receiver gets the image, two phases to obtain the sending message from this image; these phases are extract and decryption message. In the first phase, used codebook table generated by the sender was used to extract a bit from components of colour, either R, G, or B; this led to extracted all bits from the image, which includes binary values, either 0’s or 1’s. In the second phase, the decryption of the message is applied to get the main message by using the same number of steps in the encryption phase but in reverse order. Where the decryption process is achieved by:
- Receive the image that the sender sends.
- Used the codebook table to decide the place of hidden bits.
- Extract all the hidden bits inside the image.
- Implement XOR operation between extracted binary values and the key value.
- Group and convert each 8 binary number to decimal. For example, the binary number 10000011 is converted to 131.
- Used a decimal converting table to convert each decimal number to four RNA characters.
- Finally, the RNA sequences table is used to convert each four RNA characters to their equivalent characters from the table.
- The achieved characters (alphabet characters, numbers, and special characters) represent the original message sent by the sender.
3. Results and discussion
The performance evaluation of the proposed method is done by calculating the cryptography process time and steganography process time, where the cryptography process includes encryption and decryption time, while the steganography process includes message hiding and message extraction time. Firstly, the achieved cryptography process time for the proposed method in terms of seconds are shown in Table 3 and Fig 5.
As mentioned in Table 3 and Fig 5, the achieved time of the proposed cryptography method is fast, where the encryption time for different messages with different lengths (1000, 5000, 10000, and 2000 characters) is equal to 0.5, 2, 7, and 16 seconds respectively. At the same time, the decryption time for the same messages is equal to 1, 3, 9, and 19 seconds respectively.
Secondly, the achieved steganography process time for the proposed method in terms of seconds are stated in Table 4 and Fig 6.
Table 4 and Fig 6 showed that the achieved time of the proposed steganography is fast, where the message hiding time for different message lengths (1000, 5000, 10000, and 2000 characters) are equal to 0.4, 1, 1 and 3 seconds respectively. At the same time, the message extraction time for messages is equal to 1, 1.5, 2 and 5 seconds respectively.
The following example explains and highlights the proposed cryptography process steps; assume that the used plaintext is “Please meet me at street number 62 today at 8 Pm”
The first step of the proposed cryptography method is done by converting the message to RNA Sequences:
GAAG UCAC UAAG AUCU GCUU UAAG AAAA AUGU UAAG UAAG GGUC AAAA AUGU UAAG AAAA AUCU GGUC AAAA GCUU GGUC ACGU UAAG UAAG GGUC AAAA UCGA CCGA AUGU GUAA UAAG ACGU AAAA GAGG UCCA AAAA GGUC GCUA AGGG AUCU AGCU AAAA AUCU GGUC AAAA UUGC AAAA GAAG AUGU
The second step of the proposed cryptography method is done by converting RNA sequences to decimal values:
16 31 27 45 31 136 39 31 31 46 136 39 31 136 27 46 136 45 46 44 31 31 46 136 40 47 39 28 31 44 136 59 55 136 46 41 30 27 51 136 27 46 136 61 136 16 39
In the third step of the proposed cryptography method, decimal values are converted to binary numbers:
00010000 00000000 00011111 00011011 00101101 00011111 10001000 00100111 00011111 00011111 00101110 10001000 00100111 00011111 10001000 00011011 00101110 10001000 00101101 00101110 00101100 00011111 00011111 00101110 10001000 00101000 00101111 00100111 00011100 00011111 00101100 10001000 00111011 00110111 10001000 00101110 00101001 00011110 00011011 00110011 10001000 00011011 00101110 10001000 00111101 10001000 00010000 00100111
While in the fourth step of the proposed cryptography method, a cryptography key is generated, and suppose the generated key is “Cryptography Key” This key is converted to decimal values and then converted to binary values:
67 114 121 112 116 111 103 114 97 112 104 121 32 75 101 121
01000011 01110010 01111001 01110000 01110100 01101111 01100111 01110010 01100001 01110000 01101000 01111001 00100000 01001011 01100101 01111001
The last step of the proposed cryptography method is done by applying the XOR operation between binary values achieved from step 3 (the message) and binary values achieved from step 4 (the key). The achieved results represent the ciphertext:
01010011 01110010 01100110 01101011 01011001 01110000 11101111 01010101 01111110 01101111 01000110 11110001 00000111 01010100 11101101 01100010 01101101 11111010 01010100 01011110 01011000 01110000 01111000 01011100 11101001 01011000 01000111 01011110 00111100 01010100 01001001 11110001 01111000 01000101 11110001 01011110 01011101 01110001 01111100 01000001 11101001 01101011 01000110 11110001 00011101 11000011 01110101 01011110
4. Conclusion
This study proposes a hybrid approach to secure text transmission based on cryptography and steganography as a more secure and reliable approach. The proposed cryptography depends on the benefits of using RNA, where the sending message is firstly converted to RNA sequences by building an RNA sequence generation table. These sequences are converted to decimal values, then convert these values to binary format. After that, True Random Number Generators are used to generate the encoding key, and finally, XOR operations are applied to achieve the ciphertext. When the cryptography process is complete. The obtained binary (ciphertext) is hidden within an image by building a codebook table to decide on colour components to store the bit inside it and by using the LSB method to hide the same bit without affecting the image. The achieved results showed that the proposed system provides a secure platform for sharing secret information through fast time. For future work, the improvements for the proposed work can be done by using deep learning based key generators, guided generation of codebooks by image features and lightweight cryptographic transformations to enable application in resource-limited devices such as IoT sensors.
References
- 1. Sagar A, Saini SS, Singh J. Two level security combining DNA cryptography and image steganography. IET Conf Proc. 2023;2023(11):396–404.
- 2. Bari N, Wajid M, Ali Shah M, Ejaz G, Stanikzai AQ. Securing digital economies byimplementing DNA cryptography with amino acid and one-time pad. IET Conf Proc. 2022;2022(8):99–104.
- 3. Rashid OF. DNA encoding for misuse intrusion detection system based on UNSW-NB15 data set. eijs. 2020;:3408–16.
- 4. Biswas MdR, Alam KMdR, Tamura S, Morimoto Y. A technique for DNA cryptography based on dynamic mechanisms. Journal of Information Security and Applications. 2019;48:102363.
- 5. Beggas F, Lounici A. Generation of random sequences using DNA cryptography for OTP encryption. Biosystems. 2023;:105064. pmid:39492479
- 6. Pavithran P, Mathew S, Namasudra S, Lorenz P. A novel cryptosystem based on DNA cryptography and randomly generated mealy machine. Computers & Security. 2021;104:102160.
- 7. Monika Upadhyaya S. Secure communication using DNA cryptography with Secure Socket Layer (SSL) protocol in wireless sensor networks. Procedia Computer Science. 2015;70:808–13.
- 8. Namasudra S. A secure cryptosystem using DNA cryptography and DNA steganography for the cloud-based IoT infrastructure. Computers and Electrical Engineering. 2022;104:108426.
- 9. Rashid OF, Subhi MA, Hussein MK, Mahdi MN. Enhancing internet data security: a fusion of cryptography, steganography, and machine learning techniques. Baghdad SciJ. 2024.
- 10. Shukur WA, Qurban LK, Aljuboori A. Digital data encryption using a proposed W-method based on AES and DES algorithms. Baghdad SciJ. 2023.
- 11. Chiadighikaobi IR, Katuk N. A Scoping study on lightweight cryptography reviews in IoT. Baghdad Science Journal. 2021;18(2).
- 12. Kholdinasab N, Amirmazlaghani M. An adversarial learning based image steganography with security improvement against neural network steganalysis. Computers and Electrical Engineering. 2023;108:108725.
- 13. Zhang Z, Cao Y, Jahanshahi H, Mou J. Chaotic color multi-image compression-encryption/ LSB data type steganography scheme for NFT transaction security. Journal of King Saud University - Computer and Information Sciences. 2023;35(10):101839.
- 14. Yousefian Darani A, Khedmati Yengejeh Y, Navarro G, Pakmanesh H, Sharafi J. Optimal location using genetic algorithms for chaotic image steganography technique based on discrete framelet transform. Digital Signal Processing. 2024;144:104228.
- 15. Luo J, He P, Liu J, Wang H, Wu C, Zhou S. Reversible adversarial steganography for security enhancement. Journal of Visual Communication and Image Representation. 2023;97:103935.
- 16. Yang A, Bai Y, Xue T, Li Y, Li J. A novel image steganography algorithm based on hybrid machine leaning and its application in cyberspace security. Future Generation Computer Systems. 2023;145:293–302.
- 17. Aparna H, Madhumitha J. Combined image encryption and steganography technique for enhanced security using multiple chaotic maps. Computers and Electrical Engineering. 2023;110:108824.
- 18. Sharma VK, Mir RN, Rout RK. Towards secured image steganography based on content-adaptive adversarial perturbation. Computers and Electrical Engineering. 2023;105:108484.
- 19. A secure enhancement for encoding/ decoding data using elliptic curve cryptography. IJS. 2018;59(1A).
- 20. Hamza YA, Tewfiq NE, Ahmed MQ. An enhanced approach of image steganographic using discrete shearlet transform and secret sharing. Baghdad SciJ. 2022;19(1):0197.