Пример #1
0
        public IActionResult CifradoHash
            (String contenido, String resultado, String accion)
        {
            String res = CypherService.EncriptarTextoBasico(contenido);

            //SOLAMENTE SI ESCRIBIMOS EL MISMO CONTENIDO
            //TENDRIAMOS LA MISMA SECUENCIA DE SALIDA
            if (accion.ToLower() == "cifrar")
            {
                ViewData["RESULTADO"] = res;
            }
            else if (accion.ToLower() == "comparar")
            {
                //COMPARAMOS LA CAJA DE TEXTO resultado
                //CON EL DATO YA CIFRADO DE NUEVO res
                //contenido = 12345  --> resultado = 243rea
                //comparar:
                //contenido = 1234556  -->  res = 243redsaa, resultado = 243rea
                if (resultado != res)
                {
                    ViewData["MENSAJE"] =
                        "<h1 style='color:red'>No son iguales</h1>";
                }
                else
                {
                    ViewData["MENSAJE"] =
                        "<h1 style='color:blue'>Iguales</h1>";
                }
            }


            return(View());
        }
Пример #2
0
        public IActionResult CifradoHash(string contenido, string resultado, string accion)
        {
            var res = CypherService.EncriptarTextoBasico(contenido);

            if (accion.ToLower() == "cifrar")
            {
                ViewBag.Resultado = res;
            }
            else if (accion.ToLower() == "comparar")
            {
                if (resultado != res)
                {
                    ViewBag.Mensaje = "Resultados NO iguales";
                }
                else
                {
                    ViewBag.Mensaje = "Resultados iguales";
                }
            }
            return(View());
        }