473,413 Members | 2,043 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,413 software developers and data experts.

encrypt php code?

Hi all, I'm running a message board php app and one of the php files
stores a username and password. That file is not encrypted, so anyone
can actually get that username and password if they can get to the
file...

I did not develop the php bulletin board and am pretty new to php.

Does anyone have any suggestions on how I could protect that
file/information?

It now sits on a RH 8, Apache2.0.48, PHP 4.3.4

Thanks in advance for any help.

Sincerely,
CoralineSage
Jul 17 '05 #1
5 3500
use crypt() function
http://ca.php.net/crypt

Savut

"CoralineSage" <FV**********@spammotel.com> wrote in message
news:9d**************************@posting.google.c om...
Hi all, I'm running a message board php app and one of the php files
stores a username and password. That file is not encrypted, so anyone
can actually get that username and password if they can get to the
file...

I did not develop the php bulletin board and am pretty new to php.

Does anyone have any suggestions on how I could protect that
file/information?

It now sits on a RH 8, Apache2.0.48, PHP 4.3.4

Thanks in advance for any help.

Sincerely,
CoralineSage


Jul 17 '05 #2
Store in MySQL?
"CoralineSage" <FV**********@spammotel.com> wrote in message
news:9d**************************@posting.google.c om...
Hi all, I'm running a message board php app and one of the php files
stores a username and password. That file is not encrypted, so anyone
can actually get that username and password if they can get to the
file...

I did not develop the php bulletin board and am pretty new to php.

Does anyone have any suggestions on how I could protect that
file/information?

It now sits on a RH 8, Apache2.0.48, PHP 4.3.4

Thanks in advance for any help.

Sincerely,
CoralineSage

Jul 17 '05 #3
CoralineSage wrote:
Hi all, I'm running a message board php app and one of the php files
stores a username and password. That file is not encrypted, so anyone
can actually get that username and password if they can get to the
file...

(...)
Does anyone have any suggestions on how I could protect that
file/information?


Is this file parsed as a php file? What extension does it have?

Try calling the file via http://path/to/your/file

If there's no output, You're fine (well, at least rather fine).
If Yes, and the output contains sensitive data:
* give it a .php extension (check for dependent files)
or
* put it below Your www-root, so it can't be requested via http.

Hint:
If anyone can read the contents of the file via ftp, You have other
things to worry about than Your bulletin password ...

Rudi
Jul 17 '05 #4
Rudolf Horbas <rh*****@gmx.net> wrote in message news:<c2**********@svr7.m-online.net>...
CoralineSage wrote:
Hi all, I'm running a message board php app and one of the php files
stores a username and password. That file is not encrypted, so anyone
can actually get that username and password if they can get to the
file...

(...)
Does anyone have any suggestions on how I could protect that
file/information?


Is this file parsed as a php file? What extension does it have?

Try calling the file via http://path/to/your/file

If there's no output, You're fine (well, at least rather fine).
If Yes, and the output contains sensitive data:
* give it a .php extension (check for dependent files)
or
* put it below Your www-root, so it can't be requested via http.

Hint:
If anyone can read the contents of the file via ftp, You have other
things to worry about than Your bulletin password ...

Rudi


Hi Rudi, I'm sorry if I wasn't clear or failed to provide sufficient
info. The file has a php extension already and it's actually called
indirectly by the bulletin app. If I try to bring it up I see nothing
but html header info (when I source the page).

My ftp is closed also, so no problem there. I guess my main concern
was really that someone would walk up to my computer and browse the
files there and get the information out of the file...I know I can set
system passwords and all that stuff, but what I was really looking for
was to encrypt the file so that someone who had physical access to it
couldn't read it. I know it's a bit of paranoia, but it isn't my
paranoia...

Anyhow, thanks for the info and willingness to help. I really
appreciate it.

And thanks Savut and Hayden Kirk for the suggestions. I'm going to
look into it and see what's my best (read: easiest) option :)

Sincerely,
CoralineSage

Sincerely, CoralineSage
Jul 17 '05 #5
CoralineSage wrote:

I guess my main concern was really that someone would
walk up to my computer and browse the files there
and get the information out of the file...


Store a MD5 hash of the password rather than the plaintext password, and
when someone logs in, compare the MD5 hash of what they have submitted
with the MD5 hash stored in the user profile.

That's the simplest thing to do.

You should also consider storing this information in a database rather
than a flat file.

Good luck.

bblackmoor
2004-03-10
Jul 17 '05 #6

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

Similar topics

1
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
1
by: Benoît | last post by:
Hi, I have generated two keys : "C:>openssl req -nodes -new -x509 -keyout ben.key -out ben.crt -days 3650" I try to encrypt/decrypt a string like "JOHN" with these asymetrics keys. With the...
20
by: Drebin | last post by:
It's a long story really, but the bottom line is we need to encrypt or obfuscate a clear-text 9-digit SSN/taxpayer ID into something less than 21 characters. It doesn't need to be super-secure,...
8
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
1
by: Tommy | last post by:
I want to encrypt the values of my cookies. I found out that I could create a FormsAuthenticationTicket, and use the FormsAuthentication.Encrypt method to encrypt the cookie. However, I do not...
8
by: toupeira23 | last post by:
Hello, I'm trying to encrypt passwords in my app. After discovering that there's no simple function to do this, I wrote a wrapper class which decodes a string using UTF8, encrypts it with...
4
by: Islamegy® | last post by:
I give up.. I tried everything to encrypt querystring and decrypt it back but this never success.. i use RSA encryption. I always get excption when Convert fromBase64String so i tried...
2
by: fineman | last post by:
Hi all, I want to get a 64bit(8 bytes) Encrypt result use DES class in the VS2005. Though I encrypt data is 64bit(8 bytes), but DES return encrypt result that always is 128bit(16 bytes), I don't...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
0
by: lildiapaz | last post by:
Hi, everyone I'm developing a c# windows application that allows the user to encrypt any file type. i would like to encrypt the file using a powerful encrypting algorithm. I've tried to use the...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.