I need to port a passlib (pbkdf2-sha512 to be specific) digest to another system (Auth0) and need to convert it to PHC string format using a B64 encoded salt (regular base64 without padding characters).
Passlib encodes to a shortened base64 format using it's own 'adapted base64 encoding' method. I basically need to convert that to the B64 format to include in my import file for Auth0.
The pbkdf2-sha512 documentation explains the output format as:
$pbkdf2-digest$rounds$salt$checksum
My complete pbkdf2-sha512 hash of my password 'Password!' looks like this:
$pbkdf2-sha512$25000$8d7bW2stZaw1BoBQyhkjZA$Dszct0GGjjfikK3cJhx.4M.YdOoytY9T5qaib9y8C/gvC1rE4iCWT970bN/MJD81RVToY.855KWRsGoPudA0HA
A simple script to output the passlib hash:
from passlib.hash import pbkdf2_sha512
print(pbkdf2_sha512.hash("Password!"))
From the Passlib documentation, I assume the following:
Key size: 16k (128 bits) - this is the default (not specified anywhere in the output)
Digest type: pbkdf2-sha512
Rounds: 25000
Salt: 8d7bW2stZaw1BoBQyhkjZA
Digest / Hash data: Dszct0GGjjfikK3cJhx.4M.YdOoytY9T5qaib9y8C/gvC1rE4iCWT970bN/MJD81RVToY.855KWRsGoPudA0HA
What I'm struggling to do is convert the salt and digest to the B64 format required by Auth0. Any help is appreciated!