登录页面与htpasswd的 - 哪个更安全?页面、安全、htpasswd

由网友(柠檬校草。)分享简介:给出一个简单的登录系统(注册和登录),在两种选择中的哪一个更安全的:Given a simple login system (register and login), which of the two choices is more secure:使用htaccess以及htpasswd的文件来存储和验证用户使用P...

给出一个简单的登录系统(注册和登录),在两种选择中的哪一个更安全的:

Given a simple login system (register and login), which of the two choices is more secure:

使用htaccess以及htpasswd的文件来存储和验证用户 使用PHP的CRUD和MySQL(或任何其他数据库真的)来存储信息

用户信息完全由用户名密码。

User info consists purely of username-password.

当然,最好的情况,假设这两个选项:MySQL的注射占了,密码是MD5 / SHA1 / MD5 + SHA1 /任何其他方式加密,等

Of course, best-case is assumed for both options: MySQL injections are accounted for, password is md5/sha1/md5+sha1/any other means encrypted, etc.

如果你想知道,在第一种情况下,PHP将增加用户凭据htpasswd的文件。 (见的示例实现,这的问题。)

In case you're wondering, in the first case, php will add user credentials to the htpasswd file. (see this question for an example implementation.)

推荐答案

我一直说的登录表单(我假定你的意思是标准的基于会话的身份验证)。

I'd say always the login form (by which I assume you mean standard session-based authentication).

的.htaccess 验证在每次请求发送的密码(当然,SSL将帮助这里)

.htaccess authentication transmits the password on every request (Of course, SSL would help here)

的.htaccess 认证没有任何限速默认/蛮力保护的Apache

.htaccess authentication doesn't have any rate limiting / brute-force protection by default in Apache

日志从的.htaccess 认证的是婊子的

Logging out from .htaccess authentication is a bitch

阅读全文

相关推荐

最新文章