Commit Graph

51 Commits

Author SHA1 Message Date
Hynek Schlawack
33cf4babc2
Update Ruff 2025-10-01 06:04:41 +02:00
Hynek Schlawack
47ef1e4bb7
Drop 3.8 2025-07-08 07:57:18 +02:00
Hynek Schlawack
71a5f0f84c
update Ruff 2025-07-08 07:55:48 +02:00
Nathan Goldbaum
b8321fa3b6
Add a multithreaded stress test (#199)
* Add a multithreaded stress test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add noqa

* add a docstring for the new test

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-03 12:45:47 +02:00
Hynek Schlawack
c4633ca2c2
Add type test for get_default_parameters 2025-02-22 09:01:44 +01:00
Hynek Schlawack
04bc442396
More meaningful test doc 2025-02-22 08:54:02 +01:00
Hynek Schlawack
d8036728bc
Replace loop with parametrization 2025-02-22 08:52:48 +01:00
Hynek Schlawack
fade17c9ee
Add get_default_parameters & UnsupportedParametersError to API docs 2025-02-22 08:45:03 +01:00
Hynek Schlawack
aa98519d64
Don't mutate profiles when determining default parameters 2025-02-22 08:36:02 +01:00
Giuseppe Capasso
52db639e39
Add support for wasm32-pyodide (#190)
* Added support for wasm32-pyodide

* Removed match: not supported before python 3.10

* Added test with good case

* Changed default parallelism=1 when platform.machine() = wasm32

* More robust platform checking

* Testing under different platforms

* Added error message to UnsupportedParamsError

* Added centralized functions for parameters validations and platform-compatible defaults

* Pre-commit

* Added test for PasswordHasher.from_parameters()

* Pre commit

* Fix pre-commit

* Fix test: made PasswordHasher.from_parameters easier to test

* Update src/argon2/exceptions.py

Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>

* Update tests/test_password_hasher.py

* Update src/argon2/_password_hasher.py

* Update .python-version-default

* Update tests/test_password_hasher.py

* Update tests/test_password_hasher.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/argon2/profiles.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/argon2/_utils.py

* Update src/argon2/exceptions.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update tests/test_password_hasher.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update tests/test_password_hasher.py

* Update tests/test_password_hasher.py

---------

Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-22 08:29:35 +01:00
pre-commit-ci[bot]
6928cdd5fa
[pre-commit.ci] pre-commit autoupdate (#192)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.4)
- [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.3.0...v2.4.1)

* Fix Ruff

* fix ci

* actually fix ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
2025-02-04 10:45:20 +01:00
Hynek Schlawack
7749356596
Drop Python 3.7 (#186)
* Drop Python 3.7

* Add PR #
2024-10-31 11:16:42 +01:00
Hynek Schlawack
e26858b221
Switch formatters 2024-10-12 15:04:27 +02:00
Hynek Schlawack
d362c8dded
Make check_needs_rehash accept bytes, too (#174) 2024-04-16 08:40:44 +02:00
Isidro
5c13aa6bbb
Patch 1 (#160)
* using hypothesys `func` param instead fixed

* rst doc: not used link definition

* small refactor in cli

* Retain param order

---------

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2023-11-28 07:24:09 +00:00
Hynek Schlawack
2708fd94b6
Don't combine pytest fixtures and Hypothesis strategies
Gives a health error about executors now.
2023-09-05 07:29:47 +02:00
Hynek Schlawack
17e2808dde
PasswordHasher.hash: allow passing explicit salt (#153) 2023-08-15 11:11:51 +02:00
Hynek Schlawack
456e175076
Hard-deprecate legacy functions 2023-08-15 08:48:22 +02:00
Hynek Schlawack
4da64d2ed4
Lint stricter 2023-07-04 09:08:17 +02:00
Hynek Schlawack
2886c462e9
Simplify CI Mypy config (#146)
* Simplify Mypy config

* env

* No mypy on pypy

* different rules for steps

* whitespace
2023-06-14 16:44:46 +02:00
Hynek Schlawack
c1dfc9502a
Ruff life 2023-06-02 15:16:24 +02:00
Hynek Schlawack
3368bb1bcd
Move to Hatch (#131)
* Move to Hatch

* Remove empty .gitmodules

* Make packaging metadata dynamic

* Get real version when checking package

* Use real versions with system-package

* Simplify tox.ini
2022-08-24 14:17:58 +02:00
pre-commit-ci[bot]
0c7b6ec667
[pre-commit.ci] pre-commit autoupdate (#117)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-02-07 18:38:16 +01:00
Hynek Schlawack
e9f84e4b6d
Add Types (#112)
* Add types

* Run 3.7 under coverage for _typing.py
2021-12-08 11:32:57 +01:00
Hynek Schlawack
3fe1a9c624 Make parameters a dataclass 2021-12-05 06:51:38 +01:00
Hynek Schlawack
fac5c08bce Add SPDX tags to code files 2021-11-28 13:00:34 +01:00
Hynek Schlawack
4e3d9aed38 Drop some Python 2-isms in docs 2021-08-30 09:57:12 +02:00
Hynek Schlawack
50e4625835
Drop Python 2 (#98)
* Drop Python 2

* Remove tox envs

* oops

* pyupgrade --py3-plus  **.py, drop six

* Fix README

* Move pytest config to pyproject.toml
2021-08-29 17:34:22 +02:00
Hynek Schlawack
8b4d5134f9 Support Python 3.10 2021-05-18 16:35:04 +02:00
Hynek Schlawack
147af0c298 pre-commit autoupdate 2020-11-01 09:11:39 +01:00
Martin Uribe
b42a51818d
Fixed __repr__ type-o for parallelism in Parameters class (#62)
* Fixed __repr__ type-o for parallelism in Parameters class

* Added test for repr change
2020-05-18 17:18:38 +02:00
Kubilay Kocak
e4cce5e9a6 Disable deadline on test_argument_ranges (#52)
test_argument_ranges fails intermittently (with high probability) with the
following error:

  Falsifying example: test_argument_ranges(password='', time_cost=1, parallelism=4, memory_cost=740, hash_len=196, salt_len=223)

  Unreliable test timings! On an initial run, this test took 332.92ms, which
  exceeded the deadline of 200.00ms, but on a subsequent run it took 24.19
  ms, which did not. If you expect this sort of variability in your test
  timings, consider turning deadlines off for this test by setting
  deadline=None.

Given the test is slow "This test is rather slow." and test can be run in
a multitude of environments including virtualized environments, and test
timing doesn't appear to be relevant or valuable, disable deadlines for
this test accordingly.
2019-06-03 16:21:47 +02:00
Florian Apolloner
1910e210da Made extract_parameters work with argon v18 hashes. (#42) 2018-08-20 11:20:18 +02:00
Hynek Schlawack
674441dc7a Make argon2.PasswordHasher's type configurable
This can be necessary to work with legacy systems that don't support Argon2id.
2018-08-19 13:44:44 +02:00
Hynek Schlawack
1ec39f8dc7
Adapt default params to RFC, add necessary hash agility (#41)
* wip

* typo

* fix test method names
2018-08-19 05:49:35 +02:00
Hynek Schlawack
fe591a65dd Fade to Black 2018-06-16 11:30:35 +02:00
Hynek Schlawack
406833e401
Make PasswordHasher use Argon2id (#34)
* Make PasswordHasher use Argon2id

C.f. https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-4

* Add PR link

* Address review comments

* Add clarification to verification times
2018-04-09 12:40:21 +02:00
Hynek Schlawack
6dce872ead Isort update 2018-03-17 12:13:16 +01:00
Hynek Schlawack
bf6d629c82 Overall polish 2018-01-06 09:40:30 +01:00
Hynek Schlawack
00120a9880 Add Argon2id 2016-11-10 10:03:46 +01:00
Hynek Schlawack
b8ea2175cf Modules should be plural 2016-04-19 12:39:01 +02:00
Hynek Schlawack
e7aaa8028f Add VerifyMismatchError
We can now differentiate between an actual verification error and a
password/hash mismatch.
2016-04-18 09:14:50 +02:00
Hynek Schlawack
9380662da1 Make tests pass on Argon 1.3 2016-03-16 09:54:26 +01:00
Hynek Schlawack
675576a634 Update argon2, make cffi figure out values
Also add an integration test that checks that for most reasonable values, both
hashing and verifying works.
2016-01-25 08:50:05 +01:00
Hynek Schlawack
045e110631 Add low-level bindings for Argon2's low-level core function
For the truly adventurous.
2015-12-28 15:43:57 +01:00
Hynek Schlawack
3e856b3ff9 Fix imports 2015-12-28 13:15:29 +01:00
Hynek Schlawack
53d312de8b Refactor low-level 2015-12-28 13:11:47 +01:00
Hynek Schlawack
f9e8cd7e37 Refactor low-level functions 2015-12-23 16:23:37 +01:00
Hynek Schlawack
90d244e537 Add high-level abstraction in the form of PasswordHasher 2015-12-22 19:40:18 +01:00
Hynek Schlawack
33440bec3c Remove type guessing in verify_password
Since it was done in Python, it generated significant overhead.

Now it does default to the same type as hash_password so trivial usage
works the same.
2015-12-17 11:42:21 +01:00