Get the desired password from the user through a double prompt.

def double_prompt_for_plaintext_password():
    """Get the desired password from the user through a double prompt."""
    password = 1
    password_repeat = 2
    while password != password_repeat:
        password = getpass.getpass('Enter password: ')
        password_repeat = getpass.getpass('Repeat password: ')
        if password != password_repeat:
            sys.stderr.write('Passwords do not match, try again.\n')
    return password