I had that years ago, but copying a 14-character line of gibberish led to too many errors. I admire your ability to copy them all correctly.
Not a big deal. I wrote a Python script to generate passwords:
Code:
#!/usr/bin/env python
# Generate random passwords of length up to 16. Use upper and
# lower case letters, digits, and punctuation marks. May run
# interactively or with command line options.
import sys
import getopt
from random import randint
VERSION= "1.0.0"
HELP= ["-l [length] (1-16) -- The length of password generated",
"-p [--punct] -- Use punctuation",
"-h [--help] -- show the command line help; exit",
"-v [--version] -- show the version of app; exit"]
LENGTH_ERR= ["Password must be between 1 and 16 characters in length",
"Entering interactive mode..."]
# Functions
def WriteOut(Msg) :
'''Prints out multi-line messages'''
for Line in Msg :
print("\n{0}".format(Line))
pass
################################################################################
def Options(argv) :
'''Parse command line options, return values as needed'''
Length= 0
PMark= "n"
# Put this in a try...except block since getopt barfs on empty command lines
# catch and discard the exception. Send back 0 as a result, set up for
# interactive session
try :
Opts,Args= getopt.getopt(argv, "l:phv", ["length=", "punct", "help", "version"])
except getopt.GetoptError as err : return Length,PMark
for opts,args in Opts :
if opts in ("-l", "--length") : Length= int(args)
elif opts in ("-p", "--punct") : PMark= "y"
elif opts in ("-h", "--help") :
WriteOut(HELP)
sys.exit(0)
elif opts in ("-v", "--version") :
print("Version: {0}".format(VERSION))
sys.exit(0)
pass
return Length,PMark
################################################################################
def Password(Length, PMark) :
'''Generate random passwords'''
# Key= 1: Upper case letter
# Key= 2: Lower case letter
# Key= 3: Digit
# Key= 4: Punc. mark
RetVal= ""
Letters= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
letters= "abcdefghijklmnopqrstuvwxyz"
Digits= "0123456789"
Punct= "~@#$&%*_"
i= 1
while i <= Length :
Key= randint(1, 4)
if Key == 1 :
Index= randint(0, 25)
RetVal+= Letters[Index]
elif Key == 2 :
Index= randint(0, 25)
RetVal+= letters[Index]
elif Key == 3 :
Index= randint(0, 9)
RetVal+= Digits[Index]
elif Key == 4 :
if PMark != "y" : continue
Index= randint(0, 7)
RetVal+= Punct[Index]
i+= 1
pass
return RetVal
################################################################################
def main() :
'''The main program: run as stand-alone script'''
Length,PMark= Options(sys.argv[1:])
if Length <= 0 or Length > 16 :
WriteOut(LENGTH_ERR)
Length= 0
if not Length :
print("\nUsing interactive mode...")
if PMark == "n" : PMark= raw_input("Use puncruation? y|n [ n ] ")
while 1 :
Len_str= raw_input("Enter length of password--> ")
Length= int(Len_str)
if Length > 0 and Length < 17 : break
else : print("\nPassword must be between 1 and 16 characters in length")
pass
print("Here is your password: {0}\n".format(Password(Length, PMark)))
sys.exit(0)
################################################################################
if __name__ == '__main__' : main()
You can run that in Linux as is after tagging it as executable, or use Cygwin with Windows, or install the Windows version of Python and run it from a terminal:
py passwordgen.py <options here>
If you do a copy pasta and name it "passwordgen.py". Just copy what it gives you right off the screen. "py" invokes the Python interpreter in Windows, and just pass it the script file name and you're good to go. That way, you always get secure passwords, no need to think of them yourself, and it's easy to give every web site its own password in case one gets compromised.