Abstract
The aim of this article is to solve the system , where , and X is an unknown vector of a size n, with S being an additively idempotent semiring. If the system has solutions, then we completely characterize its maximal one, and in the particular case where S is a generalized tropical semiring, a complete characterization of its solutions is provided as well as an explicit bound of the computational cost associated with its computation. Finally, we show how to apply this method to cryptanalyze two different key exchange protocols defined for a finite case and the tropical semiring, respectively.
Keywords:
linear systems over semirings; maximal solution; generalized tropical semirings; cryptography MSC:
16Y10; 15A06; 94A60
1. Introduction
A semiring is an algebraic structure in which is a commutative monoid with an identity element 0 and is a monoid with an identity element 1, with both being internal operations connected by ring-like distributivity. The additive identity 0 is multiplicatively absorbing, and (see, for example, the monograph [1] for an intensive treatment of this algebraic structure). Moreover, a semiring is said to be additively idempotent if for all . Historically, the first notion of a semiring was from Vandiver [2] in 1934, and interest in additively idempotent semirings arose in the through the observation that some problems in discrete optimization could be linearized over such structures (see, for example, [3]). The first work to make use of an algebra over an idempotent ring (apart from Boolean fields) was that of Kleene [4], where nerve nets were studied in the context of finite state machines. Since then, the study of additively idempotent semirings has led to multiple connections with such diverse fields as graph theory (path algebra), Hamilton–Jacobi theory, automata and language theory, discrete event system theory (where linear systems over additively idempotent semirings modelize discrete event systems of practical interest), and fuzzy logic. As some examples of connections with the latter, each fuzzy triangular norm (t-norm; see, for example, [5]) conducts an additively idempotent semiring, which is called a max-t semiring in the literature, and in [6,7,8], Nola et al. studied certain objects of algebra over semirings arising from fuzzy logic, such as MV-algebras or the Lukasiewicz transform. Moreover, there is currently vast research on matrices with idempotent coefficients and their applications (e.g., [3,9,10]).
As an example of an additively idempotent semiring, we will study the tropical semiring. Tropical algebra was the first section of tropical mathematics to appear, and although a systematic study of the tropical semiring began only after the works of Simon (see [11]), we should note that the semiring had appeared before in optimization problems (see, for example, Floyd’s algorithm for finding the shortest paths in a graph [12]).
Although the problem of solving linear systems was formulated right after the definition of a root for a tropical polynomial and was given by Viro [13], the first paper [14] actually devoted to tropical linear algebra appeared only as late as 2005. Moreover, this problem has already proved to be quite interesting from the algorithmic point of view as it is known to be in . Some examples of algorithms proposed for solving tropical linear systems can be found in [15,16,17]. At present, there are numerous applications of linear systems over tropical semirings in various areas of mathematics, engineering, and computer science. For instance, Noel, Grigoriev, Vakulenko, and Radulescu recently proposed a way to use algorithms for solving tropical linear systems to study stable states of reaction networks in biology [18,19]. As an application in fuzzy set theory, Gavalec, Němcová et al. recently proposed a way to convert the problems of max-Lukasiewicz linear algebra (i.e., linear algebra over a max-Lukasiewicz semiring), to the problems of tropical (max-plus) linear algebra [20] and take advantage of the well-developed theory and algorithms of the latter in order to develop a theory of the matrix powers and the eigenproblem over a max-Lukasiewicz semiring. Thus, problems of tropical linear algebra and tropical linear systems in particular are important in terms of both theoretical and practical implications.
When letting be an additively idempotent semiring, we want to solve the system , where , and X is an unknown vector of a size n. We have to clarify that our notion of a solution differs from that of Viro in the sense that the maximum is achieved only once. If the system has solutions, then we can completely characterize its maximal one. Moreover, in the particular case where S is a generalized tropical semiring (see Definition 1.1.1), we are able to characterize completely its solutions and give an explicit bound of the computational cost associated with its computation. Finally, we give a cryptographic application by using our previous results in the case of S being finite and propose an attack to the key exchange protocol presented in [21] and, in the tropical semiring case, to cryptanalyze a quite recent protocol to key exchange in [22] as well.
2. Materials and Methods
In this section, we will introduce some basic background on semigroups and introduce some basic results which we will use throughout this paper.
Definition 1.
A semiring R is a non-empty set with two operations + and · such that is a commutative monoid, is a monoid, and the following distributive laws hold:
where the symbol of the operation · is omitted.
We say that a semiring is additively idempotent if for all .
Definition 2.
Let R be a semiring and be a commutative semigroup with the identity . M is a right semimodule over R if there is an external operation such that
for all and . We will denote as the simple concatenation .
Let be an additively idempotent semiring. Every such semiring is endowed with an order given by the first operation, which is defined as
This order respects the operation in R and enables defining a partial order in for every positive integer n:
If R is a semiring, then we will denote with the semiring of square matrices of the order n for some positive integer n and whose entries are in R.
Lemma 1.
The previous order is compatible with the operations in as a right semimodule.
Proof.
On one hand, if are such that and , then we have implying that and therefore . Thus, .
On the other hand, if , and (i.e., ), then and thus . Therefore, . □
Let be the system of linear equations in R with indeterminates :
with for all . If we denote as the ith row of A, where , then the system can be written as
Definition 3.
Let R be an additively idempotent semiring, and let be a linear system of equations. We say that is the maximal solution of the system if the two following conditions are satisfied:
- 1.
- is a solution of the system (i.e., );
- 2.
- If is any other solution of the system, then .
Note that the last condition is equivalent to .
3. Results
3.1. The Maximal Solution of a Linear System
Our aim in this section is to provide a characterization of the maximal solution of a linear system on certain additively idempotent semirings which will allow us to characterize every solution of these types or systems, and then we will be able to derive an algorithm to compute them.
Theorem 1.
Given an additively idempotent semiring , let . Suppose that these subsets have a maximum with respect to the order induced in R:
If has a solution, then is the maximal solution of the system.
Proof.
If there is a solution , then for all we have that
where we used the following relation:
Since in Equation (1), we have . Hence, under the proof of Lemma 1, we have
In addition, as , by the definition of , we find that
and thus, (i.e., Z is a solution). Furthermore, under the definition of the order in , we find that this solution is maximal. □
In the finite case, where both the existence of a solution for the linear system and the computation of the maximal solution are guaranteed precisely by the finiteness condition, we have the following result.
Theorem 2.
Let R be an additively idempotent finite semiring, and let be a system of equations with and . If the system has a solution, then is finite and
is the maximal solution of the system.
Proof.
To show this, it is enough to prove that the set has a maximum, which is
and then apply Theorem 1.
Given that is finite for every , we can assert that for every is well defined.
Now, if , then for every , given that
Finally, if , then , which shows that is additively closed, and hence . □
3.2. Linear Systems on Tropical Semirings
As we showed in Theorem 1, we can characterize the maximal solution of a linear system over an additively idempotent semiring under some circumstances. Our aim in this section is to study the existence of solutions in the particular case of tropical semirings.
Definition 4.
Let be a semiring. We say that R is a generalized tropical semiring if
The following lemma is immediate from the preceding definition.
Lemma 2.
Every generalized tropical semiring is totally ordered with respect to the order induced by the addition.
Example 1.
is a semiring where , and thus it is a generalized tropical semiring. Analogously, , and are also generalized tropical semirings, and they verify being a group with respect to the second operation.
The semiring , where + and · denote the usual addition and product of natural numbers, respectively, is an example of a semiring which is not a generalized tropical semiring.
The previous example induces the following definition.
Definition 5.
Let be a semigroup with a total order which is compatible with the operation +. We define the tropicalized semiring of S as the semiring , with the inner addition defined by max, given by the order in S, and the inner product defined by +, the inner operation of S, and extend these to ∞ in the following way:
- 1.
- .
- 2.
- .
Example 2.
Let us consider the semiring with two elements whose addition is given by and and the product defined by for . Then, is a generalized tropical semiring, but it is not a tropical semiring nor the tropicalized semiring of an ordered semigroup.
The following result is straightforward.
Lemma 3.
Let be a totally ordered semigroup, and let be its tropicalized semiring. Then, is a generalized tropical semiring.
Let us recall from [17] that the tropical semiring is given by the semiring . It can immediately be found that the tropical semiring is the tropicalized version of with the usual operations.
Theorem 3.
Let be a generalized tropical semiring where is a group. If the linear system has a solution , then it is of the form .
Proof.
Firstly, we will prove that the sets with , have a maximum, and thus we can use Theorem 1.
If , then we have that , where if we see the jth row, then we can obtain . Therefore, we have
and thus if and only if for all . This condition is verified if .
Now, if we denote , then we find that is an upper bound of because . In addition, it belongs to the set due to the following identity:
which holds for all , where . We can conclude that . □
Moreover, as a consequence of the previous result, we obtain the following corollary.
Corollary 1.
Let be a generalized tropical semiring where is a group, , and the column vector . If the linear system has at least one solution, then its maximal solution is of the form , where for .
We can also point out that in case the semiring is such that is not a group, we can use the following theorem from [23].
Theorem 4.
A commutative semigroup can be embedded in a group if and only if it is cancellative.
Theorem 5.
Every generalized tropical semiring such that is cancellative can be embedded into a generalized tropical semiring having inverses with respect to ·.
Proof.
Let be a generalized tropical semiring such that is cancellative. Then, under the preceding, it can be embedded into a group, which we will denote as . Note that the elements of are of the form with . Now, given that R is totally ordered, we can endow with a total order as follows:
Now, we can define the addition in as
Then, the properties which the operation max satisfy give us that is a generalized tropical semiring. Inverses exist with respect to the second operation, and the embedding is a semiring homomorphism. □
Example 3.
We have that is a generalized tropical semiring. Furthermore, is cancellative. With the previous result, we can embed into a generalized tropical semiring with inverses which, under the preceding construction, can be .
Now, we will show how to find every solution of the previous system.
Lemma 4.
Let R be a generalized tropical semiring, where is cancellative and is a linear system of equations which has a solution, for which and . Let . Then, if and only if .
Proof.
Let , and let be the ith row of A for . Then, , and thus Moreover, , since
and hence and . □
Let R be a generalized tropical semiring, and let be a linear system of equations with and . Let . Then, under the proof of Theorem 3, has a maximum which will be denoted by for all .
Theorem 6.
Let R be a generalized tropical semiring, and let be a system of equations with and . is a solution of the system if and only if
- 1.
- , ,
- 2.
- such that .
Proof.
Let us assume first that is a solution of the system. Then, the first condition was already proven in Equation (1). Let us now show the second condition. We have that
For a fixed value j, we find that
Using the definition of generalized tropical semiring, we have that there exists such that .
Conversely, let us suppose now that X verifies both conditions. Then, we have
Now, under condition 2, there exists such that , and thus we can rewrite the equation as
As for all j, and as the semiring is additively idempotent, we finally obtain
for all . Thus, X is a solution of the system. □
Corollary 2.
Let be a generalized tropical semiring such that is a group. If the system has a solution, then is a solution if and only if
- 1.
- .
- 2.
- such that
where is the inverse of in a generalized tropical semiring having inverses with respect to · and which contains R.
Proof.
It is enough to show that the conditions are equivalent to those of Theorem 6.
Firstly, note that the first condition and condition 1 of Theorem 6 are equivalent.
We will show now that if condition 1 is true, then condition 2 is equivalent to condition 2 of Theorem 6.
If 1 is satisfied, then . In addition, if condition 2 of Theorem 6 is verified, then
using Corollary 1, and thus . The converse is trivial. □
Remark 1.
Let R be a generalized tropical semiring as illustrated above, and let us consider the system . to be a solution of the system if and only if, for every equation, in the system:
- 1.
- ;
- 2.
- such that .
Then, under the previous corollary, for every , there exists such that , and in addition, . As a result, there exits a non-empty set . This induces the following result, which provides an algorithm to solve linear equations systems.
Theorem 7.
Let be a generalized tropical semiring such that is a group, and let be a system of equations with and . Determining all of the solutions of the system has a computational cost of .
Proof.
We observe that the solution of the system is given by the vectors with the following designations.
For every j, we can choose such that . The rest of the conditions (, ) verify that .
To prove this, note that every with this designation verifies that , and from Lemma 4, we have . Moreover, we observe that for every j, we have some with . Thus, under the preceding corollary, it is a solution.
On the other hand, if is a solution, then it satisfies the conditions of the preceding corollary. Then, , and thus . Moreover, for every , there exists h such that . But then , and hence .
As a result, to determine all of the solutions of the system, it is enough to compute for every and for every .
To calculate these, we can use the following algorithm.
We first compute the matrix , whose ith column is of the form
for every
This results in the computation of being inverse and operations in the set R.
Then, we calculate for every , and simultaneously, we compute the set , which gives m comparisons for each column and thus operations.
Next, we build using with the following process:
- 1.
- Take to be empty for every .
- 2.
- Examine for , and if , then add i to .
This process requires examining , and since , this procedure requires comparisons for every . Hence, the cost is .
Taking into account that the comparison of two elements is made through the addition of both elements in R, the total cost is basic operations in the ring . □
Remark 2.
We recall that when the generalized tropical semiring R is such that is cancellative, which is less restrictive than being a group. Using Theorem 5, we can embed this semiring into a generalized tropical semiring S in the conditions of Corollary 2, and then we can solve any linear system as previously shown, obtaining each solution in S and then checking if any of them are in fact contained in R.
4. Discussion
Within the references, in [17], a method for solving a system of equations through normalization is presented. In [24], the structure of the solution of a system of equations over a tropical semiring was studied by using the rank over rows and columns, and subsequently, a generalized Cramer method was used to find the maximal solution over a tropical semiring.
Examples of systems of equations appear in both papers. In [17], a solution (though not necessarily maximal) was computed, and in [24], the authors provided the range of freedom of the solution. Now, using the preceding, we can show the complete set of solutions of those systems of equations.
To avoid misreading the operation over R as a usual ring and rather as a tropical semiring, the operation will be denoted as .
Example 4.
In [24], the authors computed a solution of the system
Let us determine the complete set of solutions of the system as well as the maximal solution.
Firstly, we calculate , obtaining the matrix
Then, we have and the rows where these minima are reached.
| Value | Row | |
| 7 | ||
| 3 | ||
| 2 | ||
| 7 | ||
| 6 |
Now, let us compute .
| Columns | |
Thus, the solutions are
with .
Moreover, we can observe that the maximal solution was .
Example 5.
In [17], the authors computed the maximal solution of
Using our proposed method, we will compute all of the solutions, including the maximal one:
Then, we have and the rows where those minima were reached.
| Value | Row | |
| 30 | ||
| 4 | ||
| 74 |
Now, we compute .
| Columns | |
Thus the solutions are
where .
In addition, the maximal solution was , which matched the one obtained in the original paper.
Cryptographic Applications
In [21], the authors introduced a key exchange protocol over semirings and proposed the use of a finite additively idempotent semiring. Quite recently, and using a similar construction to find the shared key, in [22], the authors proposed the tropical semiring to obtain another group key exchange. We now show a general strategy which reduces the cryptanalysis to solve a linear system of equations, and in the case of additively idempotent semirings, the method which we introduced in this paper can then be used to find the keys used by both proposals rather easily from just the information which the parties make public.
In both cases, they used an additively idempotent semiring R and . Each party had a pair of polynomials over the center of R, , . In the case of the protocol introduced in [21], the parties agreed on a finite additively idempotent semiring. Then, they had and , and the common shared key was . In the case of [22], the parties agreed on the tropical semiring, and they used two private numbers and had and , respectively. In this case, the shared key was .
Notice that the protocol appearing in [22] is an extension of that given in [21], if we consider that . Therefore, it is enough to simply study the second case.
Let us fix h to an upper bound for the degrees of , and let u be a bound for the integer . This is chosen by the attacker at the moment of starting the activity and depends on the computational capabilities. Then, we can rewrite as
for certain values of , where are elements of the center of R. Note that these coefficients constitute a particular solution of the system
Using the algorithm previously described, we can find a particular solution of the system . Then, we can build the function , which verifies that
Then, we have
which is the shared key after the parties run the protocol.
Now, let us check how this reasoning applies to the example proposed in [22], revealing the common key agreed upon by the parties. In this case, we make use of the following matrices:
and one of the values that is made public by one of the parties is
Using the previous algorithm, we can find the polynomial:
which satisfies , and with K as the shared key.
In the use case proposed in [21], using a particular method, the authors of [25] were able to obtain a polynomial as demonstrated above, whose evaluation in the appropriate values provided the common key. Now, by using the above reasoning and the general algorithm to solve linear equation systems, for the finite case proposed in [21], we were able to obtain precisely the same polynomial provided in [25], which shows the cryptanalysis of this case.
We determined that finding an appropriate setting to give a key exchange protocol for the post-quantum era is currently an open problem. In 2017, NIST called for a contest to select new cryptographic primitives which allowed obtaining secure algorithms against the attack of a quantum computer. In 2023, four algorithms were selected: one for key encapsulation and three others for digital signatures. Extremely recently, two digital signatures and a key encapsulation method were officially standardized, but the problem of exchanging a secret collaboratively among two communicating parties through an insecure channel remains open. Thus, the alternatives presented in the two previously discussed cases are not appropriate.
5. Conclusions
In this paper, we characterized the maximal solution of a linear equation system defined over an additively idempotent semiring. This characterization gave us the possibility of obtaining general algorithms which could be run in polynomial time to obtain the complete set of solutions of such systems (in case there is at least one) in both the finite case and the tropical semiring case. In the latter case, we extending the existing results to find not only the maximal solution of a linear system but also every solution of the system. Moreover, we have shown how to apply these algorithms to cryptography and show how possible alternatives for a group key exchange protocol for the post-quantum era are vulnerable.
Author Contributions
All authors contributed equally to this work. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by Junta de Andalucía FQM 0211; Ministerio de Ciencia, Innovación y Universidades, Agencia Estatal de Investigación, Grant number MICIU/AEI/10.13039/501100011033; and European Regional Development Fund, European Union, Grant number ERDF/EU PID2022-138906NB-C21.
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Golan, J.S. Semirings and Their Applications; Kluwer Academic Publishers: Dordrecht, Netherlands, 1999. [Google Scholar]
- Vandiver, H.S. Note on a simple type of algebra in which the cancellation law of addition does not hold. Bull. Am. Math. Soc. 1934, 40, 914–920. [Google Scholar] [CrossRef]
- Cuninghame-Green, R. Minimax Algebra. In Lecture Notes in Economics and Mathematical Systems; Springer: Berlin, Germany; New York, NY, USA, 1979; Volume 166, p. 258. [Google Scholar]
- Kleene, S.C. Representation of events in nerve nets and finite automata. In Automata Studies; Annals of Mathematics Studies; Princeton University Press: Princeton, NJ, USA, 1956; Volume 34, pp. 3–41. [Google Scholar]
- Klement, E.P.; Mesiar, R.; Pap, E. Triangular Norms; Springer: Dordrecht, The Netherlands, 2013; Volume 8. [Google Scholar]
- Di Nola, A.; Gerla, B. Algebras of Lukasiewicz’s logic and their semiring reducts. In Idempotent Mathematics and Mathematical Physics; Contemporary Mathematics; The American Mathematical Society: Providence, RI, USA, 2005; Volume 377, pp. 131–144. [Google Scholar]
- Di Nola, A.; Lettieri, A.; Perfilieva, I.; Novák, V. Algebraic analysis of fuzzy systems. Fuzzy Sets Syst. 2007, 158, 1–22. [Google Scholar] [CrossRef]
- Di Nola, A.; Russo, C. Semiring and semimodule issues in MV-algebras. Commun. Algebra 2013, 41, 1017–1048. [Google Scholar] [CrossRef]
- Krivulin, N. Idempotent Algebra Methods for Problems in Modeling and Analysis of Complex Systems; St. Petersburg University: St. Petersburg, Russia, 2009. [Google Scholar]
- Litvinov, G.L.; Maslov, V.P.; Rodionov, A.Y.; Sobolevski, A.N. Universal algorithms, mathematics of semirings and parallel computations. In Coping with Complexity: Model Reduction and Data Analysis; Lecture Notes in Engineering and Computer Science; Springer: Berlin, Germany, 2011; Volume 75, pp. 63–89. [Google Scholar]
- Simon, I. Limited subsets of a free monoid. In Proceedings of the 19th Annual Symposium on Foundations of Computer Science, Ann Arbor, MI, USA, 16–18 October 1978; IEEE: Long Beach, CA, USA, 1978; pp. 143–150. [Google Scholar]
- Floyd, R.W. Algorithm 97: Shortest path. Commun. ACM 1962, 5, 345. [Google Scholar] [CrossRef]
- Viro, O. Dequantization of real algebraic geometry on logarithmic paper. In European Congress of Mathematics; Casacuberta, C., Miró-Roig, R.M., Verdera, J., Xambó-Descamps, S., Eds.; Birkhauser Basel: Basel, Switzerland, 2001; pp. 135–146. [Google Scholar]
- Develin, M.; Santos, F.; Sturmfels, B. On the rank of a tropical matrix. In Combinatorial and Computational Geometry; Publications of the Math Sciences Research Institute; Cambridge Univercity Press: Cambridge, UK, 2005; Volume 52, pp. 213–242. [Google Scholar]
- Grigoriev, D. Complexity of solving tropical linear systems. Comput. Complex. 2013, 22, 71–88. [Google Scholar] [CrossRef][Green Version]
- Davydow, A. New algorithms for solving tropical linear systems. Algebra i Anal. 2016, 28, 1–19. [Google Scholar] [CrossRef]
- Olia, F.; Ghalandarzadeh, S.; Amiraslani, A.; Jamshidvand, S. Solving linear systems over tropical semirings through normalization method and its applications. J. Algebra Appl. 2021, 20, 2150159. [Google Scholar] [CrossRef]
- Noel, V.; Grigoriev, D.; Vakulenko, S.; Radulescu, O. Tropical geometries and dynamics of biochemical networks application to hybrid cell cycle models. In Electronic Notes in Theoretical Computer Science, Proceedings of the 2nd International Workshop on Static Analysis and Systems Biology (SASB 2011), Venice, Italy, 13 September 2011; Elsevier Science B.V.: Amsterdam, The Netherlands, 2012; Volume 284, pp. 75–91. [Google Scholar]
- Noel, V.; Grigoriev, D.; Vakulenko, S.; Radulescu, O. Hybrid Models of the Cell Cycle Molecular Machinery. In International Workshop on Hybrid Systems Biology Newcastle. 2012. Available online: https://api.semanticscholar.org/CorpusID:12521148 (accessed on 9 August 2024).
- Gavalec, M.; Nĕmcová, Z.; Storage, S. Tropical linear algebra with the Lukasiewicz T-norm. Fuzzy Sets Syst. 2015, 276, 131–148. [Google Scholar] [CrossRef]
- Maze, G.; Monico, C.; Rosenthal, J. Public key cryptography based on semi- group actions. Adv. Math. Commun. 2007, 1, 489–507. [Google Scholar] [CrossRef]
- Durcheva, M.; Danilchenko, K. Secure Key Exchange in Tropical Cryptography: Leveraging Efficiency with Advanced Block Matrix Protocols. Mathematics 2024, 12, 1429. [Google Scholar] [CrossRef]
- Clifford, A.H.; Preston, G.B. The Algebraic Theory of Semigroups; American Mathematical Society: Providence, RI, USA, 1961; p. 34. [Google Scholar]
- Jamshidvand, S.; Ghalandarzadeh, S.; Amiraslani, A.; Olia, F. On the maximal solution of a linear system over tropical semirings. Math. Sci. 2020, 14, 147–157. [Google Scholar] [CrossRef]
- Otero Sánchez, A.; López Ramos, J.A. Cryptanalysis of a key exchange protocol based on a congruence-simple semiring action. J. Algebra Appl. 2024, 2024, 2550229. [Google Scholar] [CrossRef]
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/).