i want to convert hashed database password converted to simple text.

in database we have like that

but i want to print it in page.tpl or in any block as a simple text..
i have done the encryption well.....but in decryption i need ideas to do that. please help me to fix it.



John_B’s picture

Basically you cannot http://stackoverflow.com/questions/13621391/how-can-i-decrypt-sha-512-ha...

though it is said these password hashes will give way to brute force attack sometimes.

Drupal is designed to be secure.

ashish.verma85’s picture

Hi john i read this.
So what is the best way to authenticate or check database username and password from outside drupa,
means from a PHP page.

I am writing a code in php page, where i have a password variable already encrypted to sha512 and username.

Now i want to validate that with drupal users table with "name" and "pass" but it give me different hash each time so its not possible to compare password, do you have any other idea in the mind?


John_B’s picture

Shared signon is outside my expertise. There are many authentication options for different situations, and you might start by study the options listed here https://groups.drupal.org/node/182004

ashish.verma85’s picture

John thanks again,
We don't need SSO here, we only need to send the data back to the third party site, like, success or fail....

the web service i created working fine with non hash password. it just not working with drupal7 hash pwd.

OK, do you know how can i compare two drupal 7 passwords?
comparing this


if they are equal or not?

that will solve my issue.


John_B’s picture

I think yes, but I never did it, so I guess you need to try. Maybe someone with experience of this will jump in and give better advice than I can.

ashish.verma85’s picture

Solved it.

UnsettlingTrend’s picture

Care to tell?

Jaypan’s picture

Hashing is a one-way process. Hashed passwords cannot be converted back to unhashed passwords (this is by design).

What you have to do is hash a submitted password using the same process as Drupal, then check if the hashed password is the same as the one saved in the database.

Checkout my Japan podcasts.
ashish.verma85’s picture


Hashing is a one-way process, so what i did, i compared two passwords using drupal functions, if you need then i can share the code.


Julien55’s picture


Can you post the code please? I have the same problem and i am really lost.
Thank you

ashish.verma85’s picture

Hi, sorry i dont have the access of the source code anymore, but you can easily compare it using the existing drupal functions.

Julien55’s picture

Hi, Where can i find the function who encrypt the password? Thanks

Shreya Shetty’s picture

https://www.drupal.org/node/1556488 . You can reset your password.