High quality, simple random password generator

前端 未结 27 2474
渐次进展
渐次进展 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:12

    Considering your comment,

    I just need to be able to generate passwords that are more secure than the ones I would come up with in my head.

    it seems you want to use your program to generate passwords, rather than just writing it as an exercise. It is preferable to use an existing implementation, because if you make a mistake, the output might be compromised. Read about random number generator attacks; in particular, a well-known RNG bug in Debian exposed people's SSL private keys.

    So instead, consider using pwgen. It provides several options, which you should choose depending on what you plan to use the passwords for.

提交回复
热议问题