I am seriously looking for a solution to encrypt at least some of the tables in my Drupal 7 database.

I'm totally suspicious about my hosting providers, I really don't want my user's data and also my business information to be visible at all.

Are there any solutions for database encryption? I don't want to buy a VPS.

  • And if it is appropriate please someone with more reputation add "Encryption" tag to this post, because there no "encryption" tag – Sadegh Apr 10 '12 at 20:30
  • 1
    I don't understand how this would work? For your install to be able to do anything useful at all with your database, the webserver would need the decryption key anyway. – Letharion Apr 10 '12 at 20:30
  • 1
    If you're suspicious about your hosting provider, then I'd strongly suggest switching provider rather than fool around with encryption that as @Letharion mentioned, will be pretty moot if someone wants the data anyway. – Chapabu Apr 10 '12 at 20:34
  • I agree with you, but i just want to prevent them to access my data with their mysql root user – Sadegh Apr 10 '12 at 20:35
  • If they're hosting it, there's pretty much nothing you can do. As @Letharion mentioned, any decryption keys/methods will have to be stored on the server as well. This means that the data can never be safe from the people you are trying to hide it from. I would take a long look at your provider's Terms and Conditions and Privacy Policy, and then judge whether switching would be a better option. – Chapabu Apr 10 '12 at 20:44

In short, unless you are the only person with physical access to the server, you are not safe, there is no way you can do this with reasonable effort, a VPS makes no difference.

If you could deploy something like full disc encryption which was only unlocked when you logged in to the system, your provider could still have virtualized the entire server, and not encrypt it anyway, only tell you they have.

Even if you somehow managed to safely encrypt the database, it needs to become readable at the server side at some point, or your server couldn't possibly serve the data.

Either this means that your webserver actually holds the decryption key, making it at most moderately complicated to copy it. You could require the key to be entered every time your http-deamon starts and store it only in RAM, but again, if your host is in a virtual machine you are immediately screwed, and a determined attacker could steal the key from RAM even from physical ram.

I could go on, but the gist is, you can't do what you want without a lot of resources, mainly physical servers in a locked serverrack.

  • +1 for the elaborate server description - It's too late here for me to do that bit ;-) – Chapabu Apr 10 '12 at 20:55
  • ok, thanks for your great and helpful description :) – Sadegh Apr 10 '12 at 20:58

Long story cut short, the servers are owned by your host therefore they can access the data at any time they so wish.

As mentioned, any encryption methods will need decryption keys/methods which will also have to be stored in your files..on the server.

You could check out Encryption or AES, but at the end of the day...your provider will be able to access the data regardless.

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.