数据库查询后,SHA1 密码以明文形式返回
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您已为会员资格提供程序使用了正确的设置(特别是
passwordFormat="hashed"
),但您还具有以下行:设置
passwordFormat="hashed"
仅告诉您正在使用的会员提供商希望对密码进行哈希处理。如果您使用自定义成员资格提供程序,则必须对该提供程序进行编码以遵循passwordFormat
设置。我 99% 确信您的密码以明文形式存储的原因是
CustomMembershipProvider
的编程目的就是这样做。You've used the right settings for the membership provider (specifically
passwordFormat="hashed"
), but you also have this line: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 thepasswordFormat
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.好吧,我想出了这个。答案是“是的,web.config 中有一个机制可以自动解密我的 SHA1 密码。注意:
OK, I figured this one out. The answer is "yes, there is a mechanism in web.config for decrypting my SHA1 pwd automatically. Note: