In general, any information which can narrow the search space for a password will
reduce the strength of that password. So, in theory, it would make sense to assume
that grammatically correct passwords are potentially weaker than those which are a
collection of unrelated words or have deliberate grammatical errors. However,
calculating exactly what the differences would be is extremely hard.
Many password cracking programs will allow you to define complex patterns. For
example, it has been observed that people often use dates as a way of including
numbers in a password i.e. password1961 or even password171067 (or password101767 for
US date), so some password crackers will search for things like
[dictonary-word][year] and [dictionary-word][date], where the numbers in the
year/date will be restricted to digits which would be valid and within an 'expected'
range (i.e. assume year/date is related to current/recent period or users date of
birth etc). Likewise, studies of passwords indicate people tend to do things like put
'special' characters at the boarders of password components i.e. password:1972. This
might suggest it would be a good idea to not use digits of this format and consider
using 3, 5, 7 digit numbers rather than 4 or 6 and if you add special/punctuation
characters, do so in /unusual/ positions i.e. pas:sword1972 (and of course, don't use
'password' :-(
As a cracker, the challenge of using grammar would be in how to model it. For
example, English has a very complex grammar. This is partially why natural language
processing is such a challenge. Theoretically, if you could define the grammar with
sufficient accuracy and had a large enough dictionary, you could generate a system
which could produce a dictionary of /valid/ sentences. However, this would still
represent a very large search space. If you know exactly how many characters are in the password, this would help reduce the search space, but it would be very
large. What would need to be determined is how much smaller such a dictionary would
be compared to a similar dictionary just consisting of random words concatenated
together. It would be smaller, but whether it would be sufficiently smaller to make
any practical difference is unknown. If the grammar based dictionary meant an average
search time of 50 years and the random word dictionary represented an average search
time of 500 years, in reality, neither approach are going to be useful (assuming
there are no other optimization which could reduce the time to a level which would be
practical).
Rather than a grammar based dictionary, I would probably compile a dictionary based
on quotes, well-known poetry and song lyrics. My theory is that when people use a
phrase as a password, that phrase will be something which is easy to remember and
therefore likely based on a song, poem or favourite quote. This would be an even
smaller dictionary. The challenge would be in building the database and ensuring it
is sufficiently comprehensive. Probably something which is getting easier given all
the digital repositories of quotes, songs, poetry etc out there.
Personally, I wouldn't worry about this too much. Obviously, it would be best not to
use well know phrases and it would be quite important to not use a phrase which
someone might be able to identify via social engineering techniques. If your a
military person, don't use famous military quotes/speeches, if you're a Christian,
avoid using quotes from the Bible, if your an obsessive fan of some
singer/actor/whatever, avoid using quotes from that person. Essentially, avoid using
anything which anyone who does some research on you might be able to use to narrow
the search space. I would also suggest using as long a phrase as possible. A very
long known quote is probably stronger than a shorter set of random words simply
because the search space is larger.
If you can remember a random set of words, then do that. However, if you can't, then
use a grammatically correct phrase, but make it as long as possible. Remembering the
password is probably as critical has ensuring it is strong. I've frequently found the
weakest part of many systems is their password recovery process and think you should
do as much as you can to avoid ever needing to use such a process. Enter the phrase
in reverse order (or some other pattern you can remember), insert special characters
and numbers into the words, not between them and avoid number patterns such as 2, 4
and 6 digits and stay away from quotes/phrases which someone could associate with
you.