p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > PHP/MySQL > PHP Databases
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2009, 10:06 PM
Authorized User
Points: 175, Level: 3
Points: 175, Level: 3 Points: 175, Level: 3 Points: 175, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2008
Location: London
Posts: 37
Thanks: 1
Thanked 5 Times in 5 Posts
Default mysql_connect password encryption

Hi All

I am a bit concerned about storing my MySQL password as plain-text in PHP source code while calling php_connect().

Are there any measure or workaround where I can put encrypted password while connecting to my database?

Any help will be much appreciated.

Thanks & regards

Zeronexxx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old March 9th, 2009, 05:01 PM
Friend of Wrox
Points: 837, Level: 11
Points: 837, Level: 11 Points: 837, Level: 11 Points: 837, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: London, , United Kingdom.
Posts: 151
Thanks: 2
Thanked 32 Times in 32 Posts
Default

There are functions in PHP which you can use to encrypt and decrypt strings, such as MCrypt (http://uk.php.net/manual/en/book.mcrypt.php). These can be used so you don't have to put the password in the raw source file.
However, if an attacker gets in to your server and can see the encrypted password in the source file, they can just as (or more) easily see the method in which it is encrypted. It wouldnt take them a minute to decrypt it themselves and have access to the database.

It would be better to spend time ensuring access to the server itself is secure.

Hope this helps
Phil
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to philip_cole For This Useful Post:
zeronexxx (March 10th, 2009)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Password encryption and storage in the database. zaheerabbas.sk ASP.NET 1.0 and 1.1 Basics 4 July 30th, 2008 06:03 AM
Storing password using encryption from JAVA inderjeet_79 Java Databases 3 October 11th, 2007 05:11 AM
Password encryption decryption, storage in databas zaheerabbas.sk ASP.NET 1.0 and 1.1 Professional 1 April 25th, 2007 03:15 AM
password encryption angshujit ASP.NET 2.0 Basics 1 January 4th, 2007 03:34 PM
password encryption kosla78 Classic ASP Professional 6 July 12th, 2006 04:50 PM



All times are GMT -4. The time now is 11:33 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc