登录页面与htpasswd的 - 哪个更安全? [英] Login page vs. htpasswd - Which is more secure?

查看:236
本文介绍了登录页面与htpasswd的 - 哪个更安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

这篇关于登录页面与htpasswd的 - 哪个更安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆