Overview
TheCifradosController provides encryption functionality with two approaches: basic encryption and efficient encryption. It uses the HelperCryptography helper class to perform cryptographic operations.
Methods
Index
Displays the main encryption view.Returns the Index view
/workspace/source/MvcCoreUtilidades/Controllers/CifradosController.cs:9
CifradoBasico (GET)
Displays the basic encryption form.Returns the CifradoBasico view
/workspace/source/MvcCoreUtilidades/Controllers/CifradosController.cs:14
CifradoBasico (POST)
[HttpPost] Performs basic encryption or comparison of encrypted content.The content to encrypt or compare
The encrypted result to compare against (used when action is “comparar”)
The action to perform: “cifrar” (encrypt) or “comparar” (compare)
Returns the CifradoBasico view with ViewData containing:
TEXTOCIFRADO: The encrypted text (when action is “cifrar”)MENSAJE: Comparison result message (when action is “comparar”)
- If
accionis “cifrar”: encrypts the content and setsTEXTOCIFRADOin ViewData - If
accionis “comparar”: encrypts the content and compares withresultado, setting appropriate message in ViewData
/workspace/source/MvcCoreUtilidades/Controllers/CifradosController.cs:48
CifradoEficiente (GET)
Displays the efficient encryption form.Returns the CifradoEficiente view
/workspace/source/MvcCoreUtilidades/Controllers/CifradosController.cs:19
CifradoEficiente (POST)
[HttpPost] Performs efficient encryption with salt or comparison of encrypted content.The content to encrypt or compare
The encrypted result to compare against (used when action is “comparar”)
The action to perform: “cifrar” (encrypt) or “comparar” (compare)
Returns the CifradoEficiente view with ViewData containing:
TEXTOCIFRADO: The encrypted text (when action is “cifrar”)SALT: The salt value used in encryption (when action is “cifrar”)MENSAJE: Comparison result message (when action is “comparar”)
- If
accionis “cifrar”:- Encrypts the content with
HelperCryptography.CifrarContenido(contenido, false) - Sets
TEXTOCIFRADOandSALTin ViewData
- Encrypts the content with
- If
accionis “comparar”:- Encrypts the content with
HelperCryptography.CifrarContenido(contenido, true) - Compares with
resultadoand sets appropriate message in ViewData
- Encrypts the content with
/workspace/source/MvcCoreUtilidades/Controllers/CifradosController.cs:24