Hi ..Frd....once try this code...this is decryption..:rose: private string Decrypt(string strText, string sDecrKey) { byte[] byKey; byte[] IV = {18, 52, 86, 120, 144, 171, 205, 239}; byte[] inputByteArray; // inputByteArray.Length = strText.Length; try { byKey = System.Text.Encoding.UTF8.GetBytes(sDecrKey.Substring(0, 8)); DESCryptoServiceProvider des = new DESCryptoServiceProvider(); inputByteArray = Convert.FromBase64String(strText); MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); System.Text.Encoding encoding = System.Text.Encoding.UTF8; return encoding.GetString(ms.ToArray()); } catch (Exception ex) { return ex.Message; } }
Naik M