Keywords

1 Introduction

Steganography is the art and science of hidden data communication. Till date, many data hiding schemes [2] are developed but only few of them are considered being more secured and have less distortion. The data hiding schemes are useful in many application areas to solve the problem of ownership identification, copyright protection, authentication, verification, and more. The main aims of data hiding schemes are to ensure extraction of secret data and recovery of original object from stego media. On the other hand, data should stay hidden in stego media even if the eavesdropper tampered the stego or degrading through natural phenomenon like transmission resampling, compression, or filtering, etc. The main drawbacks of data hiding schemes are not to provide a good solution in such cases. The degree of distortion will be high due to increase of data embedding capacity that should be balanced mathematically using spread spectrum. The data embedding in video is considered to be more unsuspicious and secured and less exploration has been done till today in this research area using Hamming code.

2 Related Work

Video hiding inside a video stream using nonuniform rectangular partition is done by Sheng et al. [3]. Then, another video hiding scheme is proposed by Yadav et al. [4] based on LSB technique which replaces the least significant bits of pixels selected to hide the secret information. Video as a collection of numerous frames has greater data hiding capacity as the small color change in the whole video stream is hard to detect in human eyes. Dasgupta et al. [5] proposed hash-based LSB techniques in spatial domain where the bits of the message can be inserted in intensity pixels of the video in LSB positions. Here, we have proposed video steganography using (7, 4) Hamming code for color images. We have divided R, G, B color pixels in bit plane [6] starting from LSB to LSB-3 (up to 4 bit plane) partitioned into (3 × 3) blocks and then apply Hamming code based data hiding scheme. In this scheme, 36 bits of data are embedded within nine pixels which is more higher than other existing LSB technique [1, 4, 5] and most of the LSB techniques are prone to attack [7, 8]. Also, it maintains high visual quality. Additionally to provide more security, the message is encrypted using symmetric key encryption techniques. Thus, we have achieved secure steganographic system for hiding data in video stream using both cryptography and steganography techniques.

3 Proposed Method

A video stream consists of collection of frames and the secret data is embedded in these frames as payload. The cover video is broken down into frames before embedding. Each frame is now considered as a cover image. Now, the proposed technique has been applied to conceal the secret data in the carrier frames.

Suppose, I is considered as the cover frame image of size (M × N), and I’ is the marked image after embedding data D = {d1, …, dX}, where di∈ {0, 1}, 1 ≤ i ≤ X. Here, H is a parity check matrix of the Hamming code. Let H be

\( H = \left| {\begin{array}{*{20}l} 0 \hfill & 0 \hfill & 0 \hfill & 1 \hfill & 1 \hfill & 1 \hfill & 1 \hfill & 0 \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & 1 \hfill & 0 \hfill & 1 \hfill & 1 \hfill & 0 \hfill & 1 \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & 1 \hfill & 1 \hfill & 0 \hfill & 1 \hfill & 0 \hfill & 0 \hfill & 1 \hfill \\ \end{array} } \right|, \) Embedding capacity is an important metric for data embedding. It is measured by the number of secret bits that can be embedded into a cover image. The embedding capacity is calculated as [2] \( ER = L/M \times N{\kern 1pt} {\text{bpp}} \) where L is the length of the secret message. Before embedding the secret data, we take 36 bit secret key k1 which is known to both the sender and the receiver, to encrypt the secret data bit using symmetric key encryption. We have taken each pixel block of size (3 × 3) and 4 bit plane of each pixel is used to embed the data, which results in (3 × 3) × 4 = 36 bits of data (D1) in one iteration. As an additional security measure, instead of choosing the cover image pixel block serially, we will use Pseudorandom Number Generator (PRNG) function with a secret predefined seed k2 (which is only known to the sender and the receiver) to determine the next available block for embedding. Since this seed will be known to the sender and receiver only, the generated unique pattern of pixel block selection can be used in embedding and extraction process securely. The data embedding procedure is enlisted in Algorithm 1 and the data extraction procedure is depicted in Algorithm 2 (Fig. 1).

Fig. 1
figure 1

Pictorial diagram of the proposed data hiding scheme

Algorithm 1:

Data embedding process

Input: Cover video, secret data bits D, Hamming matrix H, secret key k1, and seed value k2

Output: A stego video

  1. Step 1:

    Extract each frame from video stream as a color image I of size (M × N).

  2. Step 2:

    Collect random sequence of pixel blocks of size (3 × 3) from cover image IM×N using PRNG (k2). Say the pixel blocks are X1, X2, …, XMN.

  3. Step 3:

    Convert Xi into three separate RGB color blocks XiR, XiG, and XiB.

  4. Step 4:

    Convert each Xi’s into binary form.

  5. Step 5:

    Perform bit plane slicing of each Xi ‘s up to 4 bit plane starting from LSB that is XiR(LSB), XiR(LSB−1), XiR(LSB−2), XiR(LSB−3).

  6. Step 6:

    Take c = XiR(LSB) and calculate the syndrome S1 = (H × (c)T)T.

  7. Step 7:

    Perform D1’ = (D1 ⊕ k1); k1 = 36 bit length and D1 is also same length.

  8. Step 8:

    Take 3 bits secret data di = {d1, d2, d3} from D1’ where di ∈ {0, 1}.

  9. Step 9:

    Calculate S2 = (di ⊕ S1); if S2 = 0, no change, otherwise flip a bit at the positional value of S2 and generate H’.

  10. Step 10:

    Compute S3 = (H’ ⊕ c) and store the data.

  11. Step 11:

    Replace the matrix (c) with S3 and update XiR(LSB).

  12. Step 12:

    Repeat Step 4 to 10 using XiR(LSB−1), XiR(LSB−2) and XiR(LSB−3).

  13. Step 13:

    Repeat Step 5 to 11 to embed secret data on XiG and XiB color blocks.

  14. Step 14:

    Repeat Step 2 to 12 to embed secret data on each and every random sequence of (Xi’s) of pixel blocks.

  15. Step 15:

    Finally, after combining each stego block, we get stego frame (I’) of size (M × N).

  16. Step 16:

    Generate stego video stream with encoded frames.

  17. Step 17:

    End.

Algorithm 2:

Data extraction process

Input: Stego video stream, Hamming matrix H, secret key k1, and seed value k2

Output: Original Secret Message D.

  1. Step 1:

    Convert the video stream into frames. Extract each frame as a color cover image I’ of size (M × N).

  2. Step 2:

    Use PRNG with predetermined seed k2 to determine the stego pixel of random sequence X’i of size [3 × 3] from stego image I’.

  3. Step 3:

    Separate RGB components into X’iR, X’iG, X’iB.

  4. Step 4:

    Convert into binary form of each X’iR, X’iG, and X’iB.

  5. Step 5:

    Perform 4 bit plane slicing of each X’i‘s starting from LSB that is X’iR(LSB), X’iR(LSB−1), X’iR(LSB−2), X’iR(LSB−3).

  6. Step 6:

    Take c’ = X’iR(LSB) and calculate the syndrome S’ = (H × (c’)T)T.

  7. Step 7:

    Concatenate syndrome S’ with data unit of D’ that is D’ = D’ || (S’).

  8. Step 8:

    Repeat Steps 4 to 6 using X’iG and X’iB.

  9. Step 9:

    Compute Di = D’ ⊕ k1.

  10. Step 10:

    Repeat Steps 2 to 8 using next random sequence of Xi block.

  11. Step 11:

    Concatenate Di’s, we get original secret message D.

  12. Step 12:

    End.

3.1 Numerical Illustration

Example 1

Data Embedding

  1. 1.

    Let I is a color pixel block with (3 × 3) pixel. D = {d1, d2, …, d36} = {0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0}. k1 = {0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0} and ER = 36/(3 × 3) = 4 bpp and D’ = D ⊕ k1 = {0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}

  2. 2.

    Divided into three RGB pixel blocks shown below.

$$ R = \left| {\begin{array}{*{20}c} {141} & {141} & {141} \\ {141} & {142} & {142} \\ {140} & {143} & {143} \\ \end{array} } \right|\quad \text{G} = \left| {\begin{array}{*{20}c} {143} & {141} & {142} \\ {141} & {144} & {145} \\ {143} & {146} & {147} \\ \end{array} } \right|\quad {\text{B}} = \left| {\begin{array}{*{20}c} {147} & {145} & {145} \\ {145} & {149} & {150} \\ {146} & {150} & {151} \\ \end{array} } \right| $$
  1. 3.

    Take red pixel block and transform into binary number matrix.

$$ \text{R} = \left| {\begin{array}{*{20}c} {10001101} & {10001101} & {10001101} \\ {10001101} & {10001110} & {10001110} \\ {10001100} & {10001111} & {10001111} \\ \end{array} } \right| $$
  1. 4.

    Divide it into 4 bit plane matrices starting from LSB.

$$ R_{LSB} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 1 \\ \end{array} } \right|\quad R_{LSB - 1} = \left| {\begin{array}{*{20}c} 0 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 1 & 1 \\ \end{array} } \right|\quad R_{LSB - 2} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{array} } \right|\quad R_{LSB - 3} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{array} } \right| $$
  1. 5.

    Read the LSB matrix and form a 1D matrix. c = [1 1 1 1 0 0 0 1 1]

  2. 6.

    Calculate the syndrome

    $$ \begin{aligned} S_{1} & = H \times \left( c \right)^{T} = \left| {\begin{array}{*{20}c} 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 1 \\ \end{array} } \right| \\ & \quad \times \left| {\begin{array}{*{20}c} 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 \\ \end{array} } \right|^{T} = \left| {\begin{array}{*{20}c} 1 \\ 0 \\ 1 \\ \end{array} } \right| \\ \end{aligned} $$
  3. 7.

    Transpose the syndrome and XOR with the secret data bit, i.e., [1 0 1] ⊕ [0 1 1] = [1 1 0] which matches with the fifth column of Hamming matrix.

  4. 8.

    Generate the code H’ = [0 0 0 0 1 0 0 0 0] and XOR with the original code c.

S3 = [1 1 1 1 0 0 0 1 1] ⊕ [0 0 0 0 1 0 0 0 0] = [1 1 1 1 1 0 0 1 1].

  1. 9.

    Transform into a new LSB matrix.

$$ R^{{\prime }}_{LSB} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \\ \end{array} } \right| $$
  1. 10.

    Similarly compute the LSB-1, LSB-2, and LSB-3 matrices as follows:

$$ R^{{\prime }}_{LSB - 1} = \left| {\begin{array}{*{20}c} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \\ \end{array} } \right|\quad R^{{\prime }}_{LSB - 2} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 0 \\ \end{array} } \right|\quad R^{{\prime }}_{LSB - 3} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 1 \\ \end{array} } \right| $$
  1. 11.

    Update all four modified binary matrices to their corresponding position in original RED pixel matrix.

    $$ R^{{\prime }}_{3 \times 3} = \left| {\begin{array}{*{20}c} {10001101} & {10001101} & {10001101} \\ {10000101} & {10001111} & {10001100} \\ {10001100} & {10001111} & {10001011} \\ \end{array} } \right| = \left| {\begin{array}{*{20}c} {141} & {141} & {141} \\ {133} & {143} & {140} \\ {140} & {143} & {139} \\ \end{array} } \right| $$
  2. 12.

    Similarly get updated green and blue pixel matrices.

Example 2: Data Extraction

  1. 1.

    The marked frame pixel block is divided into three RGB color pixel blocks.

$$ R = \left| {\begin{array}{*{20}c} {141} & {141} & {141} \\ {133} & {143} & {140} \\ {140} & {143} & {139} \\ \end{array} } \right|\quad G = \left| {\begin{array}{*{20}c} {143} & {141} & {134} \\ {143} & {144} & {149} \\ {143} & {146} & {146} \\ \end{array} } \right|\quad \text{B} = \left| {\begin{array}{*{20}c} {147} & {145} & {149} \\ {145} & {149} & {150} \\ {147} & {156} & {151} \\ \end{array} } \right| $$
  1. 2.

    Take red image pixel block and transform into binary numbers.

$$ \left| {\begin{array}{*{20}c} {10001101} & {10001101} & {10001101} \\ {10000101} & {10001111} & {10001100} \\ {10001100} & {10001111} & {10001011} \\ \end{array} } \right| $$
  1. 3.

    Divide it into 4 bit plane matrices starting from LSB.

$$ R_{LSB} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \\ \end{array} } \right|\quad R_{LSB - 1} = \left| {\begin{array}{*{20}c} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \\ \end{array} } \right|\quad R_{LSB - 2} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 0 \\ \end{array} } \right|\quad R_{LSB - 3} = \left| {\begin{array}{*{20}c} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 1 \\ \end{array} } \right| $$
  1. 4.

    Read LSB matrix and form a 1D matrix. c = [1 1 1 1 1 0 0 1 1]

  2. 5.

    Calculate the syndrome S1 = H × (c)T =

$$ \left| {\begin{array}{*{20}c} 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 1 \\ \end{array} } \right| \times \left| {\begin{array}{*{20}c} 1 & 1 & 1 & 1 & 1 & 0 & 0 & 1 & 1 \\ \end{array} } \right|^{T} = \left[ {\begin{array}{*{20}c} 0 \\ 1 \\ 1 \\ \end{array} } \right] $$
  1. 6.

    Transpose the syndrome to get secret data bits d = [0 1 1]

  2. 7.

    Repeat the above steps until we do not get the secret data bits. Concatenate all the data bits to get the data, that is, D’ = {0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0}.

  3. 8.

    XOR the modified secret data with secret key k1 to get the original secret data bits that is D = {0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0}.

4 Experimental Result and Comparison

The scheme is implemented using NetBeans IDE 8.0 on standard color images to measure the performance. The standard cover video sequences are Audio Video Interleave (AVI) format with the size of (192 × 352). These are collected from the video database of department of computer science at University of Mannheim [9]. The secret message is a binary image logo. Upon extraction, the secret data is retrieved without any loss or noise. The qualities of the stego frame images are measured using Mean Square Error (MSE) and Peak Signal-to-Noise Ratio (PSNR).

$$ MSE = \frac{\text{1}}{M \times N}\sum\limits_{{i = \text{1}}}^{M} {\sum\limits_{j = 1}^{N} {\left[ {I\left( {i,j} \right) - I^{{\prime }} \left( {i,j} \right)} \right]}^{2} } $$
(1)
$$ PSNR = 10\log_{10} \frac{{255^{2} }}{MSE}\left( {dB} \right) $$
(2)

Following tables are representing the PSNR values of stego videos generated by our algorithm with varying payload. The average capacity of data embedding per frame is 16.5 KB (when ER = 2 bpp), 24.68 KB (when ER = 3 bpp), 32.9 KB (when ER = 4 bpp) which is almost eight times that of other existing algorithms [1]. The standard video sequences are 25 fps. So, we can embed maximum 823 KB data per second which is a high payload compare to any other algorithm [5] (Tables 1, 2, 3 and 4).

Table 1 Result of PSNR, SSIM from our proposed method when payload 2 bpp
Table 2 Result of PSNR, SSIM from our proposed method when payload 3 bpp
Table 3 Result of PSNR, SSIM from our proposed method when payload 4 bpp
Table 4 The performance comparison of different schemes under different video sequences

5 Security Analysis

Security analysis is an important key factor of data hiding process. In this paper, we have used two levels of security to enhance our proposed scheme from security perspective. First, we take a 36 bits secret key and encrypt the secret data bits using symmetric key encryption. As it is only known to the sender and receiver, the third party will not be able to decrypt it without knowing the secret key. In the second level, we have taken a secret seed which is also known to the receiver and sender only. Using this seed, we generate a sequence of unique numbers with the help of PRNG function. We have taken the cover image pixel blocks according to the generated numbers. So without knowing this seed, no one will be able to predict the number sequence.

We also verified our algorithm against standard measurement like SSIM. The Structural Similarity (SSIM) index is a method for measuring the similarity between two images. The SSIM index can be viewed as a quality measure of one of the images being compared provided the other image is regarded as of perfect quality. From the tables, it is observed that the SSIM values of all test images are nearer to 1.

6 Conclusion

In this paper, we introduced a novel secure data hiding scheme using Hamming Code for video steganography. Bit plane slicing of the each RGB color cover frame pixel block is also introduced to increase data hiding capacity. So the data embedding rate is raised up to 4 bpp which is greater than other existing schemes [1, 4, 5]. In our algorithm, PSNR is also high compared to existing schemes [4, 5] which means that we generate better visual quality stego videos. From security perspective, we introduced a shared secret key to find suitable bit pattern through XOR operation during data embedding as well as data extraction. The cover video frame block has been chosen in random location through PRNG which enhances security. We have tested our stego image with SSIM and observed that the proposed scheme is preferable for data embedding where visual quality and security constraint needs to be maintained for high payload. In future, the scheme has been extended to enhance security, capacity, and quality in different domains for video-based steganography.