I am making an employment application for a company I am working for. I\'ve got it to protect against SQL injection and some XSS techniques. My main issue is keeping sensiti
SQL query with key in it (as Wesley Murch suggests) is not a good idea. If you do:
update mytable set myfield = AES_ENCRYPT('some value', 'your secure secret key');
... and the query gets logged (slowlog for inst.) your secure secret key is captured in plain text, which should never happen. Such a query with the secret key would be also visible when you run query like SHOW PROCESSLIST.
Next problem where to store the secure key? In PHP file? It is again plain text.
Encrypt data:
Use private/public key encryption (http://en.wikipedia.org/wiki/Public-key_cryptography). PHP has quite good support for it.
If you want to learn more, you can google "user controlled encryption" or "zero knowledge privacy".
SQL inserts / XSS:
The best protection is secure app. No doubt. If you want to secure it, you can use for inst PHP IDS to detect attacks: https://github.com/PHPIDS/PHPIDS
I have quite good experience with it.