What this tool does
This is a whitespace steganography encoder and decoder. It conceals a secret message inside a block of trailing spaces and tabs that is invisible when the text is displayed normally. The visible “cover” text looks ordinary; the secret rides along in the whitespace after it.
How it works
Encoding is a straightforward binary mapping:
- Each character of the secret is converted to its 8-bit binary value.
- Each bit becomes a whitespace character:
0→ space,1→ tab. - The resulting run of spaces and tabs is appended to your cover text.
Because trailing spaces and tabs render as empty space, the message hides in plain sight. Decoding reverses it: the tool scans the trailing whitespace, reads each space as 0 and each tab as 1, regroups the bits into bytes, and reconstructs the characters.
Worked example — encoding the word “Hi”
H in binary is 01001000. i in binary is 01101001.
Encoding both:
H: 0 1 0 0 1 0 0 0
␣ ⇥ ␣ ␣ ⇥ ␣ ␣ ␣ (8 whitespace characters)
i: 0 1 1 0 1 0 0 1
␣ ⇥ ⇥ ␣ ⇥ ␣ ␣ ⇥ (8 whitespace characters)
The cover text “Hello world” followed by 16 invisible whitespace characters looks exactly like “Hello world” in any text renderer, but the decoder extracts “Hi” from the trailing whitespace.
Steganography vs. encryption — an important distinction
Steganography and encryption are different tools:
| Property | Steganography | Encryption |
|---|---|---|
| Hides the existence of a message | Yes | No |
| Hides the content of a message | No (without combining with encryption) | Yes |
| Requires a key to read | No (scheme itself is the “key”) | Yes |
| Survives inspection of the carrier | Only if the scheme is unknown | Yes |
Whitespace steganography is designed for concealment — a casual reader sees nothing. But anyone who knows to look for a space/tab encoding can decode it instantly. If you need both concealment and confidentiality, encrypt the secret first, then encode the ciphertext with this tool.
When whitespace survives — and when it doesn’t
This encoding is fragile in practice. Trailing whitespace is the first thing many systems strip:
- Most code editors (VS Code, Vim, Sublime) trim trailing whitespace on save by default.
- Git’s
--whitespace=fixoption and many pre-commit hooks strip it. - Email clients and webmail normalise whitespace.
- Messaging apps (Slack, WhatsApp, Signal) discard trailing spaces.
- Plain-text pastebins often strip or normalise whitespace.
Channels where it tends to survive: certain file hosting services, raw file downloads, some databases storing text as-is, and direct file transfers where no application processes the content.
Always test your channel by encoding a short message, transferring it through the intended medium, and decoding on the other end before relying on it.
Practical notes
- This encoder uses 8 bits per character, covering standard ASCII (0–127). Extended ASCII (128–255) also works but may behave differently on different systems.
- For Unicode secrets, the tool handles each byte of the UTF-8 encoding separately, which works correctly for any Unicode text as long as both encoder and decoder agree on UTF-8.
- The payload is not length-delimited in the cover text, so the decoder must receive the full encoded text intact to reconstruct it correctly.