APPLICATION OF STEGANOGRAHY IN AUDUIO VIDEO IMAGE (STEGAVI)
PROJECT MEMBERS:
Shajiselvaraj
Shanmugha jyothi
Arun
Anoop
PROJECT GUIDE:Sateesh
ABSTRACT
************************Hiding the Message(audio)*******************************
Hiding a message in Wave samples is very similar to hiding it in the pixels of a bitmap. Again, we use a key stream to skip a number of carrier units (samples/pixels), grab one carrier unit, put one bit of the message into the lowest bit of the carrier unit, and write the changed unit to the destination stream. When the entire message has been hidden like that, we copy the rest of the carrier stream..
***************Extracting the Message****************************************
Again, we use the key stream to locate the right samples, just as we did while hiding the message. Then we read the last bit of the sample and shift it into the current byte of the message. When the byte is complete, we write it into the message stream and continue with the next one
********************Recording a Wave******************************************
Keeping the original clean carriers can be dangerous. Somebody who has already got a carrier file with a secret message in it, and manages to get the original file without the hidden message, can easily compare the two files, count the distance in bytes between two non-equal samples, and quickly reconstruct the key.
That is why we have to delete and destroy our clean carrier files after we've used them once, or record a wave on the fly. it is no problem to record Wave data and hide the message in it before saving anything to a disk. There is no original file, so we do not need to care about one. In the main form, the user can choose between using an existing Wave file or recording a sound right then. If he wants to record a unique, not reproducible sound, he can plug in a microphone and speak/play/... whatever he likes:
frmRecorder is a small GUI for the WaveIn Recorder that counts the recorded samples and enables a Stop button when the sound is long enough to hide the specified message.
The new sound is stored in a MemoryStream and passed to WaveUtility. From now on, it does not matter where the stream came from, WaveUtility makes no difference between sounds read from a file or recorded on the fly.
*************************AVI reading*********************************************
The Windows AVI library is a set of functions in avifil32.dll. Before it is ready to use, it has to be initialized with AVIFileInit. AVIFileOpen opens the file, AVIFileGetStream finds the video stream. Each of these functions allocates memory which has to be released.
Now we are able to open an AVI file and get the video stream. AVI files can contain many streams of four different types (Video, Audio, Midi and Text). Usually there is only one stream of each type, and we are only interested in the video stream.
The AVI library contains a function for every question.
With these functions we can fill a BITMAPINFOHEADER structure. To extract the images, we need three more functions.
Finally we are ready to decompress the frames... ...and store them in bitmap files.
The application can use the extracted bitmaps just like any other image file. If one carrier file is an AVI video, it extracts the first frame to a temporary file, opens it and hides a part of the message. Then it writes the resulting bitmap to a new video stream, and continues with the next frame. After the last frame the application closes both video files, deletes the temporary bitmap file, and continues with the next carrier file.
Writing to a Video Stream
When the application opens an AVI carrier file, it creates another AVI file for the resulting bitmaps. The new video stream must have the same size and frame rate as the original stream, so we cannot create it in the Open() method. When the first bitmap arrives, we know the frame size and are able to create a video stream. The functions to create streams and write frames are AVIFileCreateStream, AVIStreamSetFormat and AVIStreamWrite:
Now we can create a stream...
...and write video frames.
That's all we need to read and write video streams. Non-video streams and compression are not interesting at the moment, because compression destroys the hidden message by changing colours, and sound would make the files even larger - uncompressed AVI files are big enough! ;-)
Changes in CryptUtility
The HideOrExtract() method used to load all carrier images at once. This was no good from the beginning, and now it became impossible. From now on HideOrExtract() loads only one bitmap, and disposes it before loading the next one. The currently used carrier image - simple bitmap or extracted AVI frame - is stored in a BitmapInfo structure, which is passed around by ref.
Whenever MovePixelPosition moves the position into the next carrier bitmap, it checks the field aviPosition. If aviPosition is < 0, it saves and disposes the bitmap. If aviPosition is 0 or greater, it is a frame in an AVI stream. It is not saved to a file, but added to the open AVI stream. If the bitmap was a simple image or the last frame of an AVI stream, the method opens the next carrier file. If there are more frames in the AVI stream, is exports and loads the next bitmap.
Using the code
There are three new classes in the project:
AviReader opens existing AVI files and copies frames to bitmap files.
AviWriter creates new AVI files and combines bitmaps to a video stream.
Avi contains the function declarations and structure definitions.
The operation of the file signing is divided into three states:
1.********************** Hashing:*********************************************
In this operation we read the data that is going to be hashed. Depending on the hash function provided by the framework, you can hash the data in order to be ready for the next step.
2. *******************Signing:***********************************************
In this operation we are going to sign the data received from the previous step. All we have to do is to encrypt the provided data using the private key of the user.
*******************Signing Wave Files:**************************************
I used a new idea by signing wave files. Signing wav files operations is similar to signing a normal file. First, we have to calculate the signature of the input file but instead of calculating the digest for the whole file. We will calculate the digest for the header only. Then encrypt this hash using the private key. The only difference is the storing operation. We will store the signature bits, by changing the least significant bit in all the wave samples according to the signature bits. This bit won’t make a difference in the sound of the file and we will have the digitally signed.
**********************************************************************************
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment