Mercurial > p > roundup > code
changeset 4760:efdce3d32698
Increase generated password length to 12 symbols.
Make sure at least one digit is present.
See article of Georgia Tech Research Institute at
http://goo.gl/olFxy for more information.
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Mon, 18 Feb 2013 00:42:08 +0300 |
| parents | fd90ad41d34d |
| children | a89f1e9f3ee3 |
| files | CHANGES.txt roundup/password.py |
| diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Tue Feb 05 15:06:10 2013 +0530 +++ b/CHANGES.txt Mon Feb 18 00:42:08 2013 +0300 @@ -20,6 +20,8 @@ Select 'jinja2' template_engine in config and place templates into html to play with (anatoly techtonik) - Introducing Template Loader API (anatoly techtonik) +- Increased generated password length to 12 symbols to slow down GPGPU + attacks (anatoly techtonik) Fixed:
--- a/roundup/password.py Tue Feb 05 15:06:10 2013 +0530 +++ b/roundup/password.py Mon Feb 18 00:42:08 2013 +0300 @@ -165,9 +165,13 @@ raise PasswordValueError, 'Unknown encryption scheme %r'%scheme return s -def generatePassword(length=8): +def generatePassword(length=12): chars = string.letters+string.digits - return ''.join([random.choice(chars) for x in range(length)]) + password = [random.choice(chars) for x in range(length)] + # make sure there is at least one digit + password[0] = random.choice(string.digits) + random.shuffle(password) + return ''.join(password) class JournalPassword: """ Password dummy instance intended for journal operation.
