A New Approach of Crypto-compression on MPEG Format

Issues of security and compression of transmitted data have become an important concern in multimedia technology. In this study, we propose an efficient approach to secure video sequences in real time using the method of choosing reference images that is based on the Faber-schauder Multi-scale Transform to reduce the data flow. The encryption step is based on the principle of affine encryption to achieve transposition and to perform some manipulations such as puzzle to reduce the amount of bits to be processed on the image. Testing this approach on video sequences revealed an improvement in data flow and provides a stronger security and a good encryption time.


INTRODUCTION
The sharing and the transmission of multimedia documents in various fields (medical, video-conference, IPTV ...) on the computer network have increased.Consequently, the need in cryptography and compression is become inescapable to secure the transmission and minimize the documents size.
Several works around compression have leads to the standards such as H-263, H. 26L and MPEG.The Moving Picture Experts Group (MPEG) compression is one of the most used methods.In Benabdellah et al. (2005), the authors have based on the image edge detection in order to optimize the selection of the best reference image.In 2007, Benabdellah et al. (2007) applied the Faber-schauder Multi-scale Transform (FMT) on intra and predictive images of each GOP (Group of Pictures) to compare the resulting images after subtraction, in order to choose the optimal one.
Using standard encryption algorithms like Data Encryption Standard (DES), Rivest Cipher (RC5) and Advanced Encryption Standard (AES) do not give a satisfactory solution concerning the video (Zeghid et al., 2007).In fact, the application of these algorithms, even on compressed shape, is confronted by the constraint of time required to encrypt/decrypt.
Many research efforts have been devoted to encrypt/decrypt video in real time has been done.Tang (1996) is based on the scrambling principle by permutation of the DCT coefficients of each macroblock separately.The idea is using a random permutations list, to replace the zig-zag order of the DCT coefficients of a block to a 1×64 vectors.Zeng and Lie (2003) proposed an extension of Tang algorithm operating, not on the macro-blocks, but on segments, each one consisting of macro-blocks.They permute the set of DCT coefficients of each segment separately from the other, for each intra frame of a GOP and also, they permute the motion vectors of P and B frames.Choon (2004) proposed a fast encryption algorithm based on confusion/diffusion principle introduced by Shannon (1949).It consists on macroblocks permutation in order to perform the diffusion, afterwards, XOR operations to make confusion.Choo et al. (2007) have introduced a Crypto-system for uncompressed raw MPEG data, called Secure Real-time Media Transmission (SRMT), by using two transposition steps and one of XOR operation.In 2013, Benlcouiri et al. (2013) have presented a randomized encryption method, which is based on the puzzle principle and the extended affine cipher on field ℤ/‫‬ℤ to scramble the puzzle.The advantages of this method are its randomness concerning the choice of key as well as the execution time which is proportional to the number of puzzle pieces.We exploit the speed of this method to meet the operational needs of encryption/decryption, especially, in the video conference, live-tv, VoD, IPTV, etc.However, lightweight encryption and scramble-only methods provide less security than the naive encryption.
In this study, we propose a new Cryptocompression approach for MPEG format based on FMT and the extended affine cipher.It encrypts only I-frame selected by using the Faber-schauder Multi-scale Transform.The main advantages of this approach are flexibility, reduction of data flow and processing time, which is proportional to the number of puzzle pieces during the operation of encryption/decryption.Indeed, through this method we can vary the processing time depending on the desired level of security.
The body of the present study will be organized as follow.In the second section, we present the Structure of Coding MPEG Format, describe the FMT wavelet transform and we expose the affine cipher method.The third one is devoted to our new crypto-compression approach.Then, we will describe in detail a results obtained after its implementation.Finally we conclude this study by introducing some perspectives.

Structure of coding MPEG format:
The MPEG standard defines a set of coding stages that transform a video signal (digitized in standardized format) into a binary stream (a bit stream) intended to be stored or transmitted through a network.The binary stream is described according to a syntax coded in a standardized way that can be restored easily by any decoder that recognizes the MPEG standard.The coding algorithm defines a hierarchical structure containing the levels described in the following Fig. 1 (Benabdellah et al., 2007).
The group of pictures or GOP consists of a periodic continuation of compressed images.There are three types of the compressed images: Intra image (I) compressed using JPEG for the fixed images, Predictive image (P) coded using a prediction of a previous image of type I or P and Bidirectional image (B) coded by double prediction (or Interpolation) by using a previous image of type I or P and a future Intra image or Predictive image as references.A GOP starts with an image I, contains a periodic continuation of the images P separated by a constant number of images B as in the following Fig. 2. The structure of GOP is thus defined by two parameters: the number of images of GOP and the distance between Intra images and Predictive image.

Faber-schauder Multi-scale Transform (FMT):
The Faber-Schauder wavelet transform is a simple multiscale transformation with many interesting properties in image processing.In these properties, we advertise multi-scale edge detection, preservation of pixels ranges, elimination of the constant and the linear correlation.
For the construction of the Faber-Schauder base, we suppose the family of under spaces (W j ) jЄZ of L 2 (R 2 ) such as V j is the direct sum of V j+1 and W j+ 1 (Benabdellah et al., 2007): The space base W j+1 is given by: The unconditional base and Faber-Schauder multiscale of L 2 (R 2 ) is given by: ∑ Can be broken up in a single way according to V 1 and W 1 (Benabdellah et al., 2007): The continuation f 1 is a coarse version of the original image f 0 (a polygonal approximation of f 0 ), while g 1 = (g 11 , g 21 , g 31 ) represents the difference in information between f 0 and f 1 .g 11 (respectively g 21 ) represents the difference for the first (respectively the second) variable and g 31 the diagonal represents difference for the two variables (Benabdellah et al., 2007).
The continuations f 1 and g 1 can be calculated starting from f 0 in the following way: Reciprocally one can rebuild the continuation f 0  We can consider the FMT multi-scale transformation as a linear application, from the canonical base to the multi-scale base, which distributes the information contained in the initial image in a different way.It is thus more natural to visualize this redistribution, in the multi-scale base, in only one image, as it is the case in the canonical base.The principle of the visualization of images in the canonical base consists in placing each coefficient at the place where its basic function reaches its maximum.The same principle is naturally essential for the multi-scale base.
The image obtained is a coherent one which resembles an outline representation of the original image (Fig. 3).Indeed, the FMT transformation, like some wavelets transformation, has similarities with the canny outlines detector, where the outlines correspond to the local maximum in the module of transformation.In fact, in the case of the FMT transformation, on each scale, the value of each pixel is given by the calculation of the difference with its neighboring of the preceding scale.Thus the areas which present a local peak for these differences correspond to a strong luminous transition for the values of grey, while the areas, where those differences are invalid, are associated with an area, where the level of grey is constant (Benabdellah et al., 2007).

Encryption:
The most methods of encryption based on two principles: substitution and transposition.Substitution means that replacing some letters by symbols or others.Transposition means that permuting the letters of the message to make it unintelligible.Over the centuries, many systems of cryptographic Telecare Medicine Information System (TMIS) have developed more perfection more clever (Benlcouiri et al., 2013).
Congruence: For u, v in Z and n an integer ≥2, the notation u ≡ v mod(n) reads u congruent to v modulo n and means that (u − v) is divisible by n which is equivalent to say that u and v have the same retained when divided by n, for example 17 = 5 (3) but also -1 = 1 (2).(Benlcouiri et al., 2013): u, v, r, s belong to ℤ and n an integer ≥2 if u ≡ v (n) and r ≡ s (n) so: u + r ≡ v + s (n); u-r ≡ v-s (n); u×r ≡ v×s (n) and for all k Є ℤ we have u ≡ v + kn (n) if u and v are two integers belonging to {0; 1; 2;… n-1} so u ≡ v (n) implies u ≡ v The extended euclidean algorithm: The extended Euclidean algorithm permits to calculate the inverse of b modulo n if it exists.Remembering that the inverse of modulo n of b is the whole number b -1 such that b×b -1 = 1 (mod n) for example 7 is the inverse modulo 9 of 4 because 4×7 = 28 = 1 (mod 9): Algorithm: n 0 : = n b 0 : = b t 0 : = 0 t : = 1 q : = an integer less than or equal to n 0 /b 0 r : = n 0 -q×b 0 while r>0 do start temp : = t 0 -q×t if temp > = 0 then temp : = temp mod n, else temp : = n -((-temp) mod n) t 0 : = t t : = temp n 0 : = b 0 b 0 : = r q : = an integer less or equal to n 0 /b 0 r : = n 0 -q×b 0 end while; if b 0 ≠ 1 then b has no inverse modulo n, else b -1 mod n = t This algorithm can also calculate the Bezout coefficients of a and b, (called extended Euclidean algorithm).Recalling that if d is the Greatest Common Divisor (GCD) of a and b, there exists the whole u and v such that au + bv = d.The Euclidean algorithm allows calculating these u and v coefficients.Simply go up the calculations by expressing the GCD d as a function of other numbers (Benlcouiri et al., 2013).

Affine encryptions:
Noting that E = {0; 1; 2… 25}, ܽ and ܾ are integers selected from E. Coding is affine, after numbered from 0 to 25 letters of the alphabet, to encode a letter (called source) number x by the letter number y, where y is the remainder of the division of ax + b by 26.The encoding function associated affine associated with the coefficients a and b is the function f from E to E in which x matches to f (x) = y.f (x) is the only element of the set E = {0, 1, 2... 25} which is congruent to ax + b modulo 26, f (x) ≡ ax + b mod (26) (Benlcouiri et al., 2013).
Proposed method: The proposed method includes two steps: compression step and encryption step.
The compression step: Consists in extracting the various images initially; Intra image, Predictive image and Bidirectional image constituting the video sequence.
We apply the FMT only on Intra and Predictive images.Then, we make the subtraction between the resulting images.We choose the best reference image for each image as follows: • If we will have results, after subtraction of resulting images, containing only the points, we choose the best reference image for the concerned image, that which corresponds to the result containing the minimum number of points.• If we will have results containing the points and the parallel linear or nonlinear curves.We choose the best reference image for the concerned image that which corresponds to the result containing the minimal distance between parallel linear or nonlinear curves.

The encryption:
Step consists in encrypting only Intra pictures in each GOP of MPEG sequence while keeping the motion vectors responsible for reconstruction of the P images and the B images.It is to use the principles of an affine encryption on field type ℤ/pℤ married to the results of modular arithmetic and the problem of the puzzle to complete the transposition of elements.
The keys generation: For our method is divided into three parts: • Choose a prime number p to work on the ℤ/‫‬ℤ field, in which all elements are invertible.• Subdivide the image processing into ‫‬ − 1 puzzle pieces (square, triangle…) with (݊× ݊) blocks size according to the required security level.• Select a pair of elements (a, b) in [(ℤ/‫‬ℤ)*, (ℤ/ ‫‬ℤ)] and calculate the inverse of a using the extended Euclidean algorithm: ܽ × ܽ ିଵ ≡ ‫݀݉1‬ ‫.)(‬After subdividing the Intra image in ‫(‬ − 1) macro-blocks numbered from 1 to p-1, we proceed as following.Let f be the mapping defined as follows: To change the location of each macro-block of image processing, we apply the function f to its indices: Reorganize the results after applying the function f on the indices of macro-blocks conducted a transposition.The encrypted image is shown in the Fig. 5.
Reconstruct the video sequence by replacing the original Intra image by the Intra image after processing.

Decryption step:
The decryption key is the triple [p; (a ିଵ , b); (n, m); L], when L is the index of the new reference image.
We perform the extraction of images number L on the video sequence encrypted then remake the same calculation performed in the encryption phase to find the order of transposition using ݂.
We rearrange the encrypted image according to the result obtained: ሼ5; 10; … ; ‫(‬ − 1); … 3ሽ ௧௦௦ Then we apply the MPEG algorithm for the decoded video sequence.

APPLICATION AND RESULTS
For apply the proposed method we process as follows: • Extract still images that constitute the video sequence • Application of the FMT on the Intra and Predicted images.Next, make the extraction from the resulting images.Then use the two criteria we proposed to select the best reference image for each image (Intra and Predictive) • Now, for each Intra image we proceed as follows: We choose a prime number p = 257 to work on the fields ℤ/pℤ =ℤ/257ℤ • Then we divide the image into (p-1) = 256 elements each of size (n × m) where n = 8 and m = 8 • We selected from (ℤ/257ℤ) the pair (a, b) = (195, 10) that we have used, by applying the function ݂ to bring the biggest mess possible The decryption key is the same as the encryption and it is given as follows: K = [257; [(195, 10) The results of our method application using the key K are illustrated in the Table 1 and Fig. 6.
We notice that this introduced method concerns the reduction of information for a minimal storage and a transmission by reduced flow because after application of the step of choosing the right reference images, the GOP is rearranged: The image I became the image P3, the image P1 became the image I, the image P2 became the image P1 and the image P3 became the image P2.
After reconstruction of the new sequence, the entropy of the original Intra image is equal to that of the encrypted Intra image which provides a high degree of security (Fig. 6) according to law of security measure that is introduced by Shannon in information theory.The entropy of the Encrypted Images P1, B1 and B2 is a little higher than that of the original images P1, B1 and B2 (Table 1).
The subdivision of the image into 256 macroblocks allows us, on encryption, to make a calculation of codes into 8 bits and obtain a minimum processing time.
We separately encrypted the Intra image whose computation time was 2 (ms).Then, we applied the MPEG algorithm to reconstruct the images P and B who are encrypted with computation time equal to 0. Also, by our approach we have obtained a memory of the encrypted GOP smaller than the memory of original GOP (Table 1).

CONCLUSION
We introduced an encryption-compression approach of video sequences based on the FMT and the affine encryption.The encryption step by the affine encryption enabled us to produce a method of transposition on field (ℤ/pℤ) use of the principle of the puzzle allows to reduce the amount of pixels processed the results obtained from our application, shows that the complexity can produce such a system of transposition.
The main idea behind this study is to carry out tests on the modification of the encoding sequence of the video sequence images to produce a gain in the result.
Some tests highlighted a possible gain for certain sequences through the choice of the reference images.The FMT transformation is distinguished by its simplicity and its performances of seclusion of the information in the out-line regions of the image.The mixed-scale visualization of the transformed images allows putting in evidence its properties, particularly, the possibilities of compression of the images and the improvement of the performances of the other standard methods of compression as JPEG and GIF.
Based on its encryption speed and the degree of security it provides, we want to marry the encryption step with other compression methods to produce new encryption-compression approaches of video and still images.

Fig. 1 :
Fig. 1: Hierarchical structure of MPEG coding 2l 1 f + + from f 1 and g 1 by the four relationships indicated above.

Fig. 3 :
Fig. 3: Representation on mixed-scales and separate scales of the image "lena", the coefficients are in the canonical base, (a) and in the faber-schauder multi-scale base (b)