Password Generators

We all know passwords should be nice and strong and not made from dictionary or other predictable words. Here we give you some scripts to create passwords that will help keep your accounts a bit more secure.

Password Gen

Here is a python script to generate a password based on a domain name and some secret information.

It would be interesting to do some analysis on this script to see if given a password or two and their associated domains whether you could recover the secret information or enough of it to generate passwords for other domains.

Here is a link to the original script and blog article.

import string
import re

# Get the site & secret code that the user wants to use
print " "
print "Password Gen v1.0"
print " "
url = raw_input("Enter url or domain name: ")
digits = int(raw_input("Enter a secret digit(s): "))
code = raw_input("Enter a secret password: ")

# Strip out the generics from the site so the password isn't guessable
x = re.compile("^[^:]*://")
url = x.sub("", url)

y = string.find(url, 'www.')

if (y == 0):
        url = url[4:]

# Store url as individual chars and calculate length
url_stack = []

for c in url:
        url_stack.append(c)

if (url.endswith('.com') or url.endswith('.net') or url.endswith('.org')):
        url_len = len(url_stack) - 5
else:
        url_len = len(url_stack) - 1

# Store code as individual characters
code_stack = []

for c in code:
        code_stack.append(c)

code_len = len(code_stack) - 1

# Start building the password
p_word  = code_stack[0]
p_word += str(ord(url_stack[0]) + digits)
p_word += '!'
p_word += code_stack[code_len - 1]
p_word += str(ord(url_stack[url_len].upper()) + digits)
p_word += code_stack[code_len].upper()

print "Your password is: " + p_word
print ""

Submitted by Damian