Safer K-62 algorithm