A library for password hashing and JWT encoding
Project description
Pytography
A Python library that provides secure password hashing and JSON Web Token (JWT) functionality.
Installation
pip install pytography
Quick Start
Password Hashing with Scrypt (Default)
from pytography import PasswordHashLibrary
encoded_password = PasswordHashLibrary.encode(password="password")
is_valid = PasswordHashLibrary.verify(password="password", encoded_password=encoded_password)
Password Hashing with PBKDF2
from pytography import PasswordHashLibrary
encoded_password = PasswordHashLibrary.encode(password="password", algorithm="pbkdf2")
is_valid = PasswordHashLibrary.verify(password="password", encoded_password=encoded_password)
JSON Web Token (JWT)
from pytography import JsonWebToken
from datetime import datetime, timedelta, UTC
jwt = JsonWebToken()
now = datetime.now(UTC)
exp = (now + timedelta(seconds=7200)).timestamp()
# Create a token
token = jwt.encode(payload={"exp": exp, "user_id": 123}, key="key")
# Decode token to get payload
header, payload, signature = jwt.decode(token=token)
# Verify token
is_valid = jwt.verify(token=token, key="key")
License
This project is licensed under the terms of the LICENSE file included in the repository.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytography-0.1.0.tar.gz.
File metadata
- Download URL: pytography-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d3f92e2deb955bb958654e6a1f48e7a4fe34b8532beabaa7127c72d95ce93cb
|
|
| MD5 |
97a253f128262823bfc253656ea487ea
|
|
| BLAKE2b-256 |
b2a7ac435b9176cf60cc0a730f6fce00da32fd751f809779810d6a64e6d11fa8
|
Provenance
The following attestation bundles were made for pytography-0.1.0.tar.gz:
Publisher:
deploy.yml on TalentGate/pytography
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytography-0.1.0.tar.gz -
Subject digest:
0d3f92e2deb955bb958654e6a1f48e7a4fe34b8532beabaa7127c72d95ce93cb - Sigstore transparency entry: 153131858
- Sigstore integration time:
-
Permalink:
TalentGate/pytography@e23fd309ea92edef2005e22f39d3d4ba35dc25d2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/TalentGate
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@e23fd309ea92edef2005e22f39d3d4ba35dc25d2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytography-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytography-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e9b4e992b94551a40e81a4520a1bb7f27e2833fa3c0186e5143500ad95071dc
|
|
| MD5 |
6bce2d2b400c02f140fcf1ee736026d0
|
|
| BLAKE2b-256 |
0f33e31c41d398c048ec24db2bbd37bff9efe42a4e224430b869b90987c59792
|
Provenance
The following attestation bundles were made for pytography-0.1.0-py3-none-any.whl:
Publisher:
deploy.yml on TalentGate/pytography
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytography-0.1.0-py3-none-any.whl -
Subject digest:
3e9b4e992b94551a40e81a4520a1bb7f27e2833fa3c0186e5143500ad95071dc - Sigstore transparency entry: 153131859
- Sigstore integration time:
-
Permalink:
TalentGate/pytography@e23fd309ea92edef2005e22f39d3d4ba35dc25d2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/TalentGate
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@e23fd309ea92edef2005e22f39d3d4ba35dc25d2 -
Trigger Event:
release
-
Statement type: