migrated xkcd password generation functionality over from project 2