{'fraction_non_alphanumeric': 0.028237679200656465, 'fraction_numerical': 0.0027513636144229376, 'mean_word_length': 3.8828658967711527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Group ring cryptography

Cryptographic systems are derived using units in group rings. Combinations of types of units in group rings give units not of any particular type. This includes cases of taking powers of units and products of such powers and adds the complexity of the {\em discrete logarithm} problem to the system. The method enables encryption and (error-correcting) coding to be combined within one system. These group ring cryptographic systems may be combined in a neat way with existing cryptographic systems, such as RSA, and a combination has the combined strength of both systems. Examples are given.


Introduction
Cryptography is the key element in electronic security systems and has many uses. Included in cryptography are public key encryption, data encryption standards, key exchange systems, digital signatures and others. Probably the best known cryptographic systems are the RSA system, the Diffie Hellmann key exchange system and the discrete logarithm methods. In recent years there has been much interest in the use of Elliptic Curves, see [8,9].
These known systems work within commutative groups. The RSA system works in U (Z n ), the units of Z n , the integers modulo n, where n is the product of two large primes. In this system the order of U (Z n ) is kept secret. Other systems are based on the units or multiplicative group of a finite field GF (q), q = p n with p a prime.
The security of RSA depends on the difficulty of factoring primes; others depend on the difficulty of the discrete logarithm problem.
There has also been some interest in constructing public key cryptosystems via combinatorial group theory. This can be considered as a possible generalisation of the discrete logarithm problem to arbitrary groups using the difficulty of the so-called conjugacy search problem. See for example [1], [4], [5], [6] and the references therein; note that [5] discusses attacks on those that use Braid groups and looks at other possibilities.
The technique here is to use appropriate elements of the group of units, U (RG), of a group ring RG for encryption and decryption. Many construction methods work in many different group rings giving rise to different unique systems of public key encryption.
As group rings may also be used for designing codes, the method enables encryption and (error-correcting) coding to be integrated within the same group ring system. This has potential in terms of complexity reduction, cost savings in terms of chip design, and the number of possible applications that could benefit from cheap, secure and reliable communication.
In the group ring method, units of particular types may be combined to give a unit which is not of any of the constituent types nor of any known type. It is computationally impossible to obtain the original units from the product without information on the units involved. Compare this to RSA in which the two primes are combined to give an element/number from which it is impossible computationally to retrieve the original primes. To decrypt in the group ring method, information on the individual units (primes!) involved must be known as well as information on the inverses of each of these components. A component may itself be a power of an unknown unit adding the difficulty of the discrete logarithm problem to the system.
The group ring method may if required be combined with existing systems, such as RSA, in a particularly neat way giving a system which has the combined strength of both systems.
When the keys have been constructed the time for encryption and decryption is of order n log n at most.
Illustrative examples are given which demonstrate the techniques. These examples are not exhaustive and the lengths and numbers are kept relatively small here so they can be displayed.

Group ring cryptography
The group ring RG of a group G over a ring R is the set of all formal sums where only a finite number of the coefficients (elements of R) are non-zero. See [10] for further information on group rings. We assume that the ring R has an identity element but there is no further restriction on the ring used; in particular it does not necessarily have to be a field. A group ring is a ring itself and it's possible to choose the ring R in the group ring RG to be a group ring itself and this can sometimes be useful.
The set of invertible elements in a ring H is a group, U (H), called the the group of units of H. A zero-divisor in a ring H is an element u = 0 ∈ H such that there is an element v ∈ H, v = 0 with uv = 0. There is extensive literature on units and zero-divisors in group rings.
If u ∈ U (RG) then the inverse of u is denoted by u −1 and satisfies u * u −1 = e = u −1 * u where e is the identity element of RG and * denotes multiplication in RG.

Method
The method of encryption is performed as follows.
• Suppose first of all the data or number to be encrypted, w say, is expressible with digits in a base and whose number of digits in that base is less than or equal to the order of G.
The digits of w are considered as elements of the ring R. It is always possible to find such a ring as for example the integers Z will suffice. In many cases R will be the integers Z or the integers modulo q, Z q , but elements over finite fields or other systems can also be used.
Then w = β 1 β 2 . . . β n with the β i ∈ R. Hence w can be uniquely represented as a group ring elementŵ = n i=1 β i g i with the β i as the digits, which are elements of R, and the G = {g 1 , g 2 , . . . , g n } is a listing of the elements of G.
Thus given a unit u = n i=1 α i g i and an element w = n i=1 β i g i the encryption is given by w → w * u, where * signifies multiplication in the group ring. An encryption may also be given by w → u * w and this is different in general.
We can also add extra digits, and these can be used in various ways such as for error correcting codes.
The encryption depends on the listing of the elements of G and a further complexity could be introduced by permuting the order.
• If the number of digits in w is greater than or equal to the order of G then it may be encrypted by breaking it into smaller blocks in each of which the number of digits is less than or equal to the order of G. Each block is then encrypted.
• In the same way an encryption (block encryption) may then also be applied to the blocks; decrypting can only be performed by knowing both keys, the key for decrypting each block and the key for decrypting the block encryption.
One way of applying block encryption is as follows: Let the blocks be B i h i with the h i as the elements of another, or the same, group H whose order is greater than t. Assume B i = 0 for i > t and the B i ∈ R for some ring R. (R could for example be Z.) Then encode by w → w * u where u is a unit in RH.
In some applications it is true that w * u = u * w but this is not always the case. If w * u = u * w for all w then the encryption/decryption is said to be commutative; otherwise it is said to be non-commutative. Indeed non-commutativity can add another dimension of complexity. When non-commutative the encryption w → u * w is different to w → w * u. Further an encrytion could be performed by w → v * w * u for units v, u which in the non-commutative case is not the same as w → v * u * w.
The inverse, u −1 , of u must be known in order to perform the decryption. The decryption is c → u −1 * c when the encryption is w → u * w; the decryption is is c → c * u −1 when the encryption is w → w * u and similarly for others. The inverse may be the product of inverses of certain units.

Large numbers.
When working out a unit to be used for encryption or decryption it is sometimes the case that large numbers will occur. We can get over this problem as follows. Let u be a unit which involves large numbers and which is to be used for encryption. Suppose the data to be encrypted only involves non-negative integers less than some number m. Let this data be q = n i=1 γ i g i with 0 ≤ γ i < m. Suppose the encryption is given by q → q * u and the decryption is f → f * v where v is the inverse of u. Then in integer coefficients: Let u m denote u with its coefficients taken modulo m and similarly v m is v with coefficients modulo m. Then we see that q = q * u m * v m from the condition on the coefficients of q. Thus the encryption can be given by q → q * u m and the decryption is then f → f * v m where the the coefficients here are worked out modulo m.
Note that m can be taken as large as the computer system and software will allow. We can thus in this situation work in Z m the integers modulo m or the finite field GF (m) when m is a prime or a power of a prime.

Products and powers of units.
The product of units is also a unit. Different types of units are known; further information may be obtained in [10] and in the references therein. The product of a particular type of units is in most case not of this type or indeed of any known type. Thus the encryption can be further made more difficult to decrypt by taking the product of two or more units and using these to encrypt and decrypt. The product in expanded form only is given. Compare this to RSA in which two large primes are multiplied together but only the product, which is not a prime, is given or known to the public.
For example given two units q, t and an element w to be encrypted, the encryption is given by w → w * (q * t) and the decryption is given by p → p * t −1 * q −1 -note the order of inversion is important for non-commutative units. Now q * t only is given and not q, t individually but the decoding is done step-by-step. The product will almost always not be of a known type even when the types of q, t are known. Similarly we can use a product of a number of units.
Taking powers of a particular type of unit for which the type is known will not be of this type and introduces the difficulty of the discrete logarithm problem, i.e. knowing the power of the unit it is not computationally possible to deduce the unit.

Combining with existing systems.
The group ring unit method of encryption may also be combined with known methods such as RSA and this then gives an encryption method which is stronger than the RSA and unit group ring method. Examples of this are given below.
In RSA the integer n is chosen as the product of two (large) primes, the alphabet is Z N for some positive integer N and k = [log N n], the integer part of log N n. A word m to be encrypted has the form m 1 . . . m k corresponding to At any stage either before or after this encryption, or both before and after, a unit encryption may be introduced. Consider then m = k i=1 m i g i and a unit The unit used is the given unit of the intended receiver. Then m ′ is encrypted in the normal RSA way to give a c ′ . At this stage the transmitter could directly transmit c ′ and the intended receiver would use the inverse of the RSA system first and then the inverse of the unit encryption. Alternatively the c ′ or c could be unit-encrypted using secret unit of the transmitter and then transmitted; this would enable a digital signature to be generated. It is of course also possible to encrypt m with the secret unit of the transmitter and this would also enable a digital signature to be generated.

Combining group ring cryptographic system and coding.
It is also possible to combine one of these cryptographic systems and an (errorcorrecting) coding system codes in the one system.
There are a number of ways and methods of doing this and it possible to use either the group structure or the ring structure or indeed both for the coding.
One way is to use the the extra group elements which are not used in the expression for the data to be encrypted. Suppose the word to be encrypted and coded is w = t i=0 α i g i in the group ring of the group G which has n elements where n > t. We then considerŵ = w + n j=t+1 β j g j = w + w 1 (say). Then the w 1 can be used for coding and error-correcting codes and the β j are chosen suitably for the coding.
Alternatively we can use the ring structure for encoding. Suppose for example the words we wish to encode (and encrypt) are words in Z t . We choose our ring to be Z s for some s > t or the integers Z itself. Encode then the coefficients into Z s or into Z. The process is then: encode, encrypt, transmit, decrypt and decode.
Polynomial codes can be combined very nicely with cyclic group rings. Suppose G is cyclic of order n generated by g. Then RG ∼ = R[x]/ < x n − 1 >. Many of the well known error-correcting codes have been characterised as ideals in the group ring of certain finite groups.
Order. The units can be chosen to have infinite order and taking powers of these will not help with finding keys. If the units are taken over Z n then the order will be finite but if n is large this order is also large and not obtainable by formula. (In RSA and other known systems the keys or powers used have finite order although this order is very large.) Disguising the size. Suppose u is a unit which is to be used for encryption and has the form u = n i=1 α i g i .
It is also possible to disguise n and this can be done as follows: Choose random numbers β j for j = n, . . . , s. Replace α i for i ≤ n by α i − β n+i − β n+2i − . . . − β n+ti where n + ti ≤ s and n + (t + 1)i > s. Then β j g j , where the elements g j for j > n are chosen such that g i = g n+i = . . . = g n+it . 1 The person encrypting the message need not know these relations on g k but would know the multiplication of the g k . Then n can be kept secret. Variations on this theme of adding "pseudo" coefficients are also possible.
We are thus able to work in a system without revealing its order and all we need to know is how the multiplication is performed in the group ring. Now [3] section "Generalization" on page 153 discusses this type of difficulty.
Units and types. There are many known units in group rings and there is extensive literature on these. Non-commutative systems and units as well as commutative ones are available. However given a group ring it is not possible to say what the units are. Known ones are constructed by formula but combinations of these are not available by formula.
Cyclic group rings can be used but also combinations of cyclic group rings within other group rings. If G is cyclic of order n then RG ∼ = R[x]/ < x n − 1 >. Hence if R is a Euclidean Domain an attack may be made on the cyclic group ring system using the Extended Euclidean Algorithm. Thus if a cyclic group ring is used on its own, the order of the ring and/or the order of the group, preferably both, should be large just like in RSA the size of the primes involved must be large.
Units can be constructed by formula. These can be combined to give others which cannot be obtained by formula. The formula for the inverse could contain additional difficulty, for example "RSA difficulty" in the sense that given n, the order of the group G, information on the prime factorisation of n, as well as information on the constructing formula, will be necessary, in order to construct the inverse of the unit. Once the inverse of a set of units is known then the inverse of the product of these units is known but a formula may not be used from the product to produce its inverse.
In practical cases once the keys have been calculated the encryption and decryption can be done in O(n log n) time at worst; methods exist which improve on this time. In certain cases existing hardware and software for polynomial multiplication over Z, Z n or finite fields can be used for fast encryption/decryption.

Variations.
Many variations and examples are possible which remain within the concept and scope of the group ring method.

Advantages.
• A new method for public key encryption. When the keys have been constructed the time for encryption and decryption is short and faster than existing methods.
• The units or cryptographic systems can be combined to form new units or cryptographic systems which are of a different type to the constituent units or cryptographic systems. This has advantages over existing systems.
• Powers of the units can be used just as easily as the units themselves but these powers are more difficult to attack as the difficulty of the discrete logarithm problem comes into play.
• These units or cryptographic systems can be combined with existing systems to form new systems which are even more powerful than the constituents. Thus combining with RSA will have RSA security and the group ring security combined and the system is not of either type.
• There are many units and group rings available of many different types which can be used. These can be non-commutative as well as commutative. Non-commutative systems for public key cryptography do not exist at present. Non-commutative systems are more difficult to break.
• In certain situations the length of system may be hidden. Systems of different lengths may be combined.

1.
A new public key cryptographic system using group rings. A group ring RG is chosen. A unit of this group ring is generated which is then used as the public key. The method of generation of the unit or public key is such that the inverse of the unit which is then the private key, cannot be obtained from the public key. The plaintext to be transmitted is converted into a (unique) group ring element and the chosen unit (public key) is used to generate the ciphertext. The ciphertext is transmitted and only the person holding the private key, which is the inverse of the unit, can decrypt the ciphertext.
2. Two or more chosen units of the same or of different types may be combined to form a new unit which is not of any of the types of the constituent units. This new unit is then used as the public key and is not of any known type. The private key is kept secret and is the combination in a certain order of the inverses of the constituent units.
3. The group rings used may be commutative or non-commutative. Known units in the non-commutative case may be combined together (or with commutative units) to give a new unit not of the same type as any of the constituents. This new unit is then the public key and the private key is obtained from the inverses of the constituents; the public key would not reveal either the inverses of the constituents nor the types of the constituents.
4. Given a unit of a particular type, a power of this unit and products of such powers may be used as the public key. Using a power of a unit also introduces the difficulty of the discrete logarithm problem so that knowing the power of the unit is not enough to know the unit itself. This power of a unit may also be combined with other keys or units which have been generated according to this or previous methods to give a new unit and hence a new public key and a new private key; this new system has both the difficulty of trying to find the inverse of a unit and the difficulty of the discrete logarithm problem.

5.
A method exists to disguise the size of the units or keys. A method exists to deal with large numbers.
6. These units or keys generated may be combined with existing public key cryptosystems such as RSA. The new combined systems have more security than each of the constituent systems and will not be of either type. Thus, for example, a system combining group ring public key and RSA public key will have more security than the group ring public key system or the RSA system and will not be of either type. . 7. In many cases these group ring public key cryptosystems can be combined with coding and error-correcting codes to give one system with both public key and coding all in one system.

Many variations and examples are possible.
Examples are now given which illustrate the techniques involved. These should be taken as illustrative and not exhaustive. Also the lengths and numbers are kept small so they can be displayed.

Examples
This examples were constructed with the help of various Computer Algebra Systems such as GAP or MATLAB. The numbers in the examples and the lengths are kept reasonable here so that they can be displayed. Lines beginning with # are comments. Other lines are program outputs or inputs.
Example 1 : This is an example of encrypting and decrypting using a unit in the group ring.
#this is the logfile of the running of groupring3, #which constructs the objects and does the encryption and decryption #the time in millesecs to perform calculations is also given # h is the public key (encrypting function), # hinv is private key which is used to decrypt. These have been constructed #from a formula in the group ring and involves parameters which are not # revealed and do not need to be revealed.