[TYPO3-english] Creating a salted MD5 password fails

Richard Davies richard at ocular.co.nz
Wed Apr 9 03:37:49 CEST 2014


Hi Marc,

Try:

        $objSalt    =
tx_saltedpasswords_salts_factory::getSaltingInstance($non_salted);
        $validPasswd= $objSalt->checkPassword($salted,$non_salted);

Richard


On 9 April 2014 03:57, Marc Klein <realshiva at gmx.de> wrote:

>
> Hi,
>
> I'm trying to generate a salted MD5 password in a eID script and doing
> something wrong :-(.
> When I call the getHashedPassword() Method 3 times in a row I get 3
> different results and none of them matches the hash in the DB.
>
> ----
>    protected function saltPassword ( $password ) {
>        $saltedPassword = '';
>        echo $password . ' || ';
>        $saltedpasswordsInstance = tx_saltedpasswords_salts_
> factory::getSaltingInstance();
>        echo $saltedPassword = $saltedpasswordsInstance->
> getHashedPassword($password);
>        echo ' || ';
>        $saltedpasswordsInstance = tx_saltedpasswords_salts_
> factory::getSaltingInstance();
>        echo $saltedPassword = $saltedpasswordsInstance->
> getHashedPassword($password);
>        echo ' || ';
>        $saltedpasswordsInstance = tx_saltedpasswords_salts_
> factory::getSaltingInstance();
>        echo $saltedPassword = $saltedpasswordsInstance->
> getHashedPassword($password);
>        echo ' || ';
>        return $saltedPassword;
>    }
> ----
> Results in
>
> asdf || $1$JiUaTtX5$gxeLYdT0M/WiA5E3TENA61 || $1$Ns7LPbhO$rgjOQve.ETW0qW0m7rhQU.
> || $1$9uVyi3MZ$yhsbscIDxwVR4pxYQnCrQ1
>
> Any idea what I'm doing wrong?
>
> With best regards
> Marc
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list