Binary image steganography based on permutation

Gray and color images contain much space for hiding information, and modification of pixel values within a certain range does not cause the image to appear abnormal. However, pixels in binary images possess only two states: black and white. As a result, distortions of binary images can be easily detected. For this reason, hiding information in binary images is more challenging. In this paper, we propose a steganographic scheme based on permutations, which improves the capacity of embedding information in a series of p host binary images. Consider a steganographic scheme T that can hide p×Q(m,n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p\times Q(m, n)$$\end{document} bits of data in p binary images, where Q(m, n) represents the embedding capacity of T for an m×n\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m\times n$$\end{document} binary image block. Our scheme takes advantage of permutation to improve this capacity for p binary images so that, instead of p×Q(m,n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p\times Q(m, n)$$\end{document} bits, it can hide p×log2(p)+p×Q(m,n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p \times \left\lfloor \log _2(p) \right\rfloor + p\times Q(m, n)$$\end{document} bits. The results obtained by experiments show that our model performs a better hiding process in terms of hiding capacity.

ods can be classified into two domains: steganography and watermarking.Digital watermarking is a method of embedding data into digital multimedia content.These data are used to verify the credibility of the content or to confirm the identity of the digital content's owner.It can be used for multiple purposes, such as copyright protection and source tracking.The word steganography is of Greek origin and means covered writing.It is the process of hiding one message within another (a cover medium) such as a web page, image, or text so that the presence of the hidden message is indiscernible.When a message is hidden in a cover medium, the resulting medium is called a stego-object.The key concept behind steganography is that the message to be transmitted should not be detectable to the naked eye.From its definition, steganography is used to ensure data confidentiality, like encryption.However, the main difference between these methods is that with encryption, anyone can see that the two parties are communicating in secret.Steganography hides the existence of a secret message, and in the best case, no one can detect the presence of the message.When they are combined, steganography and encryption can provide better security.Steganography requires three features: security, capacity, and robustness [2].Capacity refers to the amount of information that can be hidden in the medium, whereas security is important when a secret communication is to be kept secret and undetectable by eavesdroppers.Last, robustness can be characterized as the amount of modification the stego-medium can withstand before an adversary can destroy the hidden information.Information security is summarized in Fig. 1.Text, image, audio, and video files are used in steganography as cover media.In particular, images are the most popular cover medium [3].Gray and color images contain much space for hiding information, and modification of pixel values within a certain range does not cause the image to appear abnormal.With the more widespread application of digital technology, much important information, such as personal records, medical records, certificates, handwritten signatures, design drawings, and collections of books, has been scanned into digital documents and stored as binary images.This means that hiding data in binary images has great application potential [4].However, pixels in binary images possess only two states: black(1) and white(0).As a result, distortions on binary images can be easily detected even by human eyes [4,5].For this reason, hiding information in binary images is more challenging.In this paper, we propose a steganographic scheme based on permutations, which improves the capacity of embedding information in a series of p host binary images.Consider a steganographic scheme T that can hide p × Q(m, n) bits of data in p binary images, where Q(m, n) represents the embedding capacity of T for an m × n binary image block.Our scheme takes advantage of permutation to improve this capacity for p binary images so that, instead of p × Q(m, n) bits, it can hide p × log 2 ( p) + p × Q(m, n) bits.As a data sample for experimentation, we used images of 512 × 512 bits, as used in Table 3 of [4].The results obtained show that our model performs a better hiding process in terms of hiding capacity.The rest of the paper is organized as follows: in Sect.2, we present some preliminaries that lead us to the design of our scheme.Then, we present the basic idea in Sect.3. Section 4 presents our scheme.The experimental results, comparisons, and discussion are given in Sect. 5.The security of the scheme is shown in Sect.6 and finally, Sect.7 is the conclusion.

Preliminaries
This section presents an overview on permutation generation methods and on binary image steganography.

Permutation generation methods
Permutation is one of the most important combinatorial objects in computing and can be applied in various applications, for example, scheduling problems.Permutation generation can form the basis of a backtracking program to solve any problem involving reordering a set of items.It is well-known that, for n distinct items, the total number of permutations is n!.Permutation generation has a long history.Surveys in the field have been published in 1960 by Lehmer [6].Among many publications on permutations generation methods, Myrvold and Ruskey [7] proposed a ranking function (Algorithm 2) for the permutations on n symbols which assigns a unique integer in the range [0, n! − 1] to each of the n! permutations.Also, they proposed an unranking function (Algorithm 1) for which, given an integer r between 0 and n! − 1, the value of the function is the permutation of rank r .

Unranking function
First of all, recall that a permutation of order n is an arrangement of n symbols.An array π [0 . . .n − 1] is initialized to the identity permutation π [i] = i, for i = 0, 1, . . .n − 1.

Ranking function
To rank, first compute π −1 .This can be done by iterating In the algorithm below, both π and π −1 are modified.

Overview on binary image steganography
Despite the difficulty related to their structures, binary images have been the subject of several works in steganography.The common objective pursued is to increase the loading capacity while limiting the distortion of the binary image.Jung et al. [8] proposed a data hiding method for binary images that relies on block masking to distribute keys to two parts and then authenticate the correct authorized part.The proposed method divides the cover image into small subblocks and designs key pairs that determine both where a bit is to be embedded and whether it is possible to embed it there.The key pairs are also required to extract the secret data from the stego image.Ding and Wang [4] constructed coding tables for data hiding and extraction based on HVS in suitable blocks of binary images based on the condition that the content of the image is not obviously changed.Dahiwal and Chhajed [9] proposed a binary image steganographic scheme that aims to minimize the embedding distortion on the texture.The complement of a binary image is taken first, and then the image needs to be rotated.After rotation, the mirroring process is used.The flipping distortion score of pixels is calculated by measuring the flipping distortion of corresponding pixels.Jung [10] proposed a method of hiding data in binary images by checking the bit position and parity bit to hide a secret bit in binary images.The cover image is divided into M × N subblocks, and the parity bit of subblock pixels are referenced to embed a secret bit for the suitable pixel.By finding the suitable pixel position at which to insert a secret bit for each subblock, the image quality of the stego image can be improved, while maintaining low computational complexity.Wu and Hwang [11] proposed a data-hiding method based on combination theory.In their scheme, a secret position matrix is designed to improve the hiding capacity which is capable of preventing the least distortion based on the combination theory.Pan et al. [12] defined a secure data hiding scheme for two-color images.Given a cover binary image F, they partitioned it into blocks of fixed size m × n.Their method can hide as many as r bits of the guest message in each block by modifying at most 2 bits in it, where r is defined as r ≤ log 2 (mn + 1) .Because it seems to be a wellknown reference in the field, it has an interesting embedding capacity, and several works refer to it, we use their scheme to illustrate the performance of our method.We present their embedding algorithm (Algorithm 3) and their extraction algorithm (Algorithm 4) below.

Embedding algorithm
The basic idea of this scheme is to use a different binary operator to protect the secret key from being compromised and to use a weight matrix to increase the data rate while maintaining the high quality of the host image.To secure the information, they used a secret key with two components: • K : a randomly selected binary matrix of size m × n.
• W : a weight matrix which is an integer matrix of size Data hiding is achieved by modifying some bits of the cover image F. Algorithm 3 and Algorithm 4 present their embedding and extraction algorithms.
where ⊗ is the pair-wise multiplication of two equal-size matrices and SU M is the sum of all elements in a matrix.3. From the matrix Intuitively, S w is the set containing every matrix index ( j, k) such that, if we complement [F i ] j,k , we can increase the sum in step 2 by w.
There are actually two possibilities to achieve this: will decrease the weight by 2 r − w or, equivalently, increase the sum by w (under mod 2 r ).Also, define S w = S w for any w ≡ w (mod 2 r ).

Define a weight difference
If d = 0, there is no need to change F i .Otherwise, we run the following steps to transform

Extraction algorithm
To retrieve the secret message, the process is as follows.

Algorithm 4 : Extraction Algorithm
Input: The key K and W and the stego binary image

Security
In [12], Pan et al. identified some possible attacks on their scheme and their cost.From their discussion, a brute-force attack is quite impossible, since there are 2 mn and C mn 2 r −1 * (2 r − 1)! * (2 r − 1) mn−(2 r −1) combinations for K and W .
Next, considering the chosen-plaintext attack, which uses a differential technique to reduce the search range of W , that attack has a very high cost, as long as the block size (m ×n) is reasonably large and the secrecy of K and W is maintained.

Basic idea
Before the presentation of our scheme, we first present in this section, the basic idea.Let us consider three binary images of size m × n each, denoted by im 1 , im 2 and im 3 , in which we want to hide the secret message m.Additionally, we denote by T the scheme proposed by Pan et al. [12], where given a binary image of size m×n, T can hide up to log 2 (mn + 1) bits in that image.For the three images, T can hide up to 3 × log 2 (mn + 1) bits.We propose a scheme that improves on this embedding capacity.The scheme is based on the sending order of the images between the sender (A) and the receiver (B).Without loss of generality, let us consider the function f and its inverse g.

Embedding process
In this subsection, we present point by point the method to embed the secret m in the three binary images im 1 , im 2 and im 3 , using T, the scheme proposed by Pan et al. [12].
the binary representation of z.
• divide W into three blocks w 1 , w 2 and w 3 of log 2 (mn + 1) bits each.
-use the scheme of Pan et al. [12] to hide w 1 in im α , w 2 in im β and w 3 in im γ -send the images in the order im α , im β and im γ .
• retrieve the secret m = (x 2 ), the binary representation of x.
Given p binary images, Table 1 presents a comparison in terms of embedding capacity between the scheme of Pan et al. [12] and our scheme.
The following section formalizes this basic idea by presenting our scheme in the general case, where the number of images used is N and the embedding scheme used is any embedding technique denoted by T.

Scheme design
In this section, we present the details of our scheme.Let's denote by T an embedding technique for which given a binary image block I of size m × n, T can hide Q(m, n) data bits in I .Initially, the two communicating parties must share a set of N binary images of size m × n each, denoted by i 1 , i 2 , . . ., i N .Secondly, the set is divided into s blocks of p binary images.In other terms, the N images are divided as: The second block is: N 2 = (i p+1 , i p+2 , . . ., i 2 p ).More generally, for the kth block, 1 The value of p is also shared between the sender and the receiver.
The embedding process begins by dividing the secret message M into l blocks of b bits, such that

Embedding algorithm
We have a secret message M to embed in N binary images, using a steganographic scheme that can hide Q(m, n) bits in a binary image of size m × n.The scheme T uses a key K. Algorithm 5 presents the process to hide the secret message M into the N binary images, using the technique T.
the permutation corresponding to the number N perm i ; π can be considered as π (1), π ( 2), • • • , π ( p); d.Organize the p images of block N i relatively to the permutation π ; e. Compute the number r i such that r i = val i mod (2 α ), 0 ≤ r i < 2 α ; f.Compute β i by β i = (r i ) 2 , the binary representation of r i on α bits; g.Divide use the technique T with the key K to embed (β i ) k in the binary image i π (k) .i. Send the images in this order: Figure 2 presents a graphical representation of our embedding algorithm for the case of p binary images.Note that the function F processes instructions 3.a, 3.b, and 3.e of the algorithm.

Retrieval algorithm
Algorithm 6 presents how to extract the secret message embedded in a series of N binary images, using a steganographic scheme T for which T can hide Q(m, n) in a binary image of size m × n.

Algorithm 6:Retrieval algorithm Algorithm: Retrieval Input:
N : the set of binary images; p: the size of images block; s: the number of images block; M: the secret binary message to retrieve; π : the initial permutation; Q(m, n): the number of hidden bits in a binary image of size m × n bits; K : the key related to T; β: an empty string; Output: M: the secret binary message embedded; begin: 1. for each images block N i , 1 ≤ i ≤ s, a. Use the technique T with its related key K to retrieve in the image i π (k) (1 ≤ k ≤ p), the Q(m, n) embedded bits noted vect and compute β ← β + vect; b.Compute r , the decimal representation of β; c.Build the number N perm i by N perm i = rank( p, π , π −1 ) ; d.Compute val i by val i = N perm i .2α + r ; e. Compute M i , the binary representation of val i ; f.Compute M ← M + M i , where + denote the concatenation; end; Figure 3 presents a graphical representation of our extracting algorithm for the case of p binary images.Note that the function G processes instructions 1.d, 1.e and 1.f of the algorithm.

Remark
For a block of p images, we have p! possible permutations, and by this fact, the maximum value of val i is 2 α × ( p!).This means that, we can hide up to log 2 (val i ) bits per images blocks, which is log 2 ( p!) + p × Q(m, n).According to Stirling's formula [13], log 2 ( p!) ≈ p(log 2 ( p) − 1, 44).For instance, in the case where Q(m, n) is equal to log 2 (mn +1) as proposed in [12], the maximum capacity of hid-ing of p images is about p × (log 2 ( p) − 1, 44) + p × log 2 (mn + 1) .

Experimental results, comparisons, and discussions
In this section, we present experimental results and discussions of our scheme.In the experimental results subsection, we first give an example that describes step by step of the proposed embedding algorithm.We end the subsection by proposing a comparison in terms of embedding capacity for p images between our proposition and other techniques.
The section ends with a discussion subsection.

Experimental results and comparisons
Consider the following five binary images, in which we want to embed the secret message M = 100100111111111111111111001111010010 (Figs.4,5,6,7,8).
Fig. 2 The graphical representation of the embedding process

Embedding process
In this example we have: • p = 5, the number of images per block; • s = 1, the number of images block; • M, the secret message; At the arrival, the receiver will use our retrieval algorithm to obtain the secret data. Remark: • The Pan et al. [12] algorithm applied to these data allows 6 bits × 5 = 30 bits to be hidden.• For the same data, our scheme allows 36 bits to be hidden.
Table 2 presents a comparison in terms of embedding capacity (EC) for p images between our proposition and other techniques.The size of each binary image is 512×512, as used in Table 3 of [4].From this table, we can observe that for p images, regardless of the technique T used, our scheme improves the embedding capacity by p × log 2 ( p) bits.Generally, Table 3 presents the embedding capacity of our scheme for p binary images in comparison with any other embedding scheme T.

Discussion
To extract the secret message, the images must arrive in the order they were sent.This requires a fairly secure transmission channel and a reliable transfer protocol.Initially, the two communicating parties must share a large set of N binary images of size m ×n each, denoted i 1 , i 2 , . . ., i N , but the number of images effectively used depends on the size of the secret message.Compared to Fig. 1, we can say that our model is a mixed steganographic scheme because it depends on the technique T used.
6 Security and complexity of our scheme

Security of our scheme
Our scheme inherits the strengths and weaknesses of the technique T used.Suppose that T is the scheme of Pan et al. [12].In this case, when the opponent captures a copy of the images to retrieve the secret message, he needs the key.Without the key, the opponent has to proceed with a brute-force attack.The brute-force attack on our scheme requires a brute-force attack on Pan et al.'s scheme [12].
Furthermore, since the spy does not have the initial permutation, he has to use the brute-force attack.The brute-force attack for p images requires p! combinations.According to Stirling's formula, this requires ( p e ) p .√ 2π p combinations.Finally, the spy has to break the scheme proposed by Pan et al. [12] p × s times, which requires by brute-force attack an exponential number of combination.

Complexity of our scheme
The time complexity of our scheme depends on the technique T used.We can then distinguish two cases.

The technique T is the scheme of Pan et al. [12]
In this case, the complexity of our scheme is the maximum of the complexity of the scheme of Pan et al. [12] and the complexities of the other elementary steps of our scheme.The complexity of the scheme of Pan et al. [12] is O(m × n) for a binary image block of size m ×n.The other elementary steps of our scheme have l × O( p) complexity.We can obviously conclude that in this case, the time complexity is O(m × n).

The technique T is any other scheme
In this case, the time complexity is max(l × O( p), C), where C represents the complexity of the technique T used.

Conclusion
In this paper, we have proposed a steganographic scheme based on permutations that improves the capacity of embedding information in a series of p host binary images.To illustrate its performance, we used the method proposed by Pan et al., and the results obtained, showed the feasibility of the proposed scheme and comparatively to the related studies, showed that it improves the embedding capacity.

Fig. 12 i 4 Fig. 13
Fig. 12 Image i 4 • • • b r the host binary image F i Output: the stego binary image F i Begin 1. Compute F i ⊕ K , where ⊕ is the bitwise exclusive-OR of two equal-size binary matrices.2. Compute SU M((

Table 1
[12]dding capacity of our scheme for p binary images in comparison with the scheme of Pan et al.[12]

Table 2
Embedding capacity of our scheme for p binary images in comparison with other techniques Ours with T = scheme of Pan et al. [12] 1 8 p × log 2 ( p) + 18 p Ours with T = scheme of Ding and Wang [4] 14.555 p × log 2 ( p) + 14.555 × p Ours with T = scheme of and Hwang [11] 10.314 p × log 2 ( p) + 10.314 × p Fig. 3 The graphical representation of the extracting process

Table 3
Embedding capacity of our scheme for p binary images in comparison with any other embedding scheme T p T p × Q(m, n) Our scheme p × log 2 ( p) + p × Q(m, n)