CLI tools to make text human-readable but machine-hostile.
They replace characters with visually identical or similar Unicode homoglyphs and optionally inject zero-width spaces to break indexing, searching, and translation.
Each time you get a new unique line with homoglyph
# 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
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
But if the result is not good enough, there is a more hardcore
solution homoglitch
# run 3 times
echo 'Just a random string for example!' | homoglitch
Ϳ𝓾𝑠𝒕 ɑ 𝘳𝚊𝒏ꓒ𝗢m 𝐬𝕥ꭈ𝑙𝑛𝗴 𝕗ﮨ𝗋 𝓮x𝒂m⍴іⅇǃ
𝗝ꭒƽ𝘵 𝖺 𝕣𝛼𝖓𝓭𑣗m 𝐬𝓽𝗋𝚒ռ𝑔 ẝ𝛐𝐫 е𝔁аm𝞀𝙡𝐞ⵑ
ꓙ𝑢𝐬𝔱 𝛂 ᴦ𝖺𝗇ⅾ૦m 𝖘𝖙𝚛⏽ո𝖌 ẝ𐐬𝓇 𝙚⤫ɑm𝝔𝚕e!
First, generate homoglyphs.go
from a homoglyph set:
# 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
# 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.
Test data files 149K alice29.txt
, 471K plrabn12.txt
and 3,9M bible.txt
from https://corpus.canterbury.ac.nz/descriptions/
## 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