Cryptography using Automata Theory

. Encryption and decryption are the two most crucial components of cryptography. Data protection is the main objective of both systems. We utilised encryption to transform plain text into ciphertext. Decryption, which works the other way around from encryption, is the process of converting encrypted text back into plain text. By using a finite state machine and the LU decomposition method, the created encryption solution ensures data secrecy for safe communication. In our suggested approach, we additionally employ lower and upper triangular matrices, which are obtained by decomposing a square matrix. During encryption, the key will be a lower triangular matrix modulated by a prime number, and during decryption, an upper triangular matrix modulated by a prime number. The tactic is beneficial. This tactic is helpful in sectors such as finance and military services where confidential material must be delivered.


Introduction
Cryptography relies heavily on encryption and decryption. Both tactics are primarily used to protect data. To convert plain text to encrypted text, we use an encryption technique. In the opposite direction of encryption, decryption is the process of transforming encrypted text into plain text. [1,2]. Someone who works with encryption and decoding is referred to as a "cryptographer." When a user possesses a certain piece of concealed knowledge, information is identified. A key is the hidden information that is transferred to the receiver. In cryptography, the encryption process is the process of safely converting data from one form to another. As a result, ciphertext is the value of encryption, because it cannot be read by unauthorised individuals. Encryption protects data stored on a computer system or transmitted over the internet. The most critical part of any encryption is the encryption key. The two types of keys are public and private keys. In the encryption and decryption operations, both keys are used. Public keys are available to everyone, but private keys must be kept private [3]. The key size is proportional to the encryption strength. As a result, breaking encrypted data gets increasingly harder as the key size increases. Decryption is the process of transforming encrypted text into text that our computer can read and comprehend. Decryption is the manual process of decrypting data using the necessary codes or keys. Without the secret key, decoding data is exceedingly difficult. We will get the original text after decoding. Automata theory has several applications in the field of cryptography. Deterministic finite automaton (DFA )is a field of Theory of Computation which is based on Automata. For every given string character input, a finite state machine creates a unique encoded string. The words "deterministic" and "uniqueness of computation" are synonymous. On a comparable input symbol, non-deterministic finite automata allow for zero, one, or many transfers from one state to another. If S is a non-empty collection of k,j,l states, then the outcome is an element of S for deterministic automata and a subset of S for nondeterministic automata. A finite state machine is therefore an algorithm with a fixed count of states and transitions. Nowadays, this technique is widely used in cryptography to encode data and ensure data privacy.

a. Vernam Cipher and secret key cryptography
Vernam Cipher is a cryptographic encryption algorithm. It is one of the transposition methods used to convert plain strings to an encrypted string. In this strategy, we allot a number to each character in the normal-Text.

Method for obtaining a key:
In the Vernam cypher algorithm, we use a key to encrypt the strings, and the key's length should be the same as the string's length.

Algorithm for Encryption:
1. Assign a numerical value to each count in the string. 2. Add the two numbers together.
3. If the extra integer is larger than 26, deduct the integer from 26; else you are good to go.

b. Finite Automaton Public Key Cryptosystems:
Finite automata are the foundations of language-theoretic cryptosystems. The vast majority of cryptosystems based on language and word issues are either unsafe or fail to fulfil the cryptographic signature prosperity criteria. Automata-based cryptosystems are divided into three categories: transducers, cellular automata, and acceptors. In this study, we explore the benefits and drawbacks of popular finite automata-based cryptosystems such as FAPKC, Gysin, Wolfram, Kari, Dmsi's cryptosystems [4,5].
Any cryptosystem must adhere to two fundamental principles: secrecy and authenticity. These two concepts provide a dilemma for the symmetric cryptosystem. The difficulty with confidentiality in symmetric cryptography is that, as we all know, a secret key is used to both convert and decode the communication. As a result, this key must be interchanged by both communication parties in some way, or they must depend on a third organisation, such as a key allocation centre, to allocate the key [6].
However, depending on a third organisation jeopardises the secret key's confidentiality. In public key cryptography, each user must produce a pair of keys, one of which is kept hidden and is known as a private key, while the other is made public and is known as a public key. It is entirely up to the program whether the original communication can be encrypted using the giver's secret key or the beneficiary's public key.

c. Cellular automata and cryptography
Cellular automata are dynamic with distinct attributes. This algorithm consists of a sequence of cells, and which are updated in sequential manner with random time. Cellular Automata is a distinct computing paradigm that gives an easy, extensible, and effective platform for revitalising large systems and executing sophisticated computations based on evidence from the surroundings [11,12]. CA is made up of two parts. 1) a collection of cells and 2) a set of regulations.

Problem Statement
With the growing influence of the internet in terms of communication and e-commerce, data security is becoming increasingly important. The data security can be provided by various encryption techniques. These techniques use various algorithms to make the encryption and decryption more secure. The goal of this project is to provide a novel encrypting system that makes use of a FSM and recurrence matrix.

Literature Review
The paper It also proposes a different criterion for a specific type of automaton. The authors S. Nandi, B.K. and Chaudhari offer a system in their study [5], by discussing the theory and applications of Cellular Automata for a class of block and stream ciphers. Analytically, the authors demonstrated that cellular automata using XNOR rules may create an alternating group. In this Paper [6], The writers use computer theory tools for encryption and decryption. Encryption is done using an encryptor formed by using a Turing machine and Decryption using a decryptor. Paper [7], was written by Umesh Prasad , Sahu Madhusmita. This study offers a novel block cipher encryption and decryption procedure based on the principles of nonlinear and linear cellular automata. The article [8], by Harsh Bhasin, Ramesh Kumar, and Neha Kathuria provides a Cellular Automata and Genetic Method-based encryption algorithm. The approach has been deployed, and preliminary results show that it is capable of competing with AES. The authors created a producer to produce numbers arbitrarily using a unidimensional type of extended automata. [9] In the [10], the writers proposed a new graphic symmetric cryptosystem to encode coloured pictures defined by pixels and many other colours in their paper. This cryptosystem employs a pseudo random bit generator and is based on bi-dimensional cellular-automata. Study of Cellular Automata Applications by Kumaresan and Gopalan used numerous examples and examined the fundamental ideas of several functions of automata which discusses their uses in this field. [11] We reviewed a paper in which the authors researched about one dimensional cellular automata and used a genetic model to see protocols of cellular automata cells resulting in sequences matching for symmetric key cryptography. [12]

ethodology 4 M
The following algorithm works in a way such that no one can decrypt the ciphertext without knowing the private key and automata machine used. The following table shows the conversion of alphabets/characters to specific numerical values.

Table I Character conversion Table[1]
Encryption : 1. Take the String input as plain text. Encode each character according to the table. Split the plain text into x number of characters, and then position them into a matrix of order x, where x is greater than 0. This square matrix is called a plain matrix. 2. Get the input for the machine by adding all the numbers of the plain matrix and converting the final result into binary form. This input is the secret key too. 3. Create a Finite state machine. For this project we have used the "Mealy machine". 4. The recurrence matrix will be used to build the key matrix. 5. The formula for calculating the encrypted text matrix is: Encrypted matrix at ti+1th state = Encrypted matrix at ti th state (Key) (result at ti+1th state)(mod p). 6. Using the above formula calculate the cipher text matrix for all plain text matrices, at each stage. 7. Finally, reconvert the numbers of the last encrypted matrix into alphabets or characters. Lastly, send this encrypted text to the receiver Decryption : 1. The encrypted text, matrix, private key and FSM are sent to the recipient. 2. Conversion of each symbol into corresponding value using the above table.
3. The decrypted matrix is calculated by considering the inverse of the key matrix and doing calculations based on this key matrix. This decrypted matrix is obtained at each step.

Table 2. Cipher matrix at each state
As shown in the table we have 8 states according to the key matrix binary conversion. We gave this binary string as input to the Mealy machine of modulus 5 and the output of the Mealy machine is used as the power of matrix in encryption and decryption algorithm. The last column of the cipher matrix is calculated at each state by using the formula: Encrypted matrix at ti+1th state = Encrypted matrix at ti th state (Key) (result at ti+1th state)(mod p). Now this cipher(encrypted) matrix is used as the input matrix for the next state and with the output of the Mealy machine at that specific state we calculate the cipher matrix at that specific state. The cipher matrix at last state is the final encrypted matrix which is used to encrypt the string. Therefore , Reconverting the resultant matrix into character string with the help of the character conversion table , we get the following encrypted string.
The encrypted string is : XPP@AANLAVFMAANL

Future Scope 5
Although the fate of cryptography is unknown, one thing is certain: cryptography will continue to evolve and progress. Cryptography can be used in various sectors -Banking and Military services. Hence, data encryption and decryption becomes important. The algorithm of the encryption technique can be made even stronger to prevent malicious attacks. The proposed system works well for encrypting and decrypting short text messages. The system can be optimised for long text messages. The number of special characters considered in the proposed system are limited. This number of special characters can be increased so that the system becomes more efficient.

Conclusion 6
The proposed approach is based on several matrix operations and a FSM. The selected FSM, recurrence matrix, other matrix operations and secret key all contribute to the security. Although extracting original information from encrypted text is challenging, a method exists. This study proposes two optimization targets to define greater algorithm efficiency: the fewest ciphertext pairings and the minimum computational complexity. We provide the related optimum key recovery algorithms with varied optimization orders of these two goals.