Joomla salt enhanced password

2019-06-09 06:07发布

how can i know value of string which is used as salt for joomla salt enhanced password encryption??

4条回答
够拽才男人
2楼-- · 2019-06-09 06:37

If joomla is randomly generating the salt each time, how in the world does it validate user's logins against it. I thought normally the salted password was supposed to be stored somewhere as regular text and you validated against the hashed version of that and hashed password.

查看更多
我命由我不由天
3楼-- · 2019-06-09 06:41

Not familiar with joomla in particular, but most salted passwords either contain the salt in the password string, seperated my a delimiter (typically $ or some other non alphanumeric character). Or it may be stored in a seperate column in the db table

查看更多
聊天终结者
4楼-- · 2019-06-09 06:43

Joomla generates a random salt for each password. Here you can find valuable information on how to work with the joomla methods to generate passwords:

http://forum.joomla.org/viewtopic.php?f=476&t=308499

From that bit you can see that the salt is stored after the password with a colon as delimiter.

$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword("blabla", $salt);
$password = $crypt . ':' . $salt;

[EDIT] I just needed to write an Authorisiation Validator with Zend_Auth to validate against a Joomla (1.0) install and I thought I'd update the information here about it. A snip of my code.

$dbAdapter = Zend_Registry::get('jdb');
$this->_authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
$this->_authAdapter->setTableName('jos_users')
->setIdentityColumn('username')
->setCredentialColumn('password');

//Joomla 1.0 uses hashes in the form md5(passwort + salt) + salt
$users = new Users();
$hash = $users->getHash($value);
$salt = substr($hash, strpos($hash, ':') + 1);
$password = md5($context['password'] . $salt) . ':' . $salt;

[/EDIT]

查看更多
趁早两清
5楼-- · 2019-06-09 06:49

In the password field in the users table, it's the bit after the ":"

The formula is something like

password DB field = md5(password + salt) + ":" + salt

查看更多
登录 后发表回答