/unch

Hides message with invisible Unicode characters

Primary LanguageGoApache License 2.0Apache-2.0

unch 😗

tests GoDoc

Hides message with invisible Unicode characters.

unch lets you hide one string in another string by using VARIATION SELECTOR-17 (E0100) through VARIATION SELECTOR-25 (E01EF). It enables encoding of strings that contain characters beyond the standard ASCII range.

flowchart LR
    MESSAGE[/"MESSAGE"/]
    B64["BASE64"]
    LOOP{{"for CHAR in BASE64"}}
    APPEND[["OUTPUT += CHAR + E0100 offset"]]
    OUTPUT[/"PLAINTEXT + OUTPUT"/]

    MESSAGE -- "Encode" --> B64
    B64 --> LOOP --> APPEND
    APPEND --> OUTPUT

Table of Contents

Installation

Binary

Simply, download a pre-built binary from releases page. Verify and run!

Source

Using Go compiler:

Note

Go version 1.22.0+ must be installed and configured.

go install -v github.com/dwisiswant0/unch@latest

— or

Manual building executable:

Warning

The master branch contains the latest code changes and updates, which might not have undergone thorough testing and quality assurance - thus, you may encounter instability or unexpected behavior.

git clone https://github.com/dwisiswant0/unch.git
cd unch/
# git checkout [VERSION]
make build
# ./bin/unch --help

Docker

Pull the Docker image by running:

docker pull ghcr.io/dwisiswant0/unch:latest

Usage

Simply, unch can be run with:

unch "MESSAGE" "PLAINTEXT"

To decode:

unch -d "ENCODED"

Options

Here are all the options it supports.

Flag Description
-d/-decode Decodes the encoded MESSAGE
-l/-lorem Generate random PLAINTEXT with lorem ipsum
-n Do not output the trailing newline

Examples

These are some examples of usage.

Encoding

unch "MESSAGE" "PLAINTEXT"

From STDIN

unch "PLAINTEXT" <<< "MESSAGE"

From a FILE

unch "PLAINTEXT" < MESSAGE.txt

With lorem ipsum

unch -l "MESSAGE"
# or
unch -l <<< "MESSAGE"

Excluding trailing newline

unch -n "MESSAGE" "PLAINTEXT" > ENCODED.txt

Decoding

unch -d "ENCODED"

From STDIN

unch -d <<< "ENCODED"

From a FILE

unch -d < ENCODED.txt > DECODED.txt

Library

See the examples/main.go file for detailed implementation within the library.

License

unch is released with ♡ by @dwisiswant0 under the Apache 2.0 license. See LICENSE.