Skip to content

kitsuyui/invisible

Invisible

Embed noise or hidden message to text.

Coverage Github All Releases

Install

Download prebuilt binaries from the latest GitHub release.

To install from source with Go:

$ go install github.com/kitsuyui/invisible@latest

For 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.

Add noise

$ invisible add-noise < example/plain.txt > example/noised.txt

It looks normal. But the size is grown from 446 bytes to 1070 bytes by noise.

Note: add-noise output is non-deterministic — the invisible characters inserted vary on each run. Use --seed <N> to get reproducible output (e.g. --seed 42). encode and decode are always deterministic.

add-noise accepts these options:

  • --frequency <rate> / -f <rate>: noise insertion probability. The default is 0.5. Negative values are rejected.
  • --noise-size <count> / -s <count>: maximum number of invisible characters inserted at once. The default is 1.
L⁡o​rem⁣ ⁢ip​sum ⁡d​olor⁡ ⁠sit⁡ a​met⁣, ⁠c‌ons⁠ectet⁢ur⁠ ⁣a⁤di⁡p⁣isci‌n‌g e‌li⁢t,‌ ⁢se​d d⁡o‌ e​i⁡u⁠smo⁢d⁡ ​t⁠em⁡po​r in⁠cididu‌n⁡t ⁢u⁡t labo⁠re ​e⁡t​ ‌dolo⁣re​ mag‌n⁡a⁠ al⁣i​qua.⁡ ⁤Ut en​im ad⁤ ‌minim ⁡v⁢e⁣ni‌am, qui⁤s ⁢n⁡os⁣trud‌ ⁢e⁣xe‌rc⁠itati⁣on ‌u⁢l‌l⁢a​mc⁠o⁠ laboris n​i⁤si⁡ ​ut⁠ ⁢a⁠liq‌u​i⁣p e‌x e⁠a⁡ c‌ommo⁠do⁤ con⁤s⁣e⁠q⁡uat⁠. Duis aute iru⁠r⁤e ⁤d‌olor ⁤i⁣n⁢ ⁡r⁠e​pr​eh⁡end⁤e⁠rit⁣ i⁣n⁣ vo⁡l⁣uptate⁠ v‌el⁣it ​e⁢s⁡s⁡e⁠ ⁠cil⁢l‌u​m dol​ore⁢ ​e⁢u ⁠f​u⁤gi​a⁢t‌ ⁠n⁠ulla par⁣iat​u⁠r​. ‌Except‌e​ur⁢ ⁤sin​t⁠ occaecat cu​pid⁢a⁠tat ⁤n⁡o⁣n⁤ ⁠proide‌nt, ​sunt⁤ ⁡i‌n cu⁡lp⁤a ⁢qui‌ off​ic⁢i‌a dese​run​t ‌mo‌l⁢li⁡t⁣ ​a⁢ni⁤m⁣ ​id ⁡est l⁤abo⁡r​u⁢m.

Encode

$ invisible encode -m 'Hello, World!' < example/plain.txt > example/embedded.txt

Encoded text

It looks normal. But the hidden message is in.

L⁠o⁠r​e⁤m⁠ ⁣i⁣p⁢s⁡u⁡m​ ⁤do⁢l⁣o⁢r‌ ​s​i⁣t⁡ ⁣a⁣me⁡t⁢,⁢ ⁤c⁤o‌n⁢s⁢e‌c​t⁠e​t​u​r​ ​a⁠d⁠i​p⁤i⁠s⁣c⁣i⁢n⁡g⁡ ​e⁤li⁢t⁣,⁢ ‌s​e​d⁣ ⁡d⁣o⁣ e⁡i⁢u⁢s⁤m⁤o‌d⁢ ⁢t‌e​m⁠p​o​r​ ​i​n⁠c⁠i​d⁤i⁠d⁣u⁣n⁢t⁡ ⁡u​t⁤ l⁢a⁣b⁢o‌r​e​ ⁣e⁡t⁣ ⁣do⁡l⁢o⁢r⁤e⁤ ‌m⁢a⁢g‌n​a⁠ ​a​l​i​q​u⁠a⁠.​ ⁤U⁠t⁣ ⁣e⁢n⁡i⁡m​ ⁤ad⁢ ⁣m⁢i‌n​i​m⁣ ⁡v⁣e⁣ni⁡a⁢m⁢,⁤ ⁤q‌u⁢i⁢s‌ ​n⁠o​s​t​r​u​d⁠ ⁠e​x⁤e⁠r⁣c⁣i⁢t⁡a⁡t​i⁤on⁢ ⁣u⁢l‌l​a​m⁣c⁡o⁣ ⁣la⁡b⁢o⁢r⁤i⁤s‌ ⁢n⁢i‌s​i⁠ ​u​t​ ​a​l⁠i⁠q​u⁤i⁠p⁣ ⁣e⁢x⁡ ⁡e​a⁤ c⁢o⁣m⁢m‌o​d​o⁣ ⁡c⁣o⁣ns⁡e⁢q⁢u⁤a⁤t‌.⁢ ⁢D‌u​i⁠s​ ​a​u​t​e⁠ ⁠i​r⁤u⁠r⁣e⁣ ⁢d⁡o⁡l​o⁤r ⁢i⁣n⁢ ‌r​e​p⁣r⁡e⁣h⁣en⁡d⁢e⁢r⁤i⁤t‌ ⁢i⁢n‌ ​v⁠o​l​u​p​t​a⁠t⁠e​ ⁤v⁠e⁣l⁣i⁢t⁡ ⁡e​s⁤se⁢ ⁣c⁢i‌l​l​u⁣m⁡ ⁣d⁣ol⁡o⁢r⁢e⁤ ⁤e‌u⁢ ⁢f‌u​g⁠i​a​t​ ​n​u⁠l⁠l​a⁤ ⁠p⁣a⁣r⁢i⁡a⁡t​u⁤r.⁢ ⁣E⁢x‌c​e​p⁣t⁡e⁣u⁣r ⁡s⁢i⁢n⁤t⁤ ‌o⁢c⁢c‌a​e⁠c​a​t​ ​c​u⁠p⁠i​d⁤a⁠t⁣a⁣t⁢ ⁡n⁡o​n⁤ p⁢r⁣o⁢i‌d​e​n⁣t⁡,⁣ ⁣su⁡n⁢t⁢ ⁤i⁤n‌ ⁢c⁢u‌l​p⁠a​ ​q​u​i​ ⁠o⁠f​f⁤i⁠c⁣i⁣a⁢ ⁡d⁡e​s⁤er⁢u⁣n⁢t‌ ​m​o⁣l⁡l⁣i⁣t ⁡a⁢n⁢i⁤m⁤ ‌i⁢d⁢ ‌e​s⁠t​ ​l​a​b​o⁠r⁠u​m⁤.⁠
⁣⁣⁢⁡⁡​⁤⁢⁣⁢‌​​⁣⁡⁣⁣⁡⁢⁢⁤⁤‌⁢⁢‌​⁠​​​​​

Decode

$ 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!

Encoding format

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.

Version

$ invisible version

Prints the installed version. Returns (devel) when built from source and (unknown) when build information is unavailable.

Development

Install lefthook and run the following command once after cloning:

$ lefthook install

This 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 ./... and go 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.

LICENSE

Source

The 3-Clause BSD License. See also LICENSE file.

About

Embed noise or hidden message to text.

Resources

License

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors