Cryptography Using Quasi Group and Chaotic Maps

: In this paper a symmetric key (stream cipher mode/ block cipher mode) cryptosystem is proposed, involving chaotic maps and quasi group. The proposed cryptosystem destroys any existing patterns in the input, and also, it maximizes entropy. Moreover, the n-grams illustrate that the proposed cryptosystem is secure against the statistics analysis. Furthermore, Experimental results show that the ciphertext has good diffusion and confusion properties with respect to the plaintext and the key, also the results demonstrate that the block cipher mode gives higher entropy than the steam cipher mode.


Introduction
Security is one of fundamental importance in digital communication. Hence, Cryptography is one of the most important fields in computer security. It's a process of transmission data through unsecured channels, and only the authenticated receiver who has the legitimate key can read the encrypted messages which might be documents, phone conversations, images or other form of data. In cryptosystems the information must be scrambled, so that other users will not be able to access the actual information. While providing privacy remains a central goal, the field has expanded to encompass many others, including not just other goals of communication security, such as guaranteeing integrity and authenticity of communications, but many more sophisticated and fascinating goals. Once largely the domain of the military, cryptography is now in widespread use, and you are likely to have used it even if you don't know it. When you shop on the Internet, for example to buy a book, cryptography is used to ensure privacy of your credit card number as it travels from you to the shop's server. Or, in electronic banking, cryptography is used to ensure that your checks cannot be forged.
A chaotic map is a map that exhibits some sort of chaotic behavior. Maps may be parameterized by a discrete-time or a continuous-time parameter. Discrete maps usually take the form of iterated functions. Their properties, such as sensitive dependency on initial conditions and system parameters, and random-like outputs, are similar to confusion and diffusion cryptography properties, so they have been used to build good cryptosystems. Furthermore, these properties make the chaotic cryptosystems robust against any statistical attack. [1][2][3] There are some similar properties between chaotic systems and traditional cryptographic algorithms. In cryptographic algorithms, diffusion and confusion are applied on plaintext over the encryption rounds of the algorithm. In chaotic systems, similar things happen on the initial input parameters. After a sufficiently large number of iterations, an input parameter will be eventually spread over the entire phase space through the random-like orbit over iterations. The stochasticity property of a chaotic system is similar to the diffusion and confusion properties of cryptographic algorithms.
For cryptographic algorithms, in order to decrypt the cipher text to the original plain text correctly, the same key should be used in both encryption and decryption. This is just similar to the requirement that chaotic systems need the same input parameter to reproduce the same output orbit. In this case, the system parameters and initial conditions can be considered as the private key of a chaotic cryptosystem. The table 1 summaries the common relationship which promotes chaos theory into practical cryptographic design. [4,5]  Quasi groups (or Latin squares) provide a powerful technique for generating a larger set of permutation transformations by permuting not only the samples but also transforming the amplitudes themselves across their range [6]. By doing this, they provide an immensely large number of keys, even for small alphabets. Therefore, quasi group based ciphers can have a variety of applications, and in some cases can be competitive to number theory based systems in terms of the difficulty they offer to brute force attacks. Moreover, it is resist to the statistical attack. [7,8] Many researches in the field of using chaotic maps in cryptography have been developed. A cryptosystem with a private key block cipher algorithm used an external key of variable length (maximum 128-bits) to generate the system parameters and the initial conditions of the chaotic map were proposed. The ciphertext depends on the private key only [9]. The main weaknesses of this technique are the ciphertext depends on the private key only, so it is vulnerable to known plaintext attack. It uses small block size (8 bits), and easy to brute force because the initial condition only 256 values.
Later, [10] explained the weaknesses of using a 128-bit external key to derive the initial conditions and number of iterations. These weaknesses are summarized as follows: The interval chosen for a system parameter (λ), the small resolution used to calculate it, together with the deterministic nature of the algorithm, allow for a known plaintext attack. Also, the process to derive an initial condition (X) and number of iterations (N) from the external key (K) is fundamentally flawed, allowing for chosen ciphertext and chosen plaintext attacks. It is concluded from these facts that the total lack of security along with the low encryption speed discourages the use of this algorithm for secure applications.
In 2005, another chaotic map based technique was proposed, in which multiple onedimensional chaotic maps are used instead of a one-dimensional chaotic map. This algorithm uses an external secret key of variable length (maximum 128-bits). The plaintext is divided into groups of variable length (number of blocks in each group is different). These groups are encrypted by using randomly chosen chaotic map from a set of chaotic maps. The number of iterations and initial conditions for the chaotic maps depend on the randomly chosen session key and on the previous block of ciphertext. The encryption/decryption process is governed by two dynamic tables, which contain the number of iterations and initial conditions for the chaotic maps, these tables are updated from time to time during the encryption/decryption process [11]. In this cryptosystem, the ciphertext depends on the private key only, so it is vulnerable to known plaintext attack and also a small block size (8 bits) is used.
Although the previous algorithm is good regarding the confusion and diffusion as well as efficiency, in 2007, a cryptanalysis technique showed some weaknesses of it, which can be summarized as follows: The cipher generated looks like a block cipher, but it behaves as a stream cipher ,and equations of initial conditions and number of iterations are dependent on the secret key only, which results in the initial contents of the two dynamic tables exactly the same for different plaintext sequences as long as the secret key is fixed. The variable, the initial condition, which changes by iterating the maps is used to update the two tables for encrypting the next plaintext block, and each plaintext block is encrypted with the last value of X . At the end of the paper, they make a straightforward modification to make the value of X dependent on both the key and the plain text [12].
A private key cryptosystem is publicized in [13], an improved cryptosystem has been proposed to show the essential weaknesses and redundancies of the previous chaotic cryptosystems. An improved scheme is used to eliminate these weaknesses by different approaches. This scheme uses two skew tent maps instead of a logistic map. The redundant operations in previous systems are abandoned to simplify the cipher. Permutation within ciphertext was implemented by using two independent chaotic variables to mask the plaintext. Here, in the improved chaotic scheme, a onedimensional chaotic map is used, which limits the degree of confusion and diffusion. Also, the number of iterations is calculated using the key indices (60 to 67), i.e. K 60 , K 61 ,…., K 67 stream is used to provide the number of iterations to be applied to the map, which reduces the range of the expected number of iterations (Maximum number of iterations = 2 8

(256) values).
On the other hand, quasi group is a non-associative group, has good scrambling properties. The approaches [14 -16] using a quasi-group multiplication operation as a permutations. However, these schemes need another reliable encryption algorithm is required to preserve the secrecy of the encryption. It is necessary to transmit the quasi group that is being used for encryption, which is one of the main drawbacks of the above approach. Once the eavesdropper breaks the encapsulating cipher he has access to the quasi group used for the encryption and all the other required information to get the data.
Authors concluded that cryptosystem based on quasigroups are slowly but surely. Furthermore, they noticed that there are many broken designs based on quasigroups, but also there are some with perfect crypto properties [17,18].
The authors realized a Laplace transformation based synchronization between two fractional-order chaotic systems to execute error-free encryption and decryption of digital images. The statistical analyses show the consistent encryption strength of the proposed algorithm in [19]. However, a careful probe of their algorithm uncovers underlying security shortcomings which make it vulnerable to cryptanalysis. In [20] chosen plaintext-attack/known plaintext-attack was proposed to break the algorithm completely. It is shown that the plain-image can be successfully recovered without knowing secret key.
We investigate the usage of chaotic maps in cryptography, their properties, such as sensitive dependency on initial conditions and system parameters, and random-like outputs, are similar to confusion and diffusion cryptography properties. Furthermore, quasi groups provide a powerful technique for generating a larger set of permutation transformations, so, we adopt the chaotic maps and quasi groups in our proposed cryptosystem.

Materials and Methods
The proposed private key cryptosystem is based on chaotic maps and quasi groups, it has two types: stream cipher mode and block cipher mode, in the following sections those modes and their security analysis will be explored.

The Proposed Private Key Cryptosystem (Stream Cipher Mode)
Here, we use both of chaotic maps and quasi group to build an efficient cryptosystem.
The general block diagram, illustrates the phases of the cryptosystem is shown in Fig. 1. The encryption process consists of five stages, the first phase is initialization, where the variables, chaotic maps and quasi groups are built, then preprocessing phase where the message is converted into numbers, while in chaotic transposition phase, the logistic map is used to rearrange the message, the Quasi transposition phase mix up the massage using quasi group, the last phase is substitution in which the chaotic maps are used in order to change the cipher values to be unreadable date.
The steps involved in the proposed encryption/decryption process are given below.
Initialization Stage: 1. Getting the secret key 2. Build the quasi groups in the encryption process, and build the inverse quasi group in the decryption process.  Inputs: the original message.

Generate variables using chaotic maps
Outputs: the encrypted message.

Procedure:
Step 1: Initialize the required variables.
Step 2: Convert the message into numbers.
Step 3: Mix up the plaintext using chaotic maps transposition.
Step 4: Shuffle the plaintext via quasi groups transposition.
Step 5: Apply chaotic maps substitution on the plaintext.
Decryption process: Purpose: decrypting the message.
Inputs: the encrypted message.
Outputs: the original message.

Procedure:
Step 1: Initialize the required variables.
Step 2: Apply inverse chaotic maps substitution on the ciphertext.
Step 5: Message post processing.
The initialization steps in encryption side are demonstrated in Fig. 2.a, while Fig.  2.b shows the initialization steps in decryption side.
The different between them is the second step in the encryption side the construction of quasi groups, but in the decryption side the construction of inverse quasi groups.

The Proposed Private Key Cryptosystem (Block Cipher Mode)
Here we examine the proposed cryptosystem in block cipher mode.
It's known that a stream cipher mode is extremely simple and fast, but requires synchronization, while a block cipher mode output is random-looking and has good statistical properties.
The message is divided into 128 byte blocks and each block is encrypted separately using particular key, the user determines the number of encryption boxes, in the following experiments I have four encryption boxes with different keys as shown in Fig. 3.

Results and Discussion
The proposed cryptosystem has been implemented using Matlab and the simulation results were observed on Core2 Duo, 2.40GHz with 2 GB RAM , We have acquired outstanding results, as shown in the following figures the ciphertext and the plaintext are totally different.

The Proposed Private Key Cryptosystem (Stream Cipher Mode)
To show the performance of the proposed cryptosystem, we compared between two plain texts, the first one is consist of constant value particularly the letter 'E' and the other is ordinary text, Fig. 4 shows the first plaintext, and its ciphertext shown in Fig. 5, the second plain text shown in Fig. 6 while the resulted ciphertext shown in Fig. 7.
As observed from these figures, the ciphertext shows a complete random behavior.

Security analysis (Stream Cipher Mode)
The following results demonstrate how much the entropy is maximized, and how the proposed cryptosystem does destroy any existing patterns in the input plaintext, which is desirable for a good cryptosystem.

Entropy
Entropy is a statistical measure of randomness that can be used to characterize the texture of the input. Entropy is a measure of disorder, or more precisely unpredictability.
English text has fairly low entropy. In other words, it is fairly predictable. Even if we don't know exactly what is going to come next, we can be fairly certain that, for example, there will be many more e's than z's, or that the combination 'qu' will be much more common than any other combination with a 'q' in it and the combination 'th' will be more common than any of them. [21] Case 1: The plaintext: "inmathelkhhomwhichialgrowthofpertuxcvrbationslijintheirfyhvnitialconditionstheb ehiaaviityudjkflaorofthat" The entropy of the plaintext = 3.7600, while the entropy of the ciphertext = 6.5466.

Case 2:
The plaintext: The entropy of the plaintext = 0, while the entropy of the ciphertext = 4.8580.
It's observed that the entropy is increased significantly, so the proposed cryptosystem destroys the characteristic of the sent message by increasing the randomness in it.

N-grams
N-grams model is a type of probabilistic model for predicting the next item in such a sequence. The N-gram analysis determines the frequency of different N-grams in a text. Especially the gaps between equal N-grams can potentially be very useful for cracking a cipher because they can point to the key length. [22] An n-gram of size 2 is referred to as a "bigram" (or, less commonly, a "digram"); size 3 is a "trigram". [23] Case 1: The plaintext: "inmathelkhhomwhichialgrowthofpertuxcvrbationslijintheirfyhvnitialcondition sthebehiaaviityudjkflaorofthat"  It observed from the previous tables (table 2 and table 3), that the characteristics of the plaintext and ciphertext are totally different; mainly the occurrence of the characters is changed in the ciphertext from it in the plaintext.

Case 2:
The plaintext: "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" The ciphertext: "+5aQSˉ«N)©x¨((3¤F" It is noticed as shown in table 5 that the letter 'E' didn't appear in the ciphertext and there is no character as much as a recurring character 'E' in the plaintext. So, the proposed cryptosystem is secure against the statistics analysis due to the results demonstrated in table 4 and table 5.

Autocorrelation
Autocorrelation is a mathematical tool for finding repeating patterns. such as the presence of a periodic signal. It refers to the correlation of a time series with its own past and future values. [24] It may be observed from Figs. 8 and 10 that the output characteristics of both cases are a very similar even though the inputs are very different.
In the other side Fig. 9 demonstrates the pattern in case 2 text, while Fig. 10 shows how does the proposed cryptosystem destroy the existing pattern, which is desirable for a good cryptosystem.

The Proposed Private Key Cryptosystem (Block Cipher Mode)
The experiments are applied in two plaintexts:  It may be observed from the figures, that the encrypted sequence is essentially one value, even though the output sequence is very random. Study the characteristics of the output data in the next section.

Security analysis (Block cipher mode)
The following results demonstrate how much the entropy is maximized, and how the proposed cryptosystem does destroy any existing patterns in the input plaintext, which is desirable for a good cryptosystem.

Entropy
Case 1: The entropy of the plaintext = 0, while the entropy of the ciphertext = 6.6736.

Case 2:
The entropy of plaintext= 3.7600, while the entropy of the ciphertext= 6.6506.

N-grams
It's clear that the cryptosystem destroy any patterns , for example in plaintext case 1 the letter "E" has histogram 100% as shown in table 6 , the histogram reduced to 9.09 % in the ciphertext witch clear in table 7.
The same results get in case 2 the letters ( H , O, A, L and M )which are in the plaintext disappeared in the ciphertext, while the letter "W" has histogram 6.67% in the plain text as shown in table 8 , became 12.5% in the ciphertext as mentioned in table 9.

Autocorrelation
It may be noticed from Figures 15 and 17 that the output characteristics of both cases are a very similar even though the inputs are very different. In the other side Fig.  16 demonstrates the pattern in case 2 text, while Fig. 17 shows how does the proposed cryptosystem destroy the existing pattern, which is desirable for a good cryptosystem.
The result shows more randomness and confirms the diffusion property with block cipher more than it when using the stream cipher mode; on the other hand stream ciphers advantage is that they are much faster than block cipher.

Conclusions
In this paper proposed private key cryptosystem in two modes, stream cipher and block cipher mode.
The encryption process is divided into five phases, first the parameters and quasi groups were defined in the initialization phase, and second the preprocessing phase was in the preparing phase, where the plaintext was converted into numbers, which considered more suitable to deal with the chaotic and quasi group's equations. The chaotic transposition was the third phase. It's involved in the logistic map and the plaintext in one equation to eliminate the plaintext characteristics. The Quasi transposition phase which is the fourth phase was used to shuffle the plaintext via quasi groups. The last phase was the substitution where the chaotic maps were used to transform the cipher values to be unreadable date.
The outcome results show that the proposed cryptosystem acquired outstanding performance figures, the proposed cryptosystem destroys any existing patterns in the input, and maximizes entropy. Moreover, the n-grams shows that the proposed cryptosystem was secure against the statistics analysis.
The results show that the block cipher mode gives higher entropy than the steam cipher mode, the entropy of the constant plaintext = 0, while the entropy of the ciphertext using stream cipher mode = 4.8580. In the Other hand the entropy of the ciphertext using block cipher mode was = 6.6736.
For ordinary plaintext, the entropy of the plaintext = 3.7600, even though the entropy of the ciphertext using stream cipher mode = 6.5466, but the entropy of the ciphertext using block cipher mode = 6.6506.
The result refers to encryption process use different keys, i.e. different quasi groups and different chaotic maps parameters, which means more and more randomness in the resulted ciphertexts.

Conflicts of Interest
The authors declare that there is no conflict of interest regarding the publication of this article.