Embed noise or hidden message to text.
Download prebuilt binaries from the latest GitHub release.
To install from source with Go:
$ go install github.com/kitsuyui/invisible@latestFor local development builds, run go build -o invisible . from the repository
root. The bin/build.sh script is available for release-style cross-platform
builds.
$ invisible add-noise < example/plain.txt > example/noised.txtIt looks normal. But the size is grown from 446 bytes to 1070 bytes by noise.
Note:
add-noiseoutput is non-deterministic — the invisible characters inserted vary on each run. Use--seed <N>to get reproducible output (e.g.--seed 42).encodeanddecodeare always deterministic.
add-noise accepts these options:
--frequency <rate>/-f <rate>: noise insertion probability. The default is0.5. Negative values are rejected.--noise-size <count>/-s <count>: maximum number of invisible characters inserted at once. The default is1.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
$ invisible encode -m 'Hello, World!' < example/plain.txt > example/embedded.txtIt looks normal. But the hidden message is in.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
$ invisible decode < example/embedded.txt
Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Encoded messages start with an invisible v1 format marker. The decoder still
accepts older markerless payloads for compatibility, and rejects payloads that
use the reserved marker prefix with an unsupported version.
$ invisible versionPrints the installed version. Returns (devel) when built from source and (unknown) when build information is unavailable.
Install lefthook and run the following command once after cloning:
$ lefthook installThis sets up the following local Git hooks that mirror the CI checks:
- pre-commit: runs
go vet ./...to catch common issues before each commit. - pre-push: runs
go vet ./...andgo test ./...to verify correctness before pushing.
CI still runs the full test suite on every pull request and push to main — the hooks only bring that feedback earlier, during local development.
The 3-Clause BSD License. See also LICENSE file.