The Caesar cipher is a substitution cipher : each letter is replaced by another . No substitution cipher is really safe . In the first case , the cipher can be broken using the same techniques as for a general simple substitution cipher , such as frequency analysis or pattern words .