Why should I make password as hash code,then save in database?

I wanna program secure login system by php,So I surfed the web for some days and get good recommendation that provide how to do it.

But I have a question about one of the tips, Why should I save users password as hash code in database?

If some one can hack my website or database,it can access to my database,and it's not so important for him/her to has users password.He/She can access all of users information.so what is the benefit of doing it?

Answers


For some forms of attack, the attacker might only gain access to one specific table at a time.

If that table is your users table, then the attacker can see the passwords in plain text and you're completely hosed.


Need Your Help

Wordpress pretty permalinks fail over SSL - 404 File does not exist

django wordpress apache ssl php-fpm

I am unable to get wordpress pretty permalinks to work on an Ubuntu server with Apache, Django and SSL. The configuration works fine if I disable SSL, but fails with it enabled. With SSL enabled, e...

C++: Continue execution after SIGINT

c++ windows copy-paste trap sigint

Okay, I am writing a program that is doing some pretty heavy analysis and I would like to be able to stop it quickly.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.