which algorithm does Moodle uses to encrypt passwords?

which algorithm does Moodle uses to encrypt passwords?

by alisha kumar -
Number of replies: 2

I just want to know which algorithm does Moodle uses to encrypt passwords? So that, I can authenticate Moodle users on my login application.

i m using moodle 2.4

Average of ratings: -
In reply to alisha kumar

Re: which algorithm does Moodle uses to encrypt passwords?

by Guillermo Madero -

Hi Alisha,

Given that you are using Moodle 2.4, it would be MD5 hash (not encryption) algorithm.

Basically you need something like this:

MD5( userpassword + salt )

Where the salt is taken from the $CFG->passwordsaltmain parameter at the config.php file (in the moodle installation directory).

The following should be of help:

https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_md5

http://php.net/manual/en/function.md5.php

http://docs.moodle.org/24/en/Password_salting

http://docs.moodle.org/24/en/Configuration_file

http://www.md5hashgenerator.com/index.php