• This repository has been archived on 12/Sep/2021
  • Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A steganographic program that encodes files in pictures

hide.py

A steganographic program that encodes files in pictures.

Installing dependencies

To install needed python libraries, just do this in the folder with requirements.txt:

pip install -r requirements.txt

Usage

hide.py [-h] -i IMAGE [-f FILE] -a ACTION [-p PASSWORD]

"Image" specifies the image you want to decode or encode. Currently only png files are supported. "Action" must be either encode or decode. "File" is only required when encoding. It specifies the file you want to hide in the image. "Password" is an optional argument that activates AES encryption. The password is transformed into a large key unique for that string of characters before encryption takes place.

How it works

The program separates the file (any file will work) into bytes, which are then separated into 2-bit sequences. Those two bit sequences forming a byte are then used to modify the colors of the pixels of the image. Since every pixel has four channels (RGBA), and each channel uses 8 bits for its value (giving a range of 0-255), the channels are only modified by at most 3 (11 bit sequence). In other words, no one will be able to tell the image contains any hidden data without this tool or a tool that reverse-engineers this functionality.

The program adds a small header to the beginning of the stream before encoding, which stores some metadata. While the program is under development, the size of this header may change. You can hide any file, including exe and zip. In fact it is advisable to compress your files before hiding to reduce their size, bundle many files into one package or encrypt them before hiding. If you use encryption the decoded file will be indistinguishable from random noise.

The side effect of the program is that it can also decode files out of any image, even ones that don't have any hidden data, but the result will be meaningless.

If you use "encode" the program will save a new image called output.png which will be the image with encoded data. If you use "decode", the program will save the decoded data to a file called output.xxx where xxx is the file extension read from the header.

If you use a password, the password will be stretched and turned into a secure key via a hashing function. The key will be then used to encrypt data when encoding or decrypt it when decoding. The program needs to add a random nonce to the beginning of encrypted data to be able to decrypt it later. This does not compromise the hidden file. We're using AES symmetric encryption to protect the hidden file. There is also random noise added to the end of the data to hide the size of the hidden file. The length of this random data and the length of the hidden file are only known to those who know the password.

Be sure to use pngs with alpha channel, otherwise it won't work.

More Repositories

1

nuclear

Streaming music player that finds free music for you
TypeScript
12,077
star
2

react-ui-cards

Ready to use card components for React (rewritten in Typescript)
TypeScript
237
star
3

zeus

Programmable fantasy electronic game with its own assembly language and virtual architecture
Rust
59
star
4

cadmium

Transforms the colors of a given image according to a given palette
Rust
49
star
5

is-odd

Returns true if the given number is odd.
Rust
26
star
6

pi-dashboard

Beautiful terminal dashboard for Raspberry Pi
JavaScript
18
star
7

rofi-ykman

Yubikey manager script for rofi
Shell
13
star
8

dotfiles

config files and utilities
Emacs Lisp
11
star
9

mr-cool-nes

🕹️ NES emulator
Rust
10
star
10

smash

a bash.org clone built with Flask
Python
10
star
11

react-npm-minimal-package

Minimal project skeleton designed for easy development of React components to be later published on NPM
JavaScript
9
star
12

react-oxygen-ui-kit

Easy to use UI Kit for React
JavaScript
9
star
13

based-launcher

Feature-rich Linux app launcher (work in progress)
TypeScript
8
star
14

TheUnofficialDoomSpecs

Matthew S Fell's unofficial Doom specs translated into Markdown
7
star
15

react-poll-widget

Flexible poll widget for React
TypeScript
7
star
16

nukeop.github.io

SCSS
7
star
17

common-useragents

Get a list of common useragents
JavaScript
6
star
18

RelayBot2.0

New incarnation of Relay Bot™
Python
6
star
19

wojaker.js

automatic wojak reaction image generator and autoreply script
TypeScript
6
star
20

Icarus

Discord chat bot - a spiritual successor of RelayBot
Python
3
star
21

smoke

steam client powered by flask and react.js
JavaScript
2
star
22

SteamRelayBot

C#
2
star
23

codexscripts

A collection of python scripts interacting with the website RPGCodex
Python
2
star
24

boggler

selenium bot for boggle (wordplays.com)
Python
1
star
25

matrix-steampill

matrix bridge to steam chats
Python
1
star
26

xd75

my keymap for my xd75 keyboard
C
1
star
27

boardgames

Board games made with boardgame.io
TypeScript
1
star
28

nuclear-rewrite

JavaScript
1
star
29

cospad

keymap for my cospad
C
1
star
30

liko-12-demos

Demos for the liko-12 fantasy console
GLSL
1
star
31

radium

python chip-8 emulator
Python
1
star
32

battlesnake

TypeScript
1
star
33

discord-analytics

Discord analytics bot
TypeScript
1
star
34

gammabin

pastebin clone built with Flask
CSS
1
star
35

page-exists

Check if a page can be accessed or returns an error code
JavaScript
1
star
36

HackerRank

My solutions to HackerRank challenges
Python
1
star
37

fake-book

My scores
CartoCSS
1
star
38

windscribe-tmux

Windscribe VPN connection status for tmux status bar (and possibly others)
Python
1
star
39

tinycrawl-frontend

Frontend for the tinycrawl game
JavaScript
1
star
40

pitchfork-bnm

Pitchfork.com scraper that gets best new music info
JavaScript
1
star