If your message data (password, etc.) has been intercepted, then it will simply be seen as plain text. Using SSL / HTTPS will encrypt the data you send. I would not rely on client-side JavaScript or something similar for authentication / user registration purposes. This will most likely also give your users more confidence that a secure connection is being used.
Firstly, I just read about SSL and HTTPS in general, as well as SSL certificates - Wiki, Google and SO - all this will be a good place to search, there will be a ton of information.
To use SSL / HTTPS with CI, I found this useful:
In particular, the power ssl function from Nigel post :
Create a file in the / helper application called ssl_helper.php
if (!function_exists('force_ssl')) { function force_ssl() { $CI =& get_instance(); $CI->config->config['base_url'] = str_replace('http://', 'https://', $CI->config->config['base_url']); if ($_SERVER['SERVER_PORT'] != 443) { redirect($CI->uri->uri_string()); } } } function remove_ssl() { $CI =& get_instance(); $CI->config->config['base_url'] = str_replace('https://', 'http://', $CI->config->config['base_url']); if ($_SERVER['SERVER_PORT'] != 80) { redirect($CI->uri->uri_string()); } }
Download the helper, then into the constructor for any controller that requires ssl, just paste:
force_ssl();
In every controller that you do not want to use ssl:
if (function_exists('force_ssl')) remove_ssl();
This is a programmatic approach, another way would be to use .htaccess (if you are using Apache).
jleft source share