{"id":16827616,"url":"https://github.com/dseguin/steg-image","last_synced_at":"2026-07-18T07:03:01.139Z","repository":{"id":180031030,"uuid":"238773920","full_name":"dseguin/steg-image","owner":"dseguin","description":"Steganographically embed and retrive data from images","archived":false,"fork":false,"pushed_at":"2020-05-02T03:29:54.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T07:09:20.768Z","etag":null,"topics":["c","steganography"],"latest_commit_sha":null,"homepage":null,"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/dseguin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-06T20:04:42.000Z","updated_at":"2020-05-02T03:29:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"74deea51-ac36-4d5e-8a03-5a3829c82731","html_url":"https://github.com/dseguin/steg-image","commit_stats":null,"previous_names":["dseguin/steg-image"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dseguin%2Fsteg-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dseguin%2Fsteg-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dseguin%2Fsteg-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dseguin%2Fsteg-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dseguin","download_url":"https://codeload.github.com/dseguin/steg-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244102850,"owners_count":20398386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","steganography"],"created_at":"2024-10-13T11:22:01.771Z","updated_at":"2025-10-13T00:14:47.932Z","avatar_url":"https://github.com/dseguin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"steg-image\n==========\nSteganographically embed data into the color information of an image. The data is stored in the least significant bit(s) of each color channel, which can be from 1 to 8. This program makes use of the excellent [stb_image.h](https://github.com/nothings/stb) header library. Only PNG support is enabled, because JPG encoding is lossy and corrupts the embedded data.\n\nCompilation produces libsteg.so, which contains all the logic neccessary to encode and decode images. See [steganography.h](https://github.com/dseguin/steg-image/blob/master/src/libsteg/steganography.h) for a list of helper functions. You can include this file in your own project to take advantage of the libsteg.so library.\n\n### Example\n```\n$ ./steg-run -i my_image.png -e my_data.bin \u003e output.png\nUsing 2 least-significant bits (LSB) per color channel...\nEmbedding \"my_data.bin\" into image data from \"my_image.png\"...\nWriting resulting PNG image to stdout...\n$ ./steg-run -d -i output.png \u003e output.bin\nUsing 2 least-significant bits (LSB) per color channel...\nExtracting embedded data from \"output.png\"...\nEmbedded data is 198072 bytes\nWriting resulting data to stdout...\n$ ls -1\nmy_data.bin\nmy_image.png\noutput.bin\noutput.png\nsteg-image\nsteg-run\n```\n\n### Compiling\nThings you will need:\n- gcc\n- GNU Make\n- git\n```\n$ git clone https://github.com/dseguin/steg-image\n$ cd steg-image\n$ git submodule update --init\n$ make\n```\n\n### Usage\n```\nUSAGE: ./steg-run [-d|-e DATA_TO_EMBED] [-o OUT_FILE] [-b NUM_BITS] -i IMAGE_FILE\n\n  -i  Use IMAGE_FILE for steganography\n  -d  Decode the data embedded in IMAGE_FILE\n      and send the result to stdout\n  -e  Embed the file DATA_TO_EMBED into IMAGE_FILE\n      and send the result to stdout\n  -b  Use NUM_BITS as number of bits per color channel\n      for embedded data (MIN: 1, MAX: 8, defaults to 2)\n  -o  Write output to OUT_FILE (defaults to stdout)\n```\n\n`steg-run` is a convenience script that will load the libsteg.so library.\n\nUsing the `-e` flag, `steg-image` embeds the file `DATA_TO_EMBED` into the color data from `IMAGE_FILE`, and outputs the resulting PNG image to stdout (or `OUT_FILE` if using the -o flag). Using the `-d` flag, `steg-image` attempts to extract the data embedded in `IMAGE_FILE`, and outputs the resulting data to stdout (or `OUT_FILE` if using the -o flag). Again, this only works for PNG images currently.\n\nThe data is broken up into N-bit chunks (where 1 \u003c= N \u003c= 8) that are stored in reverse order in to color channels of the image, replacing the N least significant bits of each channel. This ensures the embedded data does not significantly change the image visually (if using a low number of bits). For this reason, you can only embed data up to `N/8 * number_of_pixels * number_of_channels` in bytes.\n\nAssuming 2 bit chunks, the data is broken up like so:\n```\nembedded data:               01001011\n                                 |\n                                 v\n                            01 00 10 11\n                                 |\n                                 v\n                     11       10       00       01\nimage data:    11101011 10001110 01110100 00110101\n```\nThe size of the embedded data is an unsigned int that is itself embedded at the start of the image data, using the first `CEIL(32/N)` bytes. Any form of image manipulation will corrupt the embedded data, so image hosting boards that perform image optimization will destroy anything you've embedded.\n\n### License\nsteg-image is released under the open source MIT license.\n\nsteg-image makes use of [stb_image](https://github.com/nothings/stb) by Sean Barrett, which is also under the MIT license. License text for `stb_image` can be found [here](https://github.com/nothings/stb/raw/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdseguin%2Fsteg-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdseguin%2Fsteg-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdseguin%2Fsteg-image/lists"}