SecPickle
We all know that the Python Pickle module is not secure because arbitrary code can be executed. The function of secpickle is to guarantee that you will only unzip files that were generated by you, avoiding reading unknown files.
How to use
The functions available in secpickle are:
- load()
- loads()
- dump()
- dumps()
Only one thing changes in using these functions: an argument called key has been added to each of them. The key is requested so that a unique hash can be used to prove that file was created by you. The more complex your key, the greater the security.
The same key used for dump must be used to load the file. Otherwise, the IntegrityUnconfirmedError exception will be thrown, indicating, as the name implies, that it is not possible to confirm whether that file was created by you.
from secpickle import secpickle
data = [{'name': 'SecPickle'}]
key = 'this-is-my-secret-key'
with open('data', 'wb') as file:
secpickle.dump(data, file, key)
with open('data', 'rb') as file:
result = secpickle.load(file, key)
print(result)
License
BSD 3-Clause License
Copyright (c) 2023, Firlast
This project uses the BSD 3-Clause License, please read the license for more informations.
Metadata
Release files for secpickle 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| secpickle-0.1.0.tar.gz | 2.6 kB | Without provenance | Details for secpickle-0.1.0.tar.gz |
Release files / secpickle-0.1.0.tar.gz
| Download URL | secpickle-0.1.0.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4cbff5d0409e9449e5e8198b912883516a9e41d3b2c0600744e3e603c820480
|
|
BLAKE2b-256 checksum How to use checksums |
b2d379c57e686050a71de7617bda65f20714ce9cbf8d450eaad8a76a0ecef8af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Security for secpickle 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.