Next Article in Journal
Non-Invasive Detection Method for Recycled Flash Memory Using Timing Characteristics
Next Article in Special Issue
A Secure Algorithm for Inversion Modulo 2k
Previous Article in Journal
An Autonomous, Self-Authenticating, and Self-Contained Secure Boot Process for Field-Programmable Gate Arrays
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Brief Report

Cryptanalysis of a Proposal Based on the Discrete Logarithm Problem Inside Sn

1
MACIMTE, Universidad Rey Juan Carlos, 28933 Móstoles, Madrid, Spain
2
Department of Mathematical Sciences, Florida Atlantic University, Boca Raton, FL 33431, USA
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Cryptography 2018, 2(3), 16; https://doi.org/10.3390/cryptography2030016
Submission received: 21 May 2018 / Revised: 13 July 2018 / Accepted: 16 July 2018 / Published: 19 July 2018
(This article belongs to the Special Issue Public Key Cryptography)

Abstract

:
In 2008, Doliskani et al. proposed an ElGamal-style encryption scheme using the symmetric group S n as mathematical platform. In 2012, an improvement of the cryptosystem’s memory requirements was suggested by Othman. The proposal by Doliskani et al. in particular requires the discrete logarithm problem in S n , using its natural representation, to be hard. Making use of the Chinese Remainder Theorem, we describe an efficient method to solve this discrete logarithm problem, yielding a polynomial time secret key recovery attack against Doliskani et al.’s proposal.

1. Introduction

Discrete logarithm problems in certain representations of cyclic groups, such as subgroups of elliptic curves over prime fields, are a popular resource in the construction of cryptographic primitives. Widely deployed solutions for digital signatures and key establishment rely on the computational hardness of such discrete logarithm problems. Doliskani et al. proposed a cryptosystem in [1] which relies on the discrete logarithm problem inside the symmetric group S n , using its standard representation, to be hard. The encryption scheme proposed in [1] is essentially an instantiation of the classic ElGamal [2] encryption scheme, but using a cyclic subgroup of S n in standard representation as platform instead of a more traditional platform choice.
We show that this particular discrete logarithm problem is problematic for cryptographic purposes by showing how to find such discrete logarithms in polynomial time. Consequently, in the proposal from [1], secret keys can be recovered from public data in polynomial time. Our algorithm exploits the permutation representation of a cyclic group that is used in [1]. Even though any finite cyclic group is isomorphic to a subgroup of a suitably large symmetric group, our algorithm does not imply an efficient solution for discrete logarithm problems in established cryptographic platform groups.

2. The Scheme of Doliskani et al.

In this section, we briefly recall the cryptosystem proposed by Doliskani et al. following the description given in [1] (Section 4). The scheme has the same basic structure as ElGamal encryption:
Key Generation.
The key generation algorithm, executed by the receiver, selects an appropriate index n and a suitable permutation g S n . The cyclic group generated by g will be denoted by g , and we represent its order by | g | . Further, an integer α is selected uniformly at random from { 1 , , | g | 1 } . The public key is the pair ( g , g α ) , while the private key is the secret “exponent” α . (Even though these points are not clarified by the authors, as is customary, we assume n is chosen from an input security parameter , and is polynomial in .)
Encryption.
On input of a plaintext m, which we may assume belongs to S n (we omit the encoding described in [1] (Section 3), which is irrelevant for our purposes), an integer k is chosen uniformly at random from { 1 , , n } . The ciphertext is computed as the pair of group elements ( g 1 , g 2 ) : = ( g k , m g α k ) .
Decryption.
The group element g 1 is raised to the secret exponent α and further inverted to compute m : = g 2 ( g 1 α ) 1 .
As made clear by the authors, this scheme essentially instantiates ElGamal encryption in the symmetric group S n . As such, some of the security concerns of the original ElGamal over finite fields carry over. Given an encryption of m, one can trivially derive an encryption of h m for any h S n , so we observe that malleability is one such concern. Very limited plaintext leakage is another concern. It is known that in a straightforward ElGamal implementation over Z 2 q + 1 * for a Sophie Germain prime q, one bit of the message leaks. Indeed, if the cyclic group g has order q, it is possible to determine from the ciphertext whether the underlying plaintext m is a quadratic residue mod 2 q + 1 or not, as the ciphertext leaks the Legendre symbol m 2 q + 1 of m.
Similarly, the construction in [1] leaks one bit, corresponding to the sign of the plaintext permutation m. Recall that the sign of a permutation can be seen as a group homomorphism
ε : S n { 1 , 1 } ,
defined as ε ( σ ) = 1 if and only if σ can be written as the product of an even number of transpositions. Otherwise, if σ is odd (and can thus only be decomposed as a product of an odd number of transpositions), ε ( σ ) = 1 . It is easy to see that ε is a group homomorphism, hence ε ( m g α k ) = ε ( m ) ε ( g α k ) . If any of the (public) g, g α , or g k are in the kernel of ε , then necessarily the sign of the “mask” g α k is one, too, and the sign of the plaintext leaks. Information on the elements in { 1 , , n } not stabilized by the permutation m, known as the support of plaintext m, may leak if the support of g is small. This follows from the fact that the elements in { 1 , , n } not stabilized by any permutation from g is always a subset of the support of g.
We include these remarks to emphasize that, when considering a concrete ElGamal instantiation, a thorough analysis is essential. One must consider the specific group representation and parameters in use.
In [1], the order of the public group element g is identified by the authors as the main relevant parameter determining the security of the above scheme. Indeed, when approaching a generic instance of the discrete logarithm problem in an arbitrary cyclic group, the order of the generator gives us an idea of how successful standard methods such as those mentioned in [1] (Section 2) might be when it comes to solving the associated discrete logarithm problem. This, however, does not rule out the existence of more efficient algorithms for computing discrete logarithms exploiting a concrete representation of the underlying group. As we show in the next section, this is the case for the symmetric group.

3. Finding Discrete Logarithms in Cyclic Subgroups of S n

Let S n be the symmetric group on n points, with elements f S n represented as a list of images [ f ( 1 ) , , f ( n ) ] (or in standard cycle notation). Moreover, let g S n , and h = g α some element in the cyclic group g generated by g. For the encryption scheme put forward in [1], the pair ( g , h ) represents a public key, and being able to recover α from the public key yields a successful recovery of a user’s secret key. When applied to the input ( g , h ) , the following procedure returns α ( mod | g | ) , thereby solving the discrete logarithm problem in g .
Step 1.
Decompose g and h into disjoint cycles
g = π 1 π r h = σ 1 σ s .
Here, we include length-one cycles if needed, so that each i { 1 , , n } occurs in exactly one cycle.
Step 2.
Compute arrays G and H, such that the ith entry G[i] stores:
  • the index j of the cycle π j containing i; and
  • the position of i within this cycle ( 1 i n ).
That is, G [ i ] = ( j , pos ( i ) ) would indicate that element i appears in cycle π j at position pos ( i ) . Similarly, in H[i], we store:
  • the index k of the cycle σ k containing i; and
  • the position of i within this cycle ( 1 i n ).
Thus, H [ i ] = ( k , pos ( i ) ) would indicate that element i appears in cycle σ k at position pos ( i ) .
Step 3.
Store the first element of each cycle σ j of h as First[j] in an array. Analogously, store the second element of σ j as entry Second[j] in an array. (For a length-one cycle, we set Second[j] = First[j].) Note that First[j] and Second[j] belong to the same cycle π j of g.
Step 4.
Use the array G to find for each i { 1 , , n } the cycle of g containing First[i] and Second[i], and store the difference D[i] between their positions in an array D. Then, D [ i ] = pos ( Second [ i ] ) pos ( First [ i ] ) , for each i { 1 , , n } . Further, compute the length of the cycle containing element i and store it in an array L .
Step 5.
Step 5. The solution α is congruent to each residue D [ i ] modulo L [ i ] for 1 i | D | . Compute α with the Chinese Remainder Theorem.
It may be worth noting that the last step of the above procedure uses a slightly more general version of the Chinese Remainder Theorem than is commonly discussed in introductory computer algebra courses. Instead of exploiting the availability of an efficiently computable isomorphism between Z / ( m 1 · · m r ) and Z / ( m 1 ) × × Z / ( m r ) , with m 1 , , m r being pairwise coprime natural numbers, we face the more general situation of a linear system of congruences of the form
x x 1 ( mod m 1 ) x x 2 ( mod m r )
where m 1 , , m r may have common factors. This situation is covered, e.g., in [3] (Theorem 3.12) and in [4], which show that a solution is unique modulo the least common multiple of m 1 , , m r , and for executing Step 5 we basically follow the proof given in [4]. Putting everything together, it turns out that the running time of the above procedure is polynomial. (As is common, we use the (bit) length of the group size as cost parameter. With the natural representation of S n used, the running time is also polynomial in the input length.)
Theorem 1.
Let g S n . Then, the discrete logarithm problem in the group generated by g can be solved in time O ( log 4 | g | ) = O ( n 2 log 2 n ) .
Proof. 
Let g S n . It is easy to see that Step 1 from the above description can be completed in time O ( n ) . Indeed, to express g in cycle notation, we assume (without loss of generality) it acts on { 1 , , n } . Thus, we start from i = 1 , perform a look-up and find the image of i under g. If the image is equal to i, close the cycle and increment the index i moving ahead to i + 1 . Otherwise, append g ( i ) at the end of the cycle and repeat the process for this index. There will be at most n look-ups and n stored integers between 1 and n. The arrays G , H each contain 2 n integers.
Further, Step 2 can also be completed in time O ( n ) . As there are at most n cycles in g α , the arrays First, Second are at most n integers long. Thus, the construction of these two arrays requires storing at most 2 n integers.
Let us now move ahead to Steps 3 and 4. For each 1 i | First | , perform a look-up in array G to determine to which cycle of g the value First [i] belongs. This requires at most n look-ups. Look up the position numbers of Second [i] and First [i] and subtract. This requires at most O ( n ) computations plus O ( n ) look-ups.
The final step requires that we solve a system with at most | D | modular arithmetic equations, where the moduli are not necessarily coprime. We have | D | n / 2 , so let k = n / 2 , and let
α D [ 1 ] mod L [ 1 ] α D [ 2 ] mod L [ 2 ] α D [ k ] mod L [ k ]
denote the system of congruences found in Step 5, where each L [ i ] is the length of a cycle of g. As in [4], let m = lcm ( L [ 1 ] , L [ 2 ] , , L [ k ] ) . Now, we can closely follow the the proof of [4]:
Compute the solution to the first two congruences
α D [ 1 ] mod L [ 1 ] α D [ 2 ] mod L [ 2 ] ,
and call this solution α 1 . There are t , s Z with gcd ( L [ 1 ] , L [ 2 ] ) = t · L [ 1 ] + s · L [ 2 ] . By [4], we know the solution is α 1 = D [ 1 ] + t · L [ 1 ] , which is unique mod lcm ( L [ 1 ] , L [ 2 ] ) . According to [5], this application of the Extended Euclidean Algorithm has a cost of O ( log L [ 1 ] · log L [ 2 ] ) . We upper-bound this by O ( log 2 n ) .
Next, consider the two equivalences
α α 1 mod lcm ( L [ 1 ] , L [ 2 ] ) α D [ 3 ] mod L [ 3 ] .
Compute the solution to this pair of congruences as above, and call this solution α 2 . The cost of computing α 2 is
O ( log ( lcm ( L [ 1 ] , L [ 2 ] ) ) · log L [ 3 ] ) = O ( 2 log n log n ) = O ( log 2 n ) .
Iterate this step until the k equivalences are reduced to 2. The solution to the last pair of equivalences is the solution, α .
There will be at most n 1 applications of the Extended Euclidean Algorithm, with total complexity in O ( k = 1 n 1 k · log 2 n ) = O ( n 2 log 2 n ) . From [6,7,8], we know that, for any g S n , it holds that log | g | = O ( n log n ) , and the claim follows. ☐
Correctness of the above procedure is not hard to verify:
Proposition 1.
For any g S n and h g such that h = g α , the above procedure computes α ( mod | g | ) , given g, h, and n.
Proof. 
Let g = π 1 π r and suppose the algorithm returns α ¯ D [ i ] mod L [ i ] for all i as in the proof of Theorem 1. We proceed by showing that g α ¯ = h . Since the π i are disjoint,
g α ¯ = ( π 1 π r ) α ¯ = π 1 α ¯ π r α ¯ .
There exist k i Z such that α ¯ = k i · L [ i ] + D [ i ] for all i, so (1) is equal to
π 1 k 1 L [ 1 ] + D [ 1 ] π r k r L [ r ] + D [ r ] .
The order of π i is L [ i ] for each i, so Equation (2) simplifies to
π 1 D [ 1 ] π r D [ r ] .
To show that g α ¯ = h , we evaluate g α ¯ ( First [ i ] ) and show that the result is Second [ i ] for all i. Let G [ First [ i ] ] = ( l , pos ( First [ i ] ) ) . As First [ i ] and Second [ i ] belong to the same cycle of g, then G [ Second [ i ] ] = ( l , pos ( Second [ i ] ) ) . It follows that
π 1 D [ i ] π r D [ r ] ( First [ i ] ) = π l D [ i ] ( First [ i ] ) .
The image of First [ i ] under π l D [ i ] is found by moving (cyclically) right by D [ i ] positions inside π l . Thus, First [ i ] ends up being mapped to the cycle entry at position pos ( First [ i ] ) + ( pos ( Second [ i ] ) pos ( First [ i ] ) ] ) = pos ( Second [ i ] ) . Consequently, π l D [ i ] ( First [ i ] ) = Second [ i ] . As this holds for all i, the resulting permutation satisfies g α ¯ = h .

4. Experimental Validation

The proposed attack was implemented in Magma V2.21 on a personal computer. An example of the attack in S 100 is as follows. Let
g = ( 1 , 12 , 90 , 19 , 7 , 30 , 44 , 72 , 57 , 55 , 34 , 81 , 82 , 17 , 54 , 21 , 80 , 94 , 35 , 11 , 85 , 100 ) ( 2 , 9 , 83 , 87 , 45 , 13 , 67 , 24 , 78 , 4 , 16 , 32 , 65 , 51 , 29 , 33 , 22 , 59 , 50 , 69 , 56 , 58 , 43 , 31 , 47 , 96 , 91 , 92 , 15 , 75 , 86 , 49 , 68 , 88 , 95 , 36 , 63 , 23 , 71 , 98 , 42 , 28 , 64 , 8 , 38 , 40 ) ( 3 , 10 , 97 , 48 , 74 , 39 , 46 , 60 , 89 , 5 ) ( 6 , 26 , 79 , 25 , 20 , 76 ) ( 14 , 84 , 37 , 53 , 61 , 70 , 73 ) ( 18 , 99 , 93 , 66 , 62 , 27 , 77 , 41 ) .
The order of g is 212,520. Given ( g , g 178 , 705 ) , let us try to recover the secret exponent α = 178,705. Following the procedure presented above, we store
D = [ 21 , 41 , 5 , 5 , 1 , 5 , 2 , 1 , 5 , 5 , 0 ] and L = [ 22 , 46 , 10 , 10 , 6 , 10 , 7 , 8 , 10 , 10 , 1 ] .
Further, we know that α is congruent to D [ i ] modulo L [ i ] for each i. Applying the Chinese Remainder Theorem yields the solution α = 178,705, as expected.

5. Conclusions

The above discussion provides a polynomial time solution for the discrete logarithm problem inside the symmetric group S n , using its standard presentation. On suitable elliptic curves, efficient implementations of ElGamal are available, where (in the absence of quantum computers) no polynomial time attacks on the secret key are known. With the availability of a polynomial-time secret key recovery, it seems fair to consider the security assumption underlying Doliskani et al.’s proposal as problematic.

Author Contributions

Conceptualization, Formal Analysis, and Writing: M.I.G.V, A.R., and R.S.; Software: A.R.

Funding

This research was funded by Spanish MINECO grant number MTM2016-77213-R.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Doliskani, J.N.; Malekian, E.; Zakerolhosseini, A. A Cryptosystem Based on the Symmetric Group Sn. IJCSNS Int. J. Comput. Sci. Netw. Secur. 2008, 8, 226–234. [Google Scholar]
  2. Gamal, T.E. A public key cryptosystem and a signature scheme based on discrete logarithms. IEEE Trans. Inf. Theory 1985, 31, 469–472. [Google Scholar] [Green Version]
  3. Jones, G.A.; Jones, J.M. Elementary Number Theory; Springer Undergraduate Mathematics Series; Springer: Berlin, Germany, 1998. [Google Scholar]
  4. Bogomolny, A. Chinese Remainder Theorem from Interactive Mathematics Miscellany and Puzzles. 2012. Available online: http://www.cut-the-knot.org/blue/chinese.shtml (accessed on 1 May 2018).
  5. Von zur Gathen, J.; Gerhard, J. Chapter The Euclidean Algorithm. In Modern Computer Algebra; The Press Syndicate of the University of Cambridge: Cambridge, UK, 1999; pp. 50–55. [Google Scholar]
  6. Landau, E. Über die Maximalordnung der Permutationen gegebenen Grades. Arch. Math. Phys. 1903, 5, 92–103. [Google Scholar]
  7. Massias, J.P. Majoration explicite de l’ordre Maximum d’un Élément du groupe symétrique. Ann. Fac. Sci. Toulouse Math. 1984, 6, 269–280. [Google Scholar] [CrossRef]
  8. Massias, J.P.; Nicolas, J.L.; Robin, G. Effective Bounds for the Maximal Order of an Element in the Symmetric Group. Math. Comput. 1989, 53, 665–678. [Google Scholar] [CrossRef]

Share and Cite

MDPI and ACS Style

González Vasco, M.I.; Robinson, A.; Steinwandt, R. Cryptanalysis of a Proposal Based on the Discrete Logarithm Problem Inside Sn. Cryptography 2018, 2, 16. https://doi.org/10.3390/cryptography2030016

AMA Style

González Vasco MI, Robinson A, Steinwandt R. Cryptanalysis of a Proposal Based on the Discrete Logarithm Problem Inside Sn. Cryptography. 2018; 2(3):16. https://doi.org/10.3390/cryptography2030016

Chicago/Turabian Style

González Vasco, María Isabel, Angela Robinson, and Rainer Steinwandt. 2018. "Cryptanalysis of a Proposal Based on the Discrete Logarithm Problem Inside Sn" Cryptography 2, no. 3: 16. https://doi.org/10.3390/cryptography2030016

Article Metrics

Back to TopTop