In the case of a cipher, if keys are suspected to be words, the same technique can be used to break messages encrypted with it.
An example of a dictionary attack occurred in the Second World War, when British codebreakers working on German Enigma-ciphered messages used the German word eins as part of a dictionary attack; eins, the word for the number one, appeared in 90% of all Engima messages, as the Enigma machine's keyboard had no numerals.
Clifford Stoll's book, The Cuckoo's Egg, contains an interesting, and unusually readable, account of a dictionary attack against the encrypted passwords kept in the passwd file in Unix systems, and of the reaction to the successful attack of the man (Robert Morris Sr) who invented the encryption system used for those passwords.
See also:
Well known examples of dictionary attack software tools include John the Ripper and L0phtCrack