METADATA 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. Metadata-Version: 2.4
  2. Name: argon2-cffi-bindings
  3. Version: 25.1.0
  4. Summary: Low-level CFFI bindings for Argon2
  5. Author-email: Hynek Schlawack <hs@ox.cx>
  6. License-Expression: MIT
  7. Project-URL: Tidelift, https://tidelift.com/?utm_source=lifter&utm_medium=referral&utm_campaign=hynek
  8. Project-URL: Changelog, https://github.com/hynek/argon2-cffi-bindings/blob/main/CHANGELOG.md
  9. Project-URL: GitHub, https://github.com/hynek/argon2-cffi-bindings
  10. Project-URL: Funding, https://github.com/sponsors/hynek
  11. Keywords: password,hash,hashing,security,bindings,cffi
  12. Classifier: Development Status :: 5 - Production/Stable
  13. Classifier: Intended Audience :: Developers
  14. Classifier: Natural Language :: English
  15. Classifier: Operating System :: MacOS :: MacOS X
  16. Classifier: Operating System :: Microsoft :: Windows
  17. Classifier: Operating System :: POSIX
  18. Classifier: Operating System :: Unix
  19. Classifier: Programming Language :: Python :: 3.9
  20. Classifier: Programming Language :: Python :: 3.10
  21. Classifier: Programming Language :: Python :: 3.11
  22. Classifier: Programming Language :: Python :: 3.12
  23. Classifier: Programming Language :: Python :: 3.13
  24. Classifier: Programming Language :: Python :: 3.14
  25. Classifier: Programming Language :: Python :: Free Threading
  26. Classifier: Programming Language :: Python :: Implementation :: CPython
  27. Classifier: Programming Language :: Python :: Implementation :: PyPy
  28. Classifier: Topic :: Security :: Cryptography
  29. Classifier: Topic :: Security
  30. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  31. Requires-Python: >=3.9
  32. Description-Content-Type: text/markdown
  33. License-File: LICENSE
  34. Requires-Dist: cffi>=1.0.1; python_version < "3.14"
  35. Requires-Dist: cffi>=2.0.0b1; python_version >= "3.14"
  36. Dynamic: license-file
  37. # Low-level Python CFFI Bindings for Argon2
  38. [![License: MIT](https://img.shields.io/badge/license-MIT-C06524)](https://github.com/hynek/argon2-cffi-bindings/blob/main/LICENSE)
  39. [![PyPI version](https://img.shields.io/pypi/v/argon2-cffi-bindings)](https://pypi.org/project/argon2-cffi-bindings/)
  40. [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/argon2-cffi-bindings.svg)](https://pypi.org/project/argon2-cffi-bindings)
  41. *argon2-cffi-bindings* provides low-level [CFFI](https://cffi.readthedocs.io/) bindings to the official implementation of the [Argon2] password hashing algorithm.
  42. <!-- [[[cog
  43. # Extract commit ID; refresh using `tox -e cog-render`
  44. import subprocess
  45. out = subprocess.check_output(["git", "submodule"], text=True)
  46. id = out.strip().split(" ", 1)[0]
  47. link = f'[**`{id[:7]}`**](https://github.com/P-H-C/phc-winner-argon2/commit/{id})'
  48. print(f"The currently vendored Argon2 commit ID is {link}.")
  49. ]]] -->
  50. The currently vendored Argon2 commit ID is [**`f57e61e`**](https://github.com/P-H-C/phc-winner-argon2/commit/f57e61e19229e23c4445b85494dbf7c07de721cb).
  51. <!-- [[[end]]] -->
  52. > [!NOTE]
  53. > If you want to hash passwords in an application, this package is **not** for you.
  54. > Have a look at [*argon2-cffi*] with its high-level abstractions!
  55. These bindings have been extracted from [*argon2-cffi*] and it remains its main consumer.
  56. However, they may be used by other packages that want to use the Argon2 library without dealing with C-related complexities.
  57. ## Usage
  58. *argon2-cffi-bindings* is available from [PyPI](https://pypi.org/project/argon2-cffi-bindings/).
  59. The provided CFFI bindings are compiled in API mode.
  60. Best effort is given to provide binary wheels for as many platforms as possible.
  61. ### Disabling Vendored Code
  62. A copy of [Argon2] is vendored and used by default, but can be disabled if *argon2-cffi-bindings* is installed using:
  63. ```console
  64. $ env ARGON2_CFFI_USE_SYSTEM=1 \
  65. python -Im pip install --no-binary=argon2-cffi-bindings argon2-cffi-bindings
  66. ```
  67. ### Overriding Automatic SSE2 Detection
  68. Usually the build process tries to guess whether or not it should use [SSE2](https://en.wikipedia.org/wiki/SSE2)-optimized code (see [`_ffi_build.py`](https://github.com/hynek/argon2-cffi-bindings/blob/main/src/_argon2_cffi_bindings/_ffi_build.py) for details).
  69. This can go wrong and is problematic for cross-compiling.
  70. Therefore you can use the `ARGON2_CFFI_USE_SSE2` environment variable to control the process:
  71. - If you set it to ``1``, *argon2-cffi-bindings* will build **with** SSE2 support.
  72. - If you set it to ``0``, *argon2-cffi-bindings* will build **without** SSE2 support.
  73. - If you set it to anything else, it will be ignored and *argon2-cffi-bindings* will try to guess.
  74. However, if our heuristics fail you, we would welcome a bug report.
  75. ### Python API
  76. Since this package is intended to be an implementation detail, it uses a private module name to prevent your users from using it by accident.
  77. Therefore you have to import the symbols from `_argon2_cffi_bindings`:
  78. ```python
  79. from _argon2_cffi_bindings import ffi, lib
  80. ```
  81. Please refer to [*cffi* documentation](https://cffi.readthedocs.io/en/latest/using.html) on how to use the `ffi` and `lib` objects.
  82. The list of symbols that are provided can be found in the [`_ffi_build.py` file](https://github.com/hynek/argon2-cffi-bindings/blob/main/src/_argon2_cffi_bindings/_ffi_build.py).
  83. [Argon2]: https://github.com/p-h-c/phc-winner-argon2
  84. [*argon2-cffi*]: https://argon2-cffi.readthedocs.io/
  85. ## Project Information
  86. - [**Changelog**](https://github.com/hynek/argon2-cffi-bindings/blob/main/CHANGELOG.md)
  87. - [**Documentation**](https://github.com/hynek/argon2-cffi-bindings#readme)
  88. - [**PyPI**](https://pypi.org/project/argon2-cffi-bindings/)
  89. - [**Source Code**](https://github.com/hynek/argon2-cffi-bindings)
  90. ### Credits & License
  91. *argon2-cffi-bindings* is written and maintained by [Hynek Schlawack](https://hynek.me/about/).
  92. It is released under the [MIT license](https://github.com/hynek/argon2-cffi/blob/main/LICENSE>).
  93. The development is kindly supported by [Variomedia AG](https://www.variomedia.de/) and all my amazing [GitHub Sponsors](https://github.com/sponsors/hynek).
  94. The authors of Argon2 were very helpful to get the library to compile on ancient versions of Visual Studio for ancient versions of Python.
  95. The documentation quotes frequently in verbatim from the Argon2 [paper](https://www.password-hashing.net/argon2-specs.pdf) to avoid mistakes by rephrasing.
  96. #### Vendored Code
  97. The original Argon2 repo can be found at <https://github.com/P-H-C/phc-winner-argon2/>.
  98. Except for the components listed below, the Argon2 code in this repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main authors), Jean-Philippe Aumasson and Samuel Neves, and under [CC0] license.
  99. The string encoding routines in `src/encoding.c` are copyright (c) 2015 Thomas Pornin, and under [CC0] license.
  100. The [BLAKE2](https://www.blake2.net) code in `src/blake2/` is copyright (c) Samuel Neves, 2013-2015, and under [CC0] license.
  101. [CC0]: https://creativecommons.org/publicdomain/zero/1.0/
  102. ### *argon2-cffi-bindings* for Enterprise
  103. Available as part of the [Tidelift Subscription](https://tidelift.com/?utm_source=lifter&utm_medium=referral&utm_campaign=hynek).
  104. The maintainers of *argon2-cffi-bindings* and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open-source packages you use to build your applications.
  105. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.