Skip to main content

Replace unicode characters with visually similar ones.

Project description

unicode obfuscate

Replace unicode characters with visually similar ones.

Instalation

Be sure to use python >= 3.7

pip install unicode_obfuscate

Usage

Simple usage:

>>> from unicode_obfuscate import Obfuscator
>>> text = "And Now for Something Completely Different"
>>> obfuscator = Obfuscator()
>>> new_text = obfuscator.obfuscate(text)
>>> new_text
'Αnd Νοw fοr Ѕοmеtһіng Сοmрlеtеlу Dіffеrеnt'
>>> text == new_text
False

# You can also pass a probability to change only some characters.
>>> obfuscator.obfuscate(text, prob=0.3) 
'And Νow for Ѕomething Сompletely Different'

There are two different datasets to map the characters:

  • intencional: A very short list with very similar characters (Only one option for each character). The data is taken from here.
  • confusables: A gigantic list of characters (and multiple possible characters for each one). The data is taken from here.

By default, intencional is used but it can change with keyword kind:

# this uses the dataset 'intencional'
>>> obfuscator = Obfuscator()  

# this uses the dataset 'confusables'
>>> obfuscator = Obfuscator(kind="confusables")  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unicode_obfuscate-0.1.1.tar.gz (39.9 kB view hashes)

Uploaded Source

Built Distribution

unicode_obfuscate-0.1.1-py3-none-any.whl (40.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page