If we have a set amount of usable characters, but no other restrictions on the potential characters in a completely random fixed length password, we can easily calculate the entropy by doing:
$\log_2(c^{n})$
or
$\log_2(c)*n$
with $c$ being the number of possible characters, and $n$ being the length of the password.
However, when there are restrictions being set on the contents of the random password, this obviously lowers the entropy.
For example, if you have $94$ usable characters, of which $10$ are digits, $26$ are lower case letters, $26$ are upper case letters, and $32$ are special characters.
If there are no other restrictions, this gives us
$\log_2(94^{10}) = 65.5$
which means $65.5$ bits of entropy.
Now, if we have $94$ usable characters and the following restrictions are set:
- 1 character must be an uppercase letter ($26$ options)
- 1 character must be a lowercase character ($26$ options)
- 1 character must be a digit ($10$ options)
- 1 character must be a special charater ($32$ options)
How do you calculate the entropy for a truly random fixed length password with these restrictions in mind?