https://github.com/woozymasta/homoglitch
CLI tools to make text human-readable but machine-hostile.
https://github.com/woozymasta/homoglitch
chaos cli confuse glitch go golang homoglitch homoglyph noise obfuscation unicode
Last synced: 10 months ago
JSON representation
CLI tools to make text human-readable but machine-hostile.
- Host: GitHub
- URL: https://github.com/woozymasta/homoglitch
- Owner: WoozyMasta
- License: mit
- Created: 2025-05-27T16:59:30.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-27T17:43:34.000Z (about 1 year ago)
- Last Synced: 2025-05-27T18:31:09.856Z (about 1 year ago)
- Topics: chaos, cli, confuse, glitch, go, golang, homoglitch, homoglyph, noise, obfuscation, unicode
- Language: Go
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# homoglyph / homoglitch
CLI tools to make text human-readable but machine-hostile.
They replace characters with visually identical or similar Unicode
[homoglyphs](https://en.wikipedia.org/wiki/Homoglyph) and optionally
inject zero-width spaces to break indexing, searching, and translation.
## homoglyph example
Each time you get a new unique line with `homoglyph`
```bash
# run 3 times
echo 'Just a random string for example!' | homoglyph
Ϳսѕt а rаոԁom ѕtriոg for ехаmplеǃ
Ϳսѕt а rаոԁom ѕtriոg for ехаmplеǃ
Ϳսѕt а rаոԁom ѕtriոg for ехаmplеǃ
```
Which a machine won't always be able to recognize

A string of different length with a different set and number of characters
is always generated
```bash
for _ in {0..10}; do
echo 'Just a random string for example!' | homoglitch | wc -c | tr -d '\n'
printf ' '
done
169 186 156 194 164 174 166 189 156 169 161
echo 'Just a random string for example!' | wc -c
34
```
## homoglitch example
But if the result is not good enough, there is a more hardcore
solution `homoglitch`
```bash
# run 3 times
echo 'Just a random string for example!' | homoglitch
Ϳ𝓾𝑠𝒕 ɑ 𝘳𝚊𝒏ꓒ𝗢m 𝐬𝕥ꭈ𝑙𝑛𝗴 𝕗ﮨ𝗋 𝓮x𝒂m⍴іⅇǃ
𝗝ꭒƽ𝘵 𝖺 𝕣𝛼𝖓𝓭𑣗m 𝐬𝓽𝗋𝚒ռ𝑔 ẝ𝛐𝐫 е𝔁аm𝞀𝙡𝐞ⵑ
ꓙ𝑢𝐬𝔱 𝛂 ᴦ𝖺𝗇ⅾ૦m 𝖘𝖙𝚛⏽ո𝖌 ẝ𐐬𝓇 𝙚⤫ɑm𝝔𝚕e!
```
## Build
First, generate `homoglyphs.go` from a homoglyph set:
### homoglyph
```bash
# For a visually invisible replacement
rm homo*.go
go run generate.go glyph.txt
CGO_ENABLED=0 go build -o homoglyph.exe -ldflags "-s -w" -trimpath -gcflags=all="-N -l" ./...
rm homoglyph.go
# or
./build.sh glyph.txt
```
### homoglitch
```bash
# For aggressive chaotic substitution
rm homo*.go
go run generate.go glitch.txt
CGO_ENABLED=0 go build -o homoglitch.exe -ldflags "-s -w" -trimpath -gcflags=all="-N -l" ./...
rm homoglitch.go
# or
./build.sh glitch.txt
```
The glitch.txt file is based on
[codebox/homoglyph](http://github.com/codebox/homoglyph).
## some tests
Test data files 149K `alice29.txt`, 471K `plrabn12.txt` and 3,9M `bible.txt`
from
```bash
## alice29.txt
sync; time homoglyph < alice29.txt > alice29-glyph.txt
real 0m0,048s
user 0m0,000s
sys 0m0,000s
# 436K alice29-glyph.txt
sync; time homoglitch < alice29.txt > alice29-glitch.txt
real 0m0,052s
user 0m0,000s
sys 0m0,000s
# 664K alice29-glitch.txt
## plrabn12.txt
sync; time homoglyph < plrabn12.txt > plrabn12-glyph.txt
real 0m0,099s
user 0m0,000s
sys 0m0,000s
# 1,4M plrabn12-glyph.txt
sync; time homoglitch < plrabn12.txt > plrabn12-glitch.txt
real 0m0,107s
user 0m0,000s
sys 0m0,000s
# 2,2M plrabn12-glitch.txt
## bible.txt
sync; time homoglyph < bible.txt > bible-glyph.txt
real 0m0,486s
user 0m0,000s
sys 0m0,000s
# 12M bible-glyph.txt
sync; time homoglitch < bible.txt > bible-glitch.txt
real 0m0,567s
user 0m0,000s
sys 0m0,000s
# 19M bible-glitch.txt
```