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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 803567a22054e7985a3e8d5ef845e6b2f4808c40b1a6216bec0363e74681504e |
|
MD5 | 44b8fb7ee8d6b01913d32dda47036a8d |
|
BLAKE2b-256 | cc08680e8994d53b493f4466884dc4283ea7c04a29f47f501da689f273961d32 |
Close
Hashes for json_encrypted_token-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 739d8fe00ebb0d09fba0d57fb5677f0d593f0df6d7941dc77d0a27b833da11da |
|
MD5 | 7c52dea0892dfc95ee17a490cc19eccf |
|
BLAKE2b-256 | 4bb82de8de04e867bd6ec9f5c9435008fb80d917ea0c601bf45cd02a2eaf0e97 |