Fixed weakness in secret generation