Skip to content

Instantly share code, notes, and snippets.

@gjbianco
Last active February 9, 2024 01:34
Show Gist options
  • Save gjbianco/c561313a5f92c94a1672c07423f2e204 to your computer and use it in GitHub Desktop.
Save gjbianco/c561313a5f92c94a1672c07423f2e204 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# based on https://stackoverflow.com/a/17992126/117471
import sys
from getpass import getpass
from passlib.hash import sha512_crypt
passwd = input() if not sys.stdin.isatty() else getpass()
print(sha512_crypt.encrypt(passwd))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment