pyargon2


Namepyargon2 JSON
Version 1.0.7 PyPI version JSON
download
home_page
SummarySimultaneously the simplest and most powerful Argon2 implemenation in Python
upload_time2023-01-23 00:21:10
maintainer
docs_urlNone
author
requires_python>=3.9
licenseApache2
keywords argon2 hash password
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyargon2

Simultaneously the simplest and most powerful implementation of Argon2 in Python.

## Installation 

```bash
pip install pyargon2
```

#### Compatibility

- **pyargon2 now only supports Python 3.9 and beyond**.

## Basic Usage

The hash function supports basic password hashing using the Argon2id variant and mandates password and salt strings. The resulting hash returned is hex encoded.

```python
from pyargon2 import hash

password = 'a strong password'
salt = 'a unique salt'
hex_encoded_hash = hash(password, salt)
```

The default parameters aim to generate hashes in around 0.5 seconds and are targeted at a machine housing a CPU with 4 cores and at least 4GB of RAM. If timing differs significantly on your machine, adjust the parameters using the advanced options below.
**Remember password hashing should be slow for security so don't optimise for speed!**

## Advanced Usage

### Function Parameters

The hash function takes in the following parameters:

##### Positional

- **password** : A string representing a password.
- **salt** : A string representing a unique salt.

##### Keyword

- **pepper** : A secret string to fold into the hash of the password.
- **hash_len** : The length in bytes of the resulting hash.
- **time_cost** : The number of iterations to perform.
- **memory_cost** : The number of kibibytes in memory to utilise.
- **parallelism** : The number of independent computations chains (lanes) to run.
- **flags** : Flags to determine which fields are securely wiped.
- **variant** : Argon2 algorithm variant ('i', 'd', or 'id').
- **version** : Argon2 algorithm version number.
- **encoding** : Encoding for the returned hash type ('raw', 'hex' or 'b64').

For assistance with parameter selection refer to [RFC 9106](https://www.rfc-editor.org/rfc/rfc9106.html), in particular "Chapter 4: Parameter Choice".

### Function Exceptions

Exceptions generated by the underlying Argon2 hashing function are raised under the `Argon2Error` class which can be imported as follows:

```python
from pyargon2 import Argon2Error
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyargon2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "argon2,hash,password",
    "author": "",
    "author_email": "James Webb <james@ultra-horizon.com>",
    "download_url": "https://files.pythonhosted.org/packages/ec/de/b55f943639efd986dc206a7c9e5df8ecd2ccc6c084087df58eaf5a22d43a/pyargon2-1.0.7.tar.gz",
    "platform": null,
    "description": "# pyargon2\n\nSimultaneously the simplest and most powerful implementation of Argon2 in Python.\n\n## Installation \n\n```bash\npip install pyargon2\n```\n\n#### Compatibility\n\n- **pyargon2 now only supports Python 3.9 and beyond**.\n\n## Basic Usage\n\nThe hash function supports basic password hashing using the Argon2id variant and mandates password and salt strings. The resulting hash returned is hex encoded.\n\n```python\nfrom pyargon2 import hash\n\npassword = 'a strong password'\nsalt = 'a unique salt'\nhex_encoded_hash = hash(password, salt)\n```\n\nThe default parameters aim to generate hashes in around 0.5 seconds and are targeted at a machine housing a CPU with 4 cores and at least 4GB of RAM. If timing differs significantly on your machine, adjust the parameters using the advanced options below.\n**Remember password hashing should be slow for security so don't optimise for speed!**\n\n## Advanced Usage\n\n### Function Parameters\n\nThe hash function takes in the following parameters:\n\n##### Positional\n\n- **password** : A string representing a password.\n- **salt** : A string representing a unique salt.\n\n##### Keyword\n\n- **pepper** : A secret string to fold into the hash of the password.\n- **hash_len** : The length in bytes of the resulting hash.\n- **time_cost** : The number of iterations to perform.\n- **memory_cost** : The number of kibibytes in memory to utilise.\n- **parallelism** : The number of independent computations chains (lanes) to run.\n- **flags** : Flags to determine which fields are securely wiped.\n- **variant** : Argon2 algorithm variant ('i', 'd', or 'id').\n- **version** : Argon2 algorithm version number.\n- **encoding** : Encoding for the returned hash type ('raw', 'hex' or 'b64').\n\nFor assistance with parameter selection refer to [RFC 9106](https://www.rfc-editor.org/rfc/rfc9106.html), in particular \"Chapter 4: Parameter Choice\".\n\n### Function Exceptions\n\nExceptions generated by the underlying Argon2 hashing function are raised under the `Argon2Error` class which can be imported as follows:\n\n```python\nfrom pyargon2 import Argon2Error\n```\n",
    "bugtrack_url": null,
    "license": "Apache2",
    "summary": "Simultaneously the simplest and most powerful Argon2 implemenation in Python",
    "version": "1.0.7",
    "split_keywords": [
        "argon2",
        "hash",
        "password"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91bd53ec916051b9980908be3801d99335a1443ab2fcfe72324540417dcb7d47",
                "md5": "a2f91809cb787bfa88b1621227c58262",
                "sha256": "afdc97197252216ca6361834870fbf3a77e883c037ef568ddbf3725888945847"
            },
            "downloads": -1,
            "filename": "pyargon2-1.0.7-cp39-cp39-macosx_13_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "a2f91809cb787bfa88b1621227c58262",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 29832,
            "upload_time": "2023-01-23T00:21:08",
            "upload_time_iso_8601": "2023-01-23T00:21:08.967106Z",
            "url": "https://files.pythonhosted.org/packages/91/bd/53ec916051b9980908be3801d99335a1443ab2fcfe72324540417dcb7d47/pyargon2-1.0.7-cp39-cp39-macosx_13_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ecdeb55f943639efd986dc206a7c9e5df8ecd2ccc6c084087df58eaf5a22d43a",
                "md5": "bd61c97dee8da7ff6635b780080cb48e",
                "sha256": "3c05bda28bfc8d0fb13b64ae5f7153989827167804b6a1c1d837db77bcc2dbf5"
            },
            "downloads": -1,
            "filename": "pyargon2-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "bd61c97dee8da7ff6635b780080cb48e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 58113,
            "upload_time": "2023-01-23T00:21:10",
            "upload_time_iso_8601": "2023-01-23T00:21:10.246383Z",
            "url": "https://files.pythonhosted.org/packages/ec/de/b55f943639efd986dc206a7c9e5df8ecd2ccc6c084087df58eaf5a22d43a/pyargon2-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-23 00:21:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pyargon2"
}
        
Elapsed time: 0.03195s