cscuilla
Posts: 58
Joined: Tue Apr 26, 2016 6:35 pm

Decrypt MariaDB password for use in Python Script

Sat Jul 22, 2017 11:51 pm

In PHP, I am using the following to store an encrypted password to a MariaDB (MySql)

Code: Select all

$pass = $_POST['pass'];
$passH = password_hash($pass, PASSWORD_DEFAULT);
$query=$con->prepare("UPDATE user SET pw=? WHERE id=?");
$query->execute([$passH,$userid]);
I'm trying to use that password in plain text from a python script. I know how to connect and run queries via python,
but I can't figure out how to decrypt the password.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Decrypt MariaDB password for use in Python Script

Sun Jul 23, 2017 6:47 pm

password_hash() is a one-way function. There's no way, without using the NSA or GCHQ super computer to decrypt it.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Python”