Enhancing Visual Data Security: A Novel FSM-Based Image Encryption and Decryption Methodology
<p>Testing graph.</p> "> Figure 2
<p>Graph adjacency matrix.</p> "> Figure 3
<p>The dataset comprises three distinct categories of images: the original images, the encrypted (cipher) images, and the decrypted images.</p> "> Figure 4
<p>Distribution of adjacent pixels in the original images and corresponding ciphered images: (<b>a</b>) Horizontal plain image and cipher image of Lenna, (<b>b</b>) vertical plain image and cipher image of Lenna, (<b>c</b>) diagonal plain image and cipher image of Lenna, (<b>d</b>) horizontal plain image and cipher image of Mandrill, (<b>e</b>) vertical plain image and cipher image of Mandrill, (<b>f</b>) diagonal plain image and cipher image of Mandrill, (<b>g</b>) horizontal plain image and cipher image of Peppers, (<b>h</b>) vertical plain image and cipher image of Peppers, (<b>i</b>) diagonal plain image and cipher image of Peppers, (<b>j</b>) horizontal plain image and cipher image of Airplane, (<b>k</b>) vertical plain image and cipher image of Airplane, (<b>l</b>) diagonal plain image and cipher image of Airplane.</p> ">
Abstract
:1. Introduction
2. Literature Review
3. Materials and Methods
3.1. General Finite State Machines
3.2. Encryption Algorithm Using Finite State Machines
- Consider a finite automaton denoted as , represented in the format of a state table. In this context, both and are elements of the set {0, 1};
- A testing table (TTab) is constructed, consisting of 2 parts;
- Upper part of TTab: The state table of the finite state machine is rewritten; the rows in the upper part of the table correspond to the states of the machine, and the columns to the output symbols. The entry at the intersection of row and column are states that can be reached from state using a single transition associated with the output symbol . The entire upper half of the table is actually a list of the next states of the machine and is therefore called the output table;
- Bottom of the TTab: Each compatible state pair appearing at the top becomes the row header of the bottom of the testing table. The next states of these pairs are: they consist of all implied joint pairs. Any implied pair of states that have not already been used as a row header becomes the row header, its next state being found in the same way. The process terminates when all compatible state pairs have been used as row headers;
- A testing-oriented weighted graph G, according to TTab, is constructed using the steps as follows:
- Each compatible pair of states corresponds to a vertex in G;
- An arc labeled goes from vertex to vertex , where p ≠ q, if and only if the compatible pair () is the next state of the compatible pair ();
- Determine the ratio of the original finite state machine to the group of invertible finite state machines with memory and find its delay.
- The graph G from Step 3 is checked for the presence of a cycle. If there is a cycle, then the finite automaton is not an invertible automaton with finite memory; if there is no cycle, the finite automaton is an invertible automaton with finite memory;
- Find the delay , where l is the longest path of the graph G from step 3.
- Based on the testing table, an adjacency matrix of the graph with dimension is constructed (p is the number of vertices of the graph);
- The row that has 0 in all positions is deleted, and the corresponding column is deleted. If there are no such lines, go to step 4;
- Step 2 is repeated;
- If the matrix has not completely disappeared, then the graph has a cycle. If the matrix has disappeared, then the graph does not have a cycle.
- The decryption begins with the FSM in a known initial state. The encrypted data (output sequence of the encryption process) is then fed into the FSM;
- As the FSM processes the input data, it transitions between states according to its transition function, which is designed to be reversible. The transition functions and the output functions are crafted such that each input and output symbol leads to a unique next state;
- Since the FSM is invertible, the sequence of states it transitions through can be used to uniquely determine the original input sequence. This sequence represents the decrypted data.
3.3. Statistical Test Suite
- Frequency (Monobit) Test—assesses whether the number of ones and zeros in a sequence are approximately equal;
- Block Frequency Test—examines the frequency of fixed-size blocks in the sequence;
- Runs Test—analyzes the number of runs of ones and zeros in the sequence;
- Longest Run of Ones in a Block Test—investigates the length of the longest run of ones in a sequence;
- Binary Matrix Rank Test—assesses the rank of disjoint submatrices of the entire sequence;
- Discrete Fourier Transform (Spectral) Test—utilizes the discrete Fourier transform to analyze the frequency content of the sequence;
- Non-overlapping Template Matching Test—checks for the presence of specific fixed-size patterns in the sequence;
- Overlapping Template Matching Test—similar to the non-overlapping template matching test but allows for overlapping patterns;
- Maurer’s Universal Statistical Test—measures the compressibility of a sequence;
- Random Excursions Test—analyzes the number of cycles having specified numbers of visits in a random walk;
- Random Excursions Variant Test—examines a variant of the random excursions test.
3.4. Histogram Analysis
3.5. Experimental Data
4. Results and Discussion
4.1. Image Encryption and Decryption
4.2. NIST STS Analysis
4.3. Histogram Analysis
4.4. Correlation Analysis
4.5. Comparison of Results
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Rivest, R.L.; Shamir, A.; Adleman, L. A method for obtaining digital signatures and public-key cryptosystems. Commun. ACM 1978, 21, 120–126. [Google Scholar] [CrossRef]
- Lai, J.; Deng, R.H.; Guan, C.; Weng, J. Attribute-based encryption with verifiable outsourced decryption. IEEE Trans. Inf. Forensics Secur. 2013, 8, 1343–1354. [Google Scholar] [CrossRef]
- Zhang, X.; Chen, X. Data security sharing and storage based on a consortium blockchain in a vehicular ad-hoc network. IEEE Access 2019, 7, 58241–58254. [Google Scholar] [CrossRef]
- Zhang, X.; Wang, H.; Xu, C. Identity-based key-exposure resilient cloud storage public auditing scheme from lattices. Inf. Sci. 2019, 472, 223–234. [Google Scholar] [CrossRef]
- Nedjah, N.; de Macedo Mourelle, L.; Wang, C. A parallel yet pipelined architecture for efficient implementation of the advanced encryption standard algorithm on reconfigurable hardware. Int. J. Parallel Program. 2016, 44, 1102–1117. [Google Scholar] [CrossRef]
- Liang, K.; Au, M.H.; Liu, J.K.; Susilo, W.; Wong, D.S.; Yang, G.; Xie, Q. A DFA-based functional proxy re-encryption scheme for secure public cloud data sharing. IEEE Trans. Inf. Forensics Secur. 2014, 9, 1667–1680. [Google Scholar] [CrossRef]
- Hussein, M.K.; Alhijaj, A.A. Protection of images by combination of vernam stream cipher, AES, and LSB steganography in a video clip. Bull. Electr. Eng. Inform. 2023, 12, 1578–1585. [Google Scholar] [CrossRef]
- Han, X.; Yao, G. The combined use of FAPKC without compromising the security of the cryptosystem. Jisuanji Yanjiu Yu Fazhan (Comput. Res. Dev.) 2005, 42, 1692–1697. [Google Scholar] [CrossRef]
- Panda, S.P.; Sahu, M.; Rout, U.P.; Nanda, S.K. Encryption and Decryption algorithm using two dimensional cellular automata rules in Cryptography. Int. J. Commun. Netw. Secur. 2011, 1, 18–23. [Google Scholar] [CrossRef]
- Aljawarneh, S.; Yassein, M.B.; Talafha, W.A.A. A resource-efficient encryption algorithm for multimedia big data. Multimed. Tools Appl. 2017, 76, 22703–22724. [Google Scholar] [CrossRef]
- Tao, R.; Chen, S. Two varieties of finite automaton public key cryptosystem and digital signatures. J. Comput. Sci. Technol. 1986, 1, 9–18. [Google Scholar] [CrossRef]
- Gysin, M. A One-Key Cryptosystem Based on a Finite Nonlinear Automaton; Springer: Berlin/Heidelberg, Germany, 1995. [Google Scholar]
- Dömösi, P. A novel cryptosystem based on finite automata without outputs. In Automata, Formal Languages and Algebraic Systems; World Scientific: Singapore, 2010; pp. 23–32. [Google Scholar] [CrossRef]
- Roy, S.; Shrivastava, M.; Rawat, U.; Pandey, C.; Nayak, S. IESCA: An efficient image encryption scheme using 2-D cellular automata. J. Inf. Secur. Appl. 2021, 61, 102919. [Google Scholar] [CrossRef]
- Tao, R. Finite Automata and Application to Cryptography; Springer: Chicago, IL, USA, 2008. [Google Scholar]
- Mitchell, J.C.; Shmatikov, V.; Stern, U. Finite-State Analysis of SSL 3.0. In Proceedings of the 7th USENIX Security Symposium, San Antonio, TX, USA, 26–29 January 1998; Volume 1, pp. 201–216. [Google Scholar]
- Isa, M.A.M.; Ahmad, M.M.; Sani, N.F.M.; Hashim, H.; Mahmod, R. Cryptographic key exchange protocol with message authentication codes (MAC) using finite state machine. Procedia Comput. Sci. 2014, 42, 263–270. [Google Scholar] [CrossRef]
- Kearns, M.; Valiant, L. Cryptographic limitations on learning boolean formulae and finite automata. J. ACM (JACM) 1994, 41, 67–95. [Google Scholar] [CrossRef]
- Sharipbay, A.A.; Saukhanova, Z.S.; Shakhmetova, G.B.; Saukhanov, N.S. Application of finite automata in cryptography. In Proceedings of the 5th International Conference on Engineering and MIS, ICEMIS’2019, Astana, Kazakhstan, 6–8 June 2019; pp. 1–3. [Google Scholar] [CrossRef]
- Amorim, I.; Machiavelo, A.; Reis, R. On Linear Finite Automata and Cryptography; Tech. Rep. DCC-2011-11, Ver. 1.0; Faculdade De Ciências Universidade Do Porto: Porto, Portugal, 2011. [Google Scholar]
- Saqib, Z.; Shahid, M.A.; Umair, M. Encryption and Decryption Using Automata Theory. Int. J. Multidiscip. Sci. Eng. 2015, 6, 14–21. [Google Scholar]
- Vayadande, K.; Agarwal, K.; Kabra, A.; Gangwal, K.; Kinage, A. Cryptography using Automata Theory. In ITM Web of Conferences; EDP Sciences: Les Ulis, France, 2022; Volume 50, pp. 1–9. [Google Scholar] [CrossRef]
- Khaleel, G.; Turaev, S.; Al-Shaikhli, I.; Tamrin, M.M. An overview of cryptosystems based on finite automata. J. Adv. Rev. Sci. Res. 2016, 27, 1–7. [Google Scholar]
- Peña, P.I.S.; Torres, R.E.G. Authenticated Encryption based on finite automata cryptosystems. In Proceedings of the 2016 13th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE), Mexico City, Mexico, 26–30 September 2016; pp. 1–6. [Google Scholar]
- Alawida, M.; Samsudin, A.; Teh, J.S.; Alshoura, W.H. Deterministic chaotic finite-state automata. Nonlinear Dyn. 2019, 98, 2403–2421. [Google Scholar] [CrossRef]
- Alawida, M.; Teh, J.S.; Alshoura, W.H. A New Image Encryption Algorithm Based on DNA State Machine for UAV Data Encryption. Drones 2023, 7, 38. [Google Scholar] [CrossRef]
- Geng, S.; Wu, T.; Wang, S.; Zhang, X.; Wang, Y. Image Encryption Algorithm Based on Block Scrambling and Finite State Machine. IEEE Access 2020, 8, 225831–225844. [Google Scholar] [CrossRef]
- Dougherty, S.T.; Klobusicky, J.; Şahinkaya, S.; Ustun, D. An S-Box construction from exponentiation in finite fields and its application in RGB color image encryption. Multimed. Tools Appl. 2024, 83, 41213–41241. [Google Scholar] [CrossRef]
- Alawida, M.; Teh, J.S.; Samsudin, A. An image encryption scheme based on hybridizing digital chaos and finite state machine. Signal Process. 2019, 164, 249–266. [Google Scholar] [CrossRef]
- Merhav, N. Perfectly secure encryption of individual sequences. IEEE Trans. Inf. Theory 2012, 59, 1302–1310. [Google Scholar] [CrossRef]
- Khan, S.; Han, L.; Lu, H.; Butt, K.K.; Bachira, G.; Khan, N.U. A new hybrid image encryption algorithm based on 2D-CA, FSM-DNA rule generator, and FSBI. IEEE Access 2019, 7, 81333–81350. [Google Scholar] [CrossRef]
- Benini, L.; De Micheli, G. Automatic synthesis of low-power gated-clock finite-state machines. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 1996, 15, 630–643. [Google Scholar] [CrossRef]
- Sharipbay, A.; Saukhanova, Z.; Shakhmetova, G.; Barlybayev, A. Development of Reliable and Effective Methods of Cryptographic Protection of Information Based on the Finite Automata Theory. Eurasia Proc. Sci. Technol. Eng. Math. 2023, 26, 19–25. [Google Scholar] [CrossRef]
- Bogachenko, N.F. Application of automata-theoretic models in cryptography. Math. Struct. Model. 2007, 1, 112–120. [Google Scholar]
- Lotfi, Z.; Khalifi, H.; Ouardi, F. Efficient Algebraic Method for Testing the Invertibility of Finite State Machines. Computation 2023, 11, 125. [Google Scholar] [CrossRef]
- Kohavi, Z.; Jha, N.K. Switching and Finite Automata Theory; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
- Shakhmetova, G.; Saukhanova, Z.; Udzir, N.I.; Sharipbay, A.; Saukhanov, N. Application of Pseudo-Memory Finite Automata for Information Encryption. In Proceedings of the 2nd International Workshop on Intelligent Information Technologies and Systems of Information Security, Khmelnytskyi, Ukraine, 24–26 March 2021; pp. 330–339. [Google Scholar]
- Olson, R.R. On the Invertibility of Finite State Machines; Tech. Rep. TR-EE-703; Faculdade De Ciências Universidade Do Porto: Porto, Portugal, 1970. [Google Scholar]
- Pareschi, F.; Rovatti, R.; Setti, G. On statistical tests for randomness included in the NIST SP800-22 test suite and based on the binomial distribution. IEEE Trans. Inf. Forensics Secur. 2012, 7, 491–505. [Google Scholar] [CrossRef]
- Norouzi, B.; Mirzakuchaki, S.; Seyedzadeh, S.M.; Mosavi, M.R. A simple, sensitive and secure image encryption algorithm based on hyper-chaotic system with only one round diffusion process. Multimed. Tools Appl. 2014, 71, 1469–1497. [Google Scholar] [CrossRef]
- Sharma, P.L.; Gupta, S.; Nayyar, A.; Harish, M.; Gupta, K.; Sharma, A.K. ECC based novel color image encryption methodology using primitive polynomial. Multimed. Tools Appl. 2024, 1–40. [Google Scholar] [CrossRef]
- Kaushik, P.; Attkan, A.A. Chaotic and Hyperchaotic Map based Image Encryption Protocol for High-End Colour density Images using enhanced S-box pixel permutator. In Proceedings of the 2021 2nd International Conference on Computational Methods in Science & Technology (ICCMST), Mohali, India, 17–18 December 2021; pp. 174–180. [Google Scholar]
- Hermassi, H.; Rhouma, R.; Belghith, S. Improvement of an image encryption algorithm based on hyper-chaos. Telecommun. Syst. 2013, 52, 539–549. [Google Scholar] [CrossRef]
- Ye, G.; Wong, K.W. An efficient chaotic image encryption algorithm based on a generalized Arnold map. Nonlinear Dyn. 2012, 69, 2079–2087. [Google Scholar] [CrossRef]
- Song, C.Y.; Qiao, Y.L.; Zhang, X.Z. An image encryption scheme based on new spatiotemporal chaos. Opt.-Int. J. Light Electron Opt. 2013, 124, 3329–3334. [Google Scholar] [CrossRef]
- Zeng, J.; Wang, C. A novel hyperchaotic image encryption system based on particle swarm optimization algorithm and cellular automata. Secur. Commun. Netw. 2021, 2021, 6675565. [Google Scholar] [CrossRef]
- Liu, H.; Wang, X. Color image encryption using spatial bit-level permutation and high-dimension chaotic system. Opt. Commun. 2011, 284, 3895–3903. [Google Scholar] [CrossRef]
PS | NS, z | |
---|---|---|
x = 0 | x = 1 | |
0 | 0,0 | 1,0 |
1 | 2,0 | 3,0 |
2 | 3,1 | 2,1 |
3 | 1,1 | 0,1 |
S | z = 0 | z = 1 |
---|---|---|
0 | (0,1) | - |
1 | (2,3) | - |
2 | - | (2,3) |
3 | - | (0,1) |
(0,1) | (0,2), (0,3) (1,2), (1,3) | - |
(2,3) | - | (0,2), (0,3) (1,2), (1,3) |
Test Name | p-Value | Conclusion | |
---|---|---|---|
2.01. Frequency Test: | 0.011603 | True | |
2.02. Block Frequency Test: | 0.898022 | True | |
2.03. Run Test: | 0.194845 | True | |
2.04. Run Test (Longest Run of Ones): | 0.366963 | True | |
2.05. Binary Matrix Rank Test: | 0.062628 | True | |
2.06. Discrete Fourier Transform (Spectral) Test: | 0.575633 | True | |
2.07. Non-overlapping Template Matching Test: | 0.985412 | True | |
2.08. Overlapping Template Matching Test: | 0.28564 | True | |
2.09. Universal Statistical Test: | 0.874041 | True | |
2.10. Linear Complexity Test: | 0.809612 | True | |
2.11. Serial Test: | 0.159966 | True | |
0.422105 | True | ||
2.12. Approximate Entropy Test: | 0.224807 | True | |
2.13. Cumulative Sums (Forward): | 0.021299 | True | |
2.13. Cumulative Sums (Backward): | 0.021299 | True | |
2.14. Random Excursion Test: | |||
‘−4’ | 3.200982 | 0.669032 | True |
‘−3’ | 6.112628 | 0.295414 | True |
‘−2’ | 3.762932 | 0.584027 | True |
‘−1’ | 10.89873 | 0.053425 | True |
‘+1’ | 7.531646 | 0.184007 | True |
‘+2’ | 5.497578 | 0.358212 | True |
‘+3’ | 5.469185 | 0.361337 | True |
‘+4’ | 4.987242 | 0.417439 | True |
2.15. Random Excursion Variant Test: | |||
‘−9.0’ | 123 | 0.39589 | True |
‘−8.0’ | 119 | 0.411277 | True |
‘−7.0’ | 101 | 0.627375 | True |
‘−6.0’ | 66 | 0.755169 | True |
‘−5.0’ | 50 | 0.44187 | True |
‘−4.0’ | 54 | 0.452213 | True |
‘−3.0’ | 57 | 0.433789 | True |
‘−2.0’ | 64 | 0.49084 | True |
‘−1.0’ | 85 | 0.633124 | True |
‘+1.0’ | 55 | 0.056219 | True |
‘+2.0’ | 54 | 0.25085 | True |
‘+3.0’ | 48 | 0.270057 | True |
‘+4.0’ | 48 | 0.351261 | True |
‘+5.0’ | 53 | 0.490519 | True |
‘+6.0’ | 58 | 0.614454 | True |
‘+7.0’ | 59 | 0.658999 | True |
‘+8.0’ | 40 | 0.42307 | True |
‘+9.0’ | 30 | 0.344424 | True |
Image | Horizontal | Vertical | Diagonal |
---|---|---|---|
Original Lenna | 0.9740 | 0.9694 | 0.9507 |
Encrypt Lenna | −0.0066 | −0.0106 | −0.0014 |
Original Mandrill | 0.9587 | 0.9723 | 0.9385 |
Encrypt Mandrill | 0.0034 | −0.0016 | 0.0027 |
Original Peppers | 0.9535 | 0.9217 | 0.9106 |
Encrypt Peppers | 0.0019 | −0.0037 | −0.0144 |
Original Airplane | 0.9578 | 0.9622 | 0.9180 |
Encrypt Airplane | −0.0127 | −0.0052 | −0.0134 |
Encrypt Lenna Image | Horizontal | Vertical | Diagonal |
---|---|---|---|
Finite State Machine based proposed method | −0.0066 | −0.0106 | −0.0014 |
Elliptic curve cryptography-based method using primitive polynomial [41] | −0.0022 | −0.0123 | −0.0067 |
Chaotic and hyperchaotic-based methods using enhanced S-box pixel permutator [42] | 0.0484 | 0.0119 | 0.0141 |
Hyper-chaos-based method [43] | 0.0059 | 0.0105 | 0.0142 |
Generalized Arnold map-based method [44] | 0.0173 | −0.0027 | −0.0177 |
Hyper-chaotic system with only one round diffusion process-based method [40] | 0.0117 | −0.0369 | −0.0422 |
Spatiotemporal chaos process-based method [45] | 0.0143 | 0.0280 | 0.4466 |
Particle swarm optimization algorithm and cellular automata-based method [46] | 0.0053 | −0.0089 | 0.0126 |
Spatial bit-level permutation and high-dimension-based method [47] | −0.0574 | −0.0035 | 0.0578 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Shakhmetova, G.; Barlybayev, A.; Saukhanova, Z.; Sharipbay, A.; Raykul, S.; Khassenov, A. Enhancing Visual Data Security: A Novel FSM-Based Image Encryption and Decryption Methodology. Appl. Sci. 2024, 14, 4341. https://doi.org/10.3390/app14114341
Shakhmetova G, Barlybayev A, Saukhanova Z, Sharipbay A, Raykul S, Khassenov A. Enhancing Visual Data Security: A Novel FSM-Based Image Encryption and Decryption Methodology. Applied Sciences. 2024; 14(11):4341. https://doi.org/10.3390/app14114341
Chicago/Turabian StyleShakhmetova, Gulmira, Alibek Barlybayev, Zhanat Saukhanova, Altynbek Sharipbay, Sayat Raykul, and Altay Khassenov. 2024. "Enhancing Visual Data Security: A Novel FSM-Based Image Encryption and Decryption Methodology" Applied Sciences 14, no. 11: 4341. https://doi.org/10.3390/app14114341
APA StyleShakhmetova, G., Barlybayev, A., Saukhanova, Z., Sharipbay, A., Raykul, S., & Khassenov, A. (2024). Enhancing Visual Data Security: A Novel FSM-Based Image Encryption and Decryption Methodology. Applied Sciences, 14(11), 4341. https://doi.org/10.3390/app14114341