Exemplo n.º 1
0
        public ActionResult Decrypt(Encrypt decrypt)
        {
            GenericEncryption.key    = decrypt.Key;
            GenericEncryption.vector = decrypt.Vector;
            var output = GenericEncryption.Decrypt(decrypt.Data, LevelEncrypt.medium);

            return(Json(output, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public void GenericEncryptionTest()
        {
            string str     = "ciaooo";
            string encoded = GenericEncryption.FromString(str, 50);
            string decoded = GenericEncryption.FromEncryptedString(encoded);

            Assert.AreEqual(str, decoded);
        }