I have the following in place for my PHP website:
- SSL enabled
Cookies :
session_set_cookie_params($cookieParams["lifetime"],
$cookieParams["path"], $cookieParams["domain"], $secure, $httponly);
Passwords SHA512 on transit, then password_hash() and finally PASSWORD_BCRYPT
- Mysqli Prepared statements
- Inputs all sanitized when INSERTING / UPDATE into Mysql
- htmlentities etc..used to avoid xss where possible.
I'm now looking to use AES_Encrypt function to encrypt sensitive data by having the $key to encrypt and decrypt stored outside the webroot directory.
This could potentially store patient data, does what I have in place seem secure enough?
Question:
How are you sanitizing the inputs when you INSERT/UPDATE? If you're using Prepared Statements, you should not escape the data manually as well.
Answer:
example:
$firstname = ucwords(filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…