Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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'
=======================================================
C#
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.!!!!
Posted
Updated 30-Mar-12 2:15am
v2
Comments
ZurdoDev 30-Mar-12 7:59am    
Can you not alter the table and make the column bigger?
Sanjeev236 30-Mar-12 8:03am    
ya men..! i can for that i need to change the complete code.i m nvarchar datatype for storing the password.in that i have to use text. n more than that i have to make many changes in my code.
[no name] 30-Mar-12 8:16am    
<pre> tag added.

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.[^]
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900