Craig's Utility Library  4.0 Beta
Utilities.IO.Encryption.Manager Class Reference

Compression manager More...

Public Member Functions

 Manager (IEnumerable< IAsymmetric > Asymmetric, IEnumerable< IHasher > Hashers, IEnumerable< IShift > Shifts, IEnumerable< ISymmetric > Symmetric)
 Constructor More...
 
string CreateKey (bool PrivatePublic)
 Creates a new set of keys More...
 
byte[] Decrypt (byte[] Data, DeriveBytes Key, string Algorithm="AES", string InitialVector="OFRna73m*aze01xY", int KeySize=256)
 Decrypts a byte array More...
 
byte[] Decrypt (byte[] Data, string Key, string Algorithm, string Salt="Kosher", string HashAlgorithm="SHA1", int PasswordIterations=2, string InitialVector="OFRna73m*aze01xY", int KeySize=256)
 Decrypts a byte array More...
 
byte[] Decrypt (byte[] Data, byte[] Key)
 Decrypt the data based on the key More...
 
byte[] Decrypt (byte[] Input, string Key)
 Decrypts a byte array using RSA More...
 
byte[] Encrypt (byte[] Data, DeriveBytes Key, string Algorithm="AES", string InitialVector="OFRna73m*aze01xY", int KeySize=256)
 Encrypts a byte array More...
 
byte[] Encrypt (byte[] Data, string Key, string Algorithm, string Salt="Kosher", string HashAlgorithm="SHA1", int PasswordIterations=2, string InitialVector="OFRna73m*aze01xY", int KeySize=256)
 Encrypts a byte array More...
 
byte[] Encrypt (byte[] Data, byte[] Key)
 Encrypts the data based on the key More...
 
byte[] Encrypt (byte[] Input, string Key)
 Encrypts a string using RSA More...
 
byte[] Hash (byte[] Data, string Algorithm)
 Hashes the data More...
 
string SignHash (string Input, string Key, out string Hash, Encoding EncodingUsing=null)
 Takes a string and creates a signed hash of it More...
 
override string ToString ()
 String info for the manager More...
 
bool VerifyHash (string Hash, string SignedHash, string Key)
 Verifies a signed hash against the unsigned version More...
 

Properties

IEnumerable< IAsymmetricAsymmetricAlgorithms [get]
 Asymmetric More...
 
IEnumerable< IHasherHasherAlgorithms [get]
 Hashers More...
 
IEnumerable< IShiftShiftAlgorithms [get]
 Shift More...
 
IEnumerable< ISymmetricSymmetricAlgorithms [get]
 Symmetric More...
 

Detailed Description

Compression manager

Definition at line 36 of file Manager.cs.

Constructor & Destructor Documentation

Utilities.IO.Encryption.Manager.Manager ( IEnumerable< IAsymmetric Asymmetric,
IEnumerable< IHasher Hashers,
IEnumerable< IShift Shifts,
IEnumerable< ISymmetric Symmetric 
)

Constructor

Parameters
AsymmetricThe asymmetric.
HashersThe hashers.
ShiftsThe shifts.
SymmetricThe symmetric.

Definition at line 45 of file Manager.cs.

Member Function Documentation

string Utilities.IO.Encryption.Manager.CreateKey ( bool  PrivatePublic)

Creates a new set of keys

Parameters
PrivatePublicTrue if private key should be included, false otherwise
Returns
XML representation of the key information

Definition at line 78 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Decrypt ( byte[]  Data,
DeriveBytes  Key,
string  Algorithm = "AES",
string  InitialVector = "OFRna73m*aze01xY",
int  KeySize = 256 
)

Decrypts a byte array

Parameters
DataData to be decrypted
KeyPassword to decrypt with
AlgorithmAlgorithm to use for decryption
InitialVectorNeeds to be 16 ASCII characters long
KeySizeCan be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES)
Returns
A decrypted byte array

Definition at line 98 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Decrypt ( byte[]  Data,
string  Key,
string  Algorithm,
string  Salt = "Kosher",
string  HashAlgorithm = "SHA1",
int  PasswordIterations = 2,
string  InitialVector = "OFRna73m*aze01xY",
int  KeySize = 256 
)

Decrypts a byte array

Parameters
DataData to be decrypted
KeyPassword to decrypt with
AlgorithmAlgorithm to use for decryption
SaltSalt to decrypt with
HashAlgorithmCan be either SHA1 or MD5
PasswordIterationsNumber of iterations to do
InitialVectorNeeds to be 16 ASCII characters long
KeySizeCan be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES)
Returns
A decrypted byte array

Definition at line 124 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Decrypt ( byte[]  Data,
byte[]  Key 
)

Decrypt the data based on the key

Parameters
DataData to encrypt
KeyKey to use
Returns
The decrypted data

Definition at line 145 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Decrypt ( byte[]  Input,
string  Key 
)

Decrypts a byte array using RSA

Parameters
InputInput byte array (should be small as anything over 128 bytes can not be decrypted)
KeyKey to use for decryption
Returns
A decrypted byte array

Definition at line 162 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Encrypt ( byte[]  Data,
DeriveBytes  Key,
string  Algorithm = "AES",
string  InitialVector = "OFRna73m*aze01xY",
int  KeySize = 256 
)

Encrypts a byte array

Parameters
DataData to be encrypted
KeyPassword to encrypt with
InitialVectorNeeds to be 16 ASCII characters long
KeySizeCan be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES)
AlgorithmAlgorithm
Returns
An encrypted byte array

Definition at line 182 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Encrypt ( byte[]  Data,
string  Key,
string  Algorithm,
string  Salt = "Kosher",
string  HashAlgorithm = "SHA1",
int  PasswordIterations = 2,
string  InitialVector = "OFRna73m*aze01xY",
int  KeySize = 256 
)

Encrypts a byte array

Parameters
DataData to be encrypted
KeyPassword to encrypt with
SaltSalt to encrypt with
HashAlgorithmCan be either SHA1 or MD5
PasswordIterationsNumber of iterations to do
InitialVectorNeeds to be 16 ASCII characters long
KeySizeCan be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES)
AlgorithmAlgorithm
Returns
An encrypted byte array

Definition at line 208 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Encrypt ( byte[]  Data,
byte[]  Key 
)

Encrypts the data based on the key

Parameters
DataData to encrypt
KeyKey to use
Returns
The encrypted data

Definition at line 229 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Encrypt ( byte[]  Input,
string  Key 
)

Encrypts a string using RSA

Parameters
InputInput byte array (should be small as anything over 128 bytes can not be decrypted)
KeyKey to use for encryption
Returns
An encrypted byte array (64bit string)

Definition at line 246 of file Manager.cs.

byte [] Utilities.IO.Encryption.Manager.Hash ( byte[]  Data,
string  Algorithm 
)

Hashes the data

Parameters
DataData to hash
AlgorithmAlgorithm
Returns
The hashed data

Definition at line 261 of file Manager.cs.

string Utilities.IO.Encryption.Manager.SignHash ( string  Input,
string  Key,
out string  Hash,
Encoding  EncodingUsing = null 
)

Takes a string and creates a signed hash of it

Parameters
InputInput string
KeyKey to encrypt/sign with
HashThis will be filled with the unsigned hash
EncodingUsingEncoding that the input is using (defaults to UTF8)
Returns
A signed hash of the input (64bit string)

Definition at line 278 of file Manager.cs.

override string Utilities.IO.Encryption.Manager.ToString ( )

String info for the manager

Returns
The string info that the manager contains

Definition at line 291 of file Manager.cs.

bool Utilities.IO.Encryption.Manager.VerifyHash ( string  Hash,
string  SignedHash,
string  Key 
)

Verifies a signed hash against the unsigned version

Parameters
HashThe unsigned hash (should be 64bit string)
SignedHashThe signed hash (should be 64bit string)
KeyThe key to use in decryption
Returns
True if it is verified, false otherwise

Definition at line 308 of file Manager.cs.

Property Documentation

IEnumerable<IAsymmetric> Utilities.IO.Encryption.Manager.AsymmetricAlgorithms
get

Asymmetric

Definition at line 56 of file Manager.cs.

IEnumerable<IHasher> Utilities.IO.Encryption.Manager.HasherAlgorithms
get

Hashers

Definition at line 61 of file Manager.cs.

IEnumerable<IShift> Utilities.IO.Encryption.Manager.ShiftAlgorithms
get

Shift

Definition at line 66 of file Manager.cs.

IEnumerable<ISymmetric> Utilities.IO.Encryption.Manager.SymmetricAlgorithms
get

Symmetric

Definition at line 71 of file Manager.cs.


The documentation for this class was generated from the following file: