[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

php in windows

I have a php code run on windows I have only one machine i dont want my staff to know password  how can i conceal config.php which keep my sql user name and password from mystaff
0
teera
Asked:
teera
  • 3
  • 2
  • 2
  • +4
5 Solutions
 
Mohamed AbowardaSoftware EngineerCommented:
You will have to store the username and password in more secure place, I recommend you to store them in database and use MD5 hash.
0
 
teeraAuthor Commented:
Hi Medo3337
 If i encript it only that file it work or not and how can i encrypt it
thank
0
 
Mohamed AbowardaSoftware EngineerCommented:
To encrypt the password with MD5 hash use php md5() function

example:
$password = "This variable will store the original password";
$password = md5($password);

Now $password contains the encrypted password.

I don't recommend you to save your login information into PHP file.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
dsmileCommented:
I think what teera needs is prevent others from viewing his "MySQL Account" (which is written in config.php to connect to DB)
If I'm right, then teera needs some kind of sourcecode encoding, so that other can't view it.

Some recommendation: Ioncube, Zend Guard (all non-free unfortunately)
0
 
teeraAuthor Commented:
Hi experts

Are there any software is free I need only encript 2 or 3 file
0
 
Lukasz ChmielewskiCommented:
It is not that simple. Is your skilled with computers / programming ?
Either you encrypt the file as dsmile says or you could buy another machine (or for that matter put a virtual one) and install a web server there with proper permissions. The machine you have now would have just an access to view the page / application.
0
 
ajaikkumarCommented:
Encrypt and store in config file... the simple one
0
 
Beverley PortlockCommented:
IF they have access to the PC in question then, ultimately, there is nothing you can do.

In securing systems the first rule is to restrict physical access to the machine because anyone in the room with it can do what they like. Even if you password protected the machine they could reboot it using a "Live CD" or an OS on a memory key and then read whatever files they wished. Chnaging the OS to Mac or Linux would make no difference either. If you stripped the machine down and removed all CDs, floppies, USB connectors, etc then you still would not be secure because it only takes a few seconds to pop the lid and remove the hard drive.

I know this seems extreme, but it makes the point - as long as other have physical access to the machine then data stored on it cannot be secure. Your only hope would be to add encryption software and encrypt the entire hard disk and then never give the encryption key out for any reason and never let anyone else use the PC either.

Personally, I would rent a low cost VM on an external server and put everything on it instead and logon with SSH.
0
 
Scott MadeiraCommented:
If your concern is with the other people knowing your MySQL username and password for the database then I suggest you create an additional user in the database with what ever rights they need for the data and give that username and password to your employees.  this is what would be in the config.php file.

You would have the root/admin username and password available to you if you ever needed to access the database outside of your application.

When your employees no longer need access to the database you can delete the new username/password.
0
 
Mohamed AbowardaSoftware EngineerCommented:
Put config.php in a folder and set the access permissions for that folder, so your staff wouldn't be able to access it.
0
 
Beverley PortlockCommented:
For all of you who think that changing a password on a machine that is not physically secured, here is how to reset ANY MySQL password including the root password

"If you set a root password previously, but have forgotten it, you can set a new password. The following sections provide instructions for Windows and Unix systems, as well as generic instructions that apply to any system. "

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-windows

Notice that this is listed in the MySQL on line manuals - I'm not leaking secrets here.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now