表单身份验证票证加密 [英] form authentication ticket encryption
问题描述
使用以下加密代码,我正在加密密码.但是我无法将输出存储在数据库中,导致其太大.喜欢
ADMIN =''62A67FEAD09E656F8B01D88C3ADED42F04E538D3039DE04
D70C0CB448EA773FDF4992585556560F1F1B343C938EAF03820D06
AE998BCCB5462B79DE2116BB072A83A96405A774E1E1D779398847
9BF43''
================================================== =====
Using following encryption Code,i am encrypting my password.but i m unable to store the output in database cause its too big. Like for
ADMIN=''62A67FEAD09E656F8B01D88C3ADED42F04E538D3039DE04
D70C0CB448EA773FDF4992585556560F1F1B343C938EAF03820D06
AE998BCCB5462B79DE2116BB072A83A96405A774E1E1D779398847
9BF43''
=======================================================
FormsAuthenticationTicket Ftk =
new FormsAuthenticationTicket("ADMIN",true,1);
return FormsAuthentication.Encrypt(Ftk);
================================================== =====
关于缩短加密数据或其他任何加密算法的长度的任何建议.
谢谢!!
=======================================================
any suggestion to shorten the length of encrypted data or any other encryption algorithm.
THANKS IN ADVANCE.!!!!
推荐答案
不要加密密码-请改用哈希算法.这里有一些有关如何执行此操作的信息:密码存储:如何进行 [ ^ ]
Don''t encrypt passwords - use a Hashing algorithm instead. There is some information on how to do it here: Password Storage: How to do it.[^]
我同意Griff,但是如果您确实需要能够恢复/解密密码,
看看 System.Security.Cryptography [
I agree with Griff, but if you really need to be able to restore/decrypt password,
take alook at System.Security.Cryptography[^] namespace. There are few encryption algorithms you can choose from, try TripleDES or AES.
Remember that you must keep encryption key safe - otherwise you have big security risk.
这篇关于表单身份验证票证加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!