Seite 1 von 1

Neue Passwort-Verschlüsselung

Verfasst: 07.02.2008 02:34
von mgutt
Hallo,

kurze Frage zu den Passagen:

Code: Alles auswählen

includes/functions.php
...
$output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];
...
	/**
	* We're kind of forced to use MD5 here since it's the only
	* cryptographic primitive available in all versions of PHP
	* currently in use.  To implement our own low-level crypto
	* in PHP would result in much worse performance and
	* consequently in lower iteration counts and hashes that are
	* quicker to crack (by non-PHP code).
	*/
	if (PHP_VERSION >= 5)
	{
		$hash = md5($salt . $password, true);
		do
		{
			$hash = md5($hash . $password, true);
		}
		while (--$count);
	}
	else
	{
		$hash = pack('H*', md5($salt . $password));
		do
		{
			$hash = pack('H*', md5($hash . $password));
		}
		while (--$count);
	}
Sagen wir mal unser Board startet mit PHP4 und wir rüsten später auf PHP5/6 auf, sehe ich es richtig, dass dann alle Passwörter ungültig werden?

Gruß
Marc

Verfasst: 07.02.2008 07:15
von Dr.Death
Moin,

nein...... siehe hier:
Setting raw_output to TRUE has the same effect using pack('H*', md5($string)) in php 4

pack( 'H*' , md5( $string) ) ) == md5($string, TRUE)
Quelle:
http://de3.php.net/md5
Eintrag von :
eric at opelousas dot org
31-Jul-2005 11:57

Verfasst: 08.02.2008 02:02
von mgutt
Und warum dann überhaupt die Bedingung? Ich mein, beides funktioniert doch in PHP5. Also was solls :-?

Verfasst: 08.02.2008 07:53
von bantu
PHP5 ist keine Vorraussetzung, damit man phpBB3 installieren kann. PHP4 tuts auch.

Verfasst: 08.02.2008 12:28
von mgutt
Habe ich auch nicht bezweifelt ;)