Last active
November 7, 2018 10:21
-
-
Save NIXKnight/234f53dae3d9180ab6bb229bab11b248 to your computer and use it in GitHub Desktop.
Generate PostfixAdmin Compatible MD5 Password Hash
This file contains 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
from passlib.hash import md5_crypt | |
# Suppose that password hash for PostfixAdmin admin user is $1$deceb114$ABCDefghIJKLmN09Q4sTn/ | |
# The salt will be the part between $1$ and $. Hence: | |
salt = 'deceb114' | |
# The print command below will generate a PostfixAdmin compatible MD5 hash of the password (which is KNIGHT) | |
print md5_crypt.using(salt=salt).hash('KNIGHT') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to @asamolion