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
Release history Release notifications | RSS feed
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unicode_obfuscate-0.1.1.tar.gz.
File metadata
- Download URL: unicode_obfuscate-0.1.1.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.7.6 Linux/5.6.0-2-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e82f27695bc8748d0b4869ee1adda1c41aff36661aa2ea06c6416c5329334d90
|
|
| MD5 |
ceed9d54fc493e3192eeb34b84bddaea
|
|
| BLAKE2b-256 |
b56dbbcb0a093c4ddd098d06a8bfe8ba97436ad587998159b80a3f0e49cd2571
|
File details
Details for the file unicode_obfuscate-0.1.1-py3-none-any.whl.
File metadata
- Download URL: unicode_obfuscate-0.1.1-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.7.6 Linux/5.6.0-2-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d43c0d9035004369ef07e7e2c7fbb939334b40491763057e96aa650bbc38f5b
|
|
| MD5 |
0d916add2af39abe2202f0542fa5bc3d
|
|
| BLAKE2b-256 |
98d50f02f87e129c0fe4fa0e6702a23a794135ce01d8e2da1519a9593d24c093
|