C# Class nHydrate.Generator.Common.Util.CryptoHelper

basic Encrption/decryption functionaility
Mostrar archivo Open project: nHydrate/nHydrate

Public Methods

Method Description
CryptoHelper ( ) : System
CryptoHelper ( CryptoTypes CryptoType ) : System
Decrypt ( string inputText ) : string

decrypts a string

Decrypt ( string inputText, CryptoTypes cryptoType ) : string

decrypts a string acc. to the decryption type

Decrypt ( string inputText, string password ) : string

decrypts a string using a user defined password key

Decrypt ( string inputText, string password, CryptoTypes cryptoType ) : string

decrypts a string acc. to decryption type and user defined password key

Encrypt ( string inputText ) : string

Encrypt a string

Encrypt ( string inputText, CryptoTypes cryptoType ) : string

Encrypt string acc. to cryptoType

Encrypt ( string inputText, string password ) : string

Encrypt string with user defined password

Encrypt ( string inputText, string password, CryptoTypes cryptoType ) : string

Encrypt string acc. to cryptoType and with user defined password

Private Methods

Method Description
EncryptDecrypt ( byte inputBytes, bool Encrpyt ) : byte[]

performs the actual enc/dec.

calculateNewKeyAndIV ( ) : void

calculates the key and IV acc. to the symmetric method from the password key and IV size dependant on symmetric method

getCryptoTransform ( bool encrypt ) : ICryptoTransform

returns the symmetric engine and creates the encyptor/decryptor

selectAlgorithm ( ) : SymmetricAlgorithm

returns the specific symmetric algorithm acc. to the cryptotype

Method Details

CryptoHelper() public method

public CryptoHelper ( ) : System
return System

CryptoHelper() public method

public CryptoHelper ( CryptoTypes CryptoType ) : System
CryptoType CryptoTypes
return System

Decrypt() public method

decrypts a string
public Decrypt ( string inputText ) : string
inputText string string to decrypt
return string

Decrypt() public method

decrypts a string acc. to the decryption type
public Decrypt ( string inputText, CryptoTypes cryptoType ) : string
inputText string string to decrypt
cryptoType CryptoTypes type of decryption
return string

Decrypt() public method

decrypts a string using a user defined password key
public Decrypt ( string inputText, string password ) : string
inputText string string to decrypt
password string password to use when decrypting
return string

Decrypt() public method

decrypts a string acc. to decryption type and user defined password key
public Decrypt ( string inputText, string password, CryptoTypes cryptoType ) : string
inputText string string to decrypt
password string password key used to decrypt
cryptoType CryptoTypes type of decryption
return string

Encrypt() public method

Encrypt a string
public Encrypt ( string inputText ) : string
inputText string text to encrypt
return string

Encrypt() public method

Encrypt string acc. to cryptoType
public Encrypt ( string inputText, CryptoTypes cryptoType ) : string
inputText string text to encrypt
cryptoType CryptoTypes type of encryption
return string

Encrypt() public method

Encrypt string with user defined password
public Encrypt ( string inputText, string password ) : string
inputText string text to encrypt
password string password to use when encrypting
return string

Encrypt() public method

Encrypt string acc. to cryptoType and with user defined password
public Encrypt ( string inputText, string password, CryptoTypes cryptoType ) : string
inputText string text to encrypt
password string password to use when encrypting
cryptoType CryptoTypes type of encryption
return string