{'fraction_non_alphanumeric': 0.06648524955161111, 'fraction_numerical': 0.01193642154740553, 'mean_word_length': 3.261860832894043, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 59, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On non-abelian homomorphic public-key cryptosystems

An important problem of modern cryptography concerns secret public-key computations in algebraic structures. We construct homomorphic cryptosystems being (secret) epimorphisms f:G -->H, where G, H are (publically known) groups and H is finite. A letter of a message to be encrypted is an element h element of H, while its encryption g element of G is such that f(g)=h. A homomorphic cryptosystem allows one to perform computations (operating in a group G) with encrypted information (without knowing the original message over H). In this paper certain homomorphic cryptosystems are constructed for the first time for non-abelian groups H (earlier, homomorphic cryptosystems were known only in the Abelian case). In fact, we present such a system for any solvable (fixed) group H.


Introduction
In what follows all the groups are presented in some natural way depending on the problem. For example, the special constructions of Section 2 are based on the groups Z + n and Z * n just given via n, whereas the general construction of Section 3 requires only that elements of a group in question can be generated and moreover, the multiplication and taking the inverse in the group can be performed efficiently. In the latter case the groups can be presented by generators and relations or even by generic algorithms (see e.g. [14]).
There is a lot of public-key cryptosystems using groups (see e.g. [2,11,12,15,20,21]) but only a few of them have a homomorphic property in the sense of the following definition (cf. also [7,22,23]). Definition 1.1 Let H be a finite non-identity group, G a finitely generated group and f : G → H an epimorphism. Suppose that R is a set of distinct representatives of the right cosets of G with respect to ker(f ), A is a set of words in some alphabet and a mapping P : A → G such that im(P ) = ker(f ). (H2) |R| = |H| and for any element g ∈ R its image f (g) as well as for any element h ∈ H its unique preimage g ∈ R such that f (g) = h can be computed in polynomial in N probabilistic time; (H3) the mapping P is a trapdoor function.

Remark 1.2 We require that the set R is given explicitly by a list of elements of G. So, condition (H2) implies that without loss of generality one can assume that the group H is represented by its multiplication table.
Condition (H3) means (see [8]) that the values of P can be computed in polynomial in N probabilistic time, whereas finding of the inverse mapping P −1 is a hard computational problem which can be solved with the help of some additional secret information (for instance, knowing some invariant of the group G). In a homomorphic cryptosystem S the elements of H are (publically) encrypted in a probabilistic manner by the elements of G, all the computations are performed in G and the result is decrypted to H. More precisely: ker(f ) of the group G. We assume that a solution for each instance g ′ ∈ ker(f ) of this problem must have a "proof", which is actually an element a ∈ P −1 (g ′ ). Thus, the secrecy of the system is based on the assumption that finding an element in the set P −1 (g ′ ) is an intractable computation problem. On the other hand, our ability to compute P −1 enables us to efficiently implement the decryption algorithm. One can treat P as a proof system for ker(f ) in the sense of [3]. Moreover, in case when A is a certain group and P is a homomorphism we have the following exact sequence of group homomorphisms (recall that the exact sequence means that the image of each homomorphism in it coincides with the kernel of the next one).
In the present paper the group H being an alphabet of plaintext messages is always finite (and rather small) and given by its multiplication table, while the group G of ciphertext messages could be infinite but being always finitely generated. However, the infinitness of G is not an obstacle for encrypting (and decrypting) since an element from H is encrypted by a finite word in generators of G. For example, in [6] for an (infinite, nonabelian in general) group H given by m generators and relations a natural epimorphism f : F m → H from a free group F m is considered. Thus, for any element of H one can produce its preimages (encryptions) by inserting in a word (being already a produced preimage of f ) from F m any relation defining H. In other terms, decrypting of f reduces to the word problem in H. The main difference with our approach is that we consider free products over groups of number-theoretic nature like Z * n (rather than given by generators and relations). This allows one to provide evidence for difficulty of decryption. Definition 1.3 G crypt is the class of all finite groups H for which there exists a homomorphic cryptosystem over H.
In the context of our definition of a homomorphic cryptosystem the main problem we study in this paper is to prove that the class G crypt contains all solvable nonidentity groups (see Theorem 3.6).
To our knowledge all known at present homomorphic cryptosystems are more or less modifications of the following one. Let n be the product of two distinct large primes of size O(log n). Set G = {g ∈ Z * n : J n (g) = 1} where J n is the Jacobi symbol, and H = Z + 2 . Then given a non-square g 0 ∈ G the triple (R, A, P ) where is a homomorphic cryptosystem over H with respect to the natural epimorphism f : G → H with ker(f ) = {g 2 : g ∈ Z * n } (see [9,8]). We call it the quadratic residue cryptosystem. It can be proved (see [9,8]) that in this case finding P −1 is not easier than factoring n, whereas given a prime divisor of n the computation of P −1 can be performed in polynomial time in log n.
It is an essential assumption (being a shortcoming) in the quadratic residue cryptosystem as well as other cryptosystems cited below that its security relies on a fixed a priori (proof system) P . Indeed, it is not excluded that adversary could verify whether an element of G belongs to ker(f ) avoiding making use of P , for example, in case of the quadratic residue cryptosystem that would mean verifying that g ∈ G is a square without providing a square root of g. Although, there is a common conjecture that verifying for an element to be a square (as well as some power) is also difficult.
Let us mention that a cryptosystem from [18] over H = Z + n (for the same assumptions on n as in the quadratic residue cryptosystem) with respect to the homomorphism f : G → H where G = Z * n 2 and ker(f ) = {g n : g ∈ G}, in which A = G and P : g → g n , is not homomorphic in the sense of Definition 1.1 because condition (H3) of it does not hold. (Since |G| ≤ |H| 2 , one can inverse P in a polynomial time in |H|.) By the same reason the cryptosystem from [16] over H = Z + p with respect to the homomorphism f : G → H where G = Z * p 2 q and ker(f ) = {g pq : g ∈ G} (here the integers p, q are distinct large primes of the same size) is also not homomorphic (besides, in this system only a part of the group H is encrypted). Some cryptosystems over certain dihedral groups were studied in [20].
We note in addition that an alternative setting of a homomorphic (in fact, isomorphic) encryption E (and a decryption D = E −1 ) was proposed in [12]. Unlike Definition 1.1 the encryption E : G → G is executed in the same set G (being an elliptic curve over the ring Z n ) treated as the set of plaintext messages. If n is composite, then G is not a group while being endowed with a partially defined binary operation which converts G in a group when n is prime. The problem of decrypting this cryptosystem is close to the factoring of n. In this aspect [12] is similar to the well-known RSA scheme (see e.g. [8]) if to interprete RSA as a homomorphism (in fact, isomorphism) E : Z * n → Z * n , for which the security relies on the difficulty of finding the order of the group Z * n . We complete the introduction by mentioning some cryptosystems using groups but not being homomorphic in the sense of Definition 1.1. The well-known example is a cryptosystem which relies on the Diffie-Hellman key agreement protocol (see e.g. [8]). It involves cyclic groups and relates to the discrete logarithm problem [14]; the complexity of this system was studied in [4]. Some generalizations of this system to non-abelian groups (in particular, the matrix groups over some rings) were suggested in [17] where secrecy was based on an analog of the discrete logarithm problems in groups of inner automorphisms. Certain variations of the Diffie-Hellman systems over the braid groups were described in [11]; here several trapdoor one-way functions connected with the conjugacy and the taking root problems in the braid groups were proposed. Finally it should be noted that a cryptosystem from [15] is based on a monomorphism Z + m → Z * n by means of which x is encrypted by g x (mod n) where n, g constitute a public key; its decrypting relates to the discrete logarithm problem and is feasible in this situation due to a special choice of n and m (cf. also [2]).

Homomorphic cryptosystems over cyclic groups
In this section we present an explicit homomorphic cryptosystem over a cyclic group of a prime order m whose decription is based on taking m-roots in the group Z * n for a suitable n ∈ N. It can be considered in a sense as a generalization of the quadratic residue cryptosystem over Z + 2 . Throughout this section given n ∈ N we denote by |n| the size of the number n.
Given m, N ∈ N set T N = {(p, q) : p, q are primes, |p| = |q| = N, p < q} and From the Dirichlet's theorem on primes in arithmetic progressions [5] it follows that given an odd prime m, the set D N,m is not empty for sufficiently large numbers N. Let n ∈ D N,m for some natural number N and an odd prime m. Then the group G = Z * n has a (normal) subgroup G 0 = {g m : g ∈ G} the factor by which is isomorphic to the group H = Z + m . Denote by f the corresponding epimorphism from G to H. The mapping is obviously a polynomial time computable homomorphism such that im(P ) = ker(f ). Next, any element of the set is a system of distinct representatives of the cosets of G by G 0 . We observe that given the decomposition n = pq one can find an element R ∈ R m,n in probabilistic time |n| O(1) . Indeed, since m is a prime, it suffices to compute a random element s p ∈ Z * p such that s (p−1)/m p = 1, and an element s q ∈ Z * q , then find by the Chineese reminder theorem the unique element s ∈ Z * q such that s = s p (mod p), s = s q (mod q), and set R = {s i t m i : i = 0, . . . , m − 1} for arbitrary elements t i ∈ Z * n . We claim that the triple S N,m,n = (R, A, P ) with arbitrary chosen set R ∈ R m,n , A = G and P defined by (1) is a homomorphic cryptosystem over the group H with respect to the epimorphism f whenever the following statement is true: Assumption (*). For an odd prime m the problem P(m), of finding the m-root in Z * n with n ∈ D N,m given an element R ∈ R m,n is not easier than the same problem without any such R.
Let us present the group G by the number n and the group H by the set of its elements. Then for the triple S N,m,n conditions (H1) and (H2) of Definition 1.1 are trivially satisfied (the image of the above element s i t m i with respect to the homomorphism f equals i ∈ Z + m ). In fact, condition (H3) would follow from the next lemma. (1) given primes p and q such that n = pq and an element g ∈ Z * n one can verify whether g is an m-power and if it is the case one can find an m-root of g in probabilistic polynomial time in N; (2) the factoring problem for n is probabilistic polynomial time reducible to the problem of finding an m-root in Z * n .
Proof. Throughout the proof we will use the canonical decomposition Z * n = Z * p × Z * q . To prove statement (1) we make use of Rabin's probabilistic polynomial-time algorithm for finding roots of polynomials over finite prime fields (see [19]). Namely, given the primes p, q and g ∈ Z * n we proceed as follows: Step 1. Find the elements g p ∈ Z * p and g q ∈ Z * q such that g = g p × g q , i.e. g p = g (mod p), g q = g (mod q).
Step 2. By Rabin's algorithm (for a prime field) find some roots h p ∈ Z * p and h q ∈ Z * q of the polynomials x m − g p and x m − g q , respectively.
Step 3. Output h = h p × h q .
Observe that the described algorithm fails (at Step 2) if and only if g is not an m-power.
Since, obviously, h m = h m p × h m q = g p × g q = g, statement (1) of the lemma is proved. To prove statement (2) suppose that we are supplied with a probabilistic polynomialtime algorithm Q n that given g ∈ Z * n computes an m-root Q n (g) of g. The following procedure using well-known observations [8] shows how Q n helps to find the numbers p and q.
Step 2. Set y = Q n (x m ). If x = y, then go to Step 1.
Step 3. Output q = GCD(x − y, n) and p = n/q. Let x = x p × x q and y = y p × y q where x p , y p ∈ Z * p and x q , y q ∈ Z * q . From Step 2 it follows that x m q = y m q . On the other hand, since n ∈ D N,m , we have GCD(q − 1, m) = 1. Thus x q = y q (mod q) and hence x = x q = y q = y (mod q).
So, x − y = 0 (mod n) is a multiple of q. To complete the proof we note that since m = O(1), the loop of Steps 1,2 terminates with a large probability after a polynomial number of iterations. Unfortunately, we don't know how to apply this lemma without assumption (*) because in our case the system S N,m,n includes the set R ∈ R m,n . However, from it we obtain the following statement. We complete the section by mentioning that S N,m,n can be slightly modified to avoid the applying of Rabin's algorithm for finding roots of polynomials over finite fields. In principle, to implement the decryption algorithm it suffices to determine whether a given number g ∈ G belongs to the group G 0 or not. However, this can be done by observing that g ∈ G 0 iff g 3 Homomorphic cryptosystems using free products 3.1. Throughout the section for a set X we denote by W (X) the set of all words in the alphabet X. For an element w ∈ W (X) we denote by |w| the length of w. Let G 1 , . . . , G m be a set of m ≥ 1 pairwise disjoint finite groups. For i = 1, . . . , m set Then G i = X i ; R i , i.e. G i is the group given by the set X i of generators and the set R i of relations. Set is called the free product of the groups G 1 , . . . , G m (see [13]). From the definition it follows that each element of G can be represented by the uniquely determined (canonical) word of W G = W (X G ) such that no two adjacent letters of it belong to the same set among the sets X i . This enables us to identify G with the subset of W G consisting of all such words. Thus G = {w ∈ W G : w ∈ W G } where w is the canonical word corresponding to a word w. In particular, g = g for all g ∈ G. Due to identifying the groups G 1 , . . . , G m and G with the corresponding subsets of the set W G , we will assume below that the identities of these groups are equal to the empty word of W G . Suppose we are given epimorphisms f i : G i → K i , i = 1, . . . , m. Assuming the groups K 1 , . . . , K m being pairwise disjoint we set K = K 1 * · · · * K m and W K = W (X K ) where Then the natural surjection W G → W K replacing the elements of X G by their images in X K with respect to corresponding f i , induces an epimorphism Moreover, since the conditions f * | X i = f i define the images of the generators of G, the epimorphism f * is the unique epimorphism from G onto K satisfying these conditions.

3.2.
Let us study the kernel of the epimorphism f * . To do this suppose that K i is a cyclic group of a prime order and (R i , A i , P i ) is a homomorphic cryptosystem over the group K i with respect to the epimorphism f i : G i → K i , described in Section 2, i = 1, . . . , m. Let w 1 , w 2 ∈ W G and x ∈ G i for some i. By an elementary transformation of the word w 1 xw 2 ∈ W G we mean replacing of x by a certain word x 1 P j (a j )x 2 where x 1 , x 2 ∈ G i with x = x 1 x 2 and a j ∈ A j for some j: Denote by W 0 the set of all words of W G which can be obtained from the empty word by a sequence of elementary transformations and set G 0 = {w : w ∈ W 0 }. Proof. First, let w = w 1 xw 2 where w 1 , w 2 ∈ W G and x ∈ G i for some i, to be a word of W G . Suppose that a word w ′ ∈ W G is obtained from w by the elementary transformation (3). Then the words w, w ′ belong or not to the group ker(f * ) simultaneously.
So, the inclusion ker(f * ) ⊃ G 0 follows by the induction on the number of elementary transformation used for constructing an element of G 0 . Conversely, let w ′ ∈ ker(f * ). Let us prove that w ′ ∈ G 0 by the induction on |w ′ |. If |w ′ | = 0, then the statement is obvious. Suppose |w ′ | > 0. Then w ′ = w 1 xw 2 for some w 1 , w 2 ∈ W G and x ∈ ker(f i ) for some i. (Indeed, otherwise since w ′ = w ′ , we conclude that |w ′ | = |f * (w ′ )|. So, |f * (w ′ )| > 0 which contradicts the fact that w ′ ∈ ker(f * ).) So, w ′ is obtained from the word w = w 1 w 2 of W G by the elementary transformation (3). Since w ′ ∈ ker(f * ) from (4) it follows that w ∈ ker(f * ). On the other hand, it is easy to see that |w| ≤ |w| < |w ′ |. So, by the induction hypothesis we conclude that w ∈ G 0 . By the definition of w this implies that w ′ ∈ G 0 . Thus ker(f * ) ⊂ G 0 and we are done.
Let g ∈ ker(f * ). Then from Lemma 3.1 it follows that g can be obtained from the empty word by a sequence of elementary transformations. Moreover, the proof of this lemma implies that there exists such a sequence consisting of at most |g| elementary transformations. Any such sequence is called a proof for g (more precisely, a proof of the membership of g ∈ ker(f * ), cf. (H3) in Definition 1.1). It is easy to see that any elementary transformation (3) is uniquely determined by the following data: the position of the letter x ∈ G i , the word x 1 x 2 x −1 ∈ R j and the element a j ∈ A j . Thus any proof for the element g can be represented by a word p in the alphabet N × R G × (∪ i A i ). One can see that in this case |p| is bounded by a polynomial in |g|.
We define A * to be the set of all proofs for the elements of ker(f * ). It should be stressed that A * includes only "short" (consisting of at most |g| elementary transformations) proofs for an element g ∈ ker(f * ) and does not contain "proofs" for all words of W 0 . For a given s one can generate a random element of A * of the length s in time s O(1) . Indeed, due to the definition of the elementary transformation (3) it suffices to choose randomly positions in a current word and elements of A i for all i = 1, . . . , m. However, this can be done with the help of the algorithms of the homomorphic cryptosystem (R i , A i , P i ) over K i (see condition (H1) of Definition 1.1).

Lemma 3.2
The image of the mapping P * : A * → G defined by P * (a) = g iff a is a proof for g, equals ker(f * ). Moreover, the following statements hold: (i1) given a ∈ A * the element P * (a) can be found in polynomial time in |a|, (i2) if for each i ∈ {1, . . . , m} there is an oracle Q i which for any element g i ∈ ker(f i ) produces a certain a i ∈ P −1 i (g i ), then given g ∈ ker(f * ) a proof a ∈ A * for g can be found by means of at most |g| 2 calls of oracles Q i for P −1 i (g i ), i = 1, . . . , m, g i ∈ ker(f i ), (i3) for each i ∈ {1, . . . , m} and g ∈ ker(f i ) the problem of finding an element in P −1 i (g) is polynomial time reducible to the problem of finding an element in (P * ) −1 (g).
Proof. The equality im(P * ) = ker(f * ) follows from Lemma 3.1. Statement (i1) follows from the fact that any elementary transformation (3) of g ∈ W G is reduced to finding P j (a j ) which can be done in polynomial in |a j | ≤ |a| time. To prove statement (i2) one can apply the following obvious procedure testing membership of a word w ∈ W G to the set W 0 .
Step 1. Using multiplications in the groups G i , i = 1, . . . , m, find the canonical word w of the word w.
Step 2. Using the oracles Q i , i = 1, . . . , m, delete any letter x ∈ ker(f i ) from the (current) word w. If there was at least one deletion, then go to Step 1.
Step 3. If the resulting word is empty, then w ∈ W 0 .
In fact, this procedure is the algorithmic version of the proof of Lemma 3.1. To find a proof for arbitrary g ∈ ker(f * ), it suffices to apply the above procedure to the word g ∈ W G and to collect all results at Steps 1 and 2. Since the number of them is at most |g|, and the number of calls the oracles Q i at Step 2 is also at most |g|, statement (i2) follows.
To prove statement (i3) let i ∈ {1, . . . , m} and g ∈ G i . Then since obviously g ∈ ker(f i ) iff g ∈ ker(f * ), one can test whether g ∈ ker(f i ) by means of an algorithm finding (P * ) −1 . Moreover, if g ∈ ker(f i ), then this algorithm yields a proof from A * for the element g. Set T to be the set of all elements a j ∈ A i of elementary transformations (3) belonging to this proof. Then g = a j ∈T P (a j ). Since the set A i is an Abelian group and the mapping P i : A i → G i is a homomorphism, this implies that a = a j ∈T a j is a proof for g and we are done.
Let us describe a special system of distinct representatives of the right cosets of G with respect to ker(f * ). Set W R = W (∪ i R i ). Then W R ⊂ W G and the set is a system of distinct representatives of the right cosets of G with respect to ker(f * ). Indeed, R * consists of all the words of W R which are canonical words of W G . So, no two elements of R * belong to the same right coset of G with respect to ker(f * ). Thus our claim follows from the fact that the restriction of the mapping f * on R * is the bijection from R * onto K coinciding with f i on R i , i = 1, . . . , m.

3.3.
We need one more special homomorphism of a free product. To do this we recall some facts on semidirect products of groups (see e.g. [10]). Suppose that K 1 , K 2 are groups and ϕ : K 2 → Aut(K 1 ) is a homomorphism. Then the set K 1 × K 2 forms a group with the multiplication given by This group is called a semidirect product of K 1 and K 2 (with respect to the homomorphism ϕ) and is denoted by H = Π(K 1 , K 2 ). One can see that it contains the subgroup K ′ i (isomorphic to K i ) consisting of all pairs with 1 K 3−i as the (3 − i)-th coordinate, i = 1, 2.
In general, if an arbitrary group H have such two subgroups K ′ 1 , K ′ 2 , then it is isomorphic to the semidirect product of them with respect to the homomorphism ϕ induced by the action of K ′ 2 on K ′ 1 by the conjugation. In what follows we shall identify K i with K ′ i , i = 1, 2. We also extend the definition of the semidirect product to arbitrary number of factors by means of setting for m ≥ 3 Π(K 1 , K 2 , . . . , K m ) = Π(K 1 , Π(K 2 , . . . , K m )) with respect to the suitable homomorphisms ϕ. Thus Π(K i , . . . , K m ) = Π(K i , K (i) ) where K (i) = Π(K i+1 , . . . , K m ), for all i = 1, . . . , m − 1 (for i = m − 1 we adopt that Π(K m ) = K m ). In what follows the group Π(K 1 , K 2 , . . . , K m ) will be "small" and presented by its multiplication table. Thus, its subgroups K 1 , . . . , K m are also small and for a given i the homomorphism ϕ i : K (i) → Aut(K i ) can be presented by indicating the permutations ϕ i (k) of the set K i for all k ∈ K (i) .

Lemma 3.3
Let H = Π(K 1 , . . . , K m ) and K = K 1 * · · · * K m for a set of pairwise disjoint finite groups K 1 , . . . , K m . Then there exists an epimorphism Q : K → H such that given k ∈ K one can find the element Q(k) in time polynomial in |k| and |H|.
Proof. Due to our assumptions we see that the set H as well as the set are the subsets of the group K. From the definition of the free product it follows that the elements of H are distinct elements of the quotient group K obtained from K by imposing the set R H of relations. On the other hand, from the definition of R H it follows that any element k ∈ K can be represented by an element of K of the form k 1 · · · k m for some k i ∈ K i , i = 1, . . . , m, moreover this representation is unique, since otherwise the equality of two such representations one could deduce from the relations R H which hold in the group H as well, but in the group H any two such representations differ. After identifying K with the set of all such elements, we see that the mapping is an isomorphism. Denote by Q the composition of the natural epimorpism K → K with this isomorphism. Then the mapping Q : K → H is an epimorphism and given k ∈ K the computation of Q(k) consists in a reduction of k modulo the relations of R H to the form k 1 · · · k m . This can be done by means of the following procedure Step 1. If k is the empty word, then output Q(k) = k.
Step 2. Using the relations x −1 yxy ′ ∈ R H with arbitrary x ∈ K (1) and y ∈ K 1 reduce k to the form k 1 k where k 1 ∈ K 1 and k ∈ K with K = K 2 * · · · * K m .
First, we observe that the length of any intermediate word in the above procedure is at most |k|. Next, the number of recursive calls (at Step 3) is at most |m|. Thus the procedure can be done in time polynomial in |k| and |H|. Lemma is proved.

3.4.
We are ready to describe the main construction of this section. Let K 1 , . . . , K m be a set of pairwise disjoint cyclic groups of prime orders and H = Π(K 1 , . . . , K m ). Suppose that we are given a homorphic cryptosystem (R i , A i , P i ) over the group K i with respect to the homomorphism f i : G i → K i from Section 2, i = 1, . . . , m. Without loss of generality we assume that the groups G i are pairwise disjoint. Set G = G 1 * · · · * G m . Then from the definition of f * (see formula (2)) and Lemma 3.3 it follows that the mapping f = Qf * from G to H is an epimorphism.
with A * , P * defined in Subsection 3.2 and R * defined in (5), is a homomorphic cryptosystem over the group H with respect to the homomorphism f : G → H.
Proof. From the definition of R * it follows that given g ∈ G there exist uniquely determined g 0 ∈ ker(f * ) and r ∈ R * such that g = g 0 r. So, f (g) = Q(f * (g 0 )f * (r)) = Q(f * (r)) = f (r). Thus g ∈ ker(f ) iff f (r) = 1. By Lemma 3.2 this implies that im(P ) = ker(f ). To check the condition (H1) of Definition 1.1 we have to show how to get random elements of A. This follows from the remarks before Lemma 3.2 for random generating elements of A * , whereas the sets R i , i = 1, . . . , m, are given explicitly. Thus it remains to verify that P is a trapdoor function (i.e. the condition (H3)).
First, we observe that by statement (i1) of Lemma 3.2 and by Lemma 3.3 the mapping P is polynomial time computable. Second, by condition (H3) for homomorphic cryptosystems (R i , A i , P i ) there exists an algorithm that given i ∈ {1, . . . , m} and g i ∈ G i efficiently finds an element of the set P −1 i (g i ). Let us show that it suffices to invert P . Indeed, in this case given g ∈ G the element f * (g) ∈ K can be found efficiently. Since g = g 0 r for uniquely determined g 0 ∈ ker(f * ) and r ∈ R * , and f * (r) = f * (g), one can compute the element r and hence the element g 0 = gr −1 within the same time. By statement (i2) of Lemma 3.2 we can also find an element a ∈ A * such that P * (a) = g 0 . Thus to invert P it suffices to test whether f (r) = 1 H holds (if f (r) = 1 H , then (a, r) ∈ A and P (a, r) = g). We have f (r) = Q(f * (r)). Next, by condition (H2) for homomorphic cryptosystems (R i , A i , P i ) we can find the element f * (r) and so by Lemma 3.3 the element Q(f * (r)), and finally test the equality f (r) = 1 H .
Suppose that one can invert P efficiently. Let g ∈ G. If g ∈ ker(f ), then obviously g ∈ ker(f * ). Let now g ∈ ker(f ) and (a, r) ∈ A be a proof for g, i.e. P * (a)r = g. Since r belongs to the right transversal R * of ker(f * ) in G, it follows that g ∈ ker(f * ) iff r = 1 G . Moreover, if r = 1 G , then obviously P * (a) = g. Thus the problem of finding (P * ) −1 is polynomial time reducible to the problem of finding P −1 . So by statement (i3) of Lemma 3.2 the problem of finding P −1 i , i = 1, . . . , m, is polynomial time reducible to the problem of finding P −1 . Thus P is a trapdoor function which completes the proof.
Observe that one can explicitly produce a set R satisfying the condition of Theorem 3.4 (i.e. the condition (H2)). Namely, for each element h ∈ H find a representation h = k 1 · · · k m where k i ∈ K i (cf. Subsection 3.3), and take r i ∈ R i such that f i (r i ) = k i , i = 1, . . . , m. Then the set of all elements r 1 · · · r m for all h ∈ H can be chosen as the set R.
From Theorems 2.2 and 3.4 we immediately obtain the following statement. 3.5. The special cases of a semidirect product are the direct and wreath products. Indeed, in the latter case the resulting group is a semidirect product of the direct power of the first group (with the number of the factors being equal to the order of the second group) by the second group which acts on the product by permutations of direct factors, see e.g. [10]. Thus as an immediate consequence of Theorem 3.4 we conclude that the class G crypt contains direct and wreath products of cyclic groups of prime orders (cf. Corollary 3.5). Using this fact we can prove the main result of the paper. Theorem 3.6 Any solvable nonidentity group belongs to the class G crypt .
Proof. It is a well-known fact that any solvable group can be constructed from a cyclic group of prime order by a sequence of cyclic extensions. On the other hand, from [10, Theorem 6.2.8] it follows that any extension of one group by another one is isomorphic to a subgroup of the wreath product of them. So it suffices to verify (cf. Corollary 3.5) that any nonidentity subgroup of a semidirect product of cyclic groups of prime orders belongs to the class G crypt .
To do this let H ∈ G crypt be such a group. Then there exists a homomorphic cryptosystem S = (R, A, P ) over H with respect to some epimorphism f : G → H. Without loss of generality we assume that S is the homomorphic cryptosystem from Theorem 3.4. Given explicitely a non-identity subgroup H ′ of H set G ′ = f −1 (H ′ ), f ′ = f | G ′ and S ′ = (R ′ , A ′ , P ′ ) where R ′ = R ∩ f −1 (H ′ ), A ′ = {(a, r) ∈ A * × (R * ) ′ : f (r) = 1 H }, P ′ : A ′ → G ′ , (a, r) → P * (a)r and (R * ) ′ = {r ∈ R * : f (r) ∈ H ′ }. Then S ′ is a homomorphic cryptosystem over H ′ with respect to the homomorphism f ′ : G ′ → H ′ . Indeed, we present the group G ′ as a subgroup of G generated by the sets im(P ′ ) and R ′ . (In this presentation of G ′ we would be unable to recognize its elements in G, but we do not need this.) Now the first two conditions of the Definition 1.1 are satisfied for S ′ because they are satisfied for S (to generate a random element of A ′ , it suffices to generate a random element r ′ of (R * ) ′ and for this purpose one can generate a random r ∈ R * and set r ′ = r r where r is the element of R ′ such that f (r)f ( r) −1 ∈ H ′ ). Since ker(f ′ ) = ker(f ), we have im(P ′ ) = ker(f ′ ) and condition (H3) is also satisfied for S ′ because it is satisfied for S.
It should be remarked that the construction of a homomorphic cryptosystem over a solvable group H described in this section is rather theoretical. The computational complexity of the underlying algorithms is bounded by a polynomial the degree of which is a function of |H|. Besides, the size of representing G could be exponential in |H| due to involving wreath products. However, it seems that more careful implementation can be developed for small groups.
From Theorem 3.6 it follows that there exists a homomorphic cryptosystem over the group Sym(n) for n ≤ 4. It would be interesting to construct a homomorphic cryptosystem over an arbitrary symmetric group, because such a system would provide secret computations with any permutation group and moreover an implementation of any boolean circuit in the sense of [1]. In this connection we remark that every boolean circuit of logarithmic depth can be implemented by a polynomial-time computation in an arbitrary nonsolvable group (see [1]). On the other hand, it was proved in [1] that over an arbitrary nilpotent group not any boolean circuit can be implemented. If the group is not nilpotent but is solvable, then only an exponential size implementation is known [1] and it is conjectured that one is unable to do better. Thus, if the latter conjecture was wrong, then combining with Theorem 3.6 would enable us to encrypt any boolean circuit.