public ActionResult Upload(FileModel model)
        {
            try
            {
                if (model.PostedFile.ContentLength > 0)
                {
                    var tripleDesEncryptor = new TripleDESEncrypt(model.Key);

                    var file = new File(System.Web.HttpContext.Current);

                    var encryptedFileContent = "";
                    using (var sr = new StreamReader(model.PostedFile.InputStream))
                    {
                        encryptedFileContent = sr.ReadToEnd();
                    }

                    var decryptedValue = tripleDesEncryptor.Decrypt(encryptedFileContent);

                    file.SetFileContent(decryptedValue);
                }

                return(View("Index"));
            }
            catch (Exception)
            {
                ViewBag.Erro = "Esta chave é inválida";
                return(View("Index"));
            }
        }
        public void WhenDecryptAWordItMustBeEqualsBefore()
        {
            var word = "Murilo";

            var encryptedWord = _tripleDesCrypt.Encrypt(word);
            var decryptedWord = _tripleDesCrypt.Decrypt(encryptedWord);

            Assert.AreEqual(word, decryptedWord);
        }