Skip to main content

Projeto para criar senhas fortes

Project description

:space_invader: 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.

:wrench: Requirements

The following Python libraries are required:

  • secrets
  • string

:runner: Usage

$ python .\strong_password\generator.py

This will execute the code and generate a strong password.

:raising_hand: Contribution

All contributions are welcome! Please open an issue or submit a pull request.

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

pyaoponto_password-0.1.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

pyaoponto_password-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pyaoponto_password-0.1.0.tar.gz.

File metadata

  • Download URL: pyaoponto_password-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Windows/10

File hashes

Hashes for pyaoponto_password-0.1.0.tar.gz
Algorithm Hash digest
SHA256 558eb37ee0aa168e5872f27d627a885ab49969bbb25ff3544d019462e575b5c2
MD5 cb7566659a780b4030e3a8ddc3cd8719
BLAKE2b-256 f78d6f132da0e2eac623a0fe01c7967b8d77156bc8aa32c1858056cb25dc72d4

See more details on using hashes here.

File details

Details for the file pyaoponto_password-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyaoponto_password-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e452462b5d133ca56ae611e8d0f322df454c1f882c86cc4cb30875271db4815e
MD5 e7fcb9b02b5d125adc9a0f08c2ba4a9f
BLAKE2b-256 62082a1525dbda02d65f5545882ade134319f829695e1e34f8ffce40afcedc95

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page