private void DecryptFile(string inputFile2, string outputFile2) { try { string password = password2; // password2 is data coming through textbox System.Text.UnicodeEncoding UE = new System.Text.UnicodeEncoding(); byte[] key = UE.GetBytes(password); FileStream fsCrypt = new FileStream(inputFile2, FileMode.Open); RijndaelManaged RMCrypto = new RijndaelManaged(); RMCrypto.Padding = PaddingMode.None; CryptoStream cs = new CryptoStream(fsCrypt, RMCrypto.CreateDecryptor(key, key), CryptoStreamMode.Read); FileStream fsOut = new FileStream(outputFile2, FileMode.Create); int data; while ((data = cs.ReadByte()) != -1) fsOut.WriteByte((byte)data); fsOut.Close(); cs.Close(); fsCrypt.Close(); return; } catch(Exception e) { MessageBox.Show("Your password does not match"+e.Message); DeLoadImage_tbx.Text = ""; //Stegno image DeSaveFile_tbx.Text = ""; // Location to save data file textBox3.Text = ""; // textbox control for accepting password } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)