Platform-Agnostic Security Tokens for Python
Project description
python-paseto
Platform-Agnostic Security Tokens for Python
Installation
pip install python-paseto
Low level API
Implements PASETO V2 encrypt / decrypt functions. Low level API is focuses on solid, high quality, production ready primitives as specified directly in the PASETO protocol.
Example use
from paseto.protocol.version2 import Version2
message = b"foo" # your data
key = b"0" * 32 # encryption key
token = Version2.encrypt(message, key)
plain_text = Version2.decrypt(token, key)
assert plain_text == message
print(f"token={token}")
print(f"plain_text={plain_text}")
print(f"message={message}")
With optional footer
from paseto.protocol.version2 import Version2
message = b"foo" # your data
key = b"0" * 32 # encryption key
optional_footer = b"sample_footer" # authenticated but not encrypted metadata
token = Version2.encrypt(message, key, optional_footer)
plain_text = Version2.decrypt(token, key, optional_footer)
assert plain_text == message
print(f"token={token}")
print(f"plain_text={plain_text}")
print(f"message={message}")
High level API
In the future a high level API will provide developer friendly access to low level API and support easy integration into other projects.
Development
Typical dev workflow operations are automated in Makefile, including testing, linting, code quality checks, benchmarks and dev environment setup.
Contributing
This library is under active development and maintenance. For any feedback, questions, comments or if you would like to request a feature, please raise an issue!
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file python-paseto-0.3.0.tar.gz
.
File metadata
- Download URL: python-paseto-0.3.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.6 Linux/5.8.0-1036-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 320dce8d1e3fa14673fc05746b5e53e329f6a82ff9171aae463c2b84e75e86ab |
|
MD5 | f5a0b41d34259b3c37641ceb4fd333b9 |
|
BLAKE2b-256 | 5f795d838d780f17f0657a7761c447dd67405f73019512b4a38c63cc49d823ef |
File details
Details for the file python_paseto-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: python_paseto-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.6 Linux/5.8.0-1036-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4233bb36a91f9831eb73a004b204e00d2e5ff762bae1c591fee980bf7909779 |
|
MD5 | 3039ce09170f3123fe806e475ef91020 |
|
BLAKE2b-256 | 8b7fbad582c757f384d9d6450b2480ba6167daf3f8284fa59991b975dcd6afbb |