Reputation: 69
I have implemented Image and Audio steganography already in java and now i want to implement video steganography. But, i still haven't been able to find what are the classes that used to do this for e.g the classes that will allow me to view the video data in binary form(because i will be using lsb replacement technique).
Upvotes: 0
Views: 1166
Reputation: 457
My diploma last year final project was Video stenography which i developed using netbeans IDE i will post code here how i have done all the process to do it.
package Stegnography;
import java.io.File;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.FileInputStream;
import java.io.FileOutputStream;
/**
*
* @author DeepRocks
*/
public class EmbProcess {
String embfilename;
public String emb(String s, String s1)
{
try{
File file = new File(s);
File file1 = new File(s1);
FileInputStream fileinputstream = new FileInputStream(s);
FileOutputStream fileoutputstream = new FileOutputStream("temp");
byte abyte0[] = new byte[8];
int i;
int k;
for(k = 0; (i = fileinputstream.read(abyte0, 0, 8)) > 0; k = i)
fileoutputstream.write(abyte0, 0, i);
fileinputstream.close();
for(int l = 1; l <= 8 - k; l++)
fileoutputstream.write(65);
fileoutputstream.write("DATAFILE".getBytes(), 0, 8);
System.out.println("File name==="+file1.getName());
StringBuffer stringbuffer = new StringBuffer(file1.getName());
stringbuffer.setLength(50);
fileoutputstream.write(stringbuffer.toString().getBytes(), 0, 50);
fileinputstream = new FileInputStream(s1);
int j;
while((j = fileinputstream.read(abyte0, 0, 8)) > 0)
fileoutputstream.write(abyte0, 0, j);
fileinputstream.close();
fileoutputstream.close();
file.delete();
File file2 = new File("temp");
file2.renameTo(file);
embfilename=file.getName();
}
catch(Exception e){
e.printStackTrace();
embfilename="";
}
return embfilename;
}
public String demb(String s)
{
boolean flag;
String demfile = "";
try
{
File file = new File(s);
String outpath=s.substring(0, s.lastIndexOf("\\")+1);
FileInputStream fileinputstream = new FileInputStream(s);
char c = '\b';
byte abyte0[] = new byte[c];
String s1 = "";
int i;
while((i = fileinputstream.read(abyte0, 0, c)) > 0)
{
s1 = new String(abyte0);
if(s1.equals("DATAFILE"))
break;
}
if(!s1.equals("DATAFILE"))
{
flag=false;
fileinputstream.close();
return demfile;
}
abyte0 = new byte[50];
fileinputstream.read(abyte0, 0, 50);
s1 = new String(abyte0);
String s2 = s1.trim();
String fpath = s2.substring(0, s2.lastIndexOf(".") + 1) + "enc";
System.out.println("fpath------"+fpath);
FileOutputStream fileoutputstream = new FileOutputStream(outpath+fpath);
c = '\u5000';
abyte0 = new byte[c];
while((i = fileinputstream.read(abyte0, 0, c)) > 0)
fileoutputstream.write(abyte0, 0, i);
fileinputstream.close();
fileoutputstream.close();
demfile=fpath;
}
catch(Exception exception)
{
demfile="";
exception.printStackTrace();
System.out.println(exception);
}
return demfile;
}
}**THIS CODE IS FOR EMBEDDING PROCESS**
Please clear that what you actually want, I will help you out just look at my code if it's helping you i will give you my project.
Upvotes: 2