473,763 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1690
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*******@attgl obal.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*******@attgl obal.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*******@attgl obal.net
=============== ===

Jul 5 '08 #6
On Jul 5, 12:14 pm, Alan M Dunsmuir <a...@moonrake. demon.co.ukwrot e:
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.ukwrot e:
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_add r = $argv[3];
$input = file_get_conten ts($input_file_ addr);
$key = $argv[1];
if($argv[2] == "-e")
{
$encrypted_data = @mcrypt_ecb(MCR YPT_RIJNDAEL_25 6, $key, $input,
MCRYPT_ENCRYPT) ;
//echo $encrypted_data . "\n";
$fp = fopen($input_fi le_addr,"w");
fwrite($fp,$enc rypted_data);
fclose($fp);
}
else if($argv[2] == "-d")
{
$encrypted_data = @mcrypt_ecb(MCR YPT_RIJNDAEL_25 6, $key, $input,
MCRYPT_DECRYPT) ;
//echo $encrypted_data . "\n";
$fp = fopen($input_fi le_addr,"w");
fwrite($fp,$enc rypted_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
9753
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 for my friends and I, but I have run into an issue that I have often wondered about before. Any insight would be appreciated. The database contains semi-sensitive information. Not CC numbers, but think more like usernames/passwords to other...
1
6878
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 figure out how to decrypt the data. My field in my test table, in which I'm storing the encrypted data, is a TEXT type field.
0
6528
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 /tmp/mysql.sock. Let's say, /opt/mysql_root/sock/mysql.sock. Installed DBI without any problem. In /etc/my.cnf there are lines as ----- ----- -----
11
20537
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: - I set password for root account via this command: # mysql -h atlantis -u root mysql
2
1808
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 encryption I would think any database containing personal and sensitive information would be stored encrypted, no?
7
4196
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 things this way because it made things easy. Well, I'm the person that has to put up with the long-term headache. Anywho, someone at work wants things sped up, so what I'm looking at doing is this for each client:
2
2514
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
3594
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 "myDB" with a table "myUsers" with fields "Username" and "Password". I also have the MySQL ODBC driver loaded with a DSN "dsnMySQL" setup. First question is can someone direct me to a site or provide a sample code for a login page that...
1
3502
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 well. I tried following these guides: http://www.digitalnerds.net/featured...mysql-backend/ http://www.howtoforge.com/vsftpd_mysql_debian_etch_p2 From the two guides it shows that crypt=0 and crypt=2 in /etc/pam.d/vsftp is no encryption and...
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.