{"id":13413211,"url":"https://github.com/auyer/steganography","last_synced_at":"2025-12-30T05:15:46.741Z","repository":{"id":49810303,"uuid":"134302156","full_name":"auyer/steganography","owner":"auyer","description":"Pure Golang Library that allows LSB steganography on images using ZERO dependencies","archived":false,"fork":false,"pushed_at":"2024-05-19T20:08:22.000Z","size":2359,"stargazers_count":306,"open_issues_count":0,"forks_count":43,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-07-31T20:52:02.098Z","etag":null,"topics":["go","golang","golang-library","image","image-processing","library","steganography","zero-dependency"],"latest_commit_sha":null,"homepage":"","language":"Go","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/auyer.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":"2018-05-21T17:27:36.000Z","updated_at":"2024-07-31T18:42:32.000Z","dependencies_parsed_at":"2024-01-09T09:06:53.633Z","dependency_job_id":"0b4d3fee-d20b-4f83-ae70-7d2ba03e755d","html_url":"https://github.com/auyer/steganography","commit_stats":null,"previous_names":["auyer/stego"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auyer%2Fsteganography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auyer%2Fsteganography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auyer%2Fsteganography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auyer%2Fsteganography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auyer","download_url":"https://codeload.github.com/auyer/steganography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635267,"owners_count":20322906,"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":["go","golang","golang-library","image","image-processing","library","steganography","zero-dependency"],"created_at":"2024-07-30T20:01:35.259Z","updated_at":"2025-12-30T05:15:46.652Z","avatar_url":"https://github.com/auyer.png","language":"Go","funding_links":[],"categories":["Images","Relational Databases","Members","图片","Images 图像处理","Go","图像"],"sub_categories":["Advanced Console UIs","检索及分析资料库","SQL 查询语句构建库","Search and Analytic Databases","交流"],"readme":"# Steganography Lib\n\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](http://godoc.org/github.com/auyer/steganography)\n[![Go Report Card](https://goreportcard.com/badge/github.com/auyer/steganography)](https://goreportcard.com/report/github.com/auyer/steganography)\n[![LICENSE MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://img.shields.io/badge/license-MIT-brightgreen.svg)\n[![Actions CI](https://github.com/auyer/steganography/actions/workflows/test.yaml/badge.svg)](https://github.com/auyer/steganography/actions)\n[![codecov](https://codecov.io/gh/auyer/steganography/branch/main/graph/badge.svg)](https://codecov.io/gh/auyer/steganography)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go) \n\nSteganography is a library written in Pure go to allow simple LSB steganography on images. It is capable of both encoding and decoding images. It can store files of any format.\nThis library is inspired by [Stego by EthanWelsh](https://github.com/EthanWelsh/Stego), a command line utility with the same purpose.\n\n## Installation\n```go\ngo get -u github.com/auyer/steganography\n```\n\n## Demonstration\n\n| Original              |Encoded           |\n| -------------------- | ------------------|\n| ![Original File](examples/stegosaurus.png)  | ![Encoded File](examples/encoded_stegosaurus.png)\n\nThe second image contains the first paragraph of the description of a stegosaurus on [Wikipedia](https://en.wikipedia.org/wiki/Stegosaurus), also available in [examples/message.txt](https://raw.githubusercontent.com/auyer/steganography/master/examples/message.txt) as an example.\n\n------\nGetting Started\n------\n```go\npackage main\nimport (\n    \"bufio\"\n    \"image/png\"\n    \"io/ioutil\"\n\n    \"github.com/auyer/steganography\"\n)\n```\n\nEncode\n------\nWrite mode is used to take a message and embed it into an image file using LSB steganography in order to produce a secret image file that will contain your message.\n\nNote that the minimum image size is 24 pixels for one byte. For each additional byte, it is necessary 3 more pixels.\n\n```go\ninFile, _ := os.Open(\"input_file.png\") // opening file\nreader := bufio.NewReader(inFile)   // buffer reader \nimg, _ := png.Decode(reader)   // decoding to golang's image.Image\n\nw := new(bytes.Buffer)   // buffer that will recieve the results\nerr := steganography.Encode(w, img, []byte(\"message\")) // Encode the message into the image\nif err != nil {\n    log.Printf(\"Error Encoding file %v\", err)\n    return\n}\noutFile, _ := os.Create(\"out_file.png\") // create file\nw.WriteTo(outFile) // write buffer to it\noutFile.Close()\n```\nnote: all error checks were removed for brevity, but they should be included.\n\nSize of Message\n------\nLength mode can be used in order to preform a preliminary check on the carrier image in order to deduce how large of a file it can store.\n\n```go\nsizeOfMessage := steganography.GetMessageSizeFromImage(img) // retrieves the size of the encoded message\n```\n\nDecode\n-----\nRead mode is used to read an image that has been encoded using LSB steganography, and extract the hidden message from that image.\n\n```go\ninFile, _ := os.Open(encodedInputFile) // opening file\ndefer inFile.Close()\n\nreader := bufio.NewReader(inFile) // buffer reader \nimg, _ := png.Decode(reader) // decoding to golang's image.Image\n\nsizeOfMessage := steganography.GetMessageSizeFromImage(img) // retrieving message size to decode in the next line\n\nmsg := steganography.Decode(sizeOfMessage, img) // decoding the message from the file\nfmt.Println(string(msg))\n\n```\nnote: all error checks were removed for brevity, but they should be included.\n\nComplete Example\n------\nFor a complete example, see the [examples/stego.go](examples/stego.go) file. It is a command line app based on the original fork of this repository, but modified to use the Steganography library.\n\n-----\n### Attributions\n - Stegosaurus Picture By Matt Martyniuk - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=42215661\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauyer%2Fsteganography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauyer%2Fsteganography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauyer%2Fsteganography/lists"}