用于登录的加密和解密 [英] encryption and decryption for login

查看:166
本文介绍了用于登录的加密和解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个登录名和一个用户表单。我创建了用户表单,以加密格式存储用户密码。我想当用户在登录表单文本框中输入密码,然后要求解密密码表单数据库,其中userid还需要匹配并比较解密的密码和用户输入的密码。

解决方案

< blockquote>密码不被解密。事实上,它没有加密,而是''哈希''。当用户输入密码时,将其哈希并与存储在数据库中的哈希密码进行比较。如果两个字符串都匹配,那么密码是正确的。



使用SQL成员资格提供程序而不是重新编写相同的代码http://www.asp.net/web-forms / videos / how-do-i / how-do-i-set-up-sql-membership-provider [ ^ ]


查看此链接



http://www.aspdotnet-suresh.com/2010/12/introduction-here-i-will-explain-how-to_28.html [<一个href =http://www.aspdotnet-suresh.com/2010/12/introduction-here-i-will-explain-how-to_28.html\"target =_ blanktitle =New Window> ^ ]






不要加密和解密密码,你需要'h ash''密码。看看这个提示:

密码存储:怎么做。 [ ^ ]

还看看这篇文章:

The Art&存储密码科学 [ ^ ]

I create one login and one user form. I have create the user form which store the user password in encryption format. i want when user enter password in login form textbox, then require to decrypt the password form database where userid also require to match and compare the decrypted password and user entered password.

解决方案

The password is not to be decrypted. In fact it is not encrypted but ''hashed''. When the user enters the password , hash it and compare with the hashed password stored in the database. If both the strings match , then the password is correct.

Use SQL Membership provider instead of re-writing the same code again http://www.asp.net/web-forms/videos/how-do-i/how-do-i-set-up-the-sql-membership-provider[^]


check this link

http://www.aspdotnet-suresh.com/2010/12/introduction-here-i-will-explain-how-to_28.html[^]


Hi,

Don''t encrypt and decrypt a password, you need to ''hash'' a password. Have a look at this Tip:
Password Storage: How to do it.[^]
And also have a look at this article:
The Art & Science of Storing Passwords[^]


这篇关于用于登录的加密和解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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