Hi all, I'm currently learning cryptography (RC2CryptoServiceProvider). i able to encrypted and decrypt the data on the same asp page, But i'm facing some problem on passing the encrypted data to another asp page.
///////////////Default.aspx/////////////////protected void Button2_Click(object sender, EventArgs e)
{
UTF8Encoding
rc2CSP.GenerateKey();
rc2CSP.GenerateIV();
key = rc2CSP.Key;
IV = rc2CSP.IV;
toEncrypt = textConverter.GetBytes(original);
csEncrypt.Write(toEncrypt, 0, toEncrypt.Length);
csEncrypt.FlushFinalBlock();
encrypted = msEncrypt.ToArray();
/////////Default2aspx///////////
protected
TextBox1.Text = Request.QueryString[
rc2CSP.IV =
key = rc2CSP.key;
fromEncrypt =
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);
roundtrip = textConverter.GetString(fromEncrypt);
TextBox2.Text = roundtrip;
}
I'm not sure how to pass the "key" and "IV" to Default2.aspx. And the encrypted data, i able to pass to over, but it is a "String", how to convert back to array of btye?
Anybody help?? Thanks:)