You are on page 1of 5

Volume 7, Issue 9, September – 2022 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Encryption and Decryption of Audioby Changing


Properties and Noise Reduction
Nirzar Barua, Md. Ahasan Kabir
Department of Electronics and Telecommunication Engineering
Chittagong University of Engineering and Technology,
CUET Chittagong, Bangladesh

Abstract:- Encryption, the process of data hiding at the Using a random encryption private key, image data
time of transmission, gives security to messages. Audio matrixencryption and decryption was taken place. After
signal is vastly used for communication now a days. encryption, a lossless [9] data compression was done in
This paper is about an algorithm of audio file .png &.tiff format.After decrypting, raw data Image has to
encryption in image format by usingprivate keyand be changed into the audio signal. Audio may be stereo or
decryption into audio. Audio encryption which is bulky mono, needs proper condition to identify and encryption
in size can be overcome by processing audio signal to and decryption technique should have to be used.
image. It ensures secured transmission of data by
changing its features. Here, in this algorithm, A white noise [10] is produced because of the
dimensions of raw datahave been changed and the compression process. To remove the noise a white noise
reshaped format has made signal privy. This technique filter is used and regenerated signal is sent through the
provides lossless data processing as well as renders the filter.
choice of selection of any types of audio file (mp3, wave,
m4a etc.) in mono or stereo. Here security In this paper, the portrayed algorithm is feasible with
enhancementis done by using private key and changing wave, mp3, m4a different audio files to convert them into
properties of data from audio to image. Use of image and encrypted as image. Here compression of the
compression adds white noise which can be removed by audio fileshave also taken place. Encryption is made by
using proper filter. It gives improved SNR, more than changing value of array data that ensure the security of
18dBafter reception. For better communication system, communication.
this process is easier and better than other encryption II. IMAGE AND AUDIO
techniques.
Audio and image are two different types of signals with
Keywords:- Encryption, Decryption, Random private key, some different properties based on their dimension and
Mono, Stereo, Filter, SNR. array arrangement. Merging these two different signals can
I. INTRODUCTION be the better way to enhance security.The wav, mp3, m4a
different audio file of stereo and mono types were
Encryption that gives security to data signals which converted into image by reshaping their array and
can be hacked by the unwanted user and that will cause encrypted as image where compression will occur also.
unsecured transmission of data. Usually, audio encryption Encryption is made by changing value of array data. Hence
is done from message audio to noise audio. If it is possible encryption & decryption become less complex and the
to make the audio[1] to image and we encrypt the formed change of dimension of data makes the process more
image, encryption will be better. secured.

By describing an algorithm of encrypting .wav files III. AUDIO FILE GENERATION AND COMPRESSION
[2] in image format with randomly generated orthogonal
key decrypting them after being passed through the channel At first an audio file of any format has to be read from
with white noise. Encryption of the .wav data as JPEG, the internal storage and collect array matrix form the audio
PNG [3] and different image file and hiding LSB bit [4] signal. Here audio files of .wav, .mp3, .m4a etc. can be
from the secret audio/image and encrypt it by used to do the encryption and decryption which is
steganography process [5]. RSA algorithm[6] is used as a converted into raw data image. There are many formats of
very popular encryption technique where the data is image like ‘.tiff’ ‘.png’ ‘.jpeg’ etc. from which .tiff and
changed by using public key. A private key [7] is given to .png are lossless compression technique and has minimum
the exact receiver to extract the encrypted data. For audio bit error. So .tiff has been chosen as compression because
and image encryption it also used. of its flexibility, adaptability of handling images, so that
decrypted signal has become close to accurate with a small
Generally, encrypted audio will also be large in size amount of white noise which is cancelled by designing
which will take more bandwidth and more time to transmit white noise filter between 3.8KHz to 4.0KHz frequency
that can be reduced by forming into image [8]. Hence the range.
transmission time will be less and reshuffled dimension of
data matrix will make it more secured.

IJISRT22SEP682 www.ijisrt.com 805


Volume 7, Issue 9, September – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
There are two types of audios, ‘Mono’ and ‘Stereo’ V. ALGORITHM
where mono is column matrix and the stereo audio matrix
have been reshaped into a column matrix to reshape the  STEP 1: Call audio file from the directory.
audio file matrix to square matrix to show as an image. But  STEP 2: Identify the audio as it is mono or stereo.
generally, it is rare to get a matrix from audio associated  STEP 3: Transform the stereo audio into column array.
with squared number of elements. There was lack of a few  STEP 4: Generate a ones matrix with the same dimension
data which might be solved by adding some ones or zeros of the input audio signal matrix.
at the end of the audio matrix.  STEP 5: Make all negative values ofthe audiomatrix
positive by adding generated onesmatrix with input array
IV. ENCRYPTION AND DECRYPTION  STEP 6: Add zeros at the end of the values of the new
The raw data image in black and white form has got matrix until the number of the elementsof thearray will
which might be easily understood. So that, effect on the become a square number.
intensity of the array elements has been used, change the  STEP 7:Reshapethe column into two-dimensionalsquare
image property which can be said as encrypted image. matrix to form image.
 STEP8: Generate random numberand convert it to
Random integer generator is used to generate random suitable integer for using as a private encryption key.
private key in which the value of the private key is  STEP 9:Divide the elements of raw data square matrix by
controlled to make sure the better quality of the audio a private encryption key, turned into black image and
signal after decryption. intensity was decreased.
 STEP 10: Save the encrypted data in an image format.
To encrypt the image, random private encryption key  STEP 11: Call the saved image from the directory.
is used by which the value of the matrix has been changed  STEP 12: Make it double formatmatrix from unit8 form.
which ensures that at the decryption part, reverse operation  STEP 13:Multiply the matrix with the private encryption
along with the exact private key will give the proper audio key and decrypt into the two-dimensional image format.
message. Moreover, this encryption process abates
 STEP 14: Reshape the image matrix into audio matrix.
fromdata loss which takes place at the time of compression.
 STEP 15: Remove extra elements that was added as zero.

Reshape  STEP 16: Make audio mono or stereo as it was in the


Audio Private key Encrypt
to input.
Signal generator Image
Image  STEP 17: Ensure the presence of the negative value as it
was in the input by subtracting ones matrix with same
dimension.
 STEP 18:Design agaussian noise filter with appropriate
frequencybetween 3.8KHz to 4.0KHz and use it to
White
Play Regenerat Decrypt remove white noise from the regenerated audio.
Noise
Output
Filter
e Audio Image  STEP 19: Use sampling frequency to generate audio
from the regenerated matrix.
 STEP 20: Play the generated audio as decryptedoutput.
Fig. 1: Block diagram
VI. RESULTS
In receiver part, decryption has been started by
A. Image of Raw, Encrypted and Decrypted data
bringing back the original intensity of the array elements.
Then the matrix was reshaped into column matrix. If the
input audio was stereo type, one more array reshaping
would be needed. Thus, the audio will be back with white
noise. To get the proper audio removing of this white noise
is important which is done by designing a white noise filter
with appropriate frequency band.

This technique is suitable for any format of audio


signal of mono and stereo type which makes the process
flexible to use in any types of secured speech
communications. In this technique, data compression have (a) (b)
been taken place. Hence transmission will be better in this
process. Here a lossless data conversion technique is used
and so that exact audio might be got. Mono and Stereo
types audio can be processed.

IJISRT22SEP682 www.ijisrt.com 806


Volume 7, Issue 9, September – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165

(c)
(a) (b)
Fig. 2: For Mono audio (.mp3) file
(a) Raw data image Fig. 5: For of Stereo audio (.mp3) file
(b) Encrypted image (a) Input signal.
(c) Decrypted image (b) Output signal.

C. Data obtained at different stages of the operation

Stages Audio1 Audio2


Input audio data 395760×1 5652336x1
matrix double double
Number of data 396900×1 5654884x1
extending with double double
zeros
Reshaped image 630×630 2378x2378
(a) (b) matrix data double double
Encrypted 630×630 2378x2378
image matrix unit8 uint8
Decrypted 630×630 2378x2378
image matrix double double
Output 395760×1 5652336x1
audio double double
SNR(dB) 18.2937 20.3269
Table 1: Data of Mono audio (.mp3) file
(c)
Stages Audio3 Audio4
Fig. 3: For Stereo audio (.mp3) file Inputaudio data 15059568×2 4961196×2
(a) Raw data image matrix double double
(b) Encrypted image Number of data 30129121×1 9922500×1
(c) Decrypted image extending with double double
zeros
B. Graphical representation Reshaped image 5489×5489 3150×3150
matrix data double double
Encrypted image 5489×5489 3150×3150
matrix unit8 uint8
Decrypted image 5489×5489 3150×3150
matrix double double
Output audio 15059568×2 4961196×2
double double
SNR(dB) 18.1759 20.4876
Table 2: Data of Stereo audio (.mp3) file
(a) (b)
VII. RESULT ANALYSIS
Fig. 4: For Mono audio (.mp3) file
Here, in the data Table 1 and Table 2, elements of
(a) Input signal.
different stage of the experiment are shown. From the first
(b) Output signal.
table, data of mono audio can be got where the input and
out data is equal. To change properties of array and forming
square matrix extra bit have been added which was
removed before taking the output. In the second table same
procedure have been done for stereo audio. To abate

IJISRT22SEP682 www.ijisrt.com 807


Volume 7, Issue 9, September – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
complexity of the process, stereo audio has been turned into Audio SNR at .jpg(dB) SNR at .tiff & .png(dB)
a column array before changing properties from audio to Audio1 4.4300 18.2937
image. In the both, SNR of at the receiver are more than Audio2 3.9028 20.3269
18dB which are also good to dominate noise by the signal.
Audio3 3.3000 18.1759
From Fig. 2.(a) and Fig. 3.(a) raw data image and Fig. Audio4 4.5836 20.4876
2.(c) and Fig. 3.(c) give the decrypted image of mono and Table 3: SNR at .jpg, .png and .tiff compression
stereo sound respectively. In the Fig. 2.(b) and Fig. 3.(b) is
the encrypted image which are generated by using random Data compression can be lossy or lossless. In .jpg
private encryption key. As the private key changes lossy compression happens. Table 3 shows, SNR is very
randomly andboth of the encrypted images are same to look small after .jpg compression. On the other hand, SNR
like which ensures the security of the raw data. values become better and remains same after .png and .tiff
compression. The .png compression is less lossy, so some
From the waveshapes of the audio signals, some bit error happens.But in the .tiff, compression, it is lossless
changes in the output can be noticed which was taken place and minimum bit error takes place and so, .tiff is chosen for
because of compression.Fig. 4.(a) and Fig. 4.(b) is the the operation. Here the SNR is more than 18 dB where the
waveshape of mono audio input signal and output signal existing method [2]it is only more than 1.
after decryption. Fig. 5.(a) and Fig. 5.(b) is for stereo audio.
In the output signals some spikes turned into same level. It This process also gives the randomness in choice of
creates negligible noise which can be removed by using audio file. Any kind of audio file like .wav .mp3 .m4a and
proper filter. any types of dimensions like mono or stereo audio can be
chosen for the operation. Maximum amplitude of the signal
Here the number of theelements of the input signal is remains same in the output of the decrypted signal, as a
as same as the final output which was done by increasing result, the intensity of the audio cannot be reduced
element up to nearest square array. As a result, there is no extensively.
data loss happened which makes the technique better than
other. Audio message of any format is can be taken which REFERENCES
can be mono type or stereo type which gives more
[1.] Bazyar, M., & Sudirman, R. (2014). A recent review
flexibility of choosing data than other techniques.
of MP3 based steganography methods. International
Moreover, this process is less complicated than any other
Journal of Security and Its Applications, 8(6), 405-
encryption technique. But the use of random private key for
414.
encryption ensures the better security of the data.
[2.] Dutta, W., Mitra, S., &Kalaivani, S. (2017,
There are some issues of noise in the output. In the November). Audio encryption and decryption
imageformat, data omits values that more than.995 and less algorithm in image format for secured
than .005. Value that more than .995 automatically turned communication. In 2017 International Conference on
into 1 and value less than .005 turned into 0. Hence a small Inventive Computing and Informatics (ICICI) (pp.
amount of white noise has been taken place in the output. 517-521). IEEE.
Again, the SNR values representthat the created noise is [3.] Upadhyay, R. R. (2013). Study of Encryption and
highly dominated by the signal. To remove the white noise Decryption of Wave File in Image Formats. arXiv
a gaussian white noise filter is designed with 3.8×103Hz to preprint arXiv:1307.6711.
4×103Hzpassband frequency by which the noise is removed [4.] Bandyopadhyay, S. K., & Datta, B. (2011). Higher
from the regenerated signal. LSB layer based audio steganography
technique. IJECT, 2(4), 129-135.
VIII. CONCLUSION [5.] Babu, L., Jais John, S., Parameshachari, B. D.,
Muruganantham, C., &DivakaraMurthy, H. S. (2013).
Algorithms, done for audio to image encryption, was Steganographic method for data hiding in audio
lossy process. But in the above algorithm, the elements of signals with LSB & DCT. International Journal of
data in input and output are same here and so there is no Computer Science and Mobile Computing, 2(8), 54-
data loss. 62.
[6.] Yousif, S. F. (2018). ENCRYPTION AND
The use of private key for encryption ensures more DECRYPTION OF AUDIO SIGNAL BASED ON
secured communication because of its randomness. Value RSA ALGORITHN. International Journal of
of the private encryption key changes in every operation Engineering Technologies and Management
which increases the depth of the encryption technique. Research, 5(7), 57-64.
[7.] Moreno-Alvarado, R., Rivera-Jaramillo, E., Nakano,
This process is more efficient in noise reduction with
M., & Perez-Meana, H. (2019, July). Joint encryption
good SNR.After decryption there are no data loss and for
and compression of audio based on compressive
the image compressioncausesa very small white noise
sensing. In 2019 42nd International Conference on
which was removed by using white noise filter.
Telecommunications and Signal Processing
(TSP) (pp. 58-61). IEEE.
[8.] MATLAB in the Loop” for Audio Signal Processing
Darel A. Linebarger, Ph.D. Senior Manager, Signal

IJISRT22SEP682 www.ijisrt.com 808


Volume 7, Issue 9, September – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
Processing and Communications
MathWorks,https://www.mathworks.com/.../campaign
s/portals/files/apple/AudioSignalProcessing.pdf
[9.] Chawla, S., Beri, M., &Mudgil, R. (2014). Image
compression techniques: a review. International
Journal of Computer Science and Mobile
Computing, 3(8), 291-296.
[10.] Nittono, H. (2020). High-frequency sound
components of high-resolution audio are not detected
in auditory sensory memory. Scientific reports, 10(1),
1-7.
[11.] Bhattacharyya, D., Dutta, P., & Kim, T. H. (2009).
Secure data transfer through audio signal. Journal of
Security Engineering, 6(3), 187-194.
[12.] Lee, Che-Wei, and Wen-Hsiang Tsai. "A lossless data
hiding method by histogram shifting based on an
adaptive block division scheme." Pattern Recognition
and Machine Vision, River Publishers, Aalborg,
Denmark (2010): 1- 14.
[13.] Harris, F. J. (1978). On the use of windows for
harmonic analysis with the discrete Fourier
transform. Proceedings of the IEEE, 66(1), 51-83.
[14.] Khalil, M. I. (2017). Quaternion-based
encryption/decryption of audio signal using digital
image as a variable key. International Journal of
Communication Networks and Information
Security, 9(2), 216.
[15.] Rehna, V. J., & Kumar, M. J. (2012). A Strong
Encryption Method of Sound Steganography by
Encoding an Image to Audio. International Journal of
Information and Electronics Engineering, 2(3), 362.

IJISRT22SEP682 www.ijisrt.com 809

You might also like