Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unicode-obfuscate

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unicode-obfuscate

Replace unicode characters with visually similar ones.

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

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")  

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc