Skip to content

Instantly share code, notes, and snippets.

@kfiresmith
Created April 19, 2020 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfiresmith/61082d0c430359e185ecf22870bc052a to your computer and use it in GitHub Desktop.
Save kfiresmith/61082d0c430359e185ecf22870bc052a to your computer and use it in GitHub Desktop.
kickstart sh512 password hasher
#! /usr/bin/python
# Prompt user for a password string, then create a salted SHA512 hash
import crypt
import getpass
import sys
sys.dont_write_bytecode = True
userinput = getpass.getpass(prompt='Enter a password string to hash in SHA-512: ')
print(crypt.crypt(userinput, crypt.mksalt(crypt.METHOD_SHA512)))
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment