fix cipher segments