Abstract
We explore the class of positive integers n that admit idempotent factorizations such that , where is the Carmichael lambda function. Idempotent factorizations with and prime have received the most attention due to their cryptographic advantages, but there are an infinite number of n with idempotent factorizations containing composite and/or . Idempotent factorizations are exactly those and that generate correctly functioning keys in the Rivest–Shamir–Adleman (RSA) 2-prime protocol with n as the modulus. While the resulting and have no cryptographic utility and therefore should never be employed in that capacity, idempotent factorizations warrant study in their own right as they live at the intersection of multiple hard problems in computer science and number theory. We present some analytical results here. We also demonstrate the existence of maximally idempotent integers, those n for which all bipartite factorizations are idempotent. We show how to construct them, and present preliminary results on their distribution.
Keywords:
cryptography; abstract algebra; Rivest–Shamir–Adleman (RSA); computer science education; cryptography education; number theory; factorization MSC:
[2010] 11Axx 11T71
1. Introduction
Certain square-free positive integers n can be factored into two numbers such that , where is the Carmichael lambda function. We call such an idempotent factorization of n, and an idempotent tuple. We say that admits an idempotent factorization. (Overbars indicate that are not necessarily prime.)
When n is prime, all factorizations are trivially idempotent ( or ). For p and q prime, the factorization is idempotent due to Euler’s Theorem and the exponent cycle length property of . If p and q are sufficiently large, such factorizations have useful cryptographic properties, and are the basis for the 2-prime Rivest–Shamir–Adleman (RSA) cryptosystem [1]. Carmichael numbers [2] also easily form idempotent products.
These, however, are not the only idempotent factorizations. While they do not use the term themselves, Huthnance and Warndof [3] describe idempotent factorizations , where and are either primes or Carmichael numbers, noting that such integers generate correct RSA keys. These values are in fact a subset of idempotent factorizations as we define them here, as there are an infinite number of idempotent tuples with composite and/or where neither nor are Carmichael numbers. We emphasize that, like the subset of idempotent tuples noted in [3], these numbers should never be used cryptographically [4]. We merely note that idempotent factorizations are exactly those that “fool" RSA in the sense that such supplied to the 2-prime RSA protocol will generate keys that encrypt and decrypt messages correctly.
An idempotent factorization of the form or with one composite and one prime is a semi-composite idempotent factorization. A factorization of the form with both components composite is a fully composite idempotent factorization (implying n has at least four factors). Trivial factorizations ( or ) and factorizations of n where n is a semiprime ( and prime) will not be considered further.
2. Idempotent Factorizations of a Carmichael Number
Carmichael numbers C have the property . Let be a factorization of C. For a factorization of a Carmichael number to be idempotent, we have
3. Maximally Idempotent Integers
If all bipartite factorizations of n are idempotent, we say that n is maximally idempotent.
Let , with all prime. Let . Suppose that is an idempotent factorization. We have
Similarly, for the other two factorizations, we have and . Thus, n is maximally idempotent . For these three conditions to all be true, . For , the only possibility is .
This gives the following theorem:
Theorem 1.
Let prime. Let . n is maximally idempotent .
For the system of three nonlinear modular equations above consider the terms . If all of them are , all three equations are satisfied. If exactly two of them are , only one equation is satisfied. If exactly one is , no equations are satisfied. If none are , there are three possibilities: No equations are satisfied, one is satisfied if , or three are satisfied if . Thus, no integer can have exactly two idempotent factorizations.
Since the equations for maximal idempotency are all sums of products of two or more with no duplicates, and that these sums are all , we have the following result:
Theorem 2.
Let with all prime, . is maximally idempotent.
The maximally idempotent integer shows the converse of this theorem is false. , and , but , etc.
As shown previously, a Carmichael number C is maximally idempotent .
4. Strong Impostors and Idempotent Factorizations
We have shown [5] that square-free composite numbers with the property produce semi-composite idempotent tuples when paired with any prime r coprime to . We called these strong impostors because they behave as prime numbers to the 2-prime RSA protocol. Strong impostors include the Carmichael numbers, which have been long known to have this property, but are not limited to them. It can easily be shown that the product of any two odd coprime strong impostors is idempotent.
5. Examples
The first 16 square-free n with factors that admit idempotent factorizations are shown in Table 1.
Table 1.
Values of n that admit idempotent factorizations.
6 and 15 are strong impostors, but 10, 14, and 21 are not. In addition, is the smallest square-free n that can be factored into two composite factors. It can be so factored in three ways, of which (10, 21) is fully composite and idempotent.
Values of n also exist which admit multiple idempotent factorizations. n = 273 has idempotent factorizations of (3, 91), (7, 39) and (13, 21), all of which are semi-composite. n = 1365 has both semi-composite and fully composite idempotent factorizations: (7, 195), (13, 105) and (15, 91). The latter is the product of two odd strong impostors.
The first 16 maximally idempotent n with three and four prime factors are shown in Table 2, along with the two 5-factor cases . Carmichael numbers are underlined.
Table 2.
Maximally idempotent integers with 3, 4 and 5 factors.
Maximally idempotent integers are rare. Below there are 15189 with three prime factors, 315 with 4, and 2 with 5.
There are no maximally idempotent integers with six or more factors below . The smallest 6-factor maximally idempotent integer M(6) is . The smallest maximally idempotent integer with seven factors known to the author is (M(6)) + 1) × M(6) = 601 × M(6).
Cumulative Statistics for Idempotent Factorizations of the Carmichael Numbers
An analysis of maximally idempotent Carmichael numbers is shown in Table 3 [6].
Table 3.
Maximally idempotent integers among the Carmichael numbers.
As expected, maximally idempotent integers are found at higher proportions in the Carmichael numbers, although they remain rare. There is only one 5-factor maximally idempotent Carmichael number in the results above: C598349 = . It is the smallest such Carmichael number.
6. Constructing Maximally Idempotent Integers
Knowing sufficient conditions for the existence of idempotent factorizations and maximal idempotency suggests constructive approaches. We may construct a set of maximally idempotent integers sharing a given in the following way:
(1) Pick some prime p, let . (2) Find all the divisors of such that is prime. (3) Construct the of by creating a node for each , with an edge from each to every node such that . Any two such nodes will have the property . Thus, by Theorem 2, every k-clique with in the resulting graph corresponds to a maximally idempotent integer with k prime factors. Each node corresponds to a prime factor , with a maximally idempotent n equal to the product of all corresponding in the subgraph. It follows that all divisors of such constructed integers with more than two factors are also maximally idempotent.
For example, consider . The resulting divisors with prime are . This produces the divisor graph of Figure 1.
Figure 1.
Divisor graph for .
This graph contains six 3-cliques and one 4-clique. These correspond to seven maximally idempotent integers with . Five of the six 3-cliques correspond to integers in Table 2. The 4-clique is the smallest maximally idempotent integer with four factors, also shown in Table 2.
To construct a maximally idempotent integer with a large number of factors, choose p such that is highly composite. The divisor graph will then have a large number of nodes, high connectivity and a greater likelihood of k-cliques for larger k.
For example, we may choose . The procedure above yields the 31-node graph shown in Figure 2.
Figure 2.
Divisor graph for .
This graph has a total of 1293 k-cliques with . The largest clique has 10 nodes, corresponding to the 10-factor maximally idempotent integer .
We may define a function as the number of maximally idempotent integers M with that can be constructed in this way. The domain of this function is the primes. The range is the set of numbers y that are the total number of k-cliques in the divisor graph for some p with , . The first 16 nonzero values of are shown in Table 4.
Table 4.
Nonzero values of .
By this definition and computer analysis of the graph in Figure 2, the value of is 1293.
7. Cumulative Statistics on Idempotent Factorizations
Cumulative statistics for idempotent factorizations for are shown below (Table 5, Table 6 and Table 7). indicates the ratio of numbers with idempotent factorizations to the total number of candidates n, those square-free numbers with factors. indicates the ratio to all n in the indicated interval. The first entry in is the computation time in seconds on the author’s computer for the indicated interval. Remaining entries are the ratio of computation time of the current interval to the previous interval. An entry of the form i:j in row with #factors = F indicates that there are j integers with F prime factors and i idempotent factorizations.
Table 5.
Proportion of integers with idempotent factorizations.
Table 6.
Factor distribution of idempotent factorizations (<8 factorizations).
Table 7.
Factor distribution of idempotent factorizations (≥8 factorizations).
All answers are rounded to the indicated number of decimals. We ignore order when counting factorizations.
8. Idempotent Tuples and RSA
Unlike factorizations of n with p and q prime, idempotent factorizations of n with composite and/or offer no cryptographic utility. Like the Carmichael numbers, they should never be used in practice [4]. Nonetheless, all idempotent factorizations of n produce correct results if used in the 2-prime RSA protocol. Given , choosing any integers with yields public and private keys that work correctly. This arises from the definition of idempotency.
Theorem 3.
A factorization of square-free n into with and produces correctly functioning keys for 2-prime RSA iff the factorization is idempotent.
We note a well-known property of the Carmichael function: is the smallest positive integer such that . It follows by induction that .
Proof.
(→): Let produce correctly functioning keys for 2-prime RSA. Encryptions and decryption keys are chosen such so that . By hypothesis, we have . Since is a multiple of , we have
for all . Writing as , we have :
We must show .
By the exponent cycle length property of , we have
. Choosing , we have . is the smallest positive integer for which this is possible, so .
(←): By hypothesis, let n be a square-free positive integer, , for some positive integer l. Let be positive integers such that . We have
by the exponent cycle length property of . □
For example, consider the idempotent tuple . Note that both and are composite. Possible pairs include (13, 97), (19, 199), (71, 71), (17, 593), (11, 1031), (83, 167) and so forth. The reader may confirm that, for any such .
9. Conclusions and Future Work
We conjecture that, for any square-free , a composite non-Carmichael can be found such that is an idempotent factorization. We have verified this conjecture for all square-free . For certain prime, the resulting can be quite large, requiring the use of heuristic algorithms for these cases. This is work in progress.
Rather than view idempotency as an all-or-nothing property of a bipartite factorization, it may be viewed as a ratio between 0 and 1. In that case, the previous definition of idempotent factorizations could be regarded as indicating full idempotency because all pairs have the desired idempotency property. A value of 0 corresponds to minimal idempotency, in which no non-trivial pairs are functional RSA keys. Values in between indicate the idempotency ratio for a given factorization, based on the fraction of pairs for which .
The pairs that lend idempotency to a factorization of are exactly those for which , where . The desired are then exactly those solutions to the 2-variable system of nonlinear modular equations , where are the prime power factors of L. Determining whether or not such systems have solutions and calculating their exact number are known NP-complete problems. Thus, simple, efficient calculations of idempotency ratios are likely to prove elusive. This is work in progress.
We conjecture that, due to redundancy in the equations for idempotency, no non-maximally idempotent integer n can have exactly one of its factorizations be non-idempotent. No counterexamples below have been found. This suggests the question of the maximum number of idempotent factorizations an integer n with m prime factors can have without being maximally idempotent. Other questions include the asymptotic density of various kinds of idempotent factorizations, calculations of various idempotency ratios, the development of efficient algorithms to find idempotent factorizations, and more rigorous bounds on maximally idempotent integers.
Finding idempotent factorizations connects factoring, graph theory, number theory, complexity theory, and cryptography. They depend on the relationship of products of primes and their immediate predecessors , so necessary and sufficient conditions for their existence beyond their defining equations are likely to prove elusive.
Various files related to idempotent factorizations are available at the Online Encyclopedia of Integer Sequences [7,8,9,10]. Some of these ideas first appeared in preliminary form in [11].
Acknowledgments
The author wishes to thank his department colleague Carlos Salazar for asking an interesting question, and for Karl Herzinger of the USAFA Department of Mathematics for his assistance and review of this article.
Conflicts of Interest
The author declares no conflict of interest.
References
- Rivest, R.; Shamir, A.; Adleman, L. A Method for Obtaining Digital Signatures and Public-Key Cryptosystem. Commun. ACM 1978, 21, 120–126. [Google Scholar] [CrossRef]
- Carmichael, R.D. Note on a New Number Theory Function. Bull. Am. Math. Soc. 1910, 16, 232–238. [Google Scholar] [CrossRef]
- Huthnance, E.D.; Warndof, J. On Using Primes for Public Key Encryption Systems. Appl. Math. Lett. 1988, 1, 225–227. [Google Scholar] [CrossRef]
- Pinch, R.G.E. On Using Carmichael Numbers for Public Key Encryption Systems. In Proceedings of the IMA International Conference on Cryptography and Coding, Cirencester, UK, 17–19 December 1997; pp. 265–269. [Google Scholar]
- Fagin, B. Composite Numbers That Give Valid RSA Key Pairs For Any Coprime p. Information 2018, 9, 9. [Google Scholar] [CrossRef]
- Pinch, R.G.E. The Carmichael Numbers up to 1021. In Proceedings of the Conference on Algorithmic Number Theory, Turku, Finland, 8–11 May 2007; pp. 129–131. [Google Scholar]
- Fagin, B.; OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences. Squarefree n with ≥3 factors That Admit Idempotent Factorizations n = . Available online: http://oeis.org/A306330 (accessed on 4 July 2019).
- Fagin, B.; OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences. Squarefree n with Fully Composite Idempotent Factorizations. Available online: http://oeis.org/A306508 (accessed on 4 July 2019).
- Fagin, B.; OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences. Maximally Idempotent Integers with ≥3 Factors. Available online: http://oeis.org/A306812 (accessed on 4 July 2019).
- Fagin, B.; OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences. “Strong Impostors” ≠ 0 (mod 4). Available online: http://oeis.org/A318555 (accessed on 4 July 2019).
- Fagin, B. Teaching RSA: What Happens When One of Your Primes Isn’t? In Proceedings of the 50th ACM Technical Symposium on Computer Science Education (SIGCSE ’19), Minneapolis, MN, USA, 27 February–2 March 2019; p. 1286. [Google Scholar]
© 2019 by the author. 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 (http://creativecommons.org/licenses/by/4.0/).