#!/usr/bin/env python
# Password Hashing Module for Linux
# Author: Dave Russell Jr (drussell393)

from getpass import getpass
import crypt

# If you like Python 2, please to be importing.
import os
import binascii

password = getpass('Enter your desired password, Harry: ')
passwordConfirm = getpass('Confirm your password: ')

if (password == passwordConfirm):
    # Python 2 alternative, os.urandom()
    passwordHash = crypt.crypt(password, '$6$' + binascii.hexlify(os.urandom(4)))

    # Python 3 likes my crypt (mksalt doesn't work in Python 2)
    #passwordHash = crypt.crypt(password, crypt.mksalt(crypt.METHOD_SHA512))

    print('You\'re a wizard, Harry: ' + passwordHash)
else:
    print('Dobby has heard of your greatness, sir. But of your goodness, Dobby never knew.')
    print('Your confirmation password didn\'t match, Oh Great One.')

#!/usr/bin/env python3
# Password Hashing Module for Linux
# Author: Dave Russell Jr (drussell393)

from getpass import getpass
import crypt

# If you like Python 2, please to be importing.
#import os
#import binascii

password = getpass('Enter your desired password, Harry: ')
passwordConfirm = getpass('Confirm your password: ')

if (password == passwordConfirm):
    # Python 2 alternative, os.urandom()
    #passwordHash = crypt.crypt(password, '$6$' + binascii.hexlify(os.urandom(4)))

    # Python 3 likes my crypt (mksalt doesn't work in Python 2)
    passwordHash = crypt.crypt(password, crypt.mksalt(crypt.METHOD_SHA512))

    print('You\'re a wizard, Harry: ' + passwordHash)
else:
    print('Dobby has heard of your greatness, sir. But of your goodness, Dobby never knew.')
    print('Your confirmation password didn\'t match, Oh Great One.')

Make changes to default to Python3
Make changes to default to Python3

Since we have undoubtedly moved to Python3 for the most part within the community, this should be Python3 by default. We make Python2 users work harder now.
