Using PHP to create a TYPO3 salt password?

I am trying to create a custom registration component for TYPO3 on an external website where TYPO3 is not installed (I just use its database). The problem is that I have no experience using TYPO3. I was wondering if anyone knows how to create the correct password encryption for TYPO3? Passwords look like this:

$ P $ CeO / XYcbzRH9nLpCwKdp1HhsJGwJum0

I am looking for php code to create the same encryption and password verification. I have an encrytion key from the installation tools, which (I believe) is used for salting.

Or is it possible to save passwords only as MD5? Not the best option, but I could remain the only one.

I found this URL: http://srv123.typo3.org/TYPO3/Extensions/saltedpasswords/4.6/#compatibility-of-other-extensions-with-salted-user-password-hashes

But I do not know how to implement this in my own script.

+5
source share
3 answers

Looking at the hash, suppose that the saltedpasswords extension (responsible for storing salted hashes in the database) in TYPO3 is configured to use phpass . Thus, you can take this class and use it in your script to create / verify passwords in the same way as TYPO3 does.

Or is it possible to save passwords only as MD5?

, TYPO3 . , - TYPO3 , , TYPO3 , , , . , , , .

+2

typo3 6.X:

    $password = 'XXX'; // plain-text password
    $saltedPassword = '';

    if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('saltedpasswords')) {
        if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('FE')) {
            $objSalt = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(NULL);
            if (is_object($objSalt)) {
                $saltedPassword = $objSalt->getHashedPassword($password);
            }
        }
    }
+13

Check out the developer guide:

1.5.1 Creating a new password hash for salted users from a given text password

You should use it in typo3-Frontend:

$password = 'XXX'; // plain-text password
$saltedPassword = '';

if (t3lib_extMgm::isLoaded('saltedpasswords')) {
  if (tx_saltedpasswords_div::isUsageEnabled('FE')) {
    $objSalt = tx_saltedpasswords_salts_factory::getSaltingInstance(NULL);
    if (is_object($objSalt)) {
      $saltedPassword = $objSalt->getHashedPassword($password);
    }
  }
}

But , you should never try to generate a salty password outside typo3, because the encryption depends on your typo3 settings.

+7
source

All Articles