Name | hash-forge JSON |
Version |
1.2.3
JSON |
| download |
home_page | None |
Summary | Hash Forge is a lightweight Python library designed to simplify the process of hashing and verifying data using a variety of secure hashing algorithms. |
upload_time | 2024-11-08 21:58:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
ripemd-160
whirlpool
argon2
bcrypt
blake2
hash
pbkdf2
scrypt
security
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Hash Forge
[![PyPI version](https://badge.fury.io/py/hash-forge.svg)](https://pypi.org/project/hash-forge/) ![Build Status](https://github.com/Zozi96/hash-forge/actions/workflows/unittest.yml/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python Versions](https://img.shields.io/pypi/pyversions/hash-forge.svg)](https://pypi.org/project/hash-forge/) [![Downloads](https://pepy.tech/badge/hash-forge)](https://pepy.tech/project/hash-forge) [![GitHub issues](https://img.shields.io/github/issues/Zozi96/hash-forge)](https://github.com/Zozi96/hash-forge/issues) ![Project Status](https://img.shields.io/badge/status-active-brightgreen.svg) [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg)](https://github.com/Zozi96/hash-forge/issues)
**Hash Forge** is a lightweight Python library designed to simplify the process of hashing and verifying data using a variety of secure hashing algorithms.
## Overview
Hash Forge is a flexible and secure hash management tool that supports multiple hashing algorithms. This tool allows you to hash and verify data using popular hash algorithms, making it easy to integrate into projects where password hashing or data integrity is essential.
## Features
- **Multiple Hashing Algorithms**: Supports bcrypt, Scrypt, Argon2, Blake2, PBKDF2, Whirlpool and RIPEMD-160.
- **Hashing and Verification**: Easily hash strings and verify their integrity.
- **Rehash Detection**: Automatically detects if a hash needs to be rehashed based on outdated parameters or algorithms.
- **Flexible Integration**: Extendible to add new hashing algorithms as needed.
## Installation
```bash
pip install hash-forge
```
### Optional Dependencies
Hash Forge provides optional dependencies for specific hashing algorithms. To install these, use:
- **bcrypt** support:
```bash
pip install "hash-forge[bcrypt]"
```
- **Argon2** support:
```bash
pip install "hash-forge[argon2]"
```
- **Whirlpool and RIPEMD-160** support:
```bash
pip install "hash-forge[crypto]"
```
## Usage
### Basic Example
```python
from hash_forge import HashManager
from hash-forge.hashers import PBKDF2Hasher
# Initialize HashManager with PBKDF2Hasher
hash_manager = HashManager(PBKDF2Hasher())
# Hash a string
hashed_value = hash_manager.hash("my_secure_password")
# Verify the string against the hashed value
is_valid = hash_manager.verify("my_secure_password", hashed_value)
print(is_valid) # Outputs: True
# Check if the hash needs rehashing
needs_rehash = hash_manager.needs_rehash(hashed_value)
print(needs_rehash) # Outputs: False
```
> **Note:** The first hasher provided during initialization of `HashManager` will be the **preferred hasher** used for hashing operations, though any available hasher can be used for verification.
### Hashers
Currently supported hashers:
- **PBKDF2** (default)
- **bcrypt**
- **Argon2**
- **Scrypt**
- **Blake2**
- **Whirlpool**
- **RIPEMD-160**
You can initialize `HashManager` with one or more hashers:
```python
from hash_forge import HashManager
from hash_forge.hashers import (
Argon2Hasher,
BCryptSha256Hasher,
Blake2Hasher,
PBKDF2Sha256Hasher,
Ripemd160Hasher,
ScryptHasher,
WhirlpoolHasher,
)
hash_manager = HashManager(
PBKDF2Sha256Hasher(iterations=150_000),
BCryptSha256Hasher(),
Argon2Hasher(),
ScryptHasher(),
Ripemd160Hasher(),
Blake2Hasher('MySecretKey'),
WhirlpoolHasher(),
)
```
### Verifying a Hash
Use the `verify` method to compare a string with its hashed counterpart:
```python
is_valid = hash_manager.verify("my_secure_password", hashed_value)
```
### Checking for Rehashing
You can check if a hash needs to be rehashed (e.g., if the hashing algorithm parameters are outdated):
```python
needs_rehash = hash_manager.needs_rehash(hashed_value)
```
## Contributing
Contributions are welcome! Please feel free to submit issues or pull requests to help improve the project.
## License
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": null,
"name": "hash-forge",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "RIPEMD-160, Whirlpool, argon2, bcrypt, blake2, hash, pbkdf2, scrypt, security",
"author": null,
"author_email": "Zozi <zozi.fer96@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ff/3c/aaa5aa6ca27fd6f1f39b113b0885a4c297356bff357e21d023c47391145a/hash_forge-1.2.3.tar.gz",
"platform": null,
"description": "# Hash Forge\n\n[![PyPI version](https://badge.fury.io/py/hash-forge.svg)](https://pypi.org/project/hash-forge/) ![Build Status](https://github.com/Zozi96/hash-forge/actions/workflows/unittest.yml/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python Versions](https://img.shields.io/pypi/pyversions/hash-forge.svg)](https://pypi.org/project/hash-forge/) [![Downloads](https://pepy.tech/badge/hash-forge)](https://pepy.tech/project/hash-forge) [![GitHub issues](https://img.shields.io/github/issues/Zozi96/hash-forge)](https://github.com/Zozi96/hash-forge/issues) ![Project Status](https://img.shields.io/badge/status-active-brightgreen.svg) [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg)](https://github.com/Zozi96/hash-forge/issues)\n\n**Hash Forge** is a lightweight Python library designed to simplify the process of hashing and verifying data using a variety of secure hashing algorithms.\n\n## Overview\n\nHash Forge is a flexible and secure hash management tool that supports multiple hashing algorithms. This tool allows you to hash and verify data using popular hash algorithms, making it easy to integrate into projects where password hashing or data integrity is essential.\n\n## Features\n\n- **Multiple Hashing Algorithms**: Supports bcrypt, Scrypt, Argon2, Blake2, PBKDF2, Whirlpool and RIPEMD-160.\n- **Hashing and Verification**: Easily hash strings and verify their integrity.\n- **Rehash Detection**: Automatically detects if a hash needs to be rehashed based on outdated parameters or algorithms.\n- **Flexible Integration**: Extendible to add new hashing algorithms as needed.\n\n## Installation\n\n```bash\npip install hash-forge\n```\n\n### Optional Dependencies\n\nHash Forge provides optional dependencies for specific hashing algorithms. To install these, use:\n\n- **bcrypt** support:\n\n ```bash\n pip install \"hash-forge[bcrypt]\"\n ```\n- **Argon2** support:\n\n ```bash\n pip install \"hash-forge[argon2]\"\n ```\n- **Whirlpool and RIPEMD-160** support:\n\n ```bash\n pip install \"hash-forge[crypto]\"\n ```\n\n## Usage\n\n### Basic Example\n\n```python\nfrom hash_forge import HashManager\nfrom hash-forge.hashers import PBKDF2Hasher\n\n# Initialize HashManager with PBKDF2Hasher\nhash_manager = HashManager(PBKDF2Hasher())\n\n# Hash a string\nhashed_value = hash_manager.hash(\"my_secure_password\")\n\n# Verify the string against the hashed value\nis_valid = hash_manager.verify(\"my_secure_password\", hashed_value)\nprint(is_valid) # Outputs: True\n\n# Check if the hash needs rehashing\nneeds_rehash = hash_manager.needs_rehash(hashed_value)\nprint(needs_rehash) # Outputs: False\n```\n\n> **Note:** The first hasher provided during initialization of `HashManager` will be the **preferred hasher** used for hashing operations, though any available hasher can be used for verification.\n\n### Hashers\n\nCurrently supported hashers:\n\n- **PBKDF2** (default)\n- **bcrypt**\n- **Argon2**\n- **Scrypt**\n- **Blake2**\n- **Whirlpool**\n- **RIPEMD-160**\n\nYou can initialize `HashManager` with one or more hashers:\n\n```python\nfrom hash_forge import HashManager\nfrom hash_forge.hashers import (\n Argon2Hasher,\n BCryptSha256Hasher,\n Blake2Hasher,\n PBKDF2Sha256Hasher,\n Ripemd160Hasher,\n ScryptHasher,\n WhirlpoolHasher,\n)\n\nhash_manager = HashManager(\n PBKDF2Sha256Hasher(iterations=150_000),\n BCryptSha256Hasher(),\n Argon2Hasher(),\n ScryptHasher(),\n Ripemd160Hasher(),\n Blake2Hasher('MySecretKey'),\n WhirlpoolHasher(),\n )\n```\n\n### Verifying a Hash\n\nUse the `verify` method to compare a string with its hashed counterpart:\n\n```python\nis_valid = hash_manager.verify(\"my_secure_password\", hashed_value)\n```\n\n### Checking for Rehashing\n\nYou can check if a hash needs to be rehashed (e.g., if the hashing algorithm parameters are outdated):\n\n```python\nneeds_rehash = hash_manager.needs_rehash(hashed_value)\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues or pull requests to help improve the project.\n\n## License\n\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": null,
"summary": "Hash Forge is a lightweight Python library designed to simplify the process of hashing and verifying data using a variety of secure hashing algorithms.",
"version": "1.2.3",
"project_urls": {
"Homepage": "https://github.com/Zozi96/hash-forge",
"Issue Tracker": "https://github.com/Zozi96/hash-forge/issues",
"Repository": "https://github.com/Zozi96/hash-forge"
},
"split_keywords": [
"ripemd-160",
" whirlpool",
" argon2",
" bcrypt",
" blake2",
" hash",
" pbkdf2",
" scrypt",
" security"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "af8bdd32087866e462db932ccf51339e1187921d5ab694bccf222c417741dd53",
"md5": "6e1f9400bf8f95e8dd7325f589ccfff1",
"sha256": "b77520e420fb568ee637dd9baef4829309d255e82e72a26fd73a41c85d6c03d0"
},
"downloads": -1,
"filename": "hash_forge-1.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6e1f9400bf8f95e8dd7325f589ccfff1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 14905,
"upload_time": "2024-11-08T21:58:01",
"upload_time_iso_8601": "2024-11-08T21:58:01.772024Z",
"url": "https://files.pythonhosted.org/packages/af/8b/dd32087866e462db932ccf51339e1187921d5ab694bccf222c417741dd53/hash_forge-1.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ff3caaa5aa6ca27fd6f1f39b113b0885a4c297356bff357e21d023c47391145a",
"md5": "6605ce293ee23791b769bb4457daff80",
"sha256": "7a00b778017b66f0f4f0b1ebc294368145c8155e96a2472c26dee6a6238d999d"
},
"downloads": -1,
"filename": "hash_forge-1.2.3.tar.gz",
"has_sig": false,
"md5_digest": "6605ce293ee23791b769bb4457daff80",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 30945,
"upload_time": "2024-11-08T21:58:03",
"upload_time_iso_8601": "2024-11-08T21:58:03.208803Z",
"url": "https://files.pythonhosted.org/packages/ff/3c/aaa5aa6ca27fd6f1f39b113b0885a4c297356bff357e21d023c47391145a/hash_forge-1.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-08 21:58:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Zozi96",
"github_project": "hash-forge",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hash-forge"
}