0

I have a PHP script to backup a database as dbName.sql which can be accessible by anyone. I need to encrypt/decrypt the backup database to be accessible only in my application. How can I do this?

Note: I have a list page to download all database backups. I want my server to be able to use the database only.

Michael Irigoyen
  • 22,513
  • 17
  • 89
  • 131
Jakir Hosen Khan
  • 1,498
  • 1
  • 14
  • 17
  • This is really too broad to answer, because there are too many ways one could encrypt something which has nothing to do with MySQL. – Artjom B. Apr 07 '15 at 18:26

1 Answers1

0

When you backup the file, move it to a location that can not be accessed by anyone in the root directory of the server. So for example, if you're public directory is public_html, move the file to be outside (or same level) as the public_html file.

Then the only two ways to access it is either by your script (with the proper calls) or via an FTP client.

MrTechie
  • 1,797
  • 4
  • 20
  • 36