What are best practices storing confidential data encrypted in 3-rd-party-hosted MySQL servers?
I am developing (as A PHP 5.2 + MySQL application) a personal information manager web application for my own which is meant to be hosted on a shared hosting (like bluehost or dreamhost) and to store lots of very confidential personal data including those like passwo开发者_StackOverflowrds, personal private keys, financial details, contacts, etc. How do I best protect this data?
I see the folowing weak points:
- Physical access to host by hackers or hosting administrators.
- Sniffing the decrypted data between the host and the client.
- Sniffing the decrypted data on the host before it is actually sent.
And obvious solutions:
- Encrypt and decrypt on client side (in a JavaScript or Java applet), a server operates with already encrypted data only.
- Use HTTPS.
- See §1.
Are there any better ideas and known good implementations, incl. any frameworks out there?
I am interested in the following languages: PHP (5.3 or 5.2), Ruby, C#4, JavsScript (Firefox 3.7), Java (1.6).
To my knoledge, you do not have many option here:
use the OS native solution (if any). GNU/linux has something.
use third-party solution. The one I know best is Gazzang
But you should not restrict your setup to just one of these solution. Security is more than just encrypting data files. You should also take care who can access your database server, etc.
What I think is that you can never trust on shared hosting. They have access to it and view it at their free will but this is not most likely/should be done, however you are definitely on a risk of sharing your data already.
On the coding part though, you should take care of security issues such as sql injection and storing password using some encryption algorithm.
If you don't trust your hoster, you have to encrypt your sensitive data with a strong cipher at your local machine and store only the cryptogram in the database of the hoster.
Everything else could expose your sensitive data to the hoster.
精彩评论