当明文密码未存储在 Web 服务生产商上时,PasswordDigest 的替代方案是什么?

发布于 2024-09-06 13:11:13 字数 1327 浏览 13 评论 0原文

场景

Web 服务生产者仅在数据库中存储密码的 SHA-1 哈希值。我们需要使用用户名/密码组合来验证 Web 服务用户。


Web 服务安全UsernameToken Profile 允许我们为此目的添加肥皂标头:

该元素是 WSS 中引入:SOAP 消息 安全文件作为一种方式 提供用户名。

在元素内,a 元素可能是 指定的。密码类型 密码文本和密码摘要是 不限于实际密码, 虽然这是一个常见的情况。 (146-151)< /a>

PasswordText 密码类型意味着密码以纯文本形式通过线路发送,如果我们不使用传输级别安全机制,这将是一个安全问题。 PasswordDigest 避免发送纯文本密码并发送哈希值。但为了避免重放攻击(即攻击者使用窃听来捕获散列密码并通过另一个请求重新发送),PasswordDigest 在计算散列之前向密码添加时间戳和随机数。此添加导致以下限制:

请注意,PasswordDigest 只能 如果使用纯文本密码(或 密码等效)可用 向请求者和请求者双方 接受者。 (196-197)< /a>


但在我们的例子中,我们没有纯文本密码。 我的问题是:除了在服务器上提供纯文本密码之外,我们还有什么替代方法?

Scenario:

Web-service producer have only SHA-1 hash of passwords stored in database. We need to authenticate Web-service users using User Name/Password combination.


Web Services Security UsernameToken Profile allows us to add soap headers for this purpose:

The element is
introduced in the WSS: SOAP Message
Security documents as a way of
providing a username.

Within element, a
element may be
specified. Passwords of type
PasswordText and PasswordDigest are
not limited to actual passwords,
although this is a common case.
(146-151)

PasswordText password type means that password is sent over the wire as plain text which is a security issue if we are not using Transport Level Security mechanisms. PasswordDigest avoids sending plain text passwords and sends a hash. But to avoid replay attack (i-e attacker using wiretap to capture the hashed password and resend it with another request) the PasswordDigest adds a timestamp and a random number to password before computing the hash. This addition results in following restriction:

Note that PasswordDigest can only
be used if the plain text password (or
password equivalent) is available
to both the requestor and the
recipient. (196-197)


But in our case we do not have plain text password.
My question is: what alternates do we have other that to make plain text passwords available on the server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆躺在深渊里 2024-09-13 13:11:13

SHA-1 可以完美地用作“明文”密码。

  • 询问用户密码
  • 将其转换为 SHA-1
  • 通过 PasswordDigest 运行它,
  • 服务器将对数据库中的 SHA-1 执行相同的
  • 操作,服务器将发现它们匹配并允许访问

The SHA-1 can be perfectly used as a "plaintext" password.

  • Ask the user the password
  • convert it to SHA-1
  • run it throught the PasswordDigest thing
  • the server will do the same with the SHA-1 in the database
  • the server will find that they match and allow access
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文