Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import secrets
- import string
- # Generate a secure login
- alphabet = string.ascii_letters + string.digits
- login0 = ''.join(secrets.choice(alphabet) for i in range(8))
- login = login0 + "@rambler.ru" # here u can write ur mail (@gmail.com, @mail.ru, other)
- # Generate a secure password
- alphabet = string.ascii_letters + string.digits
- while True:
- password = ''.join(secrets.choice(alphabet) for i in range(16))
- if (any(c.islower() for c in password)
- and any(c.isupper() for c in password)
- and any(c.isdigit() for c in password)):
- break
- # Write login and password to file
- with open("credentials.txt", "w") as file:
- file.write(f"Login: {login}\nPassword: {password}")
- print("Login and password written to file 'credentials.txt'")
- # Wait for user exit
- input("Press enter to exit...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement