Next Article in Journal
Response Spectrum Analysis of Multi-Story Shear Buildings Using Machine Learning Techniques
Previous Article in Journal
Fast Operation of Determining the Sign of a Number in RNS Using the Akushsky Core Function
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient Algebraic Method for Testing the Invertibility of Finite State Machines

ANISSE Research Team, Department of Computer Science, Faculty of Sciences, Mohammed V University in Rabat, Rabat BP 1014, Morocco
*
Author to whom correspondence should be addressed.
Computation 2023, 11(7), 125; https://doi.org/10.3390/computation11070125
Submission received: 18 May 2023 / Revised: 20 June 2023 / Accepted: 24 June 2023 / Published: 28 June 2023
(This article belongs to the Section Computational Engineering)

Abstract

:
The emergence of new embedded system technologies, such as IoT, requires the design of new lightweight cryptosystems to meet different hardware restrictions. In this context, the concept of Finite State Machines (FSMs) can offer a robust solution when using cryptosystems based on finite automata, known as FAPKC (Finite Automaton Public Key Cryptosystems), introduced by Renji Tao. These cryptosystems have been proposed as alternatives to traditional public key cryptosystems, such as RSA. They are based on composing two private keys, which are two FSMs M 1 and M 2 with the property of invertibility with finite delay to obtain the composed FSM M = M 1 o M 2 , which is the public key. The invert process (factorizing) is hard to compute. Unfortunately, these cryptosystems have not really been adopted in real-world applications, and this is mainly due to the lack of profound studies on the FAPKC key space and a random generator program. In this paper, we first introduce an efficient algebraic method based on the notion of a testing table to compute the delay of invertibility of an FSM. Then, we carry out a statistical study on the number of invertible FSMs with finite delay by varying the number of states as well as the number of output symbols. This allows us to estimate the landscape of the space of invertible FSMs, which is considered a first step toward the design of a random generator.

Graphical Abstract

1. Introduction

For centuries, cryptography has been used to ensure the privacy of sensitive information. Its evolution has been closely tied to military communication throughout history. However, in the Information Age, there is a growing demand for secure communication in both commercial and personal contexts. Before the introduction of public key cryptography, all ciphers relied on a shared secret key, meaning that both parties needed the same key to encrypt and decrypt messages. This requirement for exchanging a secret key beforehand became a crucial step in enabling secure communication.
The emergence of public key cryptosystems brought about a revolutionary change in the field of cryptography by streamlining the distribution of keys. Unlike traditional methods that involve sharing secret keys, this new approach allowed users to share their public key with others. The public key could be used by the sender to encrypt the message, but it could not be utilized for decryption. Instead, the recipient possessed a corresponding private key that remained confidential, and they used this key to decrypt the message. This breakthrough eliminated the need for key exchange and simplified the encryption process significantly.
The concept of public key cryptography was first proposed in 1976 by Hellman, Diffie, and Merkle. Two years later, Shamir, Rivest, and Adleman developed the RSA cryptosystem, which relies on the challenge of factoring large numbers. In 1985, Taher ElGamal introduced the ElGamal cryptosystem, which is based on the discrete logarithm problem. Additionally, in that same year, Victor Miller and Neal Koblitz separately introduced elliptic curve cryptography, which utilizes the discrete logarithm problem on elliptic curves. Elliptic curves, despite being more complex mathematically, offer faster operation and smaller key sizes while maintaining a similar level of security to other cryptosystems based on number theory problems. However, these systems are dependent on a small set of problems, making them potentially vulnerable.
In the late 1970s, Renji Tao and his research group proposed a series of Finite Automata Public Key Cryptosystems (FAPKCs) [1,2,3]. These systems utilize the challenge of inverting nonlinear Finite State Machines (FSMs) and factoring matrix polynomials over a field, instead of relying on number theory problems. FAPKCs have several advantages, including small key sizes, fast encryption and decryption processes, and the ability to be used for digital signatures. Furthermore, they can be implemented efficiently using logical operations, making them suitable for embedded hardware applications [2].
The private keys in FAPKCs are represented by two FSMs with memory, as shown in Figure 1. One is linear and the second is quasilinear [4]. These FSMs are combined using a special product in order to generate a nonlinear FSM, which is the public key. Currently, there is no known algorithm to invert nonlinear FSMs or factorize them, which remains an open problem. To invert the FSM public key, it is necessary to compute the inverses of its factors, a task made straightforward using the private key FSMs. Variants of FAPKCs exist, which differ in terms of the types of FSMs employed in private keys [5].
Although some FAPKC schemes have been shown to be insecure [6], they are still considered a viable alternative to traditional cryptosystems. However, the study of FAPKCs has been hindered by the use of dry language in many papers, with results often lacking proofs and examples and referencing Chinese papers. Amorim et al. provided clarification and consolidation of existing research about FAPKCs in a series of papers [7,8,9,10] and a PhD thesis [4].
The invertibility of FSMs is a crucial concept in formal language theory and automata theory. Inverting a machine enables the reversal of its operation, which has numerous applications in various fields. In addition to cryptography, where FSMs are used as the basic concept for FAPKCs, the invertibility of FSMs has a broad range of applications that improve the performance of various systems. For example, they can be used to design systems that regulate and stabilize the behavior of complex systems [11], and they enable the reconstruction of original data from extracted features in pattern recognition [12]. In automata learning [13], they can generate counterexamples that guide the learning process.
To advance the development of efficient and secure cryptosystems, it is crucial to examine the space of invertible FSMs that serve as keys to FAPKCs. This investigation involves the study of the properties and behavior of these automata. By understanding the characteristics of these keys, cryptographers can design better algorithms and protocols that are more resistant to attacks and can protect sensitive information.
In [5], R. Tao introduced the concept of invertibility and weak-invertibility, also called injectivity, for various classes of FSMs. The invertibility property of an FSM M implies that if it generates identical output sequences for two given input sequences, regardless of their initial states, then the first input symbols of the two input sequences will also be identical. On the other hand, weak-invertibility ensures that if an FSM M produces identical output sequences for two given input sequences that originate from the same initial state, then the first input symbols of these sequences will also be identical. Therefore, it can be stated that if an FSM is invertible, it is also weak-invertible. The procedure to check these properties, as described by Tao [5], is based on the structure of the testing graph. By examining it, one can determine the invertibility and weak-invertibility of an FSM. A limitation arises when dealing with testing graphs that have a large number of vertices. Due to the increased complexity, it becomes crucial to employ a more efficient algorithm for determining whether the graph is loop-free. Our research aims to address this limitation by presenting a novel method that offers a computationally feasible solution for this task.
Building upon the work suggested by Amorim et al. [4,14], this study aims to further explore the landscape of invertible FSMs by presenting an approximate analysis of a general case. The research conducted by Amorim et al. focused on Linear FSMs, specifically investigating the statistical properties and count of weak-invertible (injective) Linear FSMs. Their study centered on the analysis of matrices, particularly the invariant factors of the transfer function matrix H ( z ) associated with linear FSMs. The results obtained from their research provided insights on the estimatation of the key space size of weak-invertible FSMs in cryptographic systems as well as on recurrence relations for counting canonical linear FSMs and approximating equivalence classes.
In contrast, our study introduces an efficient algebraic method to test the invertibility of FSMs with a finite delay, encompassing a broader scope beyond linear FSMs. By conducting experiments and analyzing invertible FSMs for general cases, we aim to provide a comprehensive understanding of their capabilities and limitations. Our research serves as a complementary contribution to the existing work by Amorim et al., as we delve into nonlinear FSMs and address the problem of invertibility in a more encompassing manner. The insights gained from our study highlight the promising potential of invertible FSMs as practical alternatives for secure key generation and cryptographic applications.
This paper is structured as follows: In Section 2, we introduce some preliminary notations and the basic definitions of Finite State Machines and graphs. In Section 3, we give a concise overview of the concept of invertibility with finite delay of Finite State Machines. In Section 4, we present a new efficient algebraic method for testing the invertibility of FSMs as well as several experimental results that allow us to give an estimation of the landscape of their space. Section 5 concludes the paper.

2. Preliminaries

In this paper, we present preliminary concepts and key findings on the topic of Finite State Machine (FSM) invertibility.
An alphabet A is a finite set of symbols where | A | . A word α over A is a finite sequence of symbols of length l.
The empty sequence, denoted by ϵ , represents a word of length l = 0 . We define A n as the set of words of length n, where n N 0 . Thus, A 0 = { ϵ } . Furthermore, A * denotes the set of all finite words, obtained by the union of A n for n 0 . Additionally, A ω represents the set of infinite words, composed of symbols a 0 a 1 a n , where a i A .

2.1. Finite State Machines

Finite State Machines (FSMs) have found widespread use as models for various types of systems in fields, such as sequential circuits, program development (e.g., lexical analysis and pattern matching), and communication protocols [15,16,17,18]. In this paper, we specifically focus on Mealy machines, which are deterministic machines that generate outputs during state transitions after receiving inputs.
Definition 1.
A Finite State Machine is represented by a quintuple X , Y , S , δ , λ , where X denotes the input alphabet, Y denotes the output alphabet, S denotes the set of states, δ : S × X S defines the state transition function, and  λ : S × X Y represents the output function.
Let M = X , Y , S , δ , λ be a Finite State Machine (FSM). The state transition function δ and the output function λ can be extended to finite words in X * recursively using the following definitions:
  • δ ( s , ϵ ) = s
  • λ ( s , ϵ ) = ϵ
  • δ ( s , x α ) = δ ( δ ( s , x ) , α )
  • λ ( s , x α ) = λ ( s , x ) λ ( δ ( s , x ) , α )
where s S , x X , and  α X * . Similarly, the output function λ can be extended to infinite words in X ω . From these definitions, it follows that for any s S , α X * , and  β X * X ω , the output of λ for x β can be computed as λ ( s , x β ) = λ ( s , α ) λ ( δ ( s , α ) , β ) .
Example 1.
The Finite State Machine M 1 = { a , b } , { 0 , 1 } , { s 1 , s 2 } , δ , λ with:
δ ( s 1 , a ) = s 1 δ ( s 1 , b ) = s 2 δ ( s 2 , a ) = s 1 δ ( s 2 , b ) = s 2
λ ( s 1 , a ) = 0 λ ( s 1 , b ) = 0 λ ( s 2 , a ) = 1 λ ( s 2 , b ) = 1
  • is represented by the diagram in Figure 2.

2.2. Graphs

Let G = ( V , Γ ) be a directed cycle-free graph, where V represents the vertex set, and Γ V × V denotes the arc set. If V is an empty set, the graph is referred to as an empty graph. The elements in V are referred to as vertices, while the elements in Γ are referred to as arcs. Let v V :
-
If v is isolated, then L e v e l ( v ) = 1 .
-
If v has no incoming arc and it has at least one outgoing arc, then L e v e l ( v ) = 0 .
-
If v has at least one incoming arc and at least one outgoing arc, then L e v e l ( v ) = Maximum { L e v e l ( v ) | ( v , v ) Γ } + 1 .
-
The level of the graph G is L e v e l ( G ) = Maximum { L e v e l ( v ) | v V } 1 .
-
If G is the empty graph, then L e v e l ( G ) = 2 .
Example 2.
Computing the level of a directed cycle-free graph (Figure 3)
The level of this graph is 1.
Remark 1.
Let G be a cycle-free directed graph of level l. Then, the maximum length of a path in G is l + 1 .

3. The Concept of Invertibility of Finite State Machines

In this section, we recall the concept of invertibility with finite delay τ of an FSM, where τ N , as well as the classical testing method based on graph theory for the invertibility property of an FSM. For more details, refer to [5].

3.1. The Invertibility with Finite Delay of an FSM

An FSM is said to be invertible if for any state in the set of states and any output sequence, the input sequence that produced the output sequence can be uniquely determined. An FSM M = X , Y , S , δ , λ is considered invertible with some delay τ if, for any state s S and any sequence of input symbols x 0 , x 1 , . . . , x τ X * , the output sequence λ ( s , x 0 . . . x τ ) Y * , generated by M , uniquely determines the input symbol x 0 . This means that if M produces identical output sequences for a given two input sequences, then their first input symbols are also identical. The delay τ is a non-negative integer that represents the number of input symbols used to determine the output symbol. The formal definitions of both are as follows:
Definition 2.
A Finite State Machine M = X , Y , S , δ , λ is considered to be invertible if
s , s S , α , α X ω , λ ( s , α ) = λ ( s , α ) α = α .
This means that for every pair of states s , s S and every pair of infinite words α , α X ω , if the output generated by the FSM is the same for both state–input pairs, i.e.,  λ ( s , α ) = λ ( s , α ) , then the infinite words α and α must be identical.
Definition 3.
A Finite State Machine M = X , Y , S , δ , λ is considered to be τ-invertible or invertible with finite delay τ, where τ N , if 
s , s S , x i , x i X with i = 0 , 1 , . . . , τ , if  λ ( s , x 0 x 1 . . . x τ ) = λ ( s , x 0 x 1 . . . x τ ) , then x 0 = x 0 .
This implies that for any pair of states s , s S and any sequence of inputs x i X with i = 0 , 1 , . . . , τ , if the outputs generated by the FSM are the same for both state–input sequences, i.e.,  λ ( s , x 0 x 1 . . . x τ ) = λ ( s , x 0 x 1 . . . x τ ) , then the initial inputs x 0 and x 0 must be identical.
It is evident that if M is invertible with a delay of τ N , then M is also invertible. The reverse statement is also true (refer to [5]).
Example 3.
Let us consider the FSM M 1 presented in Example 1. M 1 is invertible with a delay of 1, since we have for all input sequences of length 2:
λ ( s 1 , a a ) = 00 λ ( s 2 , a a ) = 10 λ ( s 1 , b a ) = 01 λ ( s 2 , b a ) = 11
λ ( s 1 , a b ) = 00 λ ( s 2 , a b ) = 10 λ ( s 1 , b b ) = 01 λ ( s 2 , b b ) = 11
Example 4.
The FSM M 2 = { a , b } , { 0 , 1 } , { s 1 , s 2 , s 3 } , δ , λ induced by the diagram M 2 in Figure 4 is not invertible with a delay of 1, since λ ( s 2 , a b ) = λ ( s 3 , b b ) and a b .
Example 5.
The FSM M 3 = { a , b } , { 0 , 1 , 2 } , { s 1 , s 2 , s 3 } , δ , λ induced by the diagramis invertible with a delay of 1 (Figure 5). To prove this, we have to compute the outputs for all states with all input sequences of l = 2 :
λ ( s 1 , a a ) = 00 λ ( s 2 , a a ) = 12 λ ( s 3 , a a ) = 22
λ ( s 1 , a b ) = 00 λ ( s 2 , a b ) = 12 λ ( s 3 , a b ) = 22
λ ( s 1 , b a ) = 01 λ ( s 2 , b a ) = 11 λ ( s 3 , b a ) = 20
λ ( s 1 , b b ) = 01 λ ( s 2 , b b ) = 11 λ ( s 3 , b b ) = 20

3.2. Graph-Based Method for Testing the Invertibility of an FSM

Let us recall some important properties of the invertibility with finite delay of an FSM, as well as the classical method for testing these properties.
Let M = X , Y , S , δ , λ be an FSM. Let us define the testing graph G M i n v = ( V , Γ ) of M as follows:
R i n v = { ( δ ( s , x ) , δ ( s , x ) ) | x x , λ ( s , x ) = λ ( s , x ) , x , x X , s , s S } .
(a)
if R i n v , then:
- The vertex set V of G M i n v is the minimal subset of S × S , which verifies:
(a)
R i n v V ,
(b)
if ( s , s ) V and λ ( s , x ) = λ ( s , x ) , x , x X , then ( δ ( s , x ) , δ ( s , x ) ) V .
- The arc set Γ of G M i n v is the set of all arcs ( ( s , s ) , ( δ ( s , x ) , δ ( s , x ) ) , such that:
(a)
( s , s ) V ,
(b)
λ ( s , x ) = λ ( s , x ) , where x , x S .
(b)
if R i n v = then G M i n v is the empty graph, G M i n v = { , } .
In other words, the graph G M i n v is constructed by forming a graph of the state transitions and output values based on the conditions described above. The vertices in the graph represent pairs of states that have the same output value for any input symbol, and the arcs represent the transition from one pair of states to another pair of states with the same output value. The graph is constructed to minimize the number of vertices and to satisfy the conditions for the vertices and arcs as described in the conditions.
Theorem 1
(Theorem 1.4.1, [5]). Let M be a Finite State Machine. M is invertible if and only if G M i n v has no circuit. Moreover, if  G M i n v has no circuit and the level of G M i n v is ρ 1 , then M is invertible with a delay of ρ + 1 and not invertible with a delay of τ for any τ ρ .
Corollary 1.
If M = X , Y , S , δ , λ is invertible, then τ | S | ( | S | 1 ) 2 exists, such that M is invertible with a delay of τ.
Example 6.
Let us define the testing graph of M 2 defined in Example 4.
R i n v is the set of pairs of states ( s , s ) that have the same output value for any two distinct input symbols, a and b. It is calculated by applying the transition function δ and the output function λ to each state s and to the input symbols a and b.
R i n v = { ( δ ( s 1 , a ) , δ ( s 1 , b ) ) , ( δ ( s 2 , a ) , δ ( s 2 , b ) ) , ( δ ( s 2 , a ) , δ ( s 3 , b ) ) , ( δ ( s 2 , b ) , δ ( s 3 , a ) ) , ( δ ( s 3 , a ) , δ ( s 3 , b ) ) } R i n v = { ( s 1 , s 2 ) , ( s 3 , s 1 ) , ( s 2 , s 3 ) , ( s 3 , s 3 ) }
V is the vertex set of the graph G M i n v . It is a minimal subset of the set of state pairs ( s , s ) that have the same output value for any input symbol. To form V, we start with R i n v and keep adding state pairs that have the same output value and are reachable from other state pairs in V. Using the information provided in the example and R i n v :
V = { ( s 2 , s 3 ) , ( s 2 , s 1 ) , ( s 3 , s 3 ) , ( s 2 , s 2 ) , ( s 3 , s 1 ) }
Γ is the arc set of the graph G M i n v . It consists of all arcs connecting pairs of state pairs ( s , s ) that have the same output value for any input symbol. To form Γ, we connect each state pair ( s , s ) in V to its reachable state pairs that have the same output value:
Γ = { ( ( s 2 , s 3 ) , ( s 2 , s 3 ) ) , ( ( s 2 , s 3 ) , ( s 2 , s 1 ) ) , ( ( s 2 , s 3 ) , ( s 3 , s 3 ) ) , ( ( s 2 , s 3 ) , ( s 2 , s 2 ) ) , ( ( s 2 , s 3 ) , ( s 3 , s 1 ) ) , ( ( s 3 , s 3 ) , ( s 3 , s 1 ) ) , ( ( s 3 , s 3 ) , ( s 3 , s 3 ) ) }
Note that this is the set of arcs connecting the state pairs in V. The graph G M 5 i n v is represented by:
Computation 11 00125 i001
The testing graph G M 2 i n v has a circuit; therefore, it is not invertible.
Example 7.
The FSM M 5 = { a , b } , { 0 , 1 , 2 } , { s 0 , s 1 , s 2 } , δ , λ is represented by the following diagram:
Computation 11 00125 i002
The graph G M 5 i n v can be constructed as follows:
R i n v = { ( s 0 , s 1 ) , ( s 1 , s 2 ) }
V = R i n v
Γ = { ( ( s 1 , s 2 ) , ( s 0 , s 1 ) ) }
Computation 11 00125 i003
The graph G M 5 i n v is loop-free, and the maximum length of a path is 1; therefore, M 5 is invertible with a delay of τ = 2 .
When the number of vertices is very large in a testing graph G i n v , it is important to have a more efficient algorithm to decide whether it is loop-free. In the next section, we present one such algorithm that can be easily executed by a computer.

4. A New Algebraic Method for Testing the Invertibility of FSMs

In this section, we introduce an efficient algorithm for testing and computing the delay of invertibility of a given FSM. We also conduct some experiments in order to produce an estimation of the landscape of the set of invertible FSMs. Our method is based on the notion of the testing table, instead of the testing graph of an FSM, which allows us to conduct a fast test using iterative zero-matrix reduction.

4.1. Algebraic Method for Testing the Invertibility of an FSM

The major tools used in the proposed method are the testing table and its corresponding connection matrix.
Definition 4.
The testing table T M i n v : ( S × S ) × Y S × S associated with an FSM M = X , Y , S , δ , λ is an application defined by two steps, as follows:
  • T M i n v ( ( s , s ) , y ) = ( δ ( s , x ) , δ ( s , x ) ) , such that λ ( s , x ) = λ ( s , x ) = y and x x , for all x , x X .
  • for all ( s , s ) I m g ( T M i n v ) , we define: T M i n v ( ( s , s ) , y ) = ( δ ( s , x ) , δ ( s , x ) ) , such that λ ( s , x ) = λ ( s , x ) = y , for all x , x X .
Note that, in Definition 4, we consider ( s , s ) = ( s , s ) for all s , s S . Then, the testing table has | S | ( | S | + 1 ) 2 rows and | Y | columns. To simplify the notation, in the next section, we note that ( s , s ) = s s .
By construction, the testing table is defined in two steps. First, the table entries are the successor’s pairs of states of a given pair of states’ row index if they have outgoing transitions with the same output symbol and different input symbols. Then, from the resulting pairs of states in the first step, the testing table entries are completed by the set of their successor’s pairs if they have outgoing transitions with the same output symbol.
Definition 5.
The connection matrix C M i n v associated with a testing table T M i n v of an FSM M is an N × N matrix, where N = | S | ( | S | + 1 ) 2 , whose rows and columns are labeled by the set of pair of states and the ( ( s 0 , s 0 ) , ( s 1 , s 1 ) ) th entry is 1 if y Y exists, such that T M i n v ( ( s 0 , s 0 ) , y ) = ( s 1 , s 1 ) , or 0 otherwise.
Based on its connection matrix, the checking of the invertibility of an FSM is performed with Algorithm 1.
Here is a step-by-step description of the testing algorithm:
  • Construct the corresponding connection matrix based on the testing table.
  • Delete all rows that consist of only zeroes in every position, and remove the corresponding columns. If there are no rows with all zeroes, proceed to step 4.
  • Repeat step 2 until there are no more rows with all zeroes.
  • If the matrix still has rows or columns remaining after the iterations, this indicates that the graph G M i n v is not loop-free; otherwise, if the matrix has completely vanished, it means that the graph G M i n v is loop-free.
Algorithm 1: Reduction of a connection matrix.
Computation 11 00125 i004
From a given connection matrix of a testing table of an FSM Algorithm 1 eliminates all rows that consist entirely of zeroes as well as their corresponding columns and repeats this process until no more rows can be eliminated. If the resulting matrix is empty (i.e., it has no rows or columns), the FSM M associated with the input connection matrix is invertible.
It is important to note that if there are two or more rows in the matrix that contain only zeroes in all of their positions, then these rows and their corresponding columns must be removed together, and this procedure will be counted as a single iteration.
In summary, the algorithm checks for rows of zeroes in the matrix and removes them, updating the matrix until no more rows of zeroes are found. The number of iterations required to remove all rows of zeroes represents the finite delay τ . If the matrix has vanished, then M is invertible with a finite delay τ ; otherwise, it is not invertible. (A “vanished” matrix has no columns or rows.)
Example 8.
Let us consider the FSM M 5 defined in Example 7. The testing table in Table 1 of M 5 is as follows:
The corresponding connection matrix is as follows:
    s 1 s 1 s 1 s 2 s 2 s 2 s 0 s 1 s 1 s 1 s 1 s 2 s 2 s 2 s 0 s 1 ( 0      0      0      0 0      0      0      1 0      0      0      0 0      0      0      0 )
In this matrix, the rows and columns are labeled with the state pairs. The cells of the matrix represent the output symbol associated with the transition from the current state pair to the next state pair. The output symbol is represented by 0 or 1, where 0 represents no transition and 1 represents a transition.
First, we remove the rows labeled s 1 s 1 , s 2 s 2 , s 0 s 1 and their corresponding columns. After that, we repeat the application of this step, which will result in the deletion of the row labeled s 1 s 2 .
    s 1 s 1 s 1 s 2 s 2 s 2 s 0 s 1 s 1 s 1 s 1 s 2 s 2 s 2 s 0 s 1 ( 0      0      0      0 0      0      0      1 0      0      0      0 0      0      0      0 ) s 1 s 2 s 1 s 2 ( 0 )
The next step results in the matrix disappearing entirely. Consequently, M 5 is invertible with a delay of τ = 2 , as is already shown in Example 7.
Theorem 2.
Algorithm 1 checks the invertibility of an FSM M = X , Y , S , δ , λ and computes its delay in a time period of O ( | S | 4 ) .
Proof. 
Let us consider an FSM M . Suppose that M is not invertible and Algorithm 1 produces an empty connection matrix. By the construction of the connection matrix C M i n v , there are rows indexed by the pairs of states s s from step 1 in the corresponding testing table. This means that x , x X exists, such that λ ( s , x ) = λ ( s , x ) and x x . Since M is not invertible, two input sequences α = x x 0 x n X ω and α = x x 0 x n X ω exist, such that λ ( s , α ) = λ ( s , α ) . Suppose now that δ ( s i , x i ) = s i + 1 , δ ( s i , x i ) = s i + 1 and δ ( s n , x n ) = s 0 δ ( s n , x n ) = s 0 , for all 0 i < n . We have
  • C M i n v [ s s ] [ s 0 s 0 ] = 1 and C M i n v [ s n s n ] [ s 0 s 0 ] = 1 ,
  • C M i n v [ s i s i ] [ s i + 1 s i + 1 ] = 1 , for all 0 i < n .
The connection matrix is as follows:
   s 0 s 0   s i s i   s n 1 s n 1 s n s n s s s 0 s 0 s i s i s n 1 s n 1 s n s n (    1       0            0         0                                0       1            0         0                                0       0            1         0                                0       0            0         1    1       0            0         0 )
According to Algorithm 1, the ones are eliminated when the corresponding columns correspond to an empty row. In our case, the matrix cannot be reduced. Consequently, M is invertible.
To prove the sufficiency condition, assume that Algorithm 1 produces a nonempty matrix. Without a loss of generality, we can consider a produced matrix with the previous matrix form. Then, two input sequences α = x x 0 x n X ω and α = x x 0 x n X ω exist, such that for some s , s S , we have λ ( s , α ) = λ ( s , α ) and x x . Then, the associated FSM is not invertible.
The time complexity of Algorithm 1 depends on the number of rows in the connection matrix. Since there are | S | × ( | S | + 1 ) 2 rows and columns, Algorithm 1 runs in the worst case scenario of a time period of O ( | S | 4 ) . Thus, the Theorem is proved. □

4.2. Experimentation and Results

This section aims to present an estimation of the landscape of invertible FSMs through the proposed algebraic testing method and randomized statistical sampling.
Theorem 3.
The number of Finite State Machines with n states, i input alphabet symbols, and o output alphabet symbols is equal to ( n × o ) n × i .
Proof. 
Let us assume that we have an FSM with n states, i input alphabet symbols, and o output alphabet symbols. First, consider the input side of the FSM. There are i possible input symbols and n possible states. Since the FSM is complete, for each state, there must be a transition defined for every input symbol in the alphabet. Therefore, the number of possible transitions from each state is equal to n i . Therefore, there are n ( i × n ) possible transition tables for the input side of the FSM. Next, consider the output side of the FSM. There are o possible output symbols that can be associated with each transition in the input side of the FSM. Therefore, there are o i × n possible transitions for each state in the output side of the FSM. Finally, to determine the total number of FSMs, we need to consider all possible combinations of transitions with input symbols and output symbols. Thus, the total number of possible FSMs is ( n × o ) n × i . □
Table 2 summarizes the total number of considered FSMs in our experiments when i = 2 for a different number of states n and output alphabet size o in { 2 , , 5 } .
It should be noted that we consider the input symbols to be in the binary alphabet, since real-world data are typically encoded in binary format.
The algorithm described in this paper was implemented in Java, and its detailed description is available in the repository [19]. A series of experiments were conducted using these implementations, which led to significant findings.
We exhibit the number of τ -invertible classes for i = 2 and a given value of o { 2 , . . . , 8 } , while the n and τ range are { 2 , . . . , 20 } and { 0 , . . . , 8 } , respectively.
For each triple of structural parameters i, o, and n, we uniformly and randomly generated a sample of 20000 FSMs. We computed the number of τ -invertible FSMs in these samples.
The graphs presented in Figure 6 represent the number of τ -invertible FSMs that can be built with a certain number of states and output symbols. They were generated using the approximate values obtained from the tables in Appendix A.
The x-axis shows the number of states, ranging from 2 to 20, and the y-axis shows the number of output symbols, ranging from 2 to 8. The z-axis represents the number of invertible FSMs that can be constructed for each combination of a number of states and output symbols. The surface plot shows a peak where the number of invertible FSMs is the highest. The plot shows that the number of invertible FSMs generally increases with the number of states and outputs. However, the rate of increase appears to decrease as the number of states and output symbols increases.
Overall, these plots provide a clear visualization of the relationship between the number of states, number of outputs, and number of invertible FSMs, with the peak indicating the most favorable conditions for constructing invertible FSMs.
The heatmap in Figure 7 shows the number of invertible FSMs for different combinations of the number of states and output symbols when the number of input symbols is fixed at 2.
The number of states is presented on the y-axis, while the number of output symbols is presented on the x-axis. The cells of the heatmap represent the total number of invertible FSMs for the corresponding combination of the number of states and output symbols.
From the heatmap, the main observation is that there is an increase in the number of invertible FSMs when the number of states n is much smaller than the number of output symbols o i.e., n < < o . This is principally due to the fact that an increase in the number of output symbols expands the number of potential transitions between states, consequently leading to a higher number of possible FSMs. Conversely, as the number of states rises relative to the number of outputs, the heatmap demonstrates that the number of invertible Finite State Machines decreases. Notably, when the number of states greatly exceeds the number of outputs, the count of invertible FSMs reaches zero.
From various experiments involving the estimation of the landscape of invertible FSMs, it has been observed that the number of invertible FSMs can grow exponentially under certain conditions. This characteristic renders them a viable solution for creating efficient and lightweight keys that offer resistance to brute force attacks in any cryptosystem. Invertible FSMs have been shown to be a promising alternative to traditional cryptographic methods, and they can offer several advantages in terms of security, efficiency, and ease of implementation [20]. However, further research and testing may be necessary to fully explore the potential of invertible FSMs for different cryptographic applications.

5. Conclusions

The construction of invertible finite automata has two critical applications in the field of cryptography: Firstly, they are utilized to generate encryption and signature keys in FAPKCs. Secondly, they can be used to attack existing cryptographic systems based on finite automata theory. In this paper, we presented an efficient algebraic algorithm that allows us to check the invertibility of FSMs with some finite delay. Then, we presented an estimation of the landscape of invertible FSMs through some experiments conducted for general cases. Our study was conducted as suggested by [14] and shows that invertible FSMs are promising alternatives to conventional cryptographic methods and can potentially provide a practical solution for creating efficient and lightweight keys that offer resistance to brute force attacks. Overall, the study of the invertibility of finite FSMs is an active area of research with both theoretical and practical implications.

Author Contributions

Conceptualization, Z.L., H.K. and F.O.; Methodology, Z.L. and F.O.; Software, Z.L.; Validation, F.O.; Formal analysis, Z.L., H.K. and F.O.; Investigation, Z.L. and F.O.; Data curation, Z.L. and F.O.; Writing—original draft, Z.L.; Writing—review & editing, Z.L., H.K. and F.O.; Visualization, Z.L.; Supervision, H.K. and F.O.; Project administration, F.O. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1. Approximate number values for i = 2 and o = 2 .
Table A1. Approximate number values for i = 2 and o = 2 .
n τ = 0 τ = 1 τ = 2
2080
30710
40141
5010
6010
7000
8000
9000
10000
Table A2. Approximate number values for i = 2 and o = 3 .
Table A2. Approximate number values for i = 2 and o = 3 .
n τ = 0 τ = 1 τ = 2 τ = 3 τ = 4
20120000
39760136140
41921580252
56392560
604810
702300
800000
900000
1000000
Table A3. Approximate number values for i = 2 and o = 4 .
Table A3. Approximate number values for i = 2 and o = 4 .
n τ = 0 τ = 1 τ = 2 τ = 3 τ = 4 τ = 5 τ = 6 τ = 7 τ = 8
204290000000
3514242921100000
44582141682160100
5605342362207132921
633769739245220
71313221552410
8335740010
9200012300
10000010100
11000000000
12000000000
Table A4. Approximate number values for i = 2 and o = 5 .
Table A4. Approximate number values for i = 2 and o = 5 .
n τ = 0 τ = 1 τ = 2 τ = 3 τ = 4 τ = 5 τ = 6 τ = 7 τ = 8
207360000000
302168311400000
4421781766104192000
518207385564619441443
6722913811654213600
74787179844013421
822305049225211
911101224164121
10916354000
11301412200
12100100000
13100010000
14000000000
15000000000
Table A5. Approximate number values for i = 2 and o = 6 .
Table A5. Approximate number values for i = 2 and o = 6 .
n τ = 0 τ = 1 τ = 2 τ = 3 τ = 4 τ = 5 τ = 6 τ = 7 τ = 8
2012510000000
333436389900000
435273189210350000
5651578984234525200
6837487662567013610
7752915132095720121
845992421586417631
93417111803118441
1026124247234100
111331619113101
127011073130
13901312000
14200110000
15000000000
16000000000
Table A6. Approximate number values for i = 2 and o = 7 .
Table A6. Approximate number values for i = 2 and o = 7 .
n τ = 0 τ = 1 τ = 2 τ = 3 τ = 4 τ = 5 τ = 6 τ = 7 τ = 8
2014340000000
332962259200000
42737288858870000
56825971135248292000
69214021191295748310
7776758803116813300
8813055872687720310
9751213412045212300
1052361931265219820
11319111752911111
121924143236400
131912228161121
14100101285210
15506132100
16202401000
17100200000
18100100110
19000000000
20000000000
Table A7. Approximate number values for i = 2 and o = 8 .
Table A7. Approximate number values for i = 2 and o = 8 .
n τ = 0 τ = 1 τ = 2 τ = 3 τ = 4 τ = 5 τ = 6 τ = 7 τ = 8
2014890000000
324009327400000
42243538918090000
54834171295196334100
66622591369339619100
778128411973927619100
89563095735010521410
9913086313218416610
10791034102357322600
1161432631896316701
1242161331194218200
133410781003111010
141722940238110
15121202993000
1691121558200
17702432000
18300422100
19001211000
20100121000

References

  1. Tao, R.; Chen, S.; Chen, X. Fapkc3: A new finite automaton public key cryptosystem. J. Comput. Sci. Technol. 1997, 12, 289. [Google Scholar] [CrossRef]
  2. Tao, R.; Chen, S. A variant of the public key cryptosystem fapkc3. J. Netw. Comput. Appl. 1997, 20, 283–303. [Google Scholar] [CrossRef]
  3. Tao, R.; Chen, S. The generalization of public key cryptosystem fapkc4. Chin. Sci. Bull. 1999, 44, 784–790. [Google Scholar] [CrossRef]
  4. Amorim, I. Linear Finite Transducers towards a Public Key Cryptographic System. Ph.D. Thesis, Faculdade de Ciências da Universidade do Porto, Porto, Portugal, 2016. [Google Scholar]
  5. Renji, T. Finite Automata and Application to Cryptography; Springer: Chicago, IL, USA, 2008. [Google Scholar]
  6. Bao, F.; Igarashi, Y. Break Finite Automata Public Key Cryptosystem; Springer: Berlin, Heidelberg, 1995; pp. 147–158. [Google Scholar]
  7. Amorim, I.; Machiavelo, A.; Reis, R. Formal power series and the invertibility of finite linear transducers. In Proceedings of the Non-Classical Models for Automata and Applications, Fribourg, Switzerland, 23–24 August 2022; pp. 33–48. [Google Scholar]
  8. Amorim, I.; Machiavelo, A.; Reis, R. Counting equivalent linear finite transducers using a canonical form. In Proceedings of the 19th International Conference on Implementation and Application of Automata, CIAA 2014, Giessen, Germany, 30 July–2 August 2014; Springer: Berlin/Heidelberg, Germany, 2014; pp. 70–83. [Google Scholar]
  9. Amorim, I.; Machiavelo, A.; Reis, R. On the invertibility of finite linear transducers. Rairo-Theor. Inform. Appl. 2014, 48, 107–125. [Google Scholar] [CrossRef] [Green Version]
  10. Amorim, I.; Machiavelo, A.; Reis, R. Statistical study on the number of injective linear finite transducers. arXiv 2014, arXiv:1407.0169. [Google Scholar]
  11. Wagner, F.; Schmuki, R.; Wagner, T. Wolstenholme. Modeling Software with Finite State Machines: A Practical Approach; CRC Press: Boca Raton, FL, USA, 2006. [Google Scholar]
  12. Khotanzad, A.; Hong, Y.H. Invariant image recognition by Zernike moments. IEEE Trans. Pattern Anal. Mach. Intell. 1990, 12, 489–497. [Google Scholar] [CrossRef] [Green Version]
  13. Cassel, S.; Howar, F.; Jonsson, B.; Steffen, B. Active learning for extended finite state machines. Form. Asp. Comput. 2016, 28, 233–263. [Google Scholar] [CrossRef]
  14. Amorim, I.; Machiavelo, A.; Reis, R. On the Number of Linear Finite Transducers. Int. J. Found. Comput. Sci. 2015, 26, 873–893. [Google Scholar] [CrossRef]
  15. Chow, T.S. Testing software design modeled by finite-state machines. IEEE Trans. Softw. Eng. 1978, SE-4, 178–187. [Google Scholar] [CrossRef]
  16. Friedman, A.D.; Menon, P.R. Fault Detection in Digital Circuits; Prentice-Hall, Inc.: Englewood Cliffs, NJ, USA, 1971. [Google Scholar]
  17. Sethi, A.V.A.R.; Ullman, J.D. Compilers: Principles, Techniques, and Tools Reading; Addison-Wksley: Boston, MA, USA, 1986. [Google Scholar]
  18. Bolzmann, G.J. Design and Validation of Protocols; Prentice-Hall: Englewood Cliffs, NJ, USA, 1990. [Google Scholar]
  19. The Source Code for the Algorithm. Available online: https://github.com/ZinebLotfi/InvertiblesFSMs (accessed on 23 June 2023).
  20. Abubaker, S.; Wu, K. DAFA—A Lightweight DES Augmented Finite Automaton Cryptosystem. In Security and Privacy in Communication Networks, Proceedings of the 8th International ICST Conference, SecureComm 2012, Padua, Italy, 3–5 September 2012; Keromytis, A.D., Di Pietro, R., Eds.; Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering; Springer: Berlin, Heidelberg, 2013; Volume 106. [Google Scholar]
Figure 1. An illustrative schema of an FAPKC.
Figure 1. An illustrative schema of an FAPKC.
Computation 11 00125 g001
Figure 2. The Finite State Machine M 1 .
Figure 2. The Finite State Machine M 1 .
Computation 11 00125 g002
Figure 3. A directed cycle-free graph.
Figure 3. A directed cycle-free graph.
Computation 11 00125 g003
Figure 4. The Finite State Machine M 2 .
Figure 4. The Finite State Machine M 2 .
Computation 11 00125 g004
Figure 5. The Finite State Machine M 3 .
Figure 5. The Finite State Machine M 3 .
Computation 11 00125 g005
Figure 6. Approximate values for the number of τ -invertible FSMs when i = 2.
Figure 6. Approximate values for the number of τ -invertible FSMs when i = 2.
Computation 11 00125 g006
Figure 7. Heatmap showing the approximate percentage values of invertible FSMs when i = 2.
Figure 7. Heatmap showing the approximate percentage values of invertible FSMs when i = 2.
Computation 11 00125 g007
Table 1. The testing table of M 5 .
Table 1. The testing table of M 5 .
S × S Output = 0Output = 1Output = 2
step 1 s 0 s 0 s 1 s 1 , s 1 s 2 , s 2 s 2 --
s 0 s 2 s 0 s 1 --
step 2 s 1 s 1 ---
s 1 s 2 - s 0 s 1 -
s 2 s 2 ---
s 0 s 1 ---
Table 2. The total number of FSMs when i = 2 .
Table 2. The total number of FSMs when i = 2 .
n o = 2 o = 3 o = 4 o = 5 o = 6 o = 7 o = 8
2 4 4 6 4 8 4 10 4 12 4 14 4 16 4
3 6 6 9 6 12 6 15 6 18 6 21 6 24 6
4 8 8 12 8 16 8 20 8 24 8 28 8 32 8
5 10 10 15 10 20 10 25 10 30 10 35 10 40 10
6 12 12 18 12 24 12 30 12 36 12 42 12 48 12
7 14 14 21 14 28 14 35 14 42 14 49 14 56 14
8 16 16 24 16 32 16 40 16 48 16 56 16 64 16
9 18 18 27 18 36 18 45 18 54 18 63 18 72 18
10 20 20 30 20 40 20 50 20 60 20 70 20 80 20
11 22 22 33 22 44 22 55 22 66 22 77 22 88 22
12 24 24 36 24 48 24 60 24 72 24 84 24 96 24
13 26 26 39 26 52 26 65 26 78 26 91 26 104 26
14 28 28 42 28 56 28 70 28 84 28 98 28 112 28
15 30 30 45 30 60 30 75 30 90 30 105 30 120 30
16 32 32 48 32 64 32 80 32 96 32 112 32 128 32
17 34 34 51 34 68 34 85 34 102 34 119 34 136 34
18 36 36 54 36 72 36 90 36 108 36 126 36 144 36
19 38 38 57 38 76 38 95 38 114 38 133 38 152 38
20 40 40 60 40 80 40 100 40 120 40 140 40 160 40
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.

Share and Cite

MDPI and ACS Style

Lotfi, Z.; Khalifi, H.; Ouardi, F. Efficient Algebraic Method for Testing the Invertibility of Finite State Machines. Computation 2023, 11, 125. https://doi.org/10.3390/computation11070125

AMA Style

Lotfi Z, Khalifi H, Ouardi F. Efficient Algebraic Method for Testing the Invertibility of Finite State Machines. Computation. 2023; 11(7):125. https://doi.org/10.3390/computation11070125

Chicago/Turabian Style

Lotfi, Zineb, Hamid Khalifi, and Faissal Ouardi. 2023. "Efficient Algebraic Method for Testing the Invertibility of Finite State Machines" Computation 11, no. 7: 125. https://doi.org/10.3390/computation11070125

APA Style

Lotfi, Z., Khalifi, H., & Ouardi, F. (2023). Efficient Algebraic Method for Testing the Invertibility of Finite State Machines. Computation, 11(7), 125. https://doi.org/10.3390/computation11070125

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