{"id":39580339,"url":"https://github.com/brandon1024/steg-png","last_synced_at":"2026-01-18T07:29:34.503Z","repository":{"id":54161524,"uuid":"204229336","full_name":"brandon1024/steg-png","owner":"brandon1024","description":":mag: Embed and obfuscate data in Portable Network Graphics","archived":false,"fork":false,"pushed_at":"2021-03-06T13:38:56.000Z","size":2917,"stargazers_count":13,"open_issues_count":10,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T13:46:08.176Z","etag":null,"topics":["c","cmake","steganography","zlib"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brandon1024.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-25T00:55:11.000Z","updated_at":"2025-09-14T16:56:26.000Z","dependencies_parsed_at":"2022-08-13T08:00:42.489Z","dependency_job_id":null,"html_url":"https://github.com/brandon1024/steg-png","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brandon1024/steg-png","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandon1024%2Fsteg-png","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandon1024%2Fsteg-png/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandon1024%2Fsteg-png/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandon1024%2Fsteg-png/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brandon1024","download_url":"https://codeload.github.com/brandon1024/steg-png/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandon1024%2Fsteg-png/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28533165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cmake","steganography","zlib"],"created_at":"2026-01-18T07:29:33.963Z","updated_at":"2026-01-18T07:29:34.494Z","avatar_url":"https://github.com/brandon1024.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# steg-png\n[![Build Status](https://travis-ci.com/brandon1024/steg-png.svg?branch=master)](https://travis-ci.com/brandon1024/steg-png)\n\n`steg-png` is a simple C-based commandline application that can be used to embed data in Portable Network Graphics (PNG) images. This concept is known as steganography, and is useful for concealing hidden messages in otherwise unassuming files.\n\n![](screenshot1.png)\n\n## How it works\nPortable Network Graphics (PNG) images have a pretty simple format. They are composed of an 8-byte file header and a number of data chunks.\n\nData chunks within the file are split into two groups, known as `critical` and `ancillary`. Critical chunks are necessary for the decoder to be able to decode and display the image. This includes information like color data and dimensions. Ancillary chunks are optional chunks of data that decoders will ignore if unknown to them. There are a number of standard ancillary chunks, but steg-png uses a custom `stEG` type chunk.\n\nChunks have the following byte structure:\n\n| Length  | Chunk Type | Chunk Data   | CRC     |\n|---------|------------|--------------|---------|\n| 4 bytes | 4 bytes    | Length bytes | 4 bytes |\n\nsteg-png uses the popular [zlib compression library](https://github.com/madler/zlib) to compress the data before embedding in the file. This has the added benefit of obfuscating the message, which will help to mitigate the risk of discovering the message when byte inspecting the file.\n\nYou can read more on the specifics of the PNG format in [informational RFC 2083](https://tools.ietf.org/html/rfc2083).\n\n## Building and Installing\nBy default, steg-png is installed into your user's ~/bin directory. To install, from the project root run:\n```bash\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make install\n\n$ ~/bin/steg-png --help\n```\n\nFor a global install, run from the project root:\n```bash\n$ mkdir build\n$ cd build\n$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..\n$ make install\n\n$ steg-png --help\n```\n\n## Usage\nUsing the tool is simple.\n\n```\nusage: steg-png embed [options] (-m | --message \u003cmessage\u003e) \u003cfile\u003e\n   or: steg-png embed [options] (-f | --file \u003cfile\u003e) \u003cfile\u003e\n   or: steg-png embed (-h | --help)\n\n    -m, --message \u003cmessage\u003e\n                        specify the message to embed in the png image\n    -f, --file \u003cfile\u003e   specify a file to embed in the png image\n    -o, --output \u003cfile\u003e\n                        output to a specific file\n    -l=\u003cn\u003e, --compression-level=\u003cn\u003e\n                        alternate compression level (0 none, 1 fastest - 9 slowest)\n    -q, --quiet         suppress informational summary to stdout\n    -h, --help          show help and exit\n\n\nusage: steg-png extract [-o | --output \u003cfile\u003e] \u003cfile\u003e\n   or: steg-png extract [--hexdump] \u003cfile\u003e\n   or: steg-png extract (-h | --help)\n\n    -o, --output \u003cfile\u003e\n                        alternate output file path\n    --hexdump           print a hexdump of the embedded data\n    -h, --help          show help and exit\n\nusage: steg-png inspect [(--filter \u003cchunk type\u003e)...] [--critical] [--ancillary] [--hexdump] \u003cfile\u003e\n   or: steg-png inspect (-i | --interactive) \u003cfile\u003e\n   or: steg-png inspect (-h | --help)\n\n    --hexdump           print a canonical hex+ASCII hexdump of the embedded data\n                        show chunks with specific type\n    --critical          show critical chunks\n    --ancillary         show ancillary chunks\n    --machine-readable\n                        show output in machine-readable format\n    -z, --nul           terminate lines with NUL byte instead of line feed\n    -h, --help          show help and exit\n```\n\n## Example Usage\n### Embed Plaintext Messages\n```bash\n$ ls\ntest.png\n$ steg-png embed -m \"my message\" -o secret.png test.png\nin  test.png    100644 936095 f253df42e3cff95507d9217c67d9b783\nout secret.png  100644 936125 85c49de24312d40e79b6f6697b71e75d\n\nsummary:\ncompression factor: 1.80 (10 in, 18 out)\nchunks embedded in file: 1\n$ ls\ntest.png\nsecret.png\n```\n\n### Embed Arbitrary Data\n```bash\n$ ls\nexecute-me.sh\ntest.png\n$ steg-png embed -f execute-me.sh -o secret.png test.png\nin  test.png    100644 936095 f253df42e3cff95507d9217c67d9b783\nout secret.png  100644 936247 2f0cd83b221c56388378c83a3ff051fe\n\nsummary:\ncompression factor: 0.72 (195 in, 140 out)\nchunks embedded in file: 1\n$ ls\ntest.png\nsecret.png\n```\n\n### Extracting Plaintext Messages\n```bash\n$ ls\ntest.png\nsecret.png\n$ steg-png extract -o secret secret.png\n$ cat secret\nhello!\n```\n\n### Extracting Arbitrary Data\n```bash\n$ ls\nsecret.png\n$ steg-png extract -o execute-me.sh secret.png\n$ chmod +x execute-me.sh\n$ ./execute-me.sh\nhello!\n```\n\n### Visualizing Embedded Data\n```bash\n$ ls\nsecret.png\n$ steg-png extract --hexdump secret.png\n00000000  68 65 6c 6c 6f 21                                |hello!|\n```\n\n### Inspecting Embedded Data\n```bash\n$ ls\nsecret.png\n$ steg-png inspect --filter stEG --hexdump secret.png\npng file summary:\nsecret.png  100644 936121 263b5b0d7a80d9ffe66ff22c195a46ae\nchunks: IHDR (1), iCCP (1), stEG (1), eXIf (1), pHYs (1), iTXt (1), iDOT (1), IDAT (58), IEND (1)\n\n\nShowing all chunks that have the type (stEG):\n\nchunk type: stEG\nfile offset: 3193\ndata length: 14\ncyclic redundancy check: 3196852778 (network byte order 0x2a1a8cbe)\ndata:\n00000000  78 9c cb 48 cd c9 c9 57 04 00 08 62 02 36        |x..H...W...b.6|\n```\n\n### Inspecting PNG File Structure\n```bash\n$ ls\nsecret.png\n$ steg-png inspect --critical secret.png\npng file summary:\nsecret.png  100644 936121 263b5b0d7a80d9ffe66ff22c195a46ae\nchunks: IHDR (1), iCCP (1), stEG (1), eXIf (1), pHYs (1), iTXt (1), iDOT (1), IDAT (58), IEND (1)\n\n\nShowing all chunks that are critical:\n\nchunk type: IHDR\nfile offset: 8\ndata length: 13\ncyclic redundancy check: 3390785450 (network byte order 0xaa471bca)\n\nchunk type: IDAT\nfile offset: 3914\ndata length: 16384\ncyclic redundancy check: 1642937807 (network byte order 0xcf3ded61)\n\nchunk type: IDAT\nfile offset: 20310\ndata length: 16384\ncyclic redundancy check: 3415450082 (network byte order 0xe2a193cb)\n\n.... (truncated for brevity)\n\nchunk type: IDAT\nfile offset: 914064\ndata length: 16384\ncyclic redundancy check: 2329633380 (network byte order 0x6462db8a)\n\nchunk type: IDAT\nfile offset: 930460\ndata length: 5637\ncyclic redundancy check: 726346680 (network byte order 0xb82b4b2b)\n\nchunk type: IEND\nfile offset: 936109\ndata length: 0\ncyclic redundancy check: 2923585666 (network byte order 0x826042ae)\n```\n\n### Parsing PNG File Structure\n```bash\n$ ls\nsecret.png\n$ # --machine-readable format: \u003cchunk type\u003e \u003cfile offset\u003e \u003cdata segment length\u003e \u003c32-bit CRC host byte order\u003e\n$ steg-png inspect --machine-readable secret.png\nIHDR 8 13 3390785450\niCCP 33 3148 3073351896\nstEG 3193 14 3196852778\neXIf 3219 138 1200866906\npHYs 3369 9 1230120176\niTXt 3390 472 2924188147\niDOT 3874 28 2081801688\nIDAT 3914 16384 1642937807\nIDAT 20310 16384 3415450082\nIDAT 36706 16384 3616936176\nIDAT 53102 16384 2514028901\nIDAT 69498 16384 3690291837\nIDAT 85894 16384 627990634\nIDAT 102290 16384 4187174932\nIDAT 118686 16384 3102413329\nIDAT 135082 16384 1513502627\nIDAT 151478 16384 1326204536\nIDAT 167874 16384 3316197314\nIDAT 184270 16384 1125484417\nIDAT 200666 16384 3644326412\nIDAT 217062 16384 3944643344\nIDAT 233458 16384 3865921331\nIDAT 249854 16384 2067871703\nIDAT 266250 16384 823706138\nIDAT 282646 16384 3387257625\nIDAT 299042 16384 644280890\nIDAT 315438 16384 433218780\nIDAT 331834 16384 3980611312\nIDAT 348230 16384 355444652\nIDAT 364626 16384 638721223\nIDAT 381022 16384 2188694194\nIDAT 397418 16384 2926094770\nIDAT 413814 16384 2441488258\nIDAT 430210 16384 3376083075\nIDAT 446606 16384 1731962082\nIDAT 463002 16384 3053040069\nIDAT 479398 16384 727178856\nIDAT 495794 16384 4208257611\nIDAT 512190 16384 3797531557\nIDAT 528586 16384 2175258547\nIDAT 544982 8358 2458139397\nIDAT 553352 16384 1977755237\nIDAT 569748 16384 2250206215\nIDAT 586144 16384 1969696234\nIDAT 602540 16384 2909082706\nIDAT 618936 16384 378917002\nIDAT 635332 16384 536186543\nIDAT 651728 16384 1043374053\nIDAT 668124 16384 3504837883\nIDAT 684520 16384 3370061706\nIDAT 700916 16384 3276306620\nIDAT 717312 16384 3425131976\nIDAT 733708 16384 134843265\nIDAT 750104 16384 267958489\nIDAT 766500 16384 2259678566\nIDAT 782896 16384 1549130947\nIDAT 799292 16384 865128891\nIDAT 815688 16384 2935915479\nIDAT 832084 16384 3787543213\nIDAT 848480 16384 2961472929\nIDAT 864876 16384 2940432080\nIDAT 881272 16384 396352217\nIDAT 897668 16384 3408016487\nIDAT 914064 16384 2329633380\nIDAT 930460 5637 726346680\nIEND 936109 0 2923585666\n```\n\n## Using steg-png with GNU Privacy Guard (GPG)\nWhen no message is provided, steg-png will accept input from stdin. This is useful when using steg-png with GPG.\n\nFor instance, you could encrypt a message symmetrically before embedding in the file:\n```\necho \"my secret message\" \u003e message_in\ngpg -o - --armor --symmetric message_in | steg-png embed example.png\n```\n\n![](screenshot2.png)\n\n## License\nThis project is free software and is available under the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandon1024%2Fsteg-png","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandon1024%2Fsteg-png","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandon1024%2Fsteg-png/lists"}