genAuth.py 577 B

1234567891011121314151617
  1. import random
  2. def generateAuthData():
  3. chars = '+-*!&$#?=@<>abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
  4. length_pas = random.randint(12,24)
  5. password = ''
  6. for i in range(length_pas):
  7. password += random.choice(chars)
  8. username = ""
  9. lenght_uname = random.randint(5,20)
  10. for i in range(lenght_uname):
  11. username += random.choice(chars)
  12. return f"{username},{password}"
  13. out = generateAuthData()
  14. with open("authdata","w+") as file:
  15. file.write(out)
  16. print("FTP AuthData has been generated and writed to file 'authdata'")