Yes, password complexity requirements reduce search space and therefore make guessing passwords easier, but at the same time can also increase security. Why? To understand this, one needs to understand that there is no such thing as a secure (or insecure) password. A password is only secure/insecure in relation to our assumptions on the attacker's attack method.
To understand this, consider the following example. If you choose at random a string of letters of 0 <=
length < n
from an alphabet of size d
, there are exactly
d^0 + d^1 + ... + d^{n-1} = (d^n - 1)/(d-1)
possibilities. If you have picked a string of length l < n
, and the attacker chooses a string of length n
uniformly at random, with probability (d-1)/(d^n - 1)
he will pick your password. Note, that this probability depends not on your password length but on the maximum length the attacker considers.
Thus we have an apparent paradox: the more passwords the attacker checks, the more secure your password becomes. Of course, that's nonsense. Indeed, if a attacker tries to crack your password, he won't just pick one password at random, he will go through all of them in a sequence.
So the proper way of asking for the security of your password is: How likely is it for an attacker to guess your password within k guesses.
If you assume your attacker goes through all passwords in lexicographic order, the password zzz...z
is objectively the most secure passwords, and must be used by every user. This is ridiculous, but only as ridiculous as our assumption.
A more reasonable approach is to assume is that the attacker goes through all strings of length < n
in a random order. With a probability of
1 - (N-1)/N * (N-2)/(N-1) * ... * (N-k)/(N-k+1) = 1 - (N-k)/N
he will have found your password (assuming the attacker keeps on guessing even if he has found it), where
N = (d^n - 1)/(d-1)
is the number of all strings of length < n
.
Again, this number doesn't depend at all on the length l
of your password. Thus, the empty password is just as secure as every other password.
Again, this is ridiculous: the attacker probably will not be as stupid as to test all possibilities in a uniform random way. He will probably go through a small subset of special cases first (password of small length, same letter passwords, ...) and then test the rest of them in a uniform random order.
To summarize: 'The security of a password' is only a subjective quantity you assign to it, based on your beliefs about the attacker. Since most of use believe attackers to check 'simple passwords' first, those are subjectively insecure. So insecure in fact, that it is reasonable to decrease the search space a bit by excluding these passwords.