Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you save important(privacy-wise) user data like SSN, Credit Card Numbers and Addresses in databases?

Only data which needs to be available is saved. For eg, SSN is saved because the app uses the SSN to identify a particular record. or credit card details are saved to make 1-click transactions possible.Some such data can be encrypted and saved, but some data needs to be available in plain text(eg. for full text search). The app uses third party hosting.

How secure is such data in plain text(or otherwise) on third party hosts like HostGator or App Engine?

Do you save such data on third party hosts(and is this practice recommended)?

Do you store it in plain text or do you encrypt such data?

Should only those companies who have the resources to have their own servers proceed to build such apps?

share|improve this question
Regarding security i would assume the worst case scenario: your hosted data is available to anyone. "We are secure" promises are not worth much, once disaster has struck. – LennyProgrammers Jan 18 '11 at 14:54
@Lenny222 I agree. It would be possible to encrypt searchable data, it will hit performance though. – abel Jan 18 '11 at 15:09
up vote 5 down vote accepted
  • You need to investigate your legal liability first - which differs from country to country. For example, financial data in the UK cannot be stored in a server in a non UK, (or non EU country depending on what that data is).

  • Data is never 100% secure when unencrypted, heck it's not even 100% safe when encrypted, but a good encryption algorithm and keeping keys nice and safe make it pretty darn secure.

  • Yes I can recommend hosting on 3rd parties, especially if you can't afford to create and maintain that data warehouse infrastructure. Again it depends on your data and business.

  • Always frickin encrypt any data that is private or business critical. Never trust a third party :).

  • Tons of business use 3rd party data hosting, you don't need to run your own farm. Of course people like twitter, Google and Facebook value their data so much that they'd never dream of storing their data on a 3rd party host.

Hope that helps!

share|improve this answer
Yup, that helps. – abel Jan 18 '11 at 15:01
I haven't worked with encryption before. any pointers to get me started? – abel Jan 18 '11 at 15:11
What language are you working in with what DB? – Martijn Verburg Jan 18 '11 at 15:13
PHP/MySQL and Python on GAE – abel Jan 18 '11 at 15:20
OK, that's out of my league - I'd Google Python Data encryption and then go and check with gurus on SO or your local Python user group – Martijn Verburg Jan 18 '11 at 17:36

Since you're including credit card numbers, you might want to look at the PCI data security standards in use. While the Wikipedia article doesn't seem to mention third-party hosts, the requirements to track access make this seem unacceptable. This is the minimum necessary to accept credit cards yourself (at least in the US).

There are sufficiently many potential legal and compliance issues that I'd think hosting one's own servers wouldn't be much of an additional expense.

share|improve this answer
Payment gateways will help me avoid these? – abel Jan 18 '11 at 15:08
@abel: yes. For one-off payments, you would pass the credit card details to the gateway and never store them yourself. If you need recurring payments, gateways offer various services. e.g. an Australian one I am working with currently allows you to send credit card details and get a "token" in return; you store this token, which allows you to trigger a payment in the future. You don't store the CC details, and even if the token is compromised, it is useless to anyone else because all it can do is make a payment to you. – Carson63000 Jan 19 '11 at 9:01
@Carson helpful. – abel Jan 19 '11 at 9:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.