Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9612

Split gen_rand_string() into gen_rand_string() and gen_rand_string_friendly()

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.8-RC1
    • 3.0.7-PL1
    • None
    • None

      4bb3266cc62003d5bd6fafda03a5582ea06250e9 changed gen_rand_string() to also map O to Y to not confuse O and 0 in generated passwords. This reduces entropy slightly in all other places where gen_rand_string() is used.

      function gen_rand_string($num_chars = 8)
      {
      	$rand_str = unique_id();
      	$rand_str = str_replace(array('0', 'O'), array('Z', 'Y'), strtoupper(base_convert($rand_str, 16, 34)));
       
      	return substr($rand_str, 0, $num_chars);
      }
      

      Another function gen_rand_passwd() should be added to increase entropy of all gen_rand_string() output.

            bantu Andreas Fischer [X] (Inactive)
            bantu Andreas Fischer [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: