C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Active Directory »

How to decrypt encrypted text or password in c#.net?


Posted Date: 11 Mar 2008    Resource Type: Code Snippets    Category: Active Directory
Author: Amol H. KagdeMember Level: Gold    
Rating: 1 out of 5Points: 5



How to decrypt encrypted text or password in c#.net get from database and check with entered password or text in textbox.




////databse coonection
SqlConnection con = new SqlConnection("server=ARETE-4;Initial catalog=test;uid=sa;pwd=;");
con.Open();
SqlDataAdapter ad = new SqlDataAdapter("select Name as s from contacts where id='5'", con);
DataSet ds = new DataSet();
ad.Fill(ds,"t1");
String s1 = ds.Tables[0].Rows[0][0].ToString();
// Setup the encryption object for 128-bit AES encryption.
Chilkat.Crypt crypt = new Chilkat.Crypt();
crypt.UnlockComponent("UnlockCode");
crypt.SetAlgorithmRijndael();
crypt.KeyLength = 128;
crypt.SetSecretKeyViaPassPhrase("myPassword");

// Encrypt Unicode characters (2 bytes per character)
System.Text.UnicodeEncoding enc = new System.Text.UnicodeEncoding();
TextBox1.Text =crypt.DecryptStr(crypt.DecodeBase64(s1));
String s3=TextBox1.Text;
String s2 = textBox2.Text;
if (s3 == s2)
{
Response.Write("");
}
else
{
Response.Write("");
}
}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Encrypting Passwords from Within SQL Server
Previous Resource: Login Form
Return to Discussion Resource Index
Post New Resource
Category: Active Directory


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use