A method and apparatus for encoding security codes are provided. In the method and apparatus a first code, which may be an erroneous code, is compared to a set of codes to identify a code portion. The code portion may be identified as contributing to inducing erroneous entry of the first code. The likelihood associated with issuing a second code including the code portion may be updated to negatively bias issuing the second code.