CiviCRM password length in Joomla
Ok, I found an example on the Civi Wiki and, with a bit of workaround, it finally works: 

function joomla_civicrm_validateForm($formName, &amp;$fields, &amp;$files, &amp;$form, &amp;$errors) {  

  $errors = array();

  // check we're targeting the right form
  if ($formName == 'Edit') {
    return true;
  }

   $password = CRM_Utils_Array::value( 'cms_pass', $fields );

   // ensure that password is present and valid
   if (!$password) {
      $errors['cms_pass'] = ts( 'Password is a required field' );
   } elseif (strlen($password) &lt; 50) {
      $errors['cms_pass'] = ts( 'Password must be longer than 50 characters');
   }

  return empty($errors) ? true : $errors;
}