Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Currently im Working with a Website that will handle a very large amount of data. These data/ entries will be stored in MS SQL Server database. My Question is what security techniques can I do to protect the Private data from hackers and likes. I have in Mind th encryption of the URL to prevent sql injections also Encrypting the data that will be Entered by the users.

any form of Ideals is greatly appreciated thank you.
Posted

There are reams of security advice but you can avoid the main problems by:


  • Use parameterised queries. Never construct a query by building up a string from user input. This protects you against SQL injection (probably the no. 1 exploit) and it's also faster and more type safe.
  • Don't save passwords in plain text. (Using the default ASP.net Membership/Role system will automatically get this and a whole bunch of other stuff right for you.) This prevents a database hack or leak compromising people's passwords.
  • Don't output unsanitised user input directly into the page stream (to prevent cross-site scripting attacks) – not so relevant for ASP.net as you don't generally make the stream yourself.
  • If you are concerned about in-transit interception of credentials or data, use SSL (i.e. HTTPS).
 
Share this answer
 
Comments
RaisKazi 4-Nov-11 9:09am    
Good Points. 5ed.
I think you're referring to encoding user input and not encrypting it.

Some things that spring to mind that you should look out for:

1. Don't trust the user's input. Make sure you validate it (especially strings) and HtmlEncode it if you're going to display it in a web page again
2. Parameterize your queries
3. Make sure the account with which you're logging onto SQL Server with has the bare minumum in terms of permissions to cover your functionality. You shouldn't need more dbdatareader and dbdatawriter by the sound of it
4. Don't store sensitive stuff like a password in a cookie

Find out more here:

http://msdn.microsoft.com/en-us/library/ff648647.aspx[^]
 
Share this answer
 
Comments
RaisKazi 4-Nov-11 9:09am    
Good Points. 5ed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900