如何更改加密密码新密码 [英] How to Change Encrepted password new password

查看:78
本文介绍了如何更改加密密码新密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaxInvestments.Account
{
    public partial class ChangePassword : System.Web.UI.Page
    {
        TaxSavingInvestmentsEntities taxEntity = new TaxSavingInvestmentsEntities();
        User userDetails = new User();
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
    }
}


听到我们有三个文本框

旧密码
新密码
确认通过

使用ado.net linq


Hear we have three textboxes

old password
new password
confirm pass

using ado.net linq

推荐答案

我将为您提供一种密码更改算法.

1.向用户询问他的现有密码.
2.使用与原始密码相同的加密技术对该值进行加密.
3.比较用户输入的值是否与数据库中的现有值匹配.
4.要求他输入并重新输入密码.
5.如果您有密码限制/条件,请检查密码强度.
6.匹配密码的输入和重新输入.
7.使用相同的加密技术对其进行加密.
8.更新数据库中的密码字段,并让用户知道他的更改已生效.

作为安全性的附加步骤,您甚至可以在步骤3成功之后向用户发送电子邮件.该电子邮件将包含一个唯一的短暂令牌来识别用户,并将用户带到一个接受新密码的页面.这样,即使某人知道现有密码也将无法更改它,因为他可能无法访问该电子邮件.

希望对您有所帮助.让我知道是否需要更多说明.
I will give you an algorithm for password change.

1. ask the user his existing password.
2. encrypt this value using same encryption technique that was used with original password.
3. Compare that the user entered value is matching the existing value in the DB.
4. Ask him to enter and re enter password.
5. Check for the password strength, if you have some constraints/criteria for that.
6. match the entry and reentry of password.
7. Encrypt this using the same encryption technique.
8. Update the password field in the DB and let the user know his change had taken effect.

As an additional step of security you can even send an email to the user after step 3 is successful. that email will contain a unique short-lived token to identify the user and will take the user to a page that will accept new password. this way even if someone know existing password will not be able to change it as he might not have access to the email.

I hope it helps. let me know if you need more clarifications.


这篇关于如何更改加密密码新密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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