<
machineKey
validationKey
="8BD03A8A935E2B78ECE7EAB6D498EA5E55AB7C07840D5DFC4EDBF67D5490BAE46BE9D37E6A0EF3C89C87CD216A91D9A2"
decryptionKey ="698DFA6663F8A3F30A7B5F3CCF30825EAA73159611F983C1" validation ="SHA1" />
< membership defaultProvider ="AspNetSqlProvider" >
< providers >
< add connectionStringName ="connStr" minRequiredPasswordLength ="6" enablePasswordRetrieval ="true" passwordFormat ="Encrypted"
minRequiredNonalphanumericCharacters ="0" name ="AspNetSqlProvider"
type ="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</ providers >
</ membership >
decryptionKey ="698DFA6663F8A3F30A7B5F3CCF30825EAA73159611F983C1" validation ="SHA1" />
< membership defaultProvider ="AspNetSqlProvider" >
< providers >
< add connectionStringName ="connStr" minRequiredPasswordLength ="6" enablePasswordRetrieval ="true" passwordFormat ="Encrypted"
minRequiredNonalphanumericCharacters ="0" name ="AspNetSqlProvider"
type ="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</ providers >
</ membership >
enablePasswordRetrieval="true" 启用密码查询
passwordFormat="Encrypted"
PasswordFormat 属性指示存储密码的格式。密码可以采用 Clear、Encrypted 和 Hashed 密码格式存储。Clear 密码以明文形式存储,这可以提高存储和检索密码的性能,但安全性较差,当数据源安全性受到威胁时此类密码很容易被读取。Encrypted 密码在存储时进行了加密,可以在比较或检索密码时进行解密。此类密码在存储和检索时需要进行额外的处理,但比较安全,在数据源的安全性受到威胁时不容易被获取。Hashed 密码在存储到数据库时使用单向哈希算法和随机生成的 salt 值进行哈希处理。在验证某一密码时,将用数据库中的 salt 值对该密码进行哈希计算以进行验证。无法检索哈希密码。
passwordFormat="Encrypted" 这样设置时,需要machineKey,因此:
<machineKey validationKey="8BD03A8A935E2B78ECE7EAB6D498EA5E55AB7C07840D5DFC4EDBF67D5490BAE46BE9D37E6A0EF3C89C87CD216A91D9A2"
decryptionKey="698DFA6663F8A3F30A7B5F3CCF30825EAA73159611F983C1" validation="SHA1" />