๐Ÿ” Go tool for LSB steganography, capable of hiding any file within an image.

stegify

Build Status Coverage Status GoDoc Go Report Card Mentioned in Awesome Go

Overview

stegify is a simple command line tool capable of fully transparent hiding any file within an image or set of images. This technique is known as LSB (Least Significant Bit) steganography

Demonstration

Carrier Data Result
Original File Data file Encoded File

The Result file contains the Data file hidden in it. And as you can see it is fully transparent.

If multiple Carrier files are provided, the Data file will be split in pieces and every piece is encoded in the respective carrier.

Carrier1 Carrier2 Data Result1 Result2

The Result1 file contains one half of the Data file hidden in it and Result2 the other. As always fully transparent.

Installation

Installing from Source

go get -u github.com/DimitarPetrov/stegify

Installing via Homebrew (macOS)

brew tap DimitarPetrov/stegify
brew install stegify

Or you can download a binary for your system here.

Usage

As a command line tool

Single carrier encoding/decoding

stegify encode --carrier <file-name> --data <file-name> --result <file-name>

stegify decode --carrier <file-name> --result <file-name>

When encoding, the file with name given to flag --data is hidden inside the file with name given to flag --carrier and the resulting file is saved in new file in the current working directory under the name given to flag --result.

NOTE: The result file won't have any file extension and therefore it should be specified explicitly in --result flag.

When decoding, given a file name of a carrier file with previously encoded data in it, the data is extracted and saved in new file in the current working directory under the name given to flag --result.

NOTE: The result file won't have any file extension and therefore it should be specified explicitly in --result flag.

In both cases the flag --result could be omitted and default values will be used.

Multiple carriers encoding/decoding

stegify encode --carriers "<file-names...>" --data <file-name> --results "<file-names...>"
OR
stegify encode --carrier <file-name> --carrier <file-name> ... --data <file-name> --result <file-name> --result <file-name> ...

stegify decode --carriers "<file-names...>" --result <file-name>
OR
stegify decode --carrier <file-name> --carrier <file-name> ... --result <file-name>

When encoding a data file in more than one carriers, the data file is split in N chunks, where N is number of provided carriers. Each of the chunks is then encoded in the respective carrier.

NOTE: When decoding, carriers should be provided in the exact same order for result to be properly extracted.

This kind of encoding provides one more layer of security and more flexibility regarding size limitations.

In both cases the flag --result/--results could be omitted and default values will be used.

NOTE: When encoding the number of the result files (if provided) should be equal to the number of carrier files. When decoding, exactly one result is expected.

When multiple carriers are provided with mixed kinds of flags, the names provided through carrier flag are taken first and with carriers/c flags second. Same goes for the result/results flag.

Programmatically in your code

stegify can be used programmatically too and it provides easy to use functions working with file names or raw Readers and Writers. You can visit godoc under steg package for details.

Disclaimer

If carrier file is in jpeg or jpg format, after encoding the result file image will be png encoded (therefore it may be bigger in size) despite of file extension specified in the result flag.

Showcases

๐Ÿšฉ Codefestโ€™19

stegify was used for one of the Capture The Flag challenges in Codefestโ€™19.

Participants were given a photo of a bunch of "innocent" cats. Nothing suspicious right? Think again!

You can read more here and here.

Owner
Dimitar Petrov
We cannot solve our problems with the same thinking we used when we created them. - Albert Einstein
Dimitar Petrov
Comments
  • empty structs use don't take any space

    empty structs use don't take any space

    Hi, I'm a beginner to Go and I started using this project to get comfortable with the language. This is a pretty small change but empty structs don't take any space compared to using booleans which use a bit. https://dave.cheney.net/2014/03/25/the-empty-struct

  • Simplfy CLI API

    Simplfy CLI API

    • Use go modules.
    • Remove duplicate of carrier/carriers result/results flags.
    • Use comma-separated instead of space separated, so quotes are no longer needed (simpler API).
    • Use a library that provides parsing command line flags, sub commands and bash completion.
  • [FR] Hide source file in multiple output files

    [FR] Hide source file in multiple output files

    Hi,

    Will be really nice to be able to hide the source file in multiples files and take in account the order specified for the encode / decode steps. It will prevent the ability to decode the source file if an image is missing or if the order is not correct.

    Additionally, adding a password protection will be neat too

    Regards,

  • Using into of a QR code ?

    Using into of a QR code ?

    Qr code using fountain algorithm .

    I was wondering if you know if I can use your lib and transfer data over a screen --> camera ?

    Not sure myself but you might know.

  • Encode data in multiple carriers

    Encode data in multiple carriers

    Support for hiding the data file in multiple files with specified order requested by https://github.com/DimitarPetrov/stegify/issues/3.

    Progress of this PR:

    • [x] Implementation
    • [x] Initial tests
    • [x] More tests
    • [x] Documentation
Image - This repository holds supplementary Go image librariesThis repository holds supplementary Go image libraries

Go Images This repository holds supplementary Go image libraries. Download/Insta

Jan 5, 2022
Generate image plots of processes' memory usage very quickly, within a single binary.
Generate image plots of processes' memory usage very quickly, within a single binary.

memplot A small utility written in golang to quickly plot memory usage of processes. memplot constantly samples memory usage of a process, for a given

Apr 17, 2021
darkroom - An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency.
darkroom - An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency.

Darkroom - Yet Another Image Proxy Introduction Darkroom combines the storage backend and the image processor and acts as an Image Proxy on your image

Dec 6, 2022
Easily customizable Social image (or Open graph image) generator

fancycard Easily customizable Social image (or Open graph image) generator Built with Go, Gin, GoQuery and Chromedp Build & Run Simply, Clone this rep

Jan 14, 2022
An API which allows you to upload an image and responds with the same image, stripped of EXIF data

strip-metadata This is an API which allows you to upload an image and responds with the same image, stripped of EXIF data. How to run You need to have

Nov 25, 2021
Imgpreview - Tiny image previews for HTML while the original image is loading
Imgpreview - Tiny image previews for HTML while the original image is loading

imgpreview This is a Go program that generates tiny blurry previews for images t

May 22, 2022
The imghdr module determines the type of image contained in a file for go
The imghdr module determines the type of image contained in a file for go

goimghdr Inspired by Python's imghdr Installation go get github.com/corona10/goimghdr List of return value Value Image format "rgb" SGI ImgLib Files

Oct 10, 2022
API-first image file text search ๐Ÿ”

API-first image file text search ??

Dec 11, 2021
Extract image tag from yaml file to stdout.

Extract image tag from yaml file to stdout.

Nov 10, 2021
Turn a grid of frames (stored in a single image) into a video file
Turn a grid of frames (stored in a single image) into a video file

reel2vid Convert a video that is encoded into one large image as many images sid

Dec 19, 2021
Faster than the fastest in the world pixel-by-pixel image difference tool.

imgdiff Faster than the fastest in the world pixel-by-pixel image difference tool. Why? imgdiff isn't as fast as a tool like this should be and I'm no

Dec 21, 2022
An extensive, fast, and accurate command-line image dithering tool.
An extensive, fast, and accurate command-line image dithering tool.

didder is an extensive, fast, and accurate command-line image dithering tool. It is designed to work well for both power users as well as pipeline scripting. It is backed by my dithering library, and is unique in its correctness and variety of dithering algorithms.

Dec 31, 2022
A lightweight and easy to use tool for deflickering timelapse image sequences.
A lightweight and easy to use tool for deflickering timelapse image sequences.

Simple Deflicker A minimalist, lightning-fast and easy to use tool for deflickering image sequences such as timelapses. It's still in its early stages

Aug 12, 2022
Tool to scan a container image's rootfs

image-rootfs-scanner A tool to pull and scan the rootfs of any container image for different binaries. It started out as a means of finding "restricte

Mar 30, 2022
Image processing algorithms in pure Go
Image processing algorithms in pure Go

bild A collection of parallel image processing algorithms in pure Go. The aim of this project is simplicity in use and development over absolute high

Jan 6, 2023
Go package for fast high-level image processing powered by libvips C library

bimg Small Go package for fast high-level image processing using libvips via C bindings, providing a simple programmatic API. bimg was designed to be

Jan 2, 2023
Image processing library and rendering toolkit for Go.

blend Image processing library and rendering toolkit for Go. (WIP) Installation: This library is compatible with Go1. go get github.com/phrozen/blend

Nov 11, 2022
Decode embedded EXIF meta data from image files.

goexif Provides decoding of basic exif and tiff encoded data. Still in alpha - no guarantees. Suggestions and pull requests are welcome. Functionality

Dec 17, 2022
A lightning fast image processing and resizing library for Go

govips A lightning fast image processing and resizing library for Go This package wraps the core functionality of libvips image processing library by

Jan 8, 2023