It will Help you.......
In the Decryption Class file you need to create one more method and in that you have to declare defualtly one value to that keyvalue. And pass that value as decryption method arguments.
like below
In Decryption Class page code.....
public Security()
{
lscryptoKey = "ChangeThis!";
}
public String psDecrypt(String sQueryString,string key)
{
Byte[] buffer;
TripleDESCryptoServiceProvider loCryptoClass =new TripleDESCryptoServiceProvider();
MD5CryptoServiceProvider loCryptoProvider = new MD5CryptoServiceProvider();
try
{
buffer = Convert.FromBase64String(sQueryString);
loCryptoClass.Key = loCryptoProvider.ComputeHash(ASCIIEncoding.ASCII.GetBytes(key));
loCryptoClass.IV = lbtVector;
return Encoding.ASCII.GetString(loCryptoClass.CreateDecryptor().TransformFinalBlock(buffer, 0, buffer.Length));
}
catch(Exception ex)
{
throw ex;
}
finally
{
loCryptoClass.Clear();
loCryptoProvider.Clear();
loCryptoClass = null;
loCryptoProvider = null;
}
}
in Your .CS page code.....
protected void btnsave_Click(object sender, EventArgs e)
{
if (txtusername1.Text.ToString() != "" || txtno.Text.ToString() != "")
{
objloginpl.username = txtusername1.Text.ToString();
objloginpl.phoneno= txtno.Text.ToString();
DataTable dtcheck = new DataTable();
dtcheck = objloginbal.getforgotpsswrd(objloginpl);
string str_decryptpwd;
str_decryptpwd = objSecurity.psDecrypt(dtcheck.Rows[0]["password"].ToString(),"ChangeThis!" );
}
else
{
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Result", "alert('Please enter username or moblie no');", true);
}
}