Sorry for being new in php programming, in my old project I use MD5 to encrypt the password, however, it is not secure enough and I found some resource on the internet suggest using password salt instead.
The problem is , I am using codeigniter, is there any helper/ library for this purpose / how to change my old code to support the generation of the password salt?
Thanks for helping. I am using PHP 5.2
And here is the old code to validate, while the user account generate by storing the md5($password);
function validate_credentials() {
$this->load->model('Secure_model');
$username = $this->input->post('username');
$password = md5($this->input->post('password'));
$is_valid = $this->Secure_model->validate('customer', $username, $password);
if ($is_valid) {
$data = array(
'user_id' => $this->get_user_id($username),
'user_name' => $username,
'is_logged_in_user' => true
);
$this->session->set_userdata($data);
redirect('profile');
} else {
$data['message_error'] = TRUE;
$data['main_content'] = 'front/login';
$this->load->view('front/includes/template', $data);
}
}