| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: confusable-homoglyphs |
| 3 |
Version: 3.3.1 |
| 4 |
Summary: Detect confusable usage of unicode homoglyphs, prevent homograph attacks. |
| 5 |
Home-page: https://github.com/vhf/confusable_homoglyphs |
| 6 |
Author: Victor Felder |
| 7 |
Author-email: [email protected] |
| 8 |
License: MIT |
| 9 |
Keywords: confusable,homoglyph,attack,homograph,unicode,spoofing |
| 10 |
Classifier: Development Status :: 5 - Production/Stable |
| 11 |
Classifier: Intended Audience :: Developers |
| 12 |
Classifier: License :: OSI Approved :: MIT License |
| 13 |
Classifier: Natural Language :: English |
| 14 |
Classifier: Programming Language :: Python :: 3 |
| 15 |
Classifier: Programming Language :: Python :: 3.7 |
| 16 |
Classifier: Programming Language :: Python :: 3.8 |
| 17 |
Classifier: Programming Language :: Python :: 3.9 |
| 18 |
Classifier: Programming Language :: Python :: 3.10 |
| 19 |
Classifier: Programming Language :: Python :: 3.11 |
| 20 |
Classifier: Programming Language :: Python :: 3.12 |
| 21 |
Classifier: Topic :: Text Processing :: Filters |
| 22 |
Classifier: Topic :: Text Processing |
| 23 |
Classifier: Topic :: Utilities |
| 24 |
Provides-Extra: cli |
| 25 |
License-File: LICENSE |
| 26 |
License-File: AUTHORS.rst |
| 27 |
|
| 28 |
confusable_homoglyphs `[doc] <http://confusable-homoglyphs.readthedocs.io/en/latest/>`__ |
| 29 |
======================================================================================== |
| 30 |
|
| 31 |
This project has been adopted from `the original confusable_homoglyphs |
| 32 |
by Victor Felder |
| 33 |
<https://github.com/vhf/confusable_homoglyphs/tree/master>`_. |
| 34 |
|
| 35 |
.. image:: https://builds.sr.ht/~valhalla/confusable_homoglyphs.svg |
| 36 |
:target: https://builds.sr.ht/~valhalla/confusable_homoglyphs |
| 37 |
:alt: Build Status |
| 38 |
|
| 39 |
.. image:: https://img.shields.io/pypi/v/confusable_homoglyphs.svg |
| 40 |
:target: https://pypi.python.org/pypi/confusable_homoglyphs |
| 41 |
:alt: Version on PyPi |
| 42 |
|
| 43 |
.. image:: https://readthedocs.org/projects/confusable_homoglyphs/badge/?version=latest |
| 44 |
:target: http://confusable-homoglyphs.readthedocs.io/en/latest/ |
| 45 |
:alt: Documentation Status |
| 46 |
|
| 47 |
*a homoglyph is one of two or more graphemes, characters, or glyphs with |
| 48 |
shapes that appear identical or very similar* |
| 49 |
`wikipedia:Homoglyph <https://en.wikipedia.org/wiki/Homoglyph>`__ |
| 50 |
|
| 51 |
Unicode homoglyphs can be a nuisance on the web. Your most popular |
| 52 |
client, AlaskaJazz, might be upset to be impersonated by a trickster who |
| 53 |
deliberately chose the username ΑlaskaJazz. |
| 54 |
|
| 55 |
- ``AlaskaJazz`` is single script: only Latin characters. |
| 56 |
- ``ΑlaskaJazz`` is mixed-script: the first character is a greek |
| 57 |
letter. |
| 58 |
|
| 59 |
You might also want to avoid people being tricked into entering their |
| 60 |
password on ``www.microsоft.com`` or ``www.faϲebook.com`` instead of |
| 61 |
``www.microsoft.com`` or ``www.facebook.com``. `Here is a |
| 62 |
utility <http://unicode.org/cldr/utility/confusables.jsp>`__ to play |
| 63 |
with these **confusable homoglyphs**. |
| 64 |
|
| 65 |
Not all mixed-script strings have to be ruled out though, you could only |
| 66 |
exclude mixed-script strings containing characters that might be |
| 67 |
confused with a character from some unicode blocks of your choosing. |
| 68 |
|
| 69 |
- ``Allo`` and ``ρττ`` are fine: single script. |
| 70 |
- ``AlloΓ`` is fine when our preferred script alias is 'latin': mixed |
| 71 |
script, but ``Γ`` is not confusable. |
| 72 |
- ``Alloρ`` is dangerous: mixed script and ``ρ`` could be confused with |
| 73 |
``p``. |
| 74 |
|
| 75 |
This library is compatible with Python 3. |
| 76 |
|
| 77 |
`API documentation <http://confusable-homoglyphs.readthedocs.io/en/latest/apidocumentation.html>`__ |
| 78 |
--------------------------------------------------------------------------------------------------- |
| 79 |
|
| 80 |
Is the data up to date? |
| 81 |
----------------------- |
| 82 |
|
| 83 |
Yep. |
| 84 |
|
| 85 |
The unicode blocks aliases and names for each character are extracted |
| 86 |
from `this file <http://www.unicode.org/Public/UNIDATA/Scripts.txt>`__ |
| 87 |
provided by the unicode consortium. |
| 88 |
|
| 89 |
The matrix of which character can be confused with which other |
| 90 |
characters is built using `this |
| 91 |
file <http://www.unicode.org/Public/security/latest/confusables.txt>`__ |
| 92 |
provided by the unicode consortium. |
| 93 |
|
| 94 |
This data is stored in two JSON files: ``categories.json`` and |
| 95 |
``confusables.json``. If you delete them, they will both be recreated by |
| 96 |
downloading and parsing the two abovementioned files and stored as JSON |
| 97 |
files again. |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
History |
| 103 |
------- |
| 104 |
|
| 105 |
1.0.0 |
| 106 |
===== |
| 107 |
|
| 108 |
Initial release. |
| 109 |
|
| 110 |
2.0.0 |
| 111 |
===== |
| 112 |
|
| 113 |
- `allowed_categories` renamed to `allowed_aliases` |
| 114 |
|
| 115 |
2.0.1 |
| 116 |
===== |
| 117 |
|
| 118 |
- Fix a TypeError: https://github.com/vhf/confusable_homoglyphs/pull/2 |
| 119 |
|
| 120 |
3.0.0 |
| 121 |
===== |
| 122 |
|
| 123 |
Courtesy of Ryan P Kilby, via https://github.com/vhf/confusable_homoglyphs/pull/6 : |
| 124 |
|
| 125 |
- Changed file paths to be relative to the `confusable_homoglyphs` |
| 126 |
package directory instead of the user's current working directory. |
| 127 |
- Data files are now distributed with the packaging. |
| 128 |
- Fixes tests so that they use the installed distribution instead of the |
| 129 |
local files. (Originally, the data files were erroneously showing up |
| 130 |
during testing, despite not being included in the distribution). |
| 131 |
- Moves the data file generation into a simple CLI. This way, users have |
| 132 |
a method for controlling when the data files are updated. |
| 133 |
- Since the data files are now included in the distribution, the CLI is |
| 134 |
made optional. Its dependencies can be installed with the `cli` |
| 135 |
bundle, eg. `pip install confusable_homoglyphs[cli]`. |
| 136 |
|
| 137 |
3.1.0 |
| 138 |
===== |
| 139 |
|
| 140 |
- Update unicode data |
| 141 |
|
| 142 |
3.1.1 |
| 143 |
===== |
| 144 |
|
| 145 |
- Update unicode data (via ftp) |
| 146 |
|
| 147 |
3.2.0 |
| 148 |
===== |
| 149 |
|
| 150 |
- Drop support for Python 3.3 |
| 151 |
- Fix #11: work as expected when char not found in datafiles |
| 152 |
|
| 153 |
3.3.0 |
| 154 |
===== |
| 155 |
|
| 156 |
- Drop support for Python 2 |
| 157 |
- Drop support for Python < 3.7, add support for Python up to 3.12 |
| 158 |
- Allow using data files from a custom location set with the |
| 159 |
CONFUSABLE_DATA environment variable. |
| 160 |
- Fix the return value of confusables.is_dangerous() to the documented |
| 161 |
API of a boolean value. It used to return either False or the list |
| 162 |
output of confusable.is_confusable(). |
| 163 |
- Added a check command for command line use. |
| 164 |
|
| 165 |
3.3.1 |
| 166 |
===== |
| 167 |
|
| 168 |
- Update unicode data |