Overview
TheHelperCryptography class provides static methods for encrypting and hashing content using SHA512 and SHA1 algorithms. This helper is used for secure password storage and basic text encryption.
Namespace: MvcCoreUtilidades.Helpers
Properties
Salt
Methods
CifrarContenido
The content to be encrypted
If
false, generates a new salt. If true, uses the existing salt value from the Salt property for comparison purposesstring - The encrypted content as a Unicode string
Usage:
EncriptarTextoBasico
The content to be encrypted
string - The encrypted content as a Unicode string
Usage:
Implementation Details
- Salt Generation: When
compararisfalse, a random 30-character salt is generated using ASCII characters (1-255) - SHA512 Hashing: The
CifrarContenidomethod applies SHA512 hashing 12 times for increased security - SHA1 Hashing: The
EncriptarTextoBasicomethod applies SHA1 hashing once - Encoding: All methods use Unicode encoding for string conversions