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

Symmetric base class More...

Inheritance diagram for Utilities.IO.Encryption.BaseClasses.SymmetricBase:
Utilities.IO.Encryption.Interfaces.ISymmetric Utilities.IO.Encryption.Default.Symmetric

Public Member Functions

bool CanHandle (string Algorithm)
 Can this handle the algorithm specified 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[] 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, DeriveBytes Key, string Algorithm="AES", string InitialVector="OFRna73m*aze01xY", int KeySize=256)
 Encrypts a byte array More...
 

Protected Member Functions

 SymmetricBase ()
 Constructor More...
 
SymmetricAlgorithm GetProvider (string Algorithm)
 Gets the symmetric algorithm More...
 

Properties

abstract string Name [get]
 Name More...
 
IDictionary< string, Func< SymmetricAlgorithm > > ImplementedAlgorithms [get]
 Algorithms this implements More...
 
- Properties inherited from Utilities.IO.Encryption.Interfaces.ISymmetric
string Name [get]
 Name of the symmetric encryptor More...
 

Detailed Description

Symmetric base class

Definition at line 35 of file SymmetricBase.cs.

Constructor & Destructor Documentation

Utilities.IO.Encryption.BaseClasses.SymmetricBase.SymmetricBase ( )
protected

Constructor

Definition at line 40 of file SymmetricBase.cs.

Member Function Documentation

bool Utilities.IO.Encryption.BaseClasses.SymmetricBase.CanHandle ( string  Algorithm)

Can this handle the algorithm specified

Parameters
AlgorithmThe algorithm name
Returns
True if it can, false otherwise

Implements Utilities.IO.Encryption.Interfaces.ISymmetric.

Definition at line 60 of file SymmetricBase.cs.

byte [] Utilities.IO.Encryption.BaseClasses.SymmetricBase.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

Implements Utilities.IO.Encryption.Interfaces.ISymmetric.

Definition at line 76 of file SymmetricBase.cs.

byte [] Utilities.IO.Encryption.BaseClasses.SymmetricBase.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

Implements Utilities.IO.Encryption.Interfaces.ISymmetric.

Definition at line 118 of file SymmetricBase.cs.

byte [] Utilities.IO.Encryption.BaseClasses.SymmetricBase.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 to use
Returns
The encrypted byte array

Implements Utilities.IO.Encryption.Interfaces.ISymmetric.

Definition at line 140 of file SymmetricBase.cs.

byte [] Utilities.IO.Encryption.BaseClasses.SymmetricBase.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 to use
Returns
The encrypted byte array

Implements Utilities.IO.Encryption.Interfaces.ISymmetric.

Definition at line 159 of file SymmetricBase.cs.

SymmetricAlgorithm Utilities.IO.Encryption.BaseClasses.SymmetricBase.GetProvider ( string  Algorithm)
protected

Gets the symmetric algorithm

Returns
The symmetric algorithm

Definition at line 193 of file SymmetricBase.cs.

Property Documentation

IDictionary<string, Func<SymmetricAlgorithm> > Utilities.IO.Encryption.BaseClasses.SymmetricBase.ImplementedAlgorithms
getprotected

Algorithms this implements

Definition at line 53 of file SymmetricBase.cs.

abstract string Utilities.IO.Encryption.BaseClasses.SymmetricBase.Name
get

Name

Definition at line 48 of file SymmetricBase.cs.


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