473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

MySQL Encryption

I'm writing a Web application using PHP5 connecting to a MySQL database.

I've told the client's application administrator to look after back-ups
of the database by using the "Export" option in phpMyAdmin to
automatically copy the database contents (recorded as SQL statements) to
his desktop.

Is there some way I can include encryption in this download process?
(And equivalently, decryption should he need to restore the database
from a backed up copy?) He is running a Windows machine, so for him to
do this locally, as a separate step, would require the use of some
Windows encryption code, and would risk his leaving a open text version
of the database on his desktop for anybody to see.
Jul 5 '08 #1
7 1665
Alan M Dunsmuir wrote:
I'm writing a Web application using PHP5 connecting to a MySQL database.

I've told the client's application administrator to look after back-ups
of the database by using the "Export" option in phpMyAdmin to
automatically copy the database contents (recorded as SQL statements) to
his desktop.

Is there some way I can include encryption in this download process?
(And equivalently, decryption should he need to restore the database
from a backed up copy?) He is running a Windows machine, so for him to
do this locally, as a separate step, would require the use of some
Windows encryption code, and would risk his leaving a open text version
of the database on his desktop for anybody to see.
This is not really a PHP question, but there are a few ways to get to a
database hosted on a web server or separate dedicated database server.

For a web server, phpMyAdmin is a possibility. To do this safely over
the big bad internet, run it on https. (you can use a self-signed
certificate and give your own root certificate to the client if you do
not want to spend money on a web certificate).

Or, you can tunnel port 3306 (or whatever port MySQL is serving) to your
local PC using an SSH tunnel. PuTTY is a good SSH client. If you
restrict SSH access to just a few known IP addresses, you can build a
pretty secure maintenance facility. One advantage of tunneling is that
your client can use any database front-end program he likes. There are
even database front-end programs that have SSH tunneling support built-in.

Best regards.
Jul 5 '08 #2
Alan M Dunsmuir wrote:
I'm writing a Web application using PHP5 connecting to a MySQL database.

I've told the client's application administrator to look after back-ups
of the database by using the "Export" option in phpMyAdmin to
automatically copy the database contents (recorded as SQL statements) to
his desktop.

Is there some way I can include encryption in this download process?
(And equivalently, decryption should he need to restore the database
from a backed up copy?) He is running a Windows machine, so for him to
do this locally, as a separate step, would require the use of some
Windows encryption code, and would risk his leaving a open text version
of the database on his desktop for anybody to see.
Try comp.databases.mysql for your mysql questions. This is a PHP newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 5 '08 #3
Jerry Stuckle wrote:
>
Try comp.databases.mysql for your mysql questions. This is a PHP
newsgroup.
No. It is actually a question about phpMyAdmin.
Jul 5 '08 #4
Alan M Dunsmuir wrote:
Jerry Stuckle wrote:
>>
Try comp.databases.mysql for your mysql questions. This is a PHP
newsgroup.

No. It is actually a question about phpMyAdmin.
In that case, he should be asking in the phpMyAdmin support forums, not
here.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 5 '08 #5
Alan M Dunsmuir wrote:
Jerry Stuckle wrote:
>>
Try comp.databases.mysql for your mysql questions. This is a PHP
newsgroup.

No. It is actually a question about phpMyAdmin.
Sorry - tried to go back to edit and hit send instead...

If you're asking about phpMyAdmin, you should be asking the phpMyAdmin
support people. This is not a product support forum for anything which
just happens to be written in PHP.

I recommended comp.databases.mysql because export is a MySQL operation,
and you might be able to get some help there.

But this is not the correct forum to be asking your question.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 5 '08 #6
On Jul 5, 12:14 pm, Alan M Dunsmuir <a...@moonrake.demon.co.ukwrote:
I'm writing a Web application using PHP5 connecting to a MySQL database.

I've told the client's application administrator to look after back-ups
of the database by using the "Export" option in phpMyAdmin to
automatically copy the database contents (recorded as SQL statements) to
his desktop.

Is there some way I can include encryption in this download process?
(And equivalently, decryption should he need to restore the database
from a backed up copy?) He is running a Windows machine, so for him to
do this locally, as a separate step, would require the use of some
Windows encryption code, and would risk his leaving a open text version
of the database on his desktop for anybody to see.
You can use PHP, with it's mcrypt-crypto functions, see http://www.php.net
for details...There are a lot of open-source solutions for simple file
encryption ;)

OR

You can pay for other encryption-decryption software.
Jul 6 '08 #7
On Jul 5, 12:14 pm, Alan M Dunsmuir <a...@moonrake.demon.co.ukwrote:
I'm writing a Web application using PHP5 connecting to a MySQL database.

I've told the client's application administrator to look after back-ups
of the database by using the "Export" option in phpMyAdmin to
automatically copy the database contents (recorded as SQL statements) to
his desktop.

Is there some way I can include encryption in this download process?
(And equivalently, decryption should he need to restore the database
from a backed up copy?) He is running a Windows machine, so for him to
do this locally, as a separate step, would require the use of some
Windows encryption code, and would risk his leaving a open text version
of the database on his desktop for anybody to see.
Here is my simple mcrypt training script works on Linux PHP-5.2.6-26
a konsole program by the way.. You need libmcrypt-2.5.8 and PHP-5.2.6
compiled with mcrypt support.

<?php
// Boris The Scripter =) 2008 Licence:GPL-2
// usage: php fubar.php <key[-e/-d] <filename>

if($argc <= 4 && is_file($argv[3]))
{
$input_file_addr = $argv[3];
$input = file_get_contents($input_file_addr);
$key = $argv[1];
if($argv[2] == "-e")
{
$encrypted_data = @mcrypt_ecb(MCRYPT_RIJNDAEL_256, $key, $input,
MCRYPT_ENCRYPT);
//echo $encrypted_data . "\n";
$fp = fopen($input_file_addr,"w");
fwrite($fp,$encrypted_data);
fclose($fp);
}
else if($argv[2] == "-d")
{
$encrypted_data = @mcrypt_ecb(MCRYPT_RIJNDAEL_256, $key, $input,
MCRYPT_DECRYPT);
//echo $encrypted_data . "\n";
$fp = fopen($input_file_addr,"w");
fwrite($fp,$encrypted_data);
fclose($fp);
}
}
else echo "Program made a boo boo!\n";

?>
Jul 6 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
Hello all. I'm currently working on a new site that encompasses the registration of members. The registration is taking place through PHP interaction with MySQL. The site is just going to be...
1
by: M Wells | last post by:
Hi All, I'm trying to implement encryption on certain data fields in my MySQL database and I'm experiencing ongoing problems. I seem to be able to encrypt the data without issues, but can't...
0
by: JL | last post by:
Platform: Linux Red Hat RHEL 3 (and red hat 9) Installed MySQL from source. As a matter of fact, installed all LAMPS from source, and the mysql socket file was arranged in a place other than...
11
by: AnhTai | last post by:
Hi all, I've just installed MySQL 5.0 on my sun box (runing Solaris 10, install from blastwave). This is my first time with MySQL so I don't have any exp with it. I have some troubles as: -...
2
by: veg_all | last post by:
The documentation for using encyption with mysql does not seem to have any easy to follow examples. Anyone know of one? I am surprised there does not seem much out there on this. I googled mysql...
7
by: Randy | last post by:
Folks: We have a web-based app that's _really_ slowing down because multiple clients are writing their own private data into a single, central database. I guess the previous programmer did...
2
by: damod.php | last post by:
what's the Basic Encryption method used in mysql, whats iner join whats outer join ,diff b/w.what are the encryption methods used to encrypt the user name and password.in php/mysql
9
by: Ben | last post by:
Hello, I'll bet this has been asked a million times but I can't seem to find a thread that gives the clear example I need. This PC has MySQL and IIS configured and running. The MySQL database is...
1
by: KalleMOD | last post by:
Hi there! I'm quite new to linux and recently bought my own server. I have installed vsftpd with SSL(FTPES) and it worked fine with local users. Now I want to allow virtual users to login as...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.