I've been assigned a web project that deals with shipping goods between two parties. I am unsure what a secure database scheme (if any) would be for storing the recipient's postal address and whether or not there are data privacy laws in regards to how these addresses should be stored? Both the recipient and the sender will require access to the address in the system.

Or unlike passwords, would it be okay to leave them as plaintext? Amazon is an established company, and when you log in to your profile, they would show you your address. This implies that Amazon stores them either in plaintext or in a decryptable state.

  • I don't remember if there's any standards to how the postal address information should be stored. It will depend on how sensitive is the data for you to encrypt / decrypt. If I'm the one doing the project, I will leave it in plaintext as I don't see extreme risk in getting the data exposed. Of course I don't deny that personal information is not sensitive but if that's the case, you might as well encrypt the whole personal data though it would incur a huge cost on your server. – Sky Jul 1 '14 at 5:28
  • Also, if both the recipent and sender require access to address information, how are you going to do the encryption/decryption of the data? A https connection should be more than sufficient to prevent MITM attacks from sniffing the personal information and transmitting data from the victims. – Sky Jul 1 '14 at 5:31
  • 1
    I don't think I'd spend a lot of time on this because postal addresses are widely available publicly. Instead, spend your effort being sure the database is safe from SQL injection and hardening OS and web server. (This is an opinion, not an answer, which is why it's a comment.) – Bob Brown Dec 26 '14 at 21:38
  • 1
    Data privacy laws are country-specific. You'll need to tell us where you do business, and even then we might not be able to provide solid answers because that's a legal question. – Bob Brown Dec 26 '14 at 21:39

As you mentioned, password hashing is a great way to secure a client's password in a database (if done right). However, if you/your app needs to know the data that is being hashed then hashing alone cannot work as you need to encrypt the data.

I assume you are concerned with data breaches themselves (attackers gaining access to the database and thus 'seeing' all this plaintext info). If this is the case, having a strong and secure (encrypted) database will be a life[money]-saver assuming the decryption keys are not also compromised...

Here is an article on how to encrypt sensitive data properly.

Here are some common mistakes.

Also, just because you 'see' Amazon's data (the addresses) doesnt mean it was stored in plain-text, it just means that -like you said- it is decryptable.

  • This answers the 'hashing' comment the OP makes, but not the main thrust of the question (how to store addresses). – schroeder Oct 27 '14 at 17:12
  • 1
    It's difficult to answer this subjective question so I chose to only address empirically proven ways to secure data (hashing and encryption). – Matthew Peters Oct 27 '14 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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