High quality, simple random password generator

前端 未结 27 2371
渐次进展
渐次进展 2020-12-22 17:06

I\'m interested in creating a very simple, high (cryptographic) quality random password generator. Is there a better way to do this?

import os, random, strin         


        
27条回答
  •  生来不讨喜
    2020-12-22 17:14

    I just recently started learning python and this is something I wrote today. Hope this helps.

    import random
    
    characters = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^()}{/<>'
    print('Password Length: ')
    passwordLength = int(input())
    password = ''
    
    for i in range(passwordLength):
        password += random.choice(characters)
    print(password)
    

提交回复
热议问题