how to decrypt the moodle password ?

how to decrypt the moodle password ?

by Kathir Rajaraman -
Number of replies: 14

Dear All,

 how to decrypt the moodle password ?


Can u help me ?

Thanks

Kathir R

Average of ratings: -
In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by James McLean -

It's hashed, so it's not reversible.

In reply to James McLean

Re: how to decrypt the moodle password ?

by Kathir Rajaraman -

Hi James,

Thanks for your reply. If any other solution is there ? 


Thanks 

Kathir R

In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Break the algorithm, https://en.wikipedia.org/wiki/Bcrypt in this case. You'll be famous!
smile
Average of ratings: Useful (3)
In reply to Visvanath Ratnaweera

Re: how to decrypt the moodle password ?

by Kathir Rajaraman -
Hi Visva,


Thanks for your reply . I will check here 

Thanks

Kathir R

In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

The solution depends on what your actual problem is...

If you just want to hack the password, then no - and certainly not one that is going to get published in an open forum here!

If you have lost/forgotten a password, then yes there are options to reset passwords.

In reply to Richard Oelmann

Re: how to decrypt the moodle password ?

by Kathir Rajaraman -

Hi Richard

Thanks for your reply.  I dont want hack the password. 

Sample Example

Moodle Admin password is Admin@123. Its  password encrypt password_hash funtion. This password encrypt to $2y$10$QlLAuCMNp8X6TZ.tqxEABu.7PCZO5EsL.DPS/b.DDc7Glta3/yPTK. But i want decrypt $2y$10$QlLAuCMNp8X6TZ.tqxEABu.7PCZO5EsL.DPS/b.DDc7Glta3/yPTK to Admin@123 password.


Thanks

Kathir R 

In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by James McLean -

I think you are misunderstanding this. The password is hashed. Hashing is a process where a string is converted into another string by a mathematical process (to keep it very simple).

Once a string has been hashed, it cannot be reversed to plain text under normal circumstances (this is intentional).

If you wish to check a password for authentication, for example, then the process is to hash the string you want to check and if it hashes to the same result, then strings are the same. You will need to factor in the salt used, as there is one in that hash. 

The function password_hash() is simply a wrapper for crypt(). 

I suggest looking at http://php.net/password_hash,  http://php.net/hash_equals and http://php.net/crypt for further information.

Average of ratings: Useful (1)
In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by Jez H -

Why cant you do a password reset?

If you have lost access to the mail account (that would receive the reset key) it can be updated in the database to another mail address you do have access to.

In reply to Jez H

Re: how to decrypt the moodle password ?

by Kathir Rajaraman -

Hi Jez

Thanks for your reply. I don't have no rest password or reset key also. My doubt is moodle password how to encrypt and how to decrypt ?


Thanks

Kathir R

In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Kathir,

As has been explained already, the password isn't encrypted, it's cryptographically hashed, a process which cannot be reversed.

Perhaps if you explain what your broader problem is, someone may be able to suggest another solution.

In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by Tomasz Muras -
Picture of Core developers Picture of Plugin developers Picture of Plugins guardians Picture of Translators

Technically hashed passwords can not be decrypted, as James said. You can try to match hash against known, most common passwords: https://moodle.org/mod/forum/discuss.php?d=278169 .


Tomek

In reply to Tomasz Muras

Re: how to decrypt the moodle password ?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Why would anyone want to ask this question if they have access to the database?

In reply to Kathir Rajaraman

Re: how to decrypt the moodle password ?

by Danny Wahl -

I think the issue here is that you have  a problem, have come up with a solution, and are asking how to do that solution- tell us what the original problem is and ask for solutions.  If you've forgotten your original admin password and you have server access you can use cli to reset the password

php /admin/cli/reset_password.php