Class Crypto
- Namespace
- Dynamicweb.Security.System
Tools
- Assembly
- Dynamicweb.Core.dll
This class contains functions uses to Encrypt/Decrypt source.
- Inheritance
-
Crypto
- Implements
- Inherited Members
Remarks
Crypto is a wrapper of System.Security.Cryptography.SymmetricAlgorithm classes and simplifies the interface. It supports customized SymmetricAlgorithm as well.
Constructors
Crypto(SymmProvEnum)
Determines kind of CryptoServiceProvider algorithm.
Parameters
netSelected
SymmProv Enum Enum of kinds.
Remarks
Constructor for using an intrinsic .Net SymmetricAlgorithm class.
Crypto(SymmetricAlgorithm)
Determines custom CryptoServiceProvider algorithm.
Parameters
serviceProvider
SymmetricAlgorithm
Remarks
Constructor for using a customized SymmetricAlgorithm class.
Fields
CryptoKey
Field Value
disposed
Field Value
Methods
Decrypt(string)
Decrypts the specified value.For new scenarios use AES
Parameters
value
stringThe value.
Returns
Decrypt(string, string)
Decrypts an input source using current Key parameter.
Parameters
Returns
- string
String representation of the decrypted source.
DecryptAes(string)
Decrypts the specified value with AES.
Parameters
value
stringThe value.
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Dispose(bool)
Parameters
disposing
bool
Encrypt(string)
Encrypts the specified value. For new scenarios use AES
Parameters
value
stringThe value.
Returns
Encrypt(string, string)
Encrypts an input source using current Key parameter.
Parameters
Returns
- string
Encrypted source converted into Base64 so that the result can be used in xml.
EncryptAes(string)
Encrypts the specified value with AES.
Parameters
value
stringThe value.
Returns
EncryptPassword(string, UserPasswordHashAlgorithm)
Encrypts a string with either MD5 or SHA512 encryption according to global settings.
Parameters
password
stringThe password.
hashAlgorithm
UserPassword Hash Algorithm The hash algorithm - either SHA512 or MD5 (default).
Returns
- string
The
password
hashed with MD5 (default) or SHA512
Remarks
A string hashed with MD5 (default) or SHA512 cannot be reversed to plain text.
EncryptSha512(string, string)
Encrypts the specified value
using the salt
with SHA512.
Parameters
Returns
- string
The hashed
value
.
HexToString(string)
Converts hex values to string.
Parameters
hex
stringThe hex.
Returns
StringToHex(string)
Converts strings to hex.
Parameters
text
stringThe text.