title: What is the best way to check the strength of a password?
body: <p>What is the best way of ensuring that a user supplied password is a strong password in a registration or change password form?</p>
  
  <p>One idea I had (in python)</p>
  
  <pre><code>def validate_password(passwd):
      conditions_met = 0
      conditions_total = 3
      if len(passwd) &gt;= 6: 
          if passwd.lower() != passwd: conditions_met += 1
          if len([x for x in passwd if x.isdigit()]) &gt; 0: conditions_met += 1
          if len([x for x in passwd if not x.isalnum()]) &gt; 0: conditions_met += 1
      result = False
      print conditions_met
      if conditions_met &gt;= 2: result = True
      return result
  </code></pre>