0% found this document useful (0 votes)
57 views15 pages

Encryption Project Proposal

The document describes a method for encrypting wave files by converting them into image formats like JPEG, PNG, and TIFF using matrix manipulation in MATLAB. It details the process of encrypting wave data into an image matrix and decrypting it back. A GUI is created in MATLAB to allow selection of a wave file, encrypting and decrypting it, and playing the original and recovered wave files for comparison.

Uploaded by

yznalsadeh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views15 pages

Encryption Project Proposal

The document describes a method for encrypting wave files by converting them into image formats like JPEG, PNG, and TIFF using matrix manipulation in MATLAB. It details the process of encrypting wave data into an image matrix and decrypting it back. A GUI is created in MATLAB to allow selection of a wave file, encrypting and decrypting it, and playing the original and recovered wave files for comparison.

Uploaded by

yznalsadeh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Encryption and decryption of

wave(sound)file in image formats

Group member:

Content:
Abstract…page 3
1.Introduction…page 4
1.1 Wave bitstream format …. page 5
2.1 Image formats and image compression…. page 6
2.Encryption…page 7
2.1 Obtaining data of wave file in column matrix…. page 7
2.2 Convert column matrix into M*N matrix…. page 8
2.3 Convert matrix into image file. …. page 9
3.Decryption of wave from image …page 10
3.1 Data type conversion…page 11
3.2 Algorithm to convert image matrix into column matrix and hence. Wav. ...page 11
3.3 Audio recorder …page11
4. Graphical use interface (GUI) …. page12
4.1 Creation a MATLAP GUI…. page 12
4.2 Explanation …. page13
4.3 Final output …. page 14
5. Deploy tool…page 15
6. Uses …. Page15
7.Bibliography…. page15
Abstract:

We will be elaborating the method of encryption wave files in popular image


formats like JPEG, TIF and PNG along with retrieving them from these image
files. MATLAP software is used to perform matrix manipulation to encrypt and
decrypt sound files into and from image files. This method is not only a
stenographic means but also a data compression technique. Steganography (a
rough Greek translation of the term Steganography is secret writing) has been
used in various forms for 2500 years. Briefly stated, steganography is the term
applied to any number of processes that will hide a message within an object,
where the hidden message will not be apparent to an observer.
1 Introduction:
This present work puts forth a novel method to encrypt ‘.wav’, which are
basically sound files in image formats such as PNG, TIF and JPEG. The sound
file is fetched and the values corresponding to the sample range is put in a
column matrix which is then put in a two-dimensional matrix having “double”
as datatype. Using ‘imwrite’ function of MATLAB, this matrix defined in the
class ‘double’ is put in a graphics file or image file. After encryption the data is
retrieved from the image file and compared with the original wave file to show
the variation in encrypted and decrypted data. This methodology can not only
be used as stenographic means but possibly as a technique for data
compression. The illustrated method for data encryption of sensitive user
information can be used as a viable method to further secure cloud computing
transactions.
Fig1.

1.1 Wave bitstream format:


Waveform Audio File Format (WAVE) is an application of RIFF or Resource Interchange File Format which stores
audio bit streams in “chunks”. WAVE encodes the sound in LPCM format ie. Linear Pulse Code Modulation.
Sound is basically a pressure wave or mechanical energy having pressure variance in an elastic medium. The
variance propagates as compression and rarefaction where compression occurs when pressure is higher than the
ambient pressure and rarefaction occurs when the pressure of the propagating wave is less than the ambient
pressure.
Exactly in the same manner a WAVE file just represents the sampled sound waves which happen to be above or
below the equilibrium or ambient air pressure. The plot of wave file is shown in fig 1.

1.2 Image formats and image compression:


Digital image formats are a means of storing digital images in either
uncompressed (e.g. TIFF), compressed (e.g. JPEG) and vector formats. On
rasterization an image is converted into a grid of pixels. Basically, there are two
types of image file compression algorithm-lossless and lossy. In lossless
compression the entire digital data is preserved during compression thus
preserving image quality. In lossy compressions, digital data preservation takes
place by compromising image quality. Here we will be discussing PNG, TIFF,
and JPEG formats and these are the very formats in which the wave file will be
encrypted into.
2. Encryption:
2.1 Obtaining data of wave file in column matrix:
We will be using “dil wav” wave file as a example whose wave representation
is show above in fig 1. The sampling length of this tone is 2000000 samples.
Following is the MATLAB code which fetches the wave file using ‘wavread’
function. Amplitude values are obtained in the range of O and +1.

Variable ‘D" which holds the first 2000000 samples. It is to be noted that
variable D is basically a column vector.

2.2 Converting column matrix into M*N matrix.


A ‘grayscale’ image of M by N pixels i represented in MATLAB as an M X N
‘matrix having “double” data type wherein each element of the matrix denotes
a pixel within an intensity of 0 and 1. Itis to be noted that the variable D is a
column matrix with “double” type and intensity within 0 and 1. 50 to convert
variable D in an image format we have to transform D into a 1000 X 2000
matrix.

2.3 Converting matrix into image file:


We convert matrix A into JPEG, PNG and TIF formats using MATLAB
function called “imwrite” Imwiite (A,"../filename.xyz').
The above syntax stores matrix A in the file path mentioned. We also save
column matrix D in a new wave file using "wavwrite” function.

How the wave file appears in JPEG format (this is a cropped image as the
actual file is far bigger).
3. Decryption of wave from image:
This method is just the opposite of encryption with minor variations. When the
image is created during encryption it i basically an M*N matrix with “double”
data type, however on fetching the same image back to MATLAB we get an
M*N matrix with datatype “uint8” i.e. unsigned integer of 8 bits.

Thus, we need to first convert all elements of matrix obtained into double
precision. Decryption can be basically understood as a data mining method to
fetch, audit, and understand the pattern of data stored in the encrypted file.
3.1 Data type conversion:
“im2double” function of MATLAB takes an image as input and converts it into another image or matrix having all
elements with type double. As already stated, the image files retrieved by MATLAB are in unsigned integer form
and before they are put in column matrix representing a WAVE file, it has to be converted into data type of double
precision.

3.2 Algorithm to convert image matrix into column matrix


and hence .wav:

3.3 Audio recorder:


Matlab build in function recorder = audiorecorder(Fs,nBits,nChannels) which allows us t0 to record the.
Sound for specic time is used is to record the audio message of user for 50 seconds.
4. Graphical use interface (GUI):
In computing, a graphical user interface (GUI, sometimes pronounced "gooey" (or "gee-you-eye")) is a type of
interface that allows users to interact with electronic devices through graphical icons and visual indicators such as
secondary notation, as opposed to text-based interfaces, typed command labels or text navigation. GUIs were
introduced in reaction to the perceived steep learning curve of command-line interfaces (CLIs), which require
commands to be typed on the keyboard.
The actions in a GUI are usually performed through direct manipulation of the graphical elements. In addition to
computers, GUIs can be found in hand-held devices such as MP3 players, portable media players, gaming devices
and smaller household, office and industry equipment.

4.1 Creating a MATLAB GUI:


GUIs (also known as graphical user interfaces or Uls) provide point-and-click control of Software applications,
eliminating the need to learn a language or type commands in order to run the application.
MATLAB apps are self-contained MATLAB programs with GUI front ends that automate a task o calculation. The
GUI typically contains controls such as menus, toolbars, buttons, and sliders. Many MATLAB products, such as
Curve Fitting Toolbox, Signal Processing Toolbox, and Control System Toolbox, include apps with custom user
interfaces. You can also create your own custom apps, including their corresponding Uls, for others to use. GUIDE
(graphical user interface design environment) provides tools for designing user interfaces for custom apps. Using
the GUIDE Layout Editor, you can graphically design Your UL GUIDE then automatically generates the MATLAB
code for constructing the UI, which you can modify to program the behavior of your app.

4.2 Explanation:
Figure 6 shows GUI model created with Guide command here we put three
axes 2 for showing wave of encrypted and decrypted signal. And 3 for
displaying the logo of Comsats. There are static text fields for displaying the
text i.e. group member names.
We add 8 push buttons in our GUI as shown i fig. 6 whose operation is written
on each button. We use the build in function uiget file to select sound file from
computer. We can make tags for component placed. Then the function of each
component can be assigned with the help of its tag. After making the model we
press the play button in the menu bar of window then this will create the code
of GUI layout. Code contains different functions and each button’s
functionality can be controlled by its function.
We can use handles of every function along with component tag to shift
between different functions. Each component function is loaded with its code
and the final output GUI is shown in figure 7.

4.3. Final output:


5.Deploy tool:
We have used the deploy tool command of MATLAB to make the exe file of our application, 50 that everyone can
use this application however his/her computer has no MATLAB Software.
6.Uses:
‘There are very vast applications/uses of encryption and decryption for which this app is helpful few of
them are given below:

 Secure data transfer.

 Military intelligence purposes.

 Safe communication.

7.Bibliography:

You might also like