数据库查询后,SHA1 密码以明文形式返回

发布于 2024-08-27 18:32:04 字数 901 浏览 6 评论 0原文

我的 aspnet_Membership 表中有 SHA1 密码和 PasswordSalt。 但是,当我从服务器运行查询(Sql 查询)时,读者会发现 该通行证已以其明文形式返回。

我想知道是否是我的 web.config 配置导致了这种情况?

<membership defaultProvider="CustomMembershipProvider" 
                userIsOnlineTimeWindow="20"
                hashAlgorithmType="SHA1">
      <providers>
        <clear/>
        <add  name="CustomMembershipProvider"
              type="Custom.Utility.CustomMembershipProvider"
              connectionStringName="MembershipDB"
              enablePasswordRetrieval="false"
              enablePasswordReset="true"
              requiresUniqueEmail="false"
              requiresQuestionAndAnswer="false"
              passwordStrengthRegularExpression=""
              minRequiredPasswordLength="1"
              minRequiredNonalphanumericCharacters="0"
              passwordFormat="Hashed"

提前致谢...

I have a SHA1 password and PasswordSalt in my aspnet_Membership table.
but, when I run a query from the server (a Sql Query), the reader reveals
that the pass has returned as its cleartext equivalent.

I am wondering if my web.config configuration is causing this?

<membership defaultProvider="CustomMembershipProvider" 
                userIsOnlineTimeWindow="20"
                hashAlgorithmType="SHA1">
      <providers>
        <clear/>
        <add  name="CustomMembershipProvider"
              type="Custom.Utility.CustomMembershipProvider"
              connectionStringName="MembershipDB"
              enablePasswordRetrieval="false"
              enablePasswordReset="true"
              requiresUniqueEmail="false"
              requiresQuestionAndAnswer="false"
              passwordStrengthRegularExpression=""
              minRequiredPasswordLength="1"
              minRequiredNonalphanumericCharacters="0"
              passwordFormat="Hashed"

thanks in advance...

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

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

发布评论

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

评论(2

带刺的爱情 2024-09-03 18:32:04

您已为会员资格提供程序使用了正确的设置(特别是 passwordFormat="hashed"),但您还具有以下行:

type="Custom.Utility.CustomMembershipProvider"

设置 passwordFormat="hashed" 仅告诉您正在使用的会员提供商希望对密码进行哈希处理。如果您使用自定义成员资格提供程序,则必须对该提供程序进行编码以遵循 passwordFormat 设置。

我 99% 确信您的密码以明文形式存储的原因是 CustomMembershipProvider 的编程目的就是这样做。

You've used the right settings for the membership provider (specifically passwordFormat="hashed"), but you also have this line:

type="Custom.Utility.CustomMembershipProvider"

Setting passwordFormat="hashed" only tells whichever membership provider you're using that you want passwords to be hashed. If you use a custom membership provider, that provider has to be coded to honour the passwordFormat setting.

I'm 99% sure that the reason your passwords are being stored in clear text is because that's what the CustomMembershipProvider is programmed to do.

吻安 2024-09-03 18:32:04

好吧,我想出了这个。答案是“是的,web.config 中有一个机制可以自动解密我的 SHA1 密码。注意:

解密=“自动”

<machineKey validationKey="MY Validateion Key"
            decryptionKey="My Decryption Key"
            validation="SHA1" decryption="Auto" />

OK, I figured this one out. The answer is "yes, there is a mechanism in web.config for decrypting my SHA1 pwd automatically. Note:

decryption="Auto"

<machineKey validationKey="MY Validateion Key"
            decryptionKey="My Decryption Key"
            validation="SHA1" decryption="Auto" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文