{'fraction_non_alphanumeric': 0.025519600105235463, 'fraction_numerical': 0.0077172673857756734, 'mean_word_length': 4.68494516450648, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Color Image Encryption Using Hybrid Method of Fractal- Based Key and Private XOR Key

The main idea of image encryption is to ensure secure transmitting it in the open network by transforming the image to not understandable form so that unauthorized person cannot decrypt and see it. This paper introduces a hybrid image encryption method based on the details of the Mandelbrot set fractals and the private XOR operation. Due to the random nature of fractal images, they can be used as a strong key for encryption. The strength of the key caused by using three random parameters as a secret keys (two of them are the zooming position values x & y, and the third is number of zooming times form that position) used to create the fractal-based key image, and they can generate large number of random fractal images. To make the secret image more secure, the original image is encrypted by applying XOR bit operation on each adjacent pixels of the image. At last the resulted image is combined with the previously obtained fractal-based key image using a predefined private XOR table in a complex order. To evaluate the performance of the system, the correlation coefficients, visual test using histogram analysis and different secret keys were used. All tested results proved that the proposed method is promising and effective to be used in image encryption fields.


Introduction
Nowadays huge amounts of digital visual data are exchanged over various sorts of networks, these visual data contain confidential information's. As a consequence, many techniques are required to provide security, like integrity, privacy, and authentication suitable for these data types [1]. Digital cryptosystems are divided into two types according to key distribution: symmetric and asymmetric key. Symmetric-key cryptosystems use a secret key for encryption and decryption. They are appropriate for processing large amounts of high speed data. The length of the symmetric cipher keys are usually of range (128 to 256) bits.
Asymmetric key cryptography also called, Public key cryptography, uses a pair of keys: public and private keys. Cryptography technique needs some algorithm for encryption of data.
Nowadays a huge sensitive information is transferred over the Internet that need to ensure its security and safety. Images are an important part of these information, therefore it is very important to protect them from unauthorized access [2].
At present, many image encryption algorithms are produced [3][4][5][6] trying to convert the image to unintelligible form that is hard to understand. The term "Fractal" was proposed by Mandelbrot in 1967 when studying patterns on England. The fractal image can be efficiently used as a key in the encryption methods because it is very difficult to break this type of keys against attacks. Generation of fractal image is changed in large amounts when a small change occurred in any of the parameters of fractal image. So it can be used as a secure encryption key. Several papers have been proposed on image encryption using fractal key for image encryption [7][8][9][10]. To study the differential attacks, the characteristics between the input image and the output ciphered image have to be meaningful. Strong encryption systems must be sensitive to minimal changes in the input to produce a totally different output [8]. In this paper, fractal image of Mandelbrot Set is used as a strong symmetric key to encrypt the source image using the XOR operation.

Fractal Geometry
Fractal geometry is a repeated pattern in images, that means, each image or object has this feature is divided into small sections. Each of these sections are a small copy of the original pattern [11]. Fractal Image is a self-similar object [12]  simplicity, efficiency, and great ability to randomly reproduce natural and complex patterns [14].
A fractal object has two basic characteristics: infinite detail at every point and a certain selfsimilarity between the object parts and the overall features of the object. Fractal images are very sensitive to initial values, a big change is taking place when a small change occurred in one of the fractal parameters during its generation. Its curves have non-integer dimensions which are between 1 and 2 [7]. The best known fractal is Mandelbrot set. Mandelbrot set is a set of points in the complex plane. The complex plane is a two-dimensional space with the a vertical imaginary axis, and a horizontal real axis. This set is beauty and complex and derived from some simple definitions (equ. 1). It is defined as a set of points C0 in the complex plane, for which the sequence is defined by the iteration, such that the infinite sequence C 0 , C 1 , …, C n , remains bounded, where: C 0= C 0, C n+1 =C n 2 +C 0 for n=0, 1, 2, 3, ...

Proposed Encryption Method
The proposed image encryption scheme is presented using C# language. It depends on three methods: The fractal geometry, the Boolean XOR operation, and the private XOR operation. The source image can be of any type (.bmp or .jpeg, or any other type) The algorithm is done on four phases as follows:

A.Encryption of the Original Image with XOR Operation:
To get more secure image, the source image is also encrypted by applying the Boolean XOR bit operation on every two adjacent pixels storing the results in the first pixel creating the first step cipher image (Cipher1).

B.Create the Fractal Cryptographic key image:
To generate any fractal image some parameters are needed as a secret keys. Three keys are used here for encryption operation which must be secret between the sender and the receiver of the image. The first two keys are the zooming position (x & y), which their values must not be more than the original image dimensions, the third is the number of zooming times, it preferred to be less than (10) times to avoid extra zooming that cause to move the position to an empty area or less detailed area that leads to weak fractal images. In this work, the fractal rectangle edges are set to (-2, 2, 2, -2) that determined the left, right, upper, and down edges of the drawing rectangle simultaneously. The parameter that represents the fractal iterations is set to 1000.
The Mandelbrot fractal image contain wide empty space which is not efficient in its default state Fig. (1)-a to be used in the encryption operation, so another image is generated from the default image to be the base fractal key. When starting encryption, the system is automatically generates this image by repeatedly calling the fractal generation program from different selected positions many times to obtain a new detailed fractal image which will be used as a base image to encrypt all images in the system. From this image and using the entered three secret keys, the new fractal key is obtained. Instead of sending the whole secret image as a key, only the three parameters are needed, and they will be used to create the secret key image needed in the encoding and decoding stages.
The secret key space in the proposed method is 2 (N x M x I) considering that the image size is (N*M) and the zooming iteration number is (I). This means we can generate one of thousands different images at each time the system is used which increases the secrecy of the system.

C. Private XOR Generation
The XOR operation is frequently used in most of image encryption systems, so it is easy to be attacked and get the original image. To get more secure image, a new predefined private XOR

D.Combine The Source Image With The Fractal Key:
The encrypted image obtained from the first phase (Cipher1) is combined with the fractal image obtained from the second phase using the private XOR table to obtain the second step Cipher image (Cipher2). Fig. (2) show the designed system in C# language displaying the base fractal image and the three secret keys, and the new generated Mandelbrot fractal key.

Experimental Results
Different encryption keys were applied on different source images (Boy, Room, and Group), with different input keys, that means different fractal images can be generated from the base fractal. Different fractal images that generated from many combinations of input keys were tested in the proposed system. Fig. (4) shows the Source colored image, the first phase was the encrypted image (Cipher1) ,and the final phase was the encrypted image(Cipher2) that obtained from combining (Cipher1) with the base fractal key using the Private XOR operation. The first encrypted image was visually good encrypted, but it might be attacked easily because of using the ordinary XOR, so the final encrypted image was provided with high security level and it is robust against any attack.
The histogram is a visual test showing the different intensity values for number of pixels in an image. Fig. (5) shows three histograms for each tested image: the original image histogram and the two phases of the encryption histograms. The second phase is more resistant to all security and statistical attacks.
Another visual test is applied using the image (Boy) with different fractal keys as examples to compare the effect of different fractals on the final encrypted images as shown in Fig. (6).
The first example is the base fractal image, the second is generated from the position (439,241) with repeated 3 times from this position, and the third is generated from the position (332,196) and repeated 5 times from this position. The histograms of the three fractal keys showed a high correlation for all encrypted images, that means at any selected combination of secret keys, the correlation will be high. Correlation is a simple and useful operation to measure the relationship between two pixels in an image. It is a linear operation that each neighboring pixels in any image have a very close correlation between them. Usually the Correlation coefficient of any original image is close to one as listed in Table (2). To enhances the randomness of the image, correlation coefficient must be reduced for Vertical, Horizontal and diagonal pixels. These correlation coefficients results is obtained using corrcoef() command in the MATLAB application and recorded for the original and encrypted images in Table (2) which shows the degradation in the average correlation coefficients in all encrypted images have changed from 0.99 to be 0.08 and less for all encrypted images.

Conclusions
The generation process of the Fractals is time consuming, but on the other hand, it would be a tedious task to avoid the attack and guess the secret key since the fractal geometry is very sensitive to any small change in its parameters. In this paper, a strong and simple hybrid encryption method have been proposed, combining the simple scrambling operation of the XOR technique which broke the correlations of the neighboring pixels of the source image, and the efficiency of the random nature of fractal images that can create thousands of images like Mandelbrot fractal set that is sensitive to a small change in its parameters which was used as a secret key, this key is combined with the managed source image using the private XOR operation. All these methods when used together made the image meaningless and hard to be attacked. Based on the results that are recorded from the experiments we concluded that the performance of the proposed encryption method is very perfect, simple, and have a high space key.