Git Product home page Git Product logo

stegosaurus's Introduction

Stegosaurus JPEG steganography library.

Stegosaurus does Steganography on JPEG images, allowing you to embed a message into a cover image using a key. It makes use of a genetic algorithm to attempt to defeat detection of a hidden message through statistical methods.

Usage

Stegosaurus uses Guice to do dependency injection, so it is really simple to integrate into any Guice-using project.

All you have to do to integrate it is install the module com.stegosaurus.stegosaurus.StegosaurusModule. For example:

  Injector injector = Guice.createInjector(new StegosaurusModule())

Once you've done that, to use Stegosaurus you just have get your hands on an instance of com.stegosaurus.stegosaurus.StegosaurusFacade, then to create the steganographic image:

  StegosaurusFacade stegosaurus = injector.getInstance(StegosaurusFacade.class);
  InputStream myImageStream = openMyImage();
  OutputStream myResultingImage = openOutputImage();
  String message = "My nice message";
  String key = "Secret!";
  /* This will place the JPEG image containing the steganographic payload in the
   * myResultingImage stream */
  stegosaurus.embed(myImageStream, myResultingImage, message, key);

Getting a message out of an image is equally simple:

  StegosaurusFacade stegosaurus = injector.getInstance(StegosaurusFacade.class);
  InputStream myImageWithPayload = openImage();
  String key = "Secret!";
  String result = stegosaurus.extract(myImageWithPayload, key);

You may want to fiddle with the parameters in use by the genetic algorithms. In order to do this, just write a new module that extends from StegosaurusModule and replaces the appropriate protected parameter getter with one that returns what you want.

Thus, say you wish to have 100 generations instead of the default 50 for the blockiness optimizer:

  public class MyCustomModule extends StegosaurusModule {
    @Override
    protected int getBNumberOfGenerations() {
      return 100;
    }
  }

And install this module instead:

  Injector = Guice.createInjector(new MyCustomModule());

See StegosaurusModule to see the list of all available parameters and their default values.

Building

To build stegosaurus you will need:

  • a jdk
  • gradle
  • a gcc toolset
  • libgtest (headers and library)
  • libjpeg (headers and library)
  • swig 2

Then just go gradle build

Algorithm details

Stegosaurus makes use of an exceedingly clever algorithm described by Lifang Yu et al.

The algorithm embeds messages into JPEG images by permutting the image's AC coefficients using a permutation initially derived from the user's key, then rekeyed with a seed selected to minimize changes to the image. A plus-minus sequence is used to decide how each bit of data is embedded into the image: a + in the sequence indicates the coefficient is incremented, while a - idicates it is decremeted. Both the new seed and the plus-minus sequence are derived using genetic algorithms.

In particular, the genetic algorithm for the plus-minus sequence seeks to minimize a second order property of the image known as "blockiness" which represents the degree to which 64-pixel blocks differ from their neighbors in the decompressed, color-space image.

License

Stegosaurus is licensed under the AGPL 3 License. See the LICENSE file for details.

stegosaurus's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.