Securing sensitive data.
If I steal your web server how secure is all that encrypted data on the drive? The answer is usually "not at all". That's because the all-too-common method for encryption in web applications also stores the decryption key, unsecured, on the same server. Get the server, get the key. Get the key, get the data. It's that simple. The argument in favor of this method says that the key has to be there for the server to encrypt the data. Perhaps it's a coincidence that it's also a lot easier, and, speaking from personal experience, programmers are lazy by nature.
So that begs the question, "Is there a way that would keep the data secure even if the attacker has full access to the server?" Yes - and it's not new. It's just harder than the one-key-fits-all method. You have to blend one-key (Symmetric) encryption with two-key (Public Key) encryption.
Encryption:- random 256-bit AES key generated - 128-bit is plenty strong enough, but hey, why not?
- random key used to encrypt the data
- RSA Public Key is used to encrypt the Random Key
- both the encrypted data and the encrypted key are stored in the database.
Decryption:
- login pass-phrase is strengthened into a 256-bit AES key
- strengthened key is used to decrypt that user's RSA Private Key
- RSA Private Key is used to decrypt the AES (Random) Key
- AES Key is used to decrypt the data.
Note that although the encryption key is stored on the server, it is encrypted and, more importantly, cannot be decrypted using anything on the server.
Since the whole decryption phase is kicked off with the user's login pass-phrase, an attacker would have to have that in addition to the encrypted data in order to get anywhere.
Most new PHP installations have everything you need:
If you're collecting sensitive information on your wesite (or websites that you've developed), you should be securing it properly. If you are not, or are not sure, give us a call. Let us discuss with you how Dialogs can empower you to securely work the web.
Recent Articles
To do today: change your LinkedIn password.
Your LinkedIn password may have been published on the web.
The web is a non-linear experience.
If you're not leading your customers through your website, you're driving them away.
You can’t afford perfection.
Don’t worry about it. Nobody can.
Do you know who you are?
Many businesses do not understand their own business model.
Find experts you trust, then trust them.
Remember, the reason you hire experts is because they know things you don't.
iCloud configuration for shared Apple Store content
Get the most out of iCloud without simplifying yourself into a mess.
An argument for onshore outsourcing.
People with direct and indirect contact with your customers affect your brand.
Designers: The giant Google Panda is watching.
You tell your clients that design matters, now Google agrees.
Every start-up requires sweat equity or real equity.
There are no exceptions.
You tweeted what?!?
Why shareware and social networking don’t mix.
Our customers say it best
Dialogs is an amazing strategic partner. They provide a solid foundation to execute strategies for my clients needs and they make me look great in the process!
— Kristina W.