Metadata-Version: 2.4
Name: MathHash
Version: 1.0.0
Summary: A math-based 256-bit hashing engine written from scratch in Python.
Author-email: Prashant Chaudhary <fin.prashant@outlook.com>
License: MIT License
        
        Copyright (c) 2025 Prashant Chaudhary
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Neravahn/MathHash
Project-URL: Source, https://github.com/Neravahn/MathHash
Project-URL: Issues, https://github.com/Neravahn/MathHash/issues
Keywords: hash,cryptography,math,256-bit,password
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MathHash - A Pure Math-Based 256-bit Hashing Engine

MathHash is a fully custom 256-bit hashing algorith written entirely in Python, using only mathematics, bitwise operations, and modular arithematic - no cryptographic libraries

It also inclues a simple password hashing API with random salts, making it easy for devlopers to use MathHash as a learning toop or experimental hashing engine.

⚠️ Disclaimer: MathHash is an educational hashing project. It is not a replacement for industry-standard cryptographic algorithms like Argon2, bcrypt, or SHA-256.


## FEATURES

#### Pure Python
- No dependencies. All math + bitwise logic written from scratch.

#### 256 bit hash output
- Produces a deterministic 32-bytes hash.

#### Salting built-in
- Automatic random 16-bytes salts for password hashing.

#### Easy to integrate
-Simple API:
```python
from mathhash import hash_password, verify_password
```


## INSTALLATION
```bash
pip install MathHash
```


## USAGE
Hash a password
```python
from mathhash import hash_password

hashed = hash_password('mypassword1234')
print(hashed)
```

Verify a password
```python
from mathhash import hash_password

is_valid = verify_password('mypassword1234', hashed)
print(is_valid)
```


## HOW IT WORKS (in short)
MathHash's engine mixes:
- modular addition
- modular multiplication
- left & right rotations
- nonlinear exponentation
- 64-bit word permutation
- round constants inpired by Feistel & sponge desgin


## PROJECT STRUCTURE 
**MathHash/**  
│  
├── **mathhash/**  
│   ├── `__init__.py`  
│   ├── `core.py`       # Password hashing & verification  
│   ├── `engine.py`     # Main 256-bit math hashing engine  
│   ├── `utils.py`      # Bit rotations & modular arithmetic  
│   └── `primes.py`     # Prime constants (optional)  
│  
├── **tests/**  
│   └── `math_hash_test.py`  
│ 
├── `README.md`  
├── `LICENSE`  
└── `pyproject.toml`


## RUNNING TESTS
Install pytest:
```bash
pip install pytest
```
Run test
```bash
pytest
```
Includes tests:
- Random collision tests
- Similar-input seperation
- Avalanche effect check

## ⚠ SECURITY WARNING
MathHash is not cryptographically audited.
Do not use it in production or to secure real user passwords.

This is for:
- Learning
- Research
- Portfolio projects
- Hackathons
- Understanding hashing internals


## CONTIBUTING
PRs and issues are welcome!
Open an issue on GitHub to suggest improvements


## LICENSE
This project is licensed under the MIT License.
See the LICENSE file for more details.


