Quote:
Originally Posted by Jeigh
I've had quite a bit of experience with PHP (I'm certainly no expert on the matter though) and lately I've been trying to find as much information on making my method of coding and manipulating database information as secure as possible.
I'm planning on creating a site now that will use PHP and MySQL, and the information people will be storing in the database may contain personal details and such. My last site just felt a little sloppy with all the coding and I'm unsure if there are any vulnerabilities in the scripts.
I know basics (very basic) with security in PHP, I use MD5 for encrypting passwords and have to protect against SQL Injection but that's about as far as my security knowledge goes. I just want to take a little time researching this before I make this site, because obviously it'll be much easier than redoing everything later.
Basically I'm having trouble finding a good tutorial, there's plenty of tutorials on different security features I've found but I'm looking for a sort of step by step guide for the basics of security for PHP and MySQL. So if anyone could point me in the direction of some good tutorials it'd be much appreciated.
Cheers.
As for you original post, I can't think of a tutorial that inspects *your* code for insecurities.
holes are found in software because of its design.
Best practices and experience in coding, i'm afraid, will only help you here.
Just think logically, when you write a piece of code say to yourself "is there anything I can give it that would break it" not even hack it.
Other practices are, never turn on error_reporting (display of errors) on production (live) sites. Hackers use this information to find holes.
Check ALL input from clients (incoming POST, GET, COOKIES, etc) as "dirty", never use them until you've done proper checking on them. MySQL injection prevents only one instance of this example.
A little checking goes along way, don't be lazy.
For large application, consider using frameworks or an MVC architecture that keeps the presentation, business logic and application logic separate.
See CakePHP and ZendFramework.
good luck,
Dan