Page 1 of 1

Acceptable Extra characters

Posted: Tue Jul 27, 2004 9:15 am
by AGISB
I modified the code of this topic

viewtopic.php?t=24191

to a random generating password script with at least 1 digit and one extra character.

Code: Select all

<?php
		srand((double)microtime()*1000000);
		$acceptable_chars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789";
		$acceptable_num = "123456789";
		$acceptable_extra = "#%ยง*!%";
		$password_length = 8;
		do {		
			$extra_rand = rand(0, $password_length - 1);
			$num_rand = rand(0, $password_length - 1);
		} while ($extra_rand == num_rand) ;
		for($i = 0;$i < $password_length;$i++) {
			if ($i == $extra_rand) {
				$new_pass .= substr($acceptable_extra, rand(0,strlen($acceptable_extra) - 1), 1);
			} elseif ($i == $num_rand) {
				$new_pass .= substr($acceptable_num, rand(0,strlen($acceptable_num) - 1), 1);
			} else { 
				$new_pass .= substr($acceptable_chars, rand(0,strlen($acceptable_chars) - 1), 1);
			}
		} 

?>
I plan to use those passwords with the http://www.authentication. Does anyone have a list of which extra charaters are allowed?
Any input on which chars to avoid is also appreaciated. (I already took out I and l and O and 0 to avoid possible confusion)

Thanks

Posted: Tue Jul 27, 2004 10:47 am
by feyd
extra characters allowed where? in a URL, in post data, what?

B and 8, 2 and Z potentially, 6 and G, U and V... A lot of this depends heavily on the font you use.

generally, if you're going for the most non-confusing characters, you don't use symbols and lower case letters.

Posted: Tue Jul 27, 2004 10:52 am
by AGISB
I was thinking of allowed in the password dialog box. Most likely this is more of an apache issue than php

Posted: Tue Jul 27, 2004 11:02 am
by feyd
any characters can be passed, they are all url encoded by the browser and sent, php's core automatically decodes it and presents it to you.