| Author |
Message |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Tue Apr 27, 2004 5:32 pm |
|
base_64 encode any perl or php file.
Here is a cool tool I ran accross while browsing the php manual comments.
This is of most interest if you are wanting to encode you config.php from prying eyes. In fact you could encode an entire script if you wanted. Requires Zlib on the webserver.
One online version and one for download.
|
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Tue Apr 27, 2004 5:35 pm |
|
I should add the compression ain't shabby either one default config.php
before 4.02 KB
after 2.26 KB
Edit:
mainfile.php (I put a few extra lines in it).
before 42.8 KB
after 14.8 KB |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Tue Apr 27, 2004 7:21 pm |
|
Just imagine you've come home late or gotten up early and your brain hasn't kicked in yet. You decide to make a change in config. php. You open up your editor and you see the base64_encoded file. You breathe heavily. You then reach over and just unplug your computer, hoping that when you try it later it will be well.  |
|
|
|
 |
darksied Hangin' Around

Joined: Jan 27, 2004 Posts: 25 Location: New Jersey
|
Posted:
Fri Jan 28, 2005 12:20 am |
|
Ok does this mean that we can use this as a way to protect our config.php files or is it a bad thing i tried it and i can still use my site. i made a backup copy of course of the config.php i really wanted to move the config file but cant seem to find any about that but i did read something once about how to move it out side of the public_html folder |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Fri Jan 28, 2005 7:30 am |
|
You can try moving it but once in a while there are problems with addons that look for it to grab the DB info ect...
encoding this way is reversable as pointed out in several other threads. But it does make it one more step
You can put it above the webroot someplace like
/usr/home/username/safe/config.ini
If your website is in /usr/home/username/public_html
Then in your webroot config.php put
<?php include("../safe/config.ini"); ?>
Really if the file is 0644 or 0600 it shouldn't be read unless there is some larger problem already. |
|
|
|
 |
darksied Hangin' Around

Joined: Jan 27, 2004 Posts: 25 Location: New Jersey
|
Posted:
Fri Jan 28, 2005 10:04 am |
|
Tried moving it but got errors i will settle for 0600 and base 64 for now till you smarter people can come up with something else or better.
thanks for the help. |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Fri Jan 28, 2005 10:15 am |
|
Like PHreekie said in another thread don't use the same usename and password for your DB as you do for your CPanel, FTP, Webmail ect... because somehow someday someone will see it especially on a shared server environment. |
|
|
|
 |
|
|
|
|