Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have stored my username and passwords in userinfo.php file.

Someone has told me that it is not a secure way to store passwords etc.
He told me that it is possible to read that file by some one else.

I am so confused.

I know that Web Server execute the PHP code and only send the HTML to the browser.
Then How it is possible to get the PHP code?

I can't understand How some one can read my php file.
Can Some one explain me briefly?
Posted
Updated 9-May-11 9:46am
v2
Comments
Dalek Dave 9-May-11 15:47pm    
Edited for Readability.

How many people do you think have access to the web server? It's more than you think...
Where on the server did you put the file?
What are the access permissions on the file? On the Folder?

Never store passwords in clear: it is always a security risk.
There is some info (c# code, but the discussion is well worth reading) here: Password Storage: How to do it.[^]
 
Share this answer
 
Comments
Dalek Dave 9-May-11 15:47pm    
Good answer, 5.
Sergey Alexandrovich Kryukov 9-May-11 22:47pm    
All correct, a 5. Password does not have to be stored, in fact.
--SA
Kim Togo 10-May-11 2:45am    
My 5. Hash is good.
Joan M 10-May-11 14:12pm    
My 5... nice answer...
The only way to steal you PHP file source code. Is the same way you up or download your website or if someone that is controlling the web server begins to look around.

Check out Zend Guard[^] a PHP encoding and obfuscation
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-May-11 22:48pm    
Kim, obfuscation is certainly a wrong way about security. Griff's right.
This is a password. It does not have to be stored.
--SA
OriginalGriff 10-May-11 2:42am    
Who is John? Did an answer get deleted?
Sergey Alexandrovich Kryukov 10-May-11 13:12pm    
Probably it's my mistake, and I meant you.
Sorry, Griff.
--SA
Kim Togo 10-May-11 2:45am    
SA, I was only focused on PHP code, not that there were saved username and password in php file. :-)
But yes OriginalGriff is correct. Never store plain password text.
Sergey Alexandrovich Kryukov 10-May-11 13:14pm    
I still think the obfuscation of PHP on the server makes no sense, but this is not really a programming controversy.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900