Python's secrets
module was introduced in version 3.6. I'm working on an application using Python 3.4. Is there a way I can import the secrets module in a 3.4 environment (a la from __future__ import print
)?
If not, is there a 3rd party module with comparable functionality?
The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.
Creating Secrets A secret contains one or more secret versions. They can be created using the gcloud command-line, but they can also be created using Python. In order to use a secret, you first need to create the secret with the name of the secret, then you add a version of the secret, being the value of the secret.
Python 3.11. 0, documentation released on 24 October 2022. Python 3.10. 7, documentation released on 6 September 2022.
A backport of the secrets
module for Python versions 2.7, 3.4 and 3.5 now exists: the (somewhat confusingly named) python2-secrets
.
Installation:
pip install python2-secrets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With