Skip to main content

Detect confusable usage of unicode homoglyphs, prevent homograph attacks.

Project description

https://img.shields.io/travis/vhf/confusable_homoglyphs.svg https://img.shields.io/pypi/v/confusable_homoglyphs.svg Documentation Status

a homoglyph is one of two or more graphemes, characters, or glyphs with shapes that appear identical or very similar wikipedia:Homoglyph

Unicode homoglyphs can be a nuisance on the web. Your most popular client, AlaskaJazz, might be upset to be impersonated by a trickster who deliberately chose the username ΑlaskaJazz.

  • AlaskaJazz is single script: only Latin characters.

  • ΑlaskaJazz is mixed-script: the first character is a greek letter.

You might also want to avoid people being tricked into entering their password on www.microsоft.com or www.faϲebook.com instead of www.microsoft.com or www.facebook.com. Here is a utility to play with these confusable homoglyphs.

Not all mixed-script strings have to be ruled out though, you could only exclude mixed-script strings containing characters that might be confused with a character from some unicode blocks of your choosing.

  • Allo and ρττ are fine: single script.

  • AlloΓ is fine when our preferred script alias is ‘latin’: mixed script, but Γ is not confusable.

  • Alloρ is dangerous: mixed script and ρ could be confused with p.

This library is compatible Python 2 and Python 3.

API documentation

Is the data up to date?

Yep.

The unicode blocks aliases and names for each character are extracted from this file provided by the unicode consortium.

The matrix of which character can be confused with which other characters is built using this file provided by the unicode consortium.

This data is stored in two JSON files: categories.json and confusables.json. If you delete them, they will both be recreated by downloading and parsing the two abovementioned files and stored as JSON files again.

History

1.0.0 (2016)

Initial release.

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

confusable_homoglyphs-2.0.2.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confusable_homoglyphs-2.0.2-py2.py3-none-any.whl (10.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file confusable_homoglyphs-2.0.2.tar.gz.

File metadata

File hashes

Hashes for confusable_homoglyphs-2.0.2.tar.gz
Algorithm Hash digest
SHA256 9c042d2c952eb2cfb26c0bfb8ea8c2105fea4817c16ea6eaf55eb01503aeaae1
MD5 d17b246c40b447f1b4cc03afb2e49199
BLAKE2b-256 e32ec17ebdbfb9f7bbd9954db6f5024b84e9ca9662938e9e358b4cde0f015f7c

See more details on using hashes here.

File details

Details for the file confusable_homoglyphs-2.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for confusable_homoglyphs-2.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e653f557f6728864e70c24dd4e33750595304f2d193a1db9f37960c5c4b50d6c
MD5 e198ddd5dda766198e7b78e9e1a20e81
BLAKE2b-256 433b167cd7cc57d5fd378573a83b8723845b7843e143bd0f005be874fc17ee9e

See more details on using hashes here.

Supported by

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