Steganography On Digital Color Image Using Modulo
Steganography On Digital Color Image Using Modulo
net/publication/357416681
Article in International Journal on Advanced Science Engineering and Information Technology · December 2021
DOI: 10.18517/ijaseit.11.6.12687
CITATIONS READS
0 21
3 authors, including:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Septia Rani on 19 January 2022.
Abstract—In this era, many people exchange data digitally either through the internet or other communication channels. However, data
sent digitally can be seen by unauthorized people. Therefore, data security is essential. One of the data security techniques is
steganography. This study employs steganography based on Pixel Value Modification (PVM) method using the modulo function. This
technique will be implemented to insert a text message in digital images in RGB color space. Besides, we use the Pseudo-Random
Number Generator with a secret key to enhance the inserted messages’ security. To measure the performance of the proposed method,
testing is carried out by comparing the stego image to cover image based on three criteria, namely imperceptibility, fidelity, and
recovery. PVM method using modulo function successfully hides text that the length is less than 200 characters into 255×255-pixel color
images. Imperceptibility testing is done by distributing a questionnaire to six people randomly. The results showed that all respondents
answered that each test image's stego image and cover image had no difference. At the same time, the results of the fidelity test show
that the MSE value is close to zero, and the PSNR value is above 40 dB. Furthermore, recovery testing will check whether the extracted
message is the same as the secret message inserted in the cover image. The results showed that all messages inserted were extracted
correctly for recovery criteria if given the correct secret key.
Keywords— Digital image; Modulo; pixel value modification; pseudo-random number generator; steganography.
Manuscript received 26 Jul. 2020; revised 1 Mar. 2021; accepted 28 Apr. 2021. Date of publication 31 Dec. 2021.
IJASEIT is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.
2470
insertion carried out in the spatial domain will be easier and the original image. Each pixel in each panel will be
faster. represented by 8 bits. A secret message that will be hidden is
The popular methods for inserting data in the spatial inserted into each pixel by sequencing. Insertion of secret
domain include the Least Significant Bit (LSB), Pixel Value messages is done on all color panels. The insertion of the first
Differencing (PVD), and Pixel Value Modification (PVM). digit is in the matrix R, the second digit is in the matrix G, and
The LSB method is simple because the secret messages are the third digit is in the matrix B. The purpose of inserting pixel
always inserted in the last bit, but the secret message inserted digits in the different color panels is to improve security,
in the cover image will be easily known. The embedding capacity, and improve image quality on the cover image.
capacity produced by the PVD method is quite good, but the
stego image generated in the color image will be easily C. Modulo Function
detected. On the other hand, the PVD method can produce a Modulo or mod is an integer operation that the result is the
good stego image, but the capacity of the inserted secret remainder of the division of a number to another number. For
message cannot be maximized. Another method is PVM. The example, 9 2 = 1, because 9 divided by 2 produces 1
advantages of PVM are that the secret message is inserted into as the remainder. Modulo adds a variety of calculations that
three different components so that it will be difficult for are quite complex, making it suitable to use in the encoding
steganalysis to find the secret messages and know how many and decryption process. Modulo function is used as part of the
bits have been inserted. Besides, hiding messages by PVM is encoding process to represents hidden messages in base
carried out in all RGB color panels so that the capacity of the numbers. The result value of the encoding process will depend
inserted secret message can be maximized. on the modulo value used. For example, if modulo 3 is used,
Wang proposed applying the PVM method for the first time secret messages will only be coded with values 0, 1, and 2.
by adding the modulo function [12]. The modulo function is Through that encoding process, it is expected that the capacity
used to decompose secret messages based on the modulo to insert the secret messages can be greater while maintaining
value used. Wang inserted secret messages in color images. cover media quality.
All color layers will be used as an insertion place to enlarge
the secret messages' insertion capacity. D. Red Green Blue (RGB) Color Model
In this paper, we design a new steganography method Red Green Blue (RGB) Color Model is a color space
based on Pixel Value Modification (PVM) for digital color consisting of three primary light layers of color R (red), G
images. The proposed method is different from the PVM (green), and B (blue). The RGB coloring system has been
method [12] because the PVM method is combined with adopted in digital appearances such as monitors, cellphones,
Xorshift Random Number Generator to choose the pixel and televisions. One of the features of this color model is easy
positions where the secret messages will be inserted. This to copy or move to another device because many devices
mechanism will add an additional layer to enhance the apply this color space. Color in a one-pixel image can be
security of the messages. This technique is much needed, represented in 3-bytes or 24 bits. The combination of the
especially in the medical field, to store patient data on a color three-color components can produce 16 million color
medical image. The text will be inserted in the spatial domain variations (224 = 16.777.216).
using PVM combined with the modulo 3 functions. The main
E. Pseudorandom Number Generator (PRNG)
contribution of this paper is to investigate the performance of
the proposed method. Pseudo-Random Number Generator (PRNG) is the
mechanism used by real-world secure systems to generate
II. MATERIALS AND METHOD values/numbers assumed to be random [14], [15]. PNRG will
generate a sequence of numbers that is not truly random but
A. Steganography follows a certain algorithm rule. PRNG has a certain cycle
The word steganography comes from Greek, "steganos" length. If the cycle length has fulfilled a certain period, the
which means closed/hidden and "graphein" which means random number cycle will return to the beginning. Thus, the
writing [13]. Steganography is a technique for hiding secret occurrence of the next random number can be predicted with
messages inserted on a media, such as text, audio, image, and statistical calculations. Xorshift Random Number Generator
video, where the results will look normal. The media used for (Xorshift RNG) is one of the PRNG algorithms. It passed of
hiding messages is called Cover media. The media that has the randomness test very well. Xorshift RNG is extremely fast
been inserted by secret messages is called Stego media. The with period 2 − 1 for = 32, 64, 96, 128, 160, 192
process of inserting a secret message into a cover media is [16][17]. In addition to speed, another advantage is Xorshift
called encoding, while the message retrieval process from RNG uses a smaller space if implemented into a program.
Stego media is called decoding. Both processes require keys
F. Data
to restrict who can access the secret messages.
Data used in this study are text and color image. Text is
B. Pixel Value Modification (PVM) used as secret messages which will be inserted into the digital
Pixel Value Modification (PVM) modify intensity value in image. The color image is in JPG file format and used as a
image pixel. One digit secret message can be inserted into one Cover image. Five Cover images used in this study are shown
pixel of the cover image. PVM divides the cover image into in Fig. 1. The size of the image in Fig. 1(a)-(c) is 225 × 225
three color panels, namely R (red), G (green), and B (blue) pixels. These images are obtained from the internet. While the
[12]. Thus, one color image will have 3 panels or 3 matrices size of the image in Fig. 1(d) and 1(e) is 3264 × 2448 pixels.
of × pixels according to the length (M) and width (N) of These images are taken using a smartphone camera.
2471
The extracting process is the process of retrieving the secret
message from the Stego image. This study used the symmetry
key to encode and decode the message.
The flowchart of the embedding process is shown in Fig. 2.
In this process, the inputs given by the user are a Cover image,
secret message, and Stego key (number). The secret message
entered by the user is a text in TXT file format. Each character
(a) (b) (c) of text in the secret message is translated into the ASCII
decimal code. Each decimal code is then represented in base-
3 numbers. Each decimal code will be represented by 5 bits
with the values of each bit 0, 1, or 2. All 5-bits messages are
then concatenated to become 1×(5*length of the message)
vector.
Before the secret message is inserted, the user's cover
image is separated into 3 panels or matrix of M×N pixels, Red
(d) (e)
Green Blue. Each matrix is reshaped into a 1×(M*N) vector
Fig. 1 Cover image. (a) Waterfall, (b) Lena, (c) Peppers, (d) Sky, (e) so that there are three 1×(M*N) vectors. These vectors are
Bicycle concatenated in the order of red vector, green vector, blue
G. Methodology vector. The pixel positions where secret messages (in the form
of the base-3 number) will be inserted are generated using
This study has two processes: the embedding (encoding)
PRNG based on the Stego key and the length of the message.
and extracting (decoding) process. The embedding process is
The intensity value of the cover image in each selected pixel
the process of inserting the secret message into the Cover
position will be changed.
image. The substitution process does the embedding process.
The intensity value is changed by following several rules the remainder of the quotient will be called F, and the bit value
chosen based on the secret message bit (base-3 number) that of a secret message in the form of the base-3 number will be
will be inserted. First, the remainder of the intensity value called D. Compare the values of F and D.
divided by 3 will be calculated (intensity value mod 3). Next,
2472
If F is equal to D, the intensity value in Stego image is equal in container media should be able to be extracted correctly
to the intensity value in the Cover image at the corresponding anytime.
pixel position. If F is smaller than D, the intensity value in the The imperceptibility aspect is measured by comparing the
Stego image is the intensity value in the cover image at the Cover image and Stego image. Imperceptibility testing is
corresponding pixel position added with the difference value done by distributing a questionnaire to six people randomly.
of D and F. If F is greater than D, the intensity value in the In the questionnaire, respondents are asked whether there are
Stego image is the intensity value in the cover image at the differences between two images A and B, in which image A
corresponding pixel position subtracted with the difference is an image before and after the secret message is inserted,
between D and F. The result of the embedding process is a respectively.
Stego image in BMP file format. To measure the distortion that occurs between the Cover
The flowchart of the extracting process is shown in Fig. 3. image and Stego image or fidelity, the formula is used. The
In this process, the inputs given by the user are a Stego image PSNR value is useful for assessing pixel similarities between
in BMP file format, Stego key (number), and the length of the the Stego image and Cover image expressed in decibels (dB).
message. Stego image inputted by the user is separated into 3 The greater the value of PSNR, the more difficult the Stego
panels or matrix of M×N pixels, Red Green Blue. Each matrix image can be distinguished from the cover image. Stego
is reshaped into a 1×(M*N) vector so that there are three image quality is strongly influenced by the size of the hidden
1×(M*N) vectors. These vectors are concatenated in the order message and bit-level used. Before calculating the PSNR
of red vector, green vector, blue vector. value, the Mean Squared Error (MSE) value must be
Secret messages in the form of the base-3 number will be calculated first. MSE can be calculated using (1), while PSNR
retrieved by extracting intensity value at certain pixels. The can be calculated using (2) [20].
pixel positions that contain secret messages are found using
PRNG based on the Stego key and the length of the message. = ∑'%&# ∑$%&
# ‖
, − ! , ‖" (1)
The intensity value of a certain pixel is divided by 3. The
remainder (intensity value mod 3) obtained from that
MSE = the value of the mean square error of the image
calculation is a bit (base-3 number) of secret message.
After all bits of the secret message is obtained, each 5-bits m = image length (in pixels)
in the sequence are grouped. Each 5-bits grouped is converted n = image width (in pixels)
to decimal number. Then, each decimal number is translated (i, j) = coordinates of each pixel
to character based on the ASCII decimal code. The result of S = stego image
the extracting process is secret message text. C = cover image
! /0 "
H. Evaluation ( ) = 10. log & . 1 (2)
In steganography, three aspects must be considered:
imperceptibility, fidelity, and recovery [18], [19]. PSNR = image PSNR value (in dB)
Imperceptibility ensures that the human senses cannot Cmax = the highest intensity value in the image
perceive the existence of hidden messages in container media. MSE = The value of the mean square error of the image
Fidelity is the quality of container media that should not be
much different after insertion. Recovery is hidden messages
The relationship between PSNR and MSE is inversely value. The greater the value of PSNR, the better the quality of
proportional. The smaller the MSE value, the smaller the error the stego image produced.
2473
Recovery testing is done by observing the extraction results. The minimum limit of the PSNR value is 40 dB. If the
Recovery testing will check whether the extracted message is PSNR value is above 40 dB, the Stego image is similar to the
the same as the secret message inserted in the cover image. Cover image. Likewise, for the MSE value, if the MSE value
approaches zero, the Stego image cannot be distinguished to
III. RESULTS AND DISCUSSION Cover image. Based on Table I, the MSE value is close to zero
The hardware used for implementation and testing is a and the PSNR value is above 40 dB, so it can be said that the
laptop with Intel Atom @ 2.27 GHz specifications, 4 GB result of inserting a secret message is successful. Changes that
RAM, and a 500 GB HDD. Meanwhile, the software used in occur in the Cover image because of the insertion of a secret
the implementation and testing is Windows 10 64 bit, Matlab message cannot be detected by the human senses.
R2013a, and Matlab R2013a GUI builder. The value is used To evaluate the recovery aspect, testing is done by
for a1, a2, and a3 in the Xorshift RNG algorithm is 21, 35, comparing the secret message before it is inserted into the
and 4, respectively. Cover image with a secret message extracted from Stego
Two processes (embedding and extracting process) have image. Test results that compare the secret message are shown
been implemented. Users will be asked to enter some data in in Table II.
the embedding process, namely a secret message, Stego key, TABLE II
and Cover image. The secret message is entered into the TEST RESULTS FOR RECOVERY ASPECT
system by uploading a .txt file that contains a secret message. Cover Message
Message
The Stego key cannot be zero and consists of a maximum of Image Type
four digits. When the embedding process has been completed, Waterfall Inserted Base layer haruslah berwarna terang agar tidak
message menyerap kalor. Rentang frekuensinya: 40-50
the system will provide output, namely the Stego image and
the length of the secret message. The length of the secret Extracted Base layer haruslah berwarna terang agar tidak
message menyerap kalor. Rentang frekuensinya: 40-50
message and Stego key must be remembered in order to be
able to do the extracting process. Stego image is in BMP file Lena Inserted If you want to go fast go alone! If you want to
format. Users will be asked to enter some data in the message go far Go with me :)
extraction process, namely the length of the secret message, Extracted If you want to go fast go alone! If you want to
Stego key, and Stego image. Length of secret message and message go far Go with me :)
Stego key is filled in according to the information at the Peppers Inserted If you want to go fast go alone! If you want to
embedding process. When the extraction process has been message go far Go with me :)
completed, the system will provide output, namely the secret Extracted If you want to go fast go alone! If you want to
message. But if the input that is filled in does not match, the message go far Go with me :)
extracted message will be incorrect. Sky Inserted Pengukuhan padukuhan Sri Bedugul dihadiri
Testing is done in two stages. In the first stage, testing is message oleh 162 orang berdasi. Mereka membawa
beberapa buah tangan yang dipersembahkan
carried out with a length of secret message less than 200 oleh Sri Baginda. Arahnya adalah #@9
characters. In the second stage, testing is carried out with the
Extracted Pengukuhan padukuhan Sri Bedugul dihadiri
length of the secret message more than or equal to 200
message oleh 162 orang berdasi. Mereka membawa
characters. In each stage, three aspects: imperceptibility, beberapa buah tangan yang dipersembahkan
fidelity, and recovery will be evaluated. Because the Stego oleh Sri Baginda. Arahnya adalah #@9
image is in BMP format, to be balanced, the cover image will Bicycle Inserted love the way it is
be changed to BMP format also during testing. message
To evaluate the imperceptibility aspect, testing is done by Extracted love the way it is
distributing a questionnaire to six respondents and comparing message
the size of the image. The distributed questionnaire asks the
respondent whether there are differences between the two It shows that five messages inserted were extracted
images (Stego image and Cover image). All respondents correctly if given the correct secret key. The wrong secret key
answered that the Stego image and Cover image of each test will result in an incorrect message as it will pick inaccurate
image had no difference. When comparing the image size pixel positions in the Stego image.
before and after the insertion of the secret message, the results
TABLE III
show that there are no differences in the image size before and THE AVERAGE OF EXECUTION TIME
after the insertion. To evaluate the fidelity aspect, testing is Execution time (s)
done by calculating the PSNR. Test results that calculated Image Size
Embed Extract
PSNR are shown in Table I. Waterfall 13,1 KB 30.62 58.12
Lena 8,05 KB 22.17 11.45
TABLE I
TEST RESULTS FOR MSE AND PSNR VALUES Peppers 12,1 KB 22.61 16.77
Sky 793 KB 69.64 11.72
File MSE PSNR Bicycle 1,2 MB 32.70 12.27
Waterfall 0.00001 98.28775 Mean 35.55 22.07
Lena 0.00006 89.62488
Peppers 0.00442 70.58482 The performance of the algorithm is tested by calculating
Sky 0.00308 72.15605 the execution time. Table III shows the average execution
Bicycle 0.00193 71.55877 time. The execution time of the embedding process ranges
Mean 0.0019 80.442 from 20 to 70 seconds. The average execution time is 35.55
2474
seconds. The execution time depends on the size of the image secret message that can be extracted correctly if given the
and the length of the inserted message. Then for the extracting correct secret key. However, when testing is done by inserting
process, the average time needed for execution is 22.07 a secret message that the length is more than or equal to 200
seconds. characters in a 255×255 pixel color image, this method's
In theory, if the size of the Cover image is 225×225 pixels, imperceptibility component cannot be fulfilled.
the secret message that can be inserted into the Cover image
is (225 × 225 × 3)/5 = 30375 characters. But the experiment REFERENCES
gave poor results when the length of the secret message [1] O. R. Shahin, A. Ben Aissa, Y. Fouad, H. Al-Mahdi, and M. Alsmarah,
inserted was more than or equal to 200 characters. Table IV “A New Method of Data Encryption based on One to One Functions,”
shows the Stego Image results that have been inserted a secret vol. 10, no. 3, pp. 1169–1175, 2020.
[2] J. Katz and Y. Lindell, Introduction to Modern Cryptography. 2014.
message with a length of more than or equal to 200 characters. [3] A. S. Ansari, M. S. Mohammadi, and M. T. Parvez, “A multiple-
The more messages inserted, the worse the damage that format steganography algorithm for color images,” IEEE Access, vol.
occurs in the Stego image. There is a noticeable change in the 8, 2020, doi: 10.1109/ACCESS.2020.2991130.
Stego image that the human senses can detect. This can evoke [4] J. R. Jayapandiyan, C. Kavitha, and K. Sakthivel, “Enhanced Least
Significant Bit Replacement Algorithm in Spatial Domain of
suspicion. For this scenario, although the Stego image can be Steganography Using Character Sequence Optimization,” IEEE
distinguished from the Cover image, we found that the Access, vol. 8, 2020, doi: 10.1109/ACCESS.2020.3009234.
message was still successfully extracted correctly in the [5] K. Wang and Q. Gao, “A Coverless Plain Text Steganography Based
recovery test. This may happen because of the use of PRNG, on Character Features,” IEEE Access, vol. 7, 2019, doi:
10.1109/ACCESS.2019.2929123.
which has a certain cycle length. A further investigation is [6] A. A. Alsabhany, F. Ridzuan, and A. H. Azni, “The Adaptive Multi-
needed to find why this phenomenon occurred, which Level Phase Coding Method in Audio Steganography,” IEEE Access,
currently cannot be covered in this paper. vol. 7, 2019, doi: 10.1109/ACCESS.2019.2940640.
[7] X. Yi, K. Yang, X. Zhao, Y. Wang, and H. Yu, “Ahcm: Adaptive
TABLE IV huffman code mapping for audio steganography based on
MESSAGE INSERTION RESULTS psychoacoustic model,” IEEE Trans. Inf. Forensics Secur., vol. 14, no.
8, 2019, doi: 10.1109/TIFS.2019.2895200.
Length [8] X. Duan et al., “High-Capacity Image Steganography Based on
Cover Image Stego Image MSE PSNR
of Char Improved FC-DenseNet,” IEEE Access, vol. 8, 2020, doi:
10.1109/access.2020.3024193.
[9] X. Zhang, F. Peng, and M. Long, “Robust Coverless Image
Steganography Based on DCT and LDA Topic Classification,” IEEE
200 0.009 67.320
Trans. Multimed., vol. 20, no. 12, 2018, doi:
10.1109/TMM.2018.2838334.
[10] O. F. AbdelWahab, A. I. Hussein, H. F. A. Hamed, H. M. Kelash, A.
A. M. Khalaf, and H. M. Ali, “Hiding data in images using
steganography techniques with compression algorithms,” Telkomnika
1.000 0.028 62.583 (Telecommunication Comput. Electron. Control., vol. 17, no. 3, pp.
1168–1175, 2019, doi: 10.12928/TELKOMNIKA.V17I3.12230.
[11] Z. Yahya, M. Hassan, S. Younis, and M. Shafique, “Probabilistic
Analysis of Targeted Attacks Using Transform-Domain Adversarial
Examples,” IEEE Access, vol. 8, 2020, doi:
10.1109/ACCESS.2020.2974525.
6.065 0.048 60.247 [12] C. M. Wang, N. I. Wu, C. S. Tsai, and M. S. Hwang, “A high quality
steganographic method with pixel-value differencing and modulus
function,” J. Syst. Softw., 2008, doi: 10.1016/j.jss.2007.01.049.
[13] M. Asikuzzaman and M. R. Pickering, “An Overview of Digital Video
Watermarking,” IEEE Transactions on Circuits and Systems for Video
30.375 0.239 53.259 Technology. 2018, doi: 10.1109/TCSVT.2017.2712162.
[14] J. Kelsey, B. Schneier, D. Wagner, and C. Hall, “Cryptanalytic attacks
on pseudorandom number generators,” 1998, doi: 10.1007/3-540-
69710-1_12.
[15] M. Aljohani, I. Ahmad, M. Basheri, and M. O. Alassafi, “Performance
Analysis of Cryptographic Pseudorandom Number Generators,” IEEE
IV. CONCLUSION
Access, vol. 7, 2019, doi: 10.1109/ACCESS.2019.2907079.
This study tries to hide a text message into a color image [16] G. Marsaglia, “Xorshift RNGs,” J. Stat. Softw., 2003, doi:
using the steganography technique. The method used is Pixel 10.18637/jss.v008.i14.
[17] S. Deshmukh, K. Doshi, and Y. Borse, “Securing Images Using
Value Modification (PVM) which is combined with the Layered Morphing,” 2018, doi: 10.1109/ICCUBEA.2018.8697888.
modulo function and Pseudo-Random Number Generator. [18] R. Munir, “Pengantar Ilmu Kriptografi,” Penerbit Andi, 2008, doi:
PVM successfully hides a secret message with a length of 10.1017/CBO9781107415324.004.
fewer than 200 characters in a 255×255 pixel color image. [19] I. J. Kadhim, P. Premaratne, P. J. Vial, and B. Halloran,
“Comprehensive survey of image steganography: Techniques,
PVM can meet the imperceptibility, fidelity, and recovery Evaluations, and trends in future research,” Neurocomputing, vol. 335,
criteria. The results of the imperceptibility test indicate that 2019, doi: 10.1016/j.neucom.2018.06.075.
the Stego image cannot be distinguished from the Cover [20] E. Emad, A. Safey, A. Refaat, Z. Osama, E. Sayed, and E. Mohamed,
image. While the results of the fidelity test show that MSE “A secure image steganography algorithm based on least significant
bit and integer wavelet transform,” J. Syst. Eng. Electron., vol. 29, no.
value is close to zero and the PSNR value is above 40 dB. 3, 2018, doi: 10.21629/JSEE.2018.03.21.
Furthermore, the recovery results are indicated by the inserted
2475