using (RijndaelManaged rijAlg = new RijndaelManaged())
rijAlg.Key = Key;
rijAlg.IV = IV;
Это дает мне ошибку «Указанный ключ не является допустимым размером для этого алгоритма».
чтобы получить ключ и 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);
Кто-нибудь может помочь?
key
иiv
? - person Artjom B.   schedule 26.02.2016using (RijndaelManaged rijAlg = new RijndaelManaged()) rijAlg.Key = Key; rijAlg.IV = IV;
вам не хватает скобокusing (..) {... }
- person Valentin   schedule 26.02.2016