using (RijndaelManaged rijAlg = new RijndaelManaged())
rijAlg.Key = Key;
rijAlg.IV = IV;
This gives me an error "Specified key is not a valid size for this algorithm."
to get Key and IV
string checkPass = "select password from UserName where Username = '" + TBLoginUser.Text + "'";
SqlCommand pass = new SqlCommand(checkPass, conn);
string password = pass.ExecuteScalar().ToString();
string checkKey = "select encKey from UserName where Username = '" + TBLoginUser.Text + "'";
SqlCommand k = new SqlCommand(checkKey, conn);
string key = k.ExecuteScalar().ToString();
string checkIV = "select encIV from UserName where Username = '" + TBLoginUser.Text + "'";
SqlCommand x = new SqlCommand(checkIV, conn);
string iv = x.ExecuteScalar().ToString();
byte[] keyByte = Encoding.ASCII.GetBytes(key);
byte[] ivByte = Encoding.ASCII.GetBytes(iv);
Anyone can help?