Page 1 of 1
Unicode string "obfuscation"
Posted: Tue Apr 06, 2021 6:38 pm
by Lunasole
Hi. Here is some small and funny experimental stuff based on Unicode character 823/0x337 I recently encountered
Doesn't look too much usable, rather just another playfUllnes (like bypassing word-filters on internet services, lol).
Code: Select all
EnableExplicit
Define *A.Unicode = @"Write something funny"
Define OutStr$
Repeat
Select *A\u
Case '0' To '9', 'a' To 'z', 'A' To 'Z':
OutStr$ + Chr(823) + Chr(*A\u)
Case 0:
Break
Default
OutStr$ + Chr(*A\u)
EndSelect
*A+SizeOf(Unicode)
ForEver
Debug OutStr$
Re: Unicode string "obfuscation"
Posted: Tue Apr 06, 2021 7:14 pm
by devox
Nice thanks for sharing. I'll have to try it in video games when naming a character and the word filter won't let me.
Re: Unicode string "obfuscation"
Posted: Tue Apr 06, 2021 8:03 pm
by NicTheQuick
I don't get it. It's just a forward slash before every letter.
Re: Unicode string "obfuscation"
Posted: Tue Apr 06, 2021 8:21 pm
by Keya
NicTheQuick wrote:I don't get it. It's just a forward slash before every letter.
It changes the string from typical ascii chars (eg. "W" is 0x57 in ascii, or 0x5700 in unicode) to a character set higher up in the Unicode table that still
looks the same (eg. "W" is 0x37035700)
Code: Select all
Before:
004330B0 57 00 72 00 69 00 74 00 65 00 20 00 73 00 6F 00 W.r.i.t.e. .s.o.
004330C0 6D 00 65 00 74 00 68 00 69 00 6E 00 67 00 20 00 m.e.t.h.i.n.g. .
After:
00395EE8 37 03 57 00 37 03 72 00 37 03 69 00 37 03 74 00 7.W.7.r.7.i.7.t.
00395EF8 37 03 65 00 20 00 37 03 73 00 37 03 6F 00 37 03 7.e. .7.s.7.o.7.
So if some code is specifically just looking for 0x57 or 0x5700 it might miss 0x37035700 and allow it through
Re: Unicode string "obfuscation"
Posted: Tue Apr 06, 2021 9:51 pm
by NicTheQuick
No. It looks like this afterwards:
Code: Select all
̷W̷r̷i̷t̷e ̷s̷o̷m̷e̷t̷h̷i̷n̷g ̷f̷u̷n̷n̷y
In my debug window it even looks more like this:
Code: Select all
/W/r/i/t/e /s/o/m/e/t/h/i/n/g /f/u/n/n/y
I think a better way would be to use the full width letter category:
Code: Select all
EnableExplicit
Define *a.Character = @"Write something funny 0123"
Define out.s
While *a\c
Select *a\c
Case '0' To '9', 'a' To 'z', 'A' To 'Z':
out + Chr($FF00 + *a\c - 32)
Default
out + Chr(*a\c)
EndSelect
*a + SizeOf(Character)
Wend
Debug out
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 12:00 am
by BarryG
I get the same output as NicTheQuick, with the slashes. Nothing interesting to see here.
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 2:07 am
by Lunasole
devox wrote:Nice thanks for sharing. I'll have to try it in video games when naming a character and the word filter won't let me.
Don't know about games (maybe some of them allow), but at least for Youtube and some other sites it works this way
Of course there are lot others ways to modify a string to fool different word-filters and neural networks, I just liked this one as it doesn't distorts original characters too much.
Would be nice anyway to collect many others examples. I have some nice and table-based things from my very old code, but was too lazy to search and recover it all.
NicTheQuick wrote:
I think a better way would be to use the full width letter category:
"̷W̷r̷i̷t̷e ̷s̷o̷m̷e̷t̷h̷i̷n̷g ̷f̷u̷n̷n̷y"
vs
"Write something funny 0123"
That might be a good way too.
But your variant doesn't work correctly in slightly different cases, btw
Code: Select all
Define *A.Unicode = @"кириллический пример"
..
Case 'а' To 'я', '0' To '9', 'a' To 'z', 'A' To 'Z':
... but at least result becomes some more funny when combining 2 variants together

(yes I'm probably too happy now, lol)
> "̷ss̷oo̷mm̷ee̷tt̷hh̷ii̷nn̷gg ̷ff̷uu̷nn̷nn̷yy"
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 9:23 am
by NicTheQuick
It seems that there are quite big differences on Linux and Windows and fonts in general. Here it was I see.
My post on Linux and Windows:
Linux:
Windows:
And this is how it looks like in my Debugger Window:

Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 9:54 am
by Saki
For plain text, you can do this with a deterministic random generator, but then nobody reads it.
It is also OK to use an AES based one.
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 9:55 am
by NicTheQuick
Saki wrote:For plain text, you can do this with a deterministic random generator, but then nobody reads it.
It is also OK to use an AES based one.
What are you talking about?
We are not talking about encryption but obfuscation.
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 10:02 am
by Saki
This is not encryption, after all.
It only prevents the text from being readable.
An obfuscator that is no good is no obfuscator.
If the thing has the security of an encryption,
it should not be a disadvantage.
Putting a character in between is nonsense.
It also bloats the text, which is not what you want at all.
If I have some time, I can make one, if I feel like it.
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 10:31 am
by NicTheQuick
What?
If you encrypt something, nobody can read it afterwards.
Did you even read the whole thread?
Lunasole wrote:(like bypassing word-filters on internet services, lol)
The text has to be readable by a human person but should pass some simple word filters. That's all.
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 12:21 pm
by Saki
Ah, OK, I had only read Obfuscator
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 12:53 pm
by Tenaja
Saki wrote:
If I have some time, I can make one, if I feel like it.
There should be at least a few on this forum, if you search--both encryption and obfuscators.
viewtopic.php?f=7&t=14590&p=84717&hilit ... ate#p84717
viewtopic.php?f=12&t=62732&p=468613&hil ... on#p468613
There are probably more, and certainly some with different forms of the word encryption.
And there is nothing wrong with encrypting the words for use as data, just decrypt it when you need it.
Re: Unicode string "obfuscation"
Posted: Wed Apr 07, 2021 4:17 pm
by Saki
Hi, yes thank you.
You can do very nice and interesting things here