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

问题描述

任何人都知道如何加密登录表的密码以及如何对其进行解密..
在登录时. ???

[edit]仅限主题:不要大喊大叫.使用所有大写字母被认为是在互联网上大喊大叫,并且粗鲁(使用所有小写字母被认为是幼稚的).如果要认真对待,请使用大写字母. -OriginalGriff [/edit]

Any one know that how to encrypt the password for login Table and how to dycrypt it..
At the the Login Time. ???

[edit]Subject only: DON''T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously. - OriginalGriff[/edit]

推荐答案


ProtectedData

类.


class.


public static string ProtectPassword(string password)
{
    byte[] bytes = Encoding.Unicode.GetBytes(password);
    byte[] protectedPassword = ProtectedData.Protect(bytes, null, DataProtectionScope.CurrentUser);
    return Convert.ToBase64String(protectedPassword);
}

public static string UnprotectPassword(string protectedPassword)
{
    byte[] bytes = Convert.FromBase64String(protectedPassword);
    byte[] password = ProtectedData.Unprotect(bytes, null, DataProtectionScope.CurrentUser);
    return Encoding.Unicode.GetString(password);
}


这篇关于如何在登录表上加密密码和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 14:30