Next Article in Journal
Sparse 3D Point Cloud Parallel Multi-Scale Feature Extraction and Dense Reconstruction with Multi-Headed Attentional Upsampling
Previous Article in Journal
A No-Reference Quality Assessment Method for Screen Content Images Based on Human Visual Perception Characteristics
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Chaos-Based Cryptography: Text Encryption Using Image Algorithms

1
Department of Mathematics Applications and Methods for Artificial Intelligence, Faculty of Applied Mathematics, Silesian University of Technology, Kaszubska 23, 44-100 Gliwice, Poland
2
Laboratory of Nonlinear Systems—Circuits & Complexity, Physics Department, Aristotle University of Thessaloniki, 54124 Thessaloniki, Greece
3
Department of Mechanical Engineering, University of Western Macedonia, 50150 Kozani, Greece
*
Author to whom correspondence should be addressed.
Electronics 2022, 11(19), 3156; https://doi.org/10.3390/electronics11193156
Submission received: 1 September 2022 / Revised: 16 September 2022 / Accepted: 27 September 2022 / Published: 1 October 2022
(This article belongs to the Section Computer Science & Engineering)

Abstract

:
Currently, chaotic cryptography is mainly concentrated on image encryption. Once-popular stream-encryption algorithms, e.g., textual data, are now rarely considered. This article studies how chaotic image-encryption algorithms can be used to encrypt text. The proposed approach to this problem consists of two stages: in the first stage, the text message is intended for encryption into an image; in the second step, the selected image-encryption algorithm is used. An example illustrates the efficiency of this method. In addition, the article presents measures used in image-encryption analysis that confirm the security of the obtained cipher-image, such as entropy (value close to 8), correlation of adjacent pixels (values close to 0), or measures related to differential cryptanalysis. The proposed method offers a new look at text encryption using chaos, by applying image-encryption algorithms already known from the literature.

1. Introduction

Chaos theory is one of the great discoveries of the 20th century. Currently, chaos and its applications are an important aspect in many fields of science [1]. The effect of chaos can be undesirable, such as oscillations in chemical reactors, or be used to achieve positive results. A wide group of chaos applications includes cryptography based on chaotic dynamical systems. Chaotic cryptography uses dynamic systems with very complex behavior. On the one hand, the obtained values from such systems appear to be random, while the way they are obtained is completely deterministic. For these reasons, chaotic mappings have been used in, among other areas, data encryption [2,3,4].
The beginnings of cryptography based on the chaos theory date to the 1990s. It was then that the first stream ciphers were presented, which were used mainly for text encryption. One of the first publications that dealt with this subject was the publication by M.S. Baptista [5]. In that article, an algorithm that uses the logistic map to encrypt text messages was presented. From then on, further publications dealing with this subject appeared in the literature. Many of the proposed ciphers were quickly broken, thus showing that, from a practical point of view, using chaos to encrypt text is not an effective solution [6]. However, chaotic cryptography deals not only with stream ciphers, but also asymmetric ciphers [7] and their successors [8], hash functions [9,10], S-boxes [11,12], pseudo-random numbers generators (PRNGs) [13,14] or image-encryption algorithms [13]. Currently, the last group of mentioned algorithms is of particular interest to scientists. Chaotic image encryption is obtained using a selected chaotic dynamic system to transform the image pixels appropriately. Such algorithms are considered to be safe and applicable in practice. In the context outlined, a question can be asked: is it possible to use the developed techniques and methods of image encryption for text encryption? An affirmative answer to this question would open up a whole new perspective on the use of chaotic mappings in cryptography. This article will answer that question and discuss how it will be possible to use image-encryption algorithms to encrypt text.
The main contribution of this article is showing the method of text encryption based on existing image-encryption algorithms. For this purpose, the method of converting text into an image is shown. Then, one of the known image-encryption algorithms is applied. To the best of the authors’ knowledge, such a method of text encryption has not been considered in the professional literature so far. As a result, this article will not propose a new cipher, as is the case with most chaos-based encryption works. This article aims to illustrate how the image-encryption algorithms known from the literature can be used to encrypt text. In addition, the presented method of text encryption sheds new light on the subject of image encryption using chaos theory, which is very popular among researchers.
This article is divided into several parts. In the first of them—the Introduction—the article’s topic is outlined. The next part discusses text-encryption algorithms and image-encryption algorithms. In the third part, the text-to-image transformation method and the use of chaotic encryption algorithms are presented. The next part presents an example of the proposed encryption technique and the analysis of the obtained cipher-image. The last part is the conclusions.

2. Related Work

The review of similar solutions will be divided into two parts. The first part presents algorithms that use chaos to encrypt text. The second group consists of image-encryption algorithms using chaotic mappings.

2.1. Chaotic Text Encryption

The early works on chaotic cryptography concerned the encryption of various multimedia files, including text, e.g., [5]. Over the years, more articles that used chaotic mappings to encrypt textual data appeared, e.g., [15,16]. However, for some time now, algorithms for encrypting text using chaotic mappings have ceased to be of interest to scientists.
For this reason, there are currently few articles in this field. However, this does not mean that such works are not published at all. One such work is [17], where the authors present an encryption framework for various types of multimedia media, including text. Text encryption also applies in the publication [18,19], where the ciphertext is obtained by appropriate permutation and substitution. A similar encryption process was used in [20,21] where a new encryption algorithm was presented based on a chaotic dynamic system, a pseudo-random number generator, and an XOR operation. The XOR operation was also used in [22] to encrypt text with some pseudo-random string. In [23], the authors presented a text-encryption algorithm that, in addition to a chaotic arrangement, also used DNA sequences to encrypt text messages. In turn, ref. [24] uses matrix calculus and chaotic mapping to encrypt text. In [25], the authors used a fractional chaotic system to encrypt various types of multimedia, including text. In turn, ref. [26] shows a text-encryption algorithm using Bi-Arnold cat map and modulus operation.
Summarizing the conducted review of the literature on text encryption through chaotic mappings, one must point out the disadvantages of this approach. First, some of the above works turned out to be unsafe, as demonstrated by the cryptanalysis techniques appearing in the literature [6]. On the other hand, some of the work on encrypting text using chaos has a fairly simple structure (e.g., XOR substitution, e.g., [22]), which may also lead to breaking such ciphers in the future. These and other reasons have drawn the attention of researchers to the use of chaos to encrypt images.

2.2. Chaotic Image Encryption

Contrary to text encryption, the interest among researchers in this way of encrypting images still is very high. To confirm this thesis, we can cite, for example, the number of articles from the Scopus database which refer to the keywords “chaos image encryption”—it is above 2500. In this part of the article, only selected recent works on image encryption will be described.
Chaotic image-encryption methods use chaotic mappings to transform image pixels properly. Roughly speaking, these algorithms usually rely on permuting and adding pseudo-random values to a pixel through, for example, an XOR function. Of course, these operations differ from one work to another. The general scheme of image encryption and decryption is shown in Figure 1. In [27] a new dynamic system—M-map—was presented, and a new encryption algorithm that uses, among others, an S-box for substitution. In [28], based on the combination of tent and logistic maps, an image-encryption algorithm was presented also using a generated S-box and XOR operation. In turn, ref. [29] proposes an image-encryption algorithm using logistic mapping and Arnold’s cat map. In this algorithm, a new method of pixel permutation and an XOR operation with a sequence of pseudo-random values is shown. In [30], a new image-encryption algorithm was developed using discrete fractional wavelet transform (DFRWT) and quantum logistic mapping. It is also based on the operation of permuting pixels and adding pseudo-random values through the XOR operation. In [31], the authors present an image-encryption algorithm using a Rubik’s cube and the prime factorization process. In turn, [32] presents an asymmetric image-encryption algorithm based on the improved Lorentz system. Yet another approach to image encryption is presented in [33], where hyperchaotic maps and DNA sequences were used to obtain a cipher-image in the form of a 3D cube image. On the other hand, ref. [34] shows an image-encryption algorithm that, apart from the chaotic system, also uses elliptic curves.
Analyzing the above works, it can be seen that this field of cryptography is developing very dynamically. Therefore, it makes sense to try to use these different encryption techniques not only for images but also for other types of data, such as text.

3. The Method

Using image-encryption algorithms to encrypt textual data is conceptually quite simple. The steps of this procedure are as follows:
  • Convert a text message into an image
  • Apply the selected image-encryption algorithm to the received image
The first step above is to convert text into an image. This allows text to be input into the encryption algorithm. In the second step, the received image is encrypted according to the selected image-encryption algorithm.
The following subsections describe the above steps in detail.

3.1. Text-to-Image Conversion

The authors in [35] present a simple algorithm for changing the message format from text to image. This procedure was not related to one of the encryption steps. It was mainly intended to save disk space occupied by data files. So using it in the context of encryption is a new idea. This algorithm requires that the text message must be encoded with UTF-8. A simplified version of this algorithm is presented below to better illustrate the procedure:
  • The text message is read into the buffer.
  • Text characters t i are converted to numbers in the range 0–65535 (UTF-8 encoding).
  • Each of the values t i is stored in the positional system with base 256 according to the equation:
    t i = a i · 256 + b i ,
    where a i and b i are the coefficients of t i in the positional numeral system with base 256. Values a i and b i are stored in one-dimensional table T.
  • The image size (height and width) is calculated using the formula
    s i z e = l e n g t h T 3 ,
    where · stands for the ceiling function, and l e n g t h T is the length of the table T.
  • If
    l e n g t h T < 3 · s i z e 2 ,
    then T is first padded with the value 3 (“End-of-Text” character) and then with random values from set { 0 , 1 , , 255 } so that its length is exactly 3 · s i z e 2 .
  • T is saved as a three-dimensional array T P s i z e × s i z e × 3 , i.e., every three consecutive elements of the array T are stored as an element of a matrix with dimensions of s i z e × s i z e .
  • Array T P s i z e × s i z e × 3 is treated as an array of pixels and saved as a png file.
Figure 2 shows a general scheme of the proposed procedure for converting text into an image.
Any text message in UTF-8 format can be converted with this procedure. This is because Formula (1) reduces the characters from this encoding to the pixel value range, i.e., the range 0–255. For the next step, which is image encryption, the proposed png image file extension is the best choice. This is due to the fact that this graphic file format has an RGB structure, which allows the use of a very wide range of encryption algorithms known from the literature. Moreover, thanks to the compression algorithms built into this format, simply storing the text in the form of a png file usually saves disk space. However, when choosing a format other than png, graphic formats with built-in lossy compression (such as jpg) must be avoided. In this case, it will be impossible to recover the plaintext, as the compression algorithm will modify its content.
The above algorithm allows the conversion of a text message into exactly one image. There may be times when the resulting image is too large in dimensions. In this case, the text can be divided into several parts, and the image conversion algorithm can be applied to each of them separately.
The proposed procedure of text-to-image conversion is fully reversible. In addition, the added random values in step 5 of the text-to-image algorithm are ignored in the image-to-text conversion. They only play the role of padding to achieve the fixed file size.
To receive a text message from a png file, follow these steps:
  • Successive image pixels are loaded in the buffer until the value of one of the components is equal to 3.
  • Loaded RGB pixel components values are stored in one- dimensional table T.
  • Every two values from T are retrieved and marked as a i and b i . These values are the coefficients of the number t i written in the number system with base 256, i.e.,
    t i = a i · 256 + b i .
  • The t i values are stored as consecutive characters in UTF-8 encoding in the text message.
Figure 3 shows a general scheme of the proposed procedure for converting images into text.
The above method of decoding an image into text is correct and allows the conversion of any RGB image to text in UTF-8 encoding. This is because the pixel range, i.e., 0–255, is extended to the UTF-8 encoding range, i.e., the value 0–65,535, by the Formula (4).

3.2. Image-Encryption Algorithm

This step requires selecting an image-encryption algorithm known from the literature. It is not important which algorithm is chosen because the text is in the form of an image and can be encrypted with any algorithm. However, it should be noted that the algorithm has no image size limitations. If they are, the text should be divided into enough parts so that the size of each of the obtained images does not exceed the assumed sizes in the algorithm.

4. Examples

To show how the whole procedure works, selecting the appropriate text message and a specific image-encryption algorithm is necessary. Obviously, the converted text message will not resemble any commonly used test images such as Lena, Baboon, or Pepper. If so, it will be impossible to compare the obtained results with other works related to image encryption. It is also evident that changing the algorithm to another one will change the obtained results. However, if the algorithm is safe, obtained results will be close to optimal values. Thus, the analysis of a specific example may seem redundant. However, it is worth showing that the obtained values of the analysis measures are close to the optimal one. Therefore, the whole procedure makes sense for the selected text message and image-encryption algorithm.
It is also worth mentioning that the structure of the text is different from the structure of the image. In an image, neighboring pixels are usually correlated with each other. However, in the case of text, such a correlation should be smaller.
To present the operation of the procedure in use, the algorithm from [27] has been selected. Roughly, its operation uses the substitution with the generated S-box, as well as the permutation of pixels by saving them in the appropriate place in the cipher-image. Its advantage is the fact that it does not have any imposed maximum image sizes and is dedicated to images in the png format. It uses two keys: the value of the initial condition x and the value of the p parameter. For further processing of this algorithm, the following values were established: x = 0.123 and p = 0.352 .
Three different text files with the following content were selected as the message to be encrypted:
  • Test File 1: Lorem Ipsum text 200 words long (ASCII encoding);
  • Test File 2: Hamlet by Shakespeare in English (ASCII encoding);
  • Test File 3: Hamlet by Shakespeare in Polish (UTF-8 encoding).
The first two files are ASCII encoded (characters of which are included in UTF-8 encoding), while the third file is UTF-8 encoding.
Figure 4a shows the generated 200-word Lorem Ipsum text. The test files converted into an image are shown in Figure 4b, Figure 5a and Figure 6a. It is worth noting that the size of the text message in the form of the text file and the image file differ in size. For example, the image of Test File 3 takes about 20% less disk space than the text file. Detailed data of this issue are presented in Table 1. This observation is described in more detail in [35].
Table 1 also provides information on the dimensions of the resulting image files. In the case of Test File 1, it is only 31 × 31 pixels. Test Files 2 and 3 are 361 × 361 and 387 × 387 pixels, respectively.
In turn, Figure 4c, Figure 5b and Figure 6b represent the encrypted images. It is worth emphasizing that the size of the encrypted file is significantly larger than the text file and the image file. This is due to the fact that the pixel distribution in the encrypted image is uniform, and thus the compression algorithms used in the p n g format will not be as efficient as in the case of a non-flat distributed graphic file. This is due to the fact that the image cipher has a random form with no pixel dependencies.
To assess whether the encryption algorithm meets specific security requirements, certain numerical values of encrypted messages are shown, which illustrate how the algorithm copes with various cryptoanalysis techniques. For the proposed approach, measures related to image cryptoanalysis should be used. Such measures include, among others, entropy, correlation of adjacent pixels, differential attack analysis or pixel inconsistency analysis. In the following subsections, these measures are presented together with their discussion for the analyzed example.

4.1. Histograms

A simple criterion for assessing the security of an encrypted image is the assessment of histograms for RGB components. Such histograms should be uniform, which means that each of the possible pixel values has appeared almost the same number of times. In the case of the analyzed test files, the histograms of both the text converted into an image and its encrypted form are presented in Figure 7, Figure 8 and Figure 9. The top row of these Figures clearly shows that there are both dominant values in the RGB components of pixels and those that are not present in the image at all. However, in the case of the encrypted image, the obtained histogram is flat, i.e., each possible pixel value appeared almost exactly the same number of times. Such a situation is, of course, necessary from the point of view of the security of the encrypted message.

4.2. Entropy

Entropy is a measure of information in the source. It can be viewed as a measure of randomness. Its value can be calculated from the formula
H ( m ) = i = 0 N 1 p ( m i ) log 2 p ( m i ) ,
where N is the number of all possible characters in the source alphabet, m i is the source character, and p ( m i ) is the probability of m i . In the case of text in UTF-8 encoding, N = 65,536, and in the case of an image saved in the format png N = 256 . Entropy is maximal when p ( m i ) = 1 N . For text in UTF-8 encoding, the maximum entropy value is H m a x = 16 , while for the image png it is H m a x = 8 . In cryptography, it is required that the entropy of the latent (encrypted) source be as close as possible to the maximum entropy.
In the case of the analyzed test files, the entropy values are presented in Table 2. The entropy of the test files is, respectively, equal to 4.2068, 4.4600 and 5.0650 (with 16 as the maximum value), an average value of 3.09, 3.23 and 3.72 for the image png version of the test files and finally an average value of 7.80, 7.99 and 7.99 for the encrypted image (with 8 as the maximum value in both cases) for the test files. These values confirm that the proposed text-encryption procedure meets the requirements for this type of algorithm.

4.3. Local Entropy

As a measure, entropy is computed over the complete information signal. This can be complemented by a secondary measure, that of local entropy [36,37,38,39]. Local entropy is computed as the average entropy of a collection of random, non-overlapping sub-blocks of an image. This measure can be more representative, as it measures the local distribution of information along the source signal.
Here, a set of 30 randomly chosen non-overlapping blocks is considered. Each block has size of 44 × 44 , so 44 2 = 1936 pixels. The results are displayed in Table 3, for all three channels of the English (Test File 2) and Polish (Test File 3) source text images. The “Lorem Ipsum” text (Test File 1) is not considered here, due to its short length. In both cases, the encrypted images showcase a high value of local entropy, at around 7.9 , which is close to the optimal value, similar to the entropy measure. On the other hand, the plaintext images have low values of local entropy, indicating that the sub-blocks of the transformed image still “carry” information about the plaintext source.

4.4. Correlations of Adjacent Pixels

The linear correlation shows whether there is a relationship between successive pixels in the vertical, horizontal, and diagonal arrangement. Its value can be calculated from Pearson’s linear correlation coefficient, which is given by the formula
r = Cov ( x , y ) σ x · σ y ,
where
σ x = Var ( x ) = 1 N i = i N x i E ( x ) 2 ,
σ y = Var ( y ) = 1 N i = i N y i E ( y ) 2 ,
Cov ( x , y ) = 1 N i = i N x i E ( x ) y i E ( y ) ,
E ( x ) = 1 N i = 1 N x i and E ( y ) = 1 N i = 1 N y i .
x and y are consecutive image pixels with dimension W × H . The correlation coefficient satisfies the r [ 1 , 1 ] relationship, and | r | values close to 1 mean that the neighboring pixels are correlated with each other, while the r value close to 0 means that such a relationship between adjacent pixels does not exist. From the point of view of cryptography, the second case is the desired variant.
In the case of the analyzed test files, the correlation values are presented in Table 4. For the test files in the image form, the correlation value in each channel is about | 0.84 | , | 0.72 | , respectively, for the test files. In turn, for the encrypted image it is about | 0.02 | , | 0.002 | and | 0.002 | , respectively, for the test files. These values show that the text saved as an image is quite strongly correlated, while its encrypted version has a completely blurred relationship between adjacent pixels.

4.5. Differential Attack Analysis

Differential cryptoanalysis is one of the basic techniques for assessing the security of a given encryption algorithm. It involves examining the differences between ciphertexts that are obtained for plaintext that differ in some specific way (usually a randomly selected value) using the same keys. In the context of the proposed method, it will allow the checking of whether the text message treated as an image can be securely encrypted with the selected algorithm. Typically, differential cryptanalysis is based on two measures—NPCR (Number of Pixel of Change Rate) and UACI (Unified Average Changing Intensity). To receive them, two cipher-images E 1 and E 2 are needed. Those cipher-images are created from encryption for two plaintexts P 1 and P 2 , which differ by one random pixel value using the same keys.
The N P C R value is calculated from the formula:
N P C R = 1 W × H i , j D ( i , j ) × 100 % ,
where
D ( i , j ) = 0 if E 1 ( i , j ) = E 2 ( i , j ) 1 if E 1 ( i , j ) E 2 ( i , j ) ,
W × H stands for image dimension and E ( i , j ) stands for pixel in ( i , j ) coordinates of image E . The ideal value for N P C R is 100%.
The U A C I value is calculated from the formula:
U A C I = 1 W × H i , j | E 1 ( i , j ) E 2 ( i , j ) | 255 × 100 % ,
where W × H stands for image dimension and E ( i , j ) stands for pixel in ( i , j ) coordinates of image E . The ideal value for U A C I is 33%.
In the case of the analyzed test files, the values for NPCR and UACI measures are presented in Table 5. The obtained NPCR values are average equal to 99.40%, 99.21% and 99.20%, respectively, for test files. In turn, the UACI values are average equal to 33.37%, 36.38% and 33.41%, respectively, for the test files. This means that in the context of the analyzed algorithm, the obtained cipher-image does not allow for the effective use of differential cryptoanalysis methods.

4.6. Pixel Inconsistency Analysis

Another important feature of secure encryption is the occurrence of the avalanche effect, i.e., the occurrence of a significant change in the encrypted image when the input image or key has been slightly changed. In practice, MSE (Mean Square Error) can be used to investigate this phenomenon, which is expressed by the formula
M S E = 1 W × H i , j E 1 ( i , j ) E 2 ( i , j ) 2 ,
where W × H stands for image dimension and E ( i , j ) stands for pixel in ( i , j ) coordinates of image E . The MSE value should be high for any robust encryption algorithms. In the case of the analyzed case, E 1 means the cipher-image, while E 2 is the cipher-image obtained for an image that differs by one random pixel value.
In the case of the analyzed test files, the value for MSE measure is presented in Table 6. The values of this measure are average equal to 3673, 4062 and 3629, respectively, for the test files. This means that the compared images differ significantly.

5. Conclusions

The article presents how to use image-encryption algorithms known from professional literature to encrypt text. The idea behind this is in two steps. In the first one, the text is converted into an RGB image; in the second step, the selected image-encryption algorithm is used. The proposed procedure is presented on an example that confirms that such a text-encryption method is correct and allows for the safe hiding of a text message. This is confirmed by the calculated measures of entropy, correlation of adjacent pixels, NPCR, and UACI, which are related to differential cryptoanalysis, and MSE, which is related to pixel inconsistency analysis. The proposed approach opens up a completely new field related to chaotic cryptography, which currently focuses mainly on image encryption.
Moreover, the conversion of a text message into an image can be used directly as a step to develop new text-encryption algorithms with an intermediate image-encryption step.
Future work on this subject may concern topics related to, e.g., visual cryptography [40,41].

Author Contributions

Conceptualization, M.L.; methodology, M.L. and L.M.; formal analysis, M.L. and L.M.; writing—original draft preparation, M.L. and L.M.; writing—review and editing, M.L. and L.M.; supervision, C.V.; All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

The authors are thankful to the anonymous reviewers for their insightful remarks.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Strogatz, S. Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering; Westview Press: Boulder, CO, USA, 2015. [Google Scholar]
  2. Kocarev, L.; Lian, S. (Eds.) Chaos-Based Cryptography—Theory, Algorithms and Applications. In Studies in Computational Intelligence; Springer: Berlin/Heidelberg, Germany, 2011; Volume 354. [Google Scholar] [CrossRef]
  3. Grassi, G. Chaos in the Real World: Recent Applications to Communications, Computing, Distributed Sensing, Robotic Motion, Bio-Impedance Modelling and Encryption Systems. Symmetry 2021, 13, 2151. [Google Scholar] [CrossRef]
  4. Moysis, L.; Butusov, D.N.; Tutueva, A.; Ostrovskii, V.; Kafetzis, I.; Volos, C. Introducing Chaos and Chaos Based Encryption Applications to University Students-Case Report of a Seminar. In Proceedings of the 2022 11th International Conference on Modern Circuits and Systems Technologies (MOCAST), Bremen, Germany, 8–10 June 2022; pp. 1–6. [Google Scholar]
  5. Baptista, M. Cryptography with Chaos. Phys. Lett. A 1998, 240, 50–54. [Google Scholar] [CrossRef]
  6. Li, S.; Chen, G.; Wong, K.W.; Mou, X.; Cai, Y. Baptista-type chaotic cryptosystems: Problems and countermeasures. Phys. Lett. A 2004, 332, 368–375. [Google Scholar] [CrossRef] [Green Version]
  7. Kocarev, L.; Tasev, Z. Public-key encryption based on Chebyshev maps. In Proceedings of the 2003 International Symposium on Circuits and Systems ( ISCAS’03), Bangkok, Thailand, 25–28 May 2003; Volume 3, p. III. [Google Scholar] [CrossRef]
  8. Lawnik, M.; Kapczyński, A. The application of modified Chebyshev polynomials in asymmetric cryptography. Comput. Sci. 2019, 20, 289–303. [Google Scholar] [CrossRef]
  9. Li, Y.; Li, X. Chaotic hash function based on circular shifts with variable parameters. Chaos Solitons Fractals 2016, 91, 639–648. [Google Scholar] [CrossRef] [Green Version]
  10. Abdelfatah, R.I.; Baka, E.A.; Nasr, M.E. Keyed Parallel Hash Algorithm Based on Multiple Chaotic Maps (KPHA-MCM). IEEE Access 2021, 9, 130399–130409. [Google Scholar] [CrossRef]
  11. Khan, M.A.; Ali, A.; Jeoti, V.; Manzoor, S. A Chaos-Based Substitution Box (S-Box) Design with Improved Differential Approximation Probability (DP). Iran. J. Sci. Technol. Trans. Electr. Eng. 2018, 42, 219–238. [Google Scholar] [CrossRef]
  12. Dimitrov, M.M. On the Design of Chaos-Based S-Boxes. IEEE Access 2020, 8, 117173–117181. [Google Scholar] [CrossRef]
  13. Zia, U.; McCartney, M.; Scotney, B.; Martinez, J.; Sajjad, A. A novel pseudo-random number generator for IoT based on a coupled map lattice system using the generalised symmetric map. SN Appl. Sci. 2022, 4, 48. [Google Scholar] [CrossRef]
  14. Haliuk, S.; Krulikovskyi, O.; Vovchuk, D.; Corinto, F. Memristive Structure-Based Chaotic System for PRNG. Symmetry 2022, 14, 68. [Google Scholar] [CrossRef]
  15. Yang, D.; Liao, X.; Wang, Y.; Yang, H.; Wei, P. A novel chaotic block cryptosystem based on iterating map with output-feedback. Chaos Solitons Fractals 2009, 41, 505–510. [Google Scholar] [CrossRef]
  16. Wang, X.Y.; Yu, Q. A block encryption algorithm based on dynamic sequences of multiple chaotic systems. Commun. Nonlinear Sci. Numer. Simul. 2009, 14, 574–581. [Google Scholar] [CrossRef]
  17. Yasser, I.; Mohamed, M.A.; Samra, A.S.; Khalifa, F. A Chaotic-Based Encryption/Decryption Framework for Secure Multimedia Communications. Entropy 2020, 22, 1253. [Google Scholar] [CrossRef] [PubMed]
  18. Sheela, S.J.; Suresh, K.V.; Tandur, D. Secured text communication using chaotic maps. In Proceedings of the 2017 International Conference on Algorithms, Methodology, Models and Applications in Emerging Technologies (ICAMMAET), Chennai, India, 16–18 February 2017; pp. 1–6. [Google Scholar] [CrossRef]
  19. Menon, U.; Menon, A.R.; Hudlikar, A. A Novel Chaotic System for Text Encryption Optimized with Genetic Algorithm. Int. J. Adv. Comput. Sci. Appl. 2020, 11, 34–40. [Google Scholar] [CrossRef]
  20. Irsan, M.Y.T.; Antoro, S.C. Text Encryption Algorithm based on Chaotic Map. J. Phys. Conf. Ser. 2019, 1341, 062023. [Google Scholar] [CrossRef] [Green Version]
  21. Charalampidis, N.; Volos, C.; Moysis, L.; Tutueva, A.V.; Butusov, D.; Stouboulos, I. Text Encryption Based on a Novel One Dimensional Piecewise Chaotic Map. In Proceedings of the 2022 Conference of Russian Young Researchers in Electrical and Electronic Engineering (ElConRus), St. Petersburg, Russia, 25–28 January 2022; pp. 263–268. [Google Scholar] [CrossRef]
  22. Qasim, H.A. Text Encryption Method Using multi Hyper-chaotic systems. Al-Qadisiyah J. Pure Sci. 2021, 23, 1–8. [Google Scholar]
  23. OleiwiTuama, S.; Kadum, S.A.; Hussein, Z. Text Encryption Approach Using DNA Computation and Hyperchaotic System. In Proceedings of the 2021 2nd Information Technology To Enhance e-learning and Other Application (IT-ELA), Baghdad, Iraq, 28–29 December 2021; pp. 100–105. [Google Scholar] [CrossRef]
  24. Arifin, S.; Muktyas, I.B.; Prasetyo, P.W.; Abdillah, A.A. Unimodular matrix and bernoulli map on text encryption algorithm using python. Al-Jabar: J. Pendidik. Mat. 2021, 12, 447–455. [Google Scholar] [CrossRef]
  25. Ataş, M.T.; Güler, H. Real-Time Encryption/Decryption Algorithm with A Fractional Chaotic System of Various Data: Image, Speech, and Text. Int. J. Appl. Comput. Math. 2022, 8, 161. [Google Scholar] [CrossRef]
  26. Ignatius Moses Setiadi, D.R.; Rachmawanto, E.H.; Zulfiningrum, R.; Sarker, M.K. Text Encryption using Bi-Amold Cat Map and Modulus Operation. In Proceedings of the 2021 International Seminar on Application for Technology of Information and Communication (iSemantic), Semarangin, Indonesia, 18–19 September 2021; pp. 102–106. [Google Scholar] [CrossRef]
  27. Lawnik, M.; Berezowski, M. New Chaotic System: M-Map and Its Application in Chaos-Based Cryptography. Symmetry 2022, 14, 895. [Google Scholar] [CrossRef]
  28. Ali, T.S.; Ali, R. A novel color image encryption scheme based on a new dynamic compound chaotic map and S-box. Multimed. Tools Appl. 2022, 81, 20585–20609. [Google Scholar] [CrossRef]
  29. Kumar, K.; Roy, S.; Rawat, U.; Malhotra, S. IEHC: An efficient image encryption technique using hybrid chaotic map. Chaos Solitons Fractals 2022, 158, 111994. [Google Scholar] [CrossRef]
  30. Li, C.; Yang, X. An image encryption algorithm based on discrete fractional wavelet transform and quantum chaos. Optik 2022, 260, 169042. [Google Scholar] [CrossRef]
  31. Vidhya, R.; Brindha, M. A chaos based image encryption algorithm using Rubik’s cube and prime factorization process (CIERPF). J. King Saud Univ. Comput. Inf. Sci. 2022, 34, 2000–2016. [Google Scholar] [CrossRef]
  32. Ye, G.; Wu, H.; Liu, M.; Shi, Y. Image encryption scheme based on blind signature and an improved Lorenz system. Expert Syst. Appl. 2022, 205, 117709. [Google Scholar] [CrossRef]
  33. Gao, X.; Mou, J.; Banerjee, S.; Cao, Y.; Xiong, L.; Chen, X. An effective multiple-image encryption algorithm based on 3D cube and hyperchaotic map. J. King Saud Univ. Comput. Inf. Sci. 2022, 34, 1535–1551. [Google Scholar] [CrossRef]
  34. Banik, A.; Laiphrakpam, D.S.; Agrawal, A.; Patgiri, R. Secret image encryption based on chaotic system and elliptic curve cryptography. Digit. Signal Process. 2022, 129, 103639. [Google Scholar] [CrossRef]
  35. Lawnik, M.; Pełka, A.; Kapczyński, A. A New Way to Store Simple Text Files. Algorithms 2020, 13, 101. [Google Scholar] [CrossRef]
  36. El-Latif, A.A.A.; Abd-El-Atty, B.; Belazi, A.; Iliyasu, A.M. Efficient Chaos-Based Substitution-Box and Its Application to Image Encryption. Electronics 2021, 10, 1392. [Google Scholar] [CrossRef]
  37. Wu, Y.; Zhou, Y.; Saveriades, G.; Agaian, S.; Noonan, J.P.; Natarajan, P. Local Shannon entropy measure with statistical tests for image randomness. Inf. Sci. 2013, 222, 323–342. [Google Scholar] [CrossRef] [Green Version]
  38. Chen, J.X.; Zhu, Z.l.; Fu, C.; Zhang, L.b.; Zhang, Y. An efficient image encryption scheme using lookup table-based confusion and diffusion. Nonlinear Dyn. 2015, 81, 1151–1166. [Google Scholar] [CrossRef]
  39. Tsafack, N.; Sankar, S.; Abd-El-Atty, B.; Kengne, J.; Jithin, K.; Belazi, A.; Mehmood, I.; Bashir, A.K.; Song, O.Y.; Abd El-Latif, A.A. A new chaotic map with dynamic analysis and encryption application in internet of health things. IEEE Access 2020, 8, 137731–137744. [Google Scholar] [CrossRef]
  40. Jiao, S.; Feng, J.; Gao, Y.; Lei, T.; Yuan, X. Visual cryptography in single-pixel imaging. Opt. Express 2020, 28, 7301–7313. [Google Scholar] [CrossRef] [Green Version]
  41. Cheremkhin, P.A.; Krasnov, V.V.; Rodin, V.G.; Starikov, R.S. QR code optical encryption using spatially incoherent illumination. Laser Phys. Lett. 2017, 14, 026202. [Google Scholar] [CrossRef]
Figure 1. Encryption and decryption process of an image. (a) Image-encryption scheme. (b) Image decryption scheme.
Figure 1. Encryption and decryption process of an image. (a) Image-encryption scheme. (b) Image decryption scheme.
Electronics 11 03156 g001
Figure 2. Text to image conversion scheme.
Figure 2. Text to image conversion scheme.
Electronics 11 03156 g002
Figure 3. Image to text conversion scheme.
Figure 3. Image to text conversion scheme.
Electronics 11 03156 g003
Figure 4. Test File 1 text message, transformed message into a p n g image and its cipher-image. (a) Lorem Ipsum text. (b) Text message in image form. (c) Encrypted image.
Figure 4. Test File 1 text message, transformed message into a p n g image and its cipher-image. (a) Lorem Ipsum text. (b) Text message in image form. (c) Encrypted image.
Electronics 11 03156 g004
Figure 5. Test File 2 text message as image p n g and its cipher-image. (a) Text message in image form. (b) Encrypted image.
Figure 5. Test File 2 text message as image p n g and its cipher-image. (a) Text message in image form. (b) Encrypted image.
Electronics 11 03156 g005
Figure 6. Test File 3 text message as image p n g and its cipher-image. (a) Text message in image form. (b) Encrypted image.
Figure 6. Test File 3 text message as image p n g and its cipher-image. (a) Text message in image form. (b) Encrypted image.
Electronics 11 03156 g006
Figure 7. Histogram of the R, G, and B components of the pixels of the image version of Test File 1 (top row) and its cipher-image (bottom row).
Figure 7. Histogram of the R, G, and B components of the pixels of the image version of Test File 1 (top row) and its cipher-image (bottom row).
Electronics 11 03156 g007
Figure 8. Histogram of the R, G, and B components of the pixels of the image version of Test File 2 (top row) and its cipher-image (bottom row).
Figure 8. Histogram of the R, G, and B components of the pixels of the image version of Test File 2 (top row) and its cipher-image (bottom row).
Electronics 11 03156 g008
Figure 9. Histogram of the R, G, and B components of the pixels of the image version of Test File 3 (top row) and its cipher-image (bottom row).
Figure 9. Histogram of the R, G, and B components of the pixels of the image version of Test File 3 (top row) and its cipher-image (bottom row).
Electronics 11 03156 g009
Table 1. Disk space comparison of the original text file with its image version and the encrypted image.
Table 1. Disk space comparison of the original text file with its image version and the encrypted image.
Text File Size [in B]Image File Size [in B]Image File DimensionsEncrypted File Size [in B]
Test File 114331224 31 × 31 2982
Test File 2200,203147,196 361 × 361 391,831
Test File 3252,640196,408 387 × 387 450,132
Table 2. Entropy comparison of the original text file with its image version and the encrypted image.
Table 2. Entropy comparison of the original text file with its image version and the encrypted image.
Text FileImage FileEncrypted File
RedGreenBlueRedGreenBlue
Test File 14.20683.08233.09843.09987.81317.78267.7949
Test File 24.46003.23163.23823.22767.99857.99847.9985
Test File 35.06503.72153.72093.72057.99867.99887.9987
Table 3. Local entropy for plaintext and encrypted image versions of the text source.
Table 3. Local entropy for plaintext and encrypted image versions of the text source.
Image FileEncrypted File
RedGreenBlueRedGreenBlue
Test File 23.20033.20723.19487.90457.90367.9040
Test File 33.68583.68083.68587.90457.90497.9033
Table 4. Correlations of adjacent pixels of the image version of the text and the encrypted image.
Table 4. Correlations of adjacent pixels of the image version of the text and the encrypted image.
Image FileEncrypted File
RedGreenBlueRedGreenBlue
Test file 1Vertical−0.8225−0.8601−0.8586−0.01110.0068−0.0370
Horizontal−0.8249−0.8559−0.8547−0.0212−0.02090.0400
Diagonal0.81270.85110.8599−0.0075−0.00730.0004
Test file 2Vertical−0.7275−0.7299−0.72680.0017−0.00060.0030
Horizontal−0.7275−0.7299−0.72680.00420.00140.0011
Diagonal0.73050.73050.7274−0.00180.00050.0050
Test file 3Vertical−0.7229−0.7235−0.7214−0.0029−0.0014−0.0027
Horizontal−0.7274−0.7277−0.7256−0.00090.00230.0049
Diagonal0.72270.72390.7205−0.0005−0.00210.0007
Table 5. NPCR and UACI values of the encrypted image.
Table 5. NPCR and UACI values of the encrypted image.
Encrypted File
RedGreenBlue
Test File 1NPCR99.47%99.47%99.37%
UACI33.68%32.90%33.55%
Test File 2NPCR99.22%99.22%99.18%
UACI36.38%36.46%36.30%
Test File 3NPCR99.19%99.21%99.19%
UACI33.43%33.38%33.42%
Table 6. MSE values of the image version of the text and the encrypted image.
Table 6. MSE values of the image version of the text and the encrypted image.
Encrypted File
VerticalHorizontalDiagonal
Test File 13761.78523577.88033683.9597
Test File 24057.67804081.20784050.6819
Test File 33630.01743627.98073630.2282
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Lawnik, M.; Moysis, L.; Volos, C. Chaos-Based Cryptography: Text Encryption Using Image Algorithms. Electronics 2022, 11, 3156. https://doi.org/10.3390/electronics11193156

AMA Style

Lawnik M, Moysis L, Volos C. Chaos-Based Cryptography: Text Encryption Using Image Algorithms. Electronics. 2022; 11(19):3156. https://doi.org/10.3390/electronics11193156

Chicago/Turabian Style

Lawnik, Marcin, Lazaros Moysis, and Christos Volos. 2022. "Chaos-Based Cryptography: Text Encryption Using Image Algorithms" Electronics 11, no. 19: 3156. https://doi.org/10.3390/electronics11193156

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop