Created
October 24, 2016 14:04
-
-
Save FilBot3/26a75b9c84fbf9d43ff2d0b561d80577 to your computer and use it in GitHub Desktop.
Generate a SHA512 Password Hash using Python3's Password Prompt and Crypt Library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # This will not work on Windows because Windows naturally lacks the encryption | |
| # and security libraries that GNU/Linux does. Ie. does not natively have | |
| # OpenSSL installed and its development libraries. | |
| # | |
| import getpass | |
| import crypt | |
| print("Please input your password:") | |
| password_string = getpass.getpass() | |
| print(crypt.crypt(password_string, crypt.mksalt(crypt.METHOD_SHA512))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment