![Video steganography project in java source code Video steganography project in java source code](http://i56.tinypic.com/o5wak0.jpg)
Source Code For Image Steganography In Java Codes and Scripts Downloads Free. Santos is a multiple source-code/resource generator developed in Java that takes an XML instance and generates the required source-code/resources as specified in its descriptor file. Accounting source code for Delphi. Steganography refers to the science of “invisible” communication. For hiding secret information in various file formats, there exists a large variety of steganographic techniques some are more complex than others and all of them have respective strong and weak points.
Permalink![Source Source](http://i.ytimg.com/vi/z835b61QeFg/maxresdefault.jpg)
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up Find file Copy path
Cannot retrieve contributors at this time
/** |
* Copyright © 2014 Leo Xiong <hello@leoxiong.com> |
* |
* This program is free software: you can redistribute it and/or modify |
* it under the terms of the GNU General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This program is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
* |
* Steganography - to conceal data within other data |
* |
* This implementation supports concealing any form of data within |
* images by utilizing the two least significant bits of each |
* RGB (no alpha) channel of each pixel in the carrier image. |
* |
* Notes: |
* TODO: encode length of payload by using a header or TLV |
* TODO: pre-calculate maximum data capacity of carrier image |
* TODO: support carrier images with a bit depth of less than 24 bits |
* TODO: variable amount of least significant bits to use for encoding |
* TODO: better cmd line arg parser |
*/ |
importjavax.imageio.ImageIO; |
importjava.awt.image.BufferedImage; |
importjava.io.*; |
publicclassSteganography { |
publicstaticvoidmain(String[] args) { |
if (args.length <2|| args.length >3) { |
System.out.println('steganography <input image> <output image> [payload file]'); |
return; |
} |
Stopwatch stopwatch =newStopwatch(); |
try { |
if (args.length 3) { |
try { |
ImageIO.write(encode(ImageIO.read(newFile(args[0])), newBitInputStream(newFile(args[2]))), 'PNG', newFile(args[1])); |
} catch (Exception e) { |
System.err.println(e.getMessage()); |
} |
} elseif (args.length 2) { |
decode(ImageIO.read(newFile(args[0])), newBitOutputStream(newFileOutputStream(args[1]))); |
} |
System.out.println(String.format('done %sms', stopwatch.getTime() /1000000)); |
} catch (IOException e) { |
System.err.println(e.getMessage()); |
} |
} |
publicstaticBufferedImageencode(BufferedImagecarrier, BitInputStreampayload) throwsException { |
for (int y =0; y < carrier.getHeight(); y++) { |
for (int x =0; x < carrier.getWidth(); x++) { |
int pixel = carrier.getRGB(x, y) &0xFFFCFCFC; |
for (int offset =16; offset >=0; offset -=8) { |
int bits = payload.readBits(2); |
if (bits -1) |
return carrier; |
pixel |= bits << offset; |
} |
carrier.setRGB(x, y, pixel); |
} |
} |
thrownewException('not enough space'); |
} |
publicstaticvoiddecode(BufferedImagecarrier, BitOutputStreampayload) throwsIOException { |
for (int y =0; y < carrier.getHeight(); y++) { |
for (int x =0; x < carrier.getWidth(); x++) { |
for (int offset =16; offset >=0; offset -=8) { |
payload.write(2, (carrier.getRGB(x, y) >> offset) &0x3); |
} |
} |
} |
payload.close(); |
} |
} |
Copy lines Copy permalink