Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpGet]
- public ActionResult Encrypted()
- {
- return View();
- }
- [HttpPost]
- public ActionResult Encrypted(HttpPostedFileBase upload1, HttpPostedFileBase upload2, string key)
- {
- string fileName1 = Path.GetFileName(upload1.FileName);
- string fileName2 = Path.GetFileName(upload2.FileName);
- upload1.SaveAs(Server.MapPath("~/Files/" + fileName1));
- Image image = Image.FromStream(upload2.InputStream);
- image.Save(Server.MapPath("~/Files/" + fileName2));
- string imagePath = Server.MapPath("~/Files/" + fileName2);
- Bitmap bmp = new Bitmap(imagePath);
- StreamReader sr = new StreamReader(Server.MapPath("~/Files/" + fileName1));
- string text = sr.ReadLine();
- text = Crypto.EncryptStringAES(text, key);
- var bmp1 = SteganoHelper.embedText(text, bmp);
- byte[] arr = bmp1.ToByteArray(ImageFormat.Bmp);
- return File(arr, "image/bmp");
- }
Add Comment
Please, Sign In to add comment