JET - JSON Encrypted Token
Project description
jet-python
JSON Encrypted Token - Python module
from jet import JET
from jet.utils import hmac_sha256
GLOBAL_JET = JET(
SECRET = 'my-secret-string'
)
user_secret = hmac_sha256('user-password', 'user-password', 'ascii')
payload = {
'id': 1,
'message': "Hola"
}
# Generate token
token = GLOBAL_JET.encrypt(user_secret, payload)
# Get info on token
decrypted_meta, decrypted_payload = GLOBAL_JET.decrypt(user_secret, token)
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
Close
Hashes for json-encrypted-token-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1223bf76239e70154b8cd5f0a571e06a7af4331448235d1f73d4caa777834b24 |
|
MD5 | f792377bc64bc96c4c3bd3d18480ea2b |
|
BLAKE2b-256 | 9fcbb6df8aaaacdc921dba1d55a362cae48d91534c280505cd51c43818c48901 |
Close
Hashes for json_encrypted_token-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 426a755bfe32af1d5eb20f1f5dc22bf728488c757bd3103cda70c7f6a2c5efd2 |
|
MD5 | 0fcaa05f8cbc218cc4865740d70cb960 |
|
BLAKE2b-256 | 49b4c6be592da6c807dff01cb0ae9421d9edeaa1e4fa75f4200a5fcdadbd0c28 |