👾 About
This code defines a function called "gerar_senha_forte" that generates a strong password. The function takes an optional argument called "tamanho" which specifies the length of the password (default is 6 characters).
Inside the function, it first checks if the specified length is less than 6. If it is, it prints a message and returns None.
If the length is 6 or greater, it creates a string variable called "caracteres" which contains all the possible characters for the password. This includes uppercase letters, lowercase letters, digits, and punctuation.
Next, it creates an empty list called "senha" and appends one random character from each category (uppercase, lowercase, digit, punctuation) to the list.
After that, it enters a for loop that repeats for (tamanho - 4) iterations. In each iteration, it appends a random character from the "caracteres" string to the "senha" list.
Once the loop is complete, it shuffles the order of the characters in the "senha" list using a cryptographic secure random number generator.
Finally, it joins all the characters in the "senha" list into a single string and returns it as the generated strong password.
🔧 Requirements
The following Python libraries are required:
- secrets
- string
🏃 Usage
$ python .\strong_password\generator.py
This will execute the code and generate a strong password.
🙋 Contribution
All contributions are welcome! Please open an issue or submit a pull request.
Metadata
Release files for pyaoponto-password 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 |
|---|---|---|---|---|
| pyaoponto_password-0.1.0.tar.gz | 2.0 kB | Without provenance | Details for pyaoponto_password-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyaoponto_password-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyaoponto_password-0.1.0-py3-none-any.whl |
Total release size: 4.7 kB
Release files / pyaoponto_password-0.1.0.tar.gz
| Download URL | pyaoponto_password-0.1.0.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
558eb37ee0aa168e5872f27d627a885ab49969bbb25ff3544d019462e575b5c2
|
|
BLAKE2b-256 checksum How to use checksums |
f78d6f132da0e2eac623a0fe01c7967b8d77156bc8aa32c1858056cb25dc72d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.3 Windows/10
|
Release files / pyaoponto_password-0.1.0-py3-none-any.whl
| Download URL | pyaoponto_password-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e452462b5d133ca56ae611e8d0f322df454c1f882c86cc4cb30875271db4815e
|
|
BLAKE2b-256 checksum How to use checksums |
62082a1525dbda02d65f5545882ade134319f829695e1e34f8ffce40afcedc95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.3 Windows/10
|
Security for pyaoponto-password 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.