Skip to content

Commit 1dfcf53

Browse files
committed
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.
1 parent cdc7ecd commit 1dfcf53

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Features:
2020
Select 'jinja2' template_engine in config and place templates into
2121
html to play with (anatoly techtonik)
2222
- Introducing Template Loader API (anatoly techtonik)
23+
- Increased generated password length to 12 symbols to slow down GPGPU
24+
attacks (anatoly techtonik)
2325

2426
Fixed:
2527

roundup/password.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,13 @@ def encodePassword(plaintext, scheme, other=None, config=None):
165165
raise PasswordValueError, 'Unknown encryption scheme %r'%scheme
166166
return s
167167

168-
def generatePassword(length=8):
168+
def generatePassword(length=12):
169169
chars = string.letters+string.digits
170-
return ''.join([random.choice(chars) for x in range(length)])
170+
password = [random.choice(chars) for x in range(length)]
171+
# make sure there is at least one digit
172+
password[0] = random.choice(string.digits)
173+
random.shuffle(password)
174+
return ''.join(password)
171175

172176
class JournalPassword:
173177
""" Password dummy instance intended for journal operation.

0 commit comments

Comments
 (0)