C# Class Utilities.IO.Encryption.Manager

Compression manager
Afficher le fichier Open project: JaCraig/Craig-s-Utility-Library

Méthodes publiques

Méthode Description
CreateKey ( bool PrivatePublic ) : string

Creates a new set of keys

Decrypt ( byte Data, DeriveBytes Key, string Algorithm = "AES", string InitialVector = "OFRna73m*aze01xY", int KeySize = 256 ) : byte[]

Decrypts a byte array

Decrypt ( byte Data, byte Key ) : byte[]

Decrypt the data based on the key

Decrypt ( byte Input, string Key ) : byte[]

Decrypts a byte array using RSA

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

Decrypts a byte array

Encrypt ( byte Data, DeriveBytes Key, string Algorithm = "AES", string InitialVector = "OFRna73m*aze01xY", int KeySize = 256 ) : byte[]

Encrypts a byte array

Encrypt ( byte Data, byte Key ) : byte[]

Encrypts the data based on the key

Encrypt ( byte Input, string Key ) : byte[]

Encrypts a string using RSA

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

Encrypts a byte array

Hash ( byte Data, string Algorithm ) : byte[]

Hashes the data

Manager ( IEnumerable Asymmetric, IEnumerable Hashers, IEnumerable Shifts, IEnumerable Symmetric ) : System

Constructor

SignHash ( string Input, string Key, string &Hash, Encoding EncodingUsing = null ) : string

Takes a string and creates a signed hash of it

ToString ( ) : string

String info for the manager

VerifyHash ( string Hash, string SignedHash, string Key ) : bool

Verifies a signed hash against the unsigned version

Method Details

CreateKey() public méthode

Creates a new set of keys
public CreateKey ( bool PrivatePublic ) : string
PrivatePublic bool True if private key should be included, false otherwise
Résultat string

Decrypt() public méthode

Decrypts a byte array
public Decrypt ( byte Data, DeriveBytes Key, string Algorithm = "AES", string InitialVector = "OFRna73m*aze01xY", int KeySize = 256 ) : byte[]
Data byte Data to be decrypted
Key System.Security.Cryptography.DeriveBytes Password to decrypt with
Algorithm string Algorithm to use for decryption
InitialVector string Needs to be 16 ASCII characters long
KeySize int /// Can be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES) ///
Résultat byte[]

Decrypt() public méthode

Decrypt the data based on the key
public Decrypt ( byte Data, byte Key ) : byte[]
Data byte Data to encrypt
Key byte Key to use
Résultat byte[]

Decrypt() public méthode

Decrypts a byte array using RSA
public Decrypt ( byte Input, string Key ) : byte[]
Input byte /// Input byte array (should be small as anything over 128 bytes can not be decrypted) ///
Key string Key to use for decryption
Résultat byte[]

Decrypt() public méthode

Decrypts a byte array
public Decrypt ( byte Data, string Key, string Algorithm, string Salt = "Kosher", string HashAlgorithm = "SHA1", int PasswordIterations = 2, string InitialVector = "OFRna73m*aze01xY", int KeySize = 256 ) : byte[]
Data byte Data to be decrypted
Key string Password to decrypt with
Algorithm string Algorithm to use for decryption
Salt string Salt to decrypt with
HashAlgorithm string Can be either SHA1 or MD5
PasswordIterations int Number of iterations to do
InitialVector string Needs to be 16 ASCII characters long
KeySize int /// Can be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES) ///
Résultat byte[]

Encrypt() public méthode

Encrypts a byte array
public Encrypt ( byte Data, DeriveBytes Key, string Algorithm = "AES", string InitialVector = "OFRna73m*aze01xY", int KeySize = 256 ) : byte[]
Data byte Data to be encrypted
Key System.Security.Cryptography.DeriveBytes Password to encrypt with
Algorithm string Algorithm
InitialVector string Needs to be 16 ASCII characters long
KeySize int /// Can be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES) ///
Résultat byte[]

Encrypt() public méthode

Encrypts the data based on the key
public Encrypt ( byte Data, byte Key ) : byte[]
Data byte Data to encrypt
Key byte Key to use
Résultat byte[]

Encrypt() public méthode

Encrypts a string using RSA
public Encrypt ( byte Input, string Key ) : byte[]
Input byte /// Input byte array (should be small as anything over 128 bytes can not be decrypted) ///
Key string Key to use for encryption
Résultat byte[]

Encrypt() public méthode

Encrypts a byte array
public Encrypt ( byte Data, string Key, string Algorithm, string Salt = "Kosher", string HashAlgorithm = "SHA1", int PasswordIterations = 2, string InitialVector = "OFRna73m*aze01xY", int KeySize = 256 ) : byte[]
Data byte Data to be encrypted
Key string Password to encrypt with
Algorithm string Algorithm
Salt string Salt to encrypt with
HashAlgorithm string Can be either SHA1 or MD5
PasswordIterations int Number of iterations to do
InitialVector string Needs to be 16 ASCII characters long
KeySize int /// Can be 64 (DES only), 128 (AES), 192 (AES and Triple DES), or 256 (AES) ///
Résultat byte[]

Hash() public méthode

Hashes the data
public Hash ( byte Data, string Algorithm ) : byte[]
Data byte Data to hash
Algorithm string Algorithm
Résultat byte[]

Manager() public méthode

Constructor
public Manager ( IEnumerable Asymmetric, IEnumerable Hashers, IEnumerable Shifts, IEnumerable Symmetric ) : System
Asymmetric IEnumerable The asymmetric.
Hashers IEnumerable The hashers.
Shifts IEnumerable The shifts.
Symmetric IEnumerable The symmetric.
Résultat System

SignHash() public méthode

Takes a string and creates a signed hash of it
public SignHash ( string Input, string Key, string &Hash, Encoding EncodingUsing = null ) : string
Input string Input string
Key string Key to encrypt/sign with
Hash string This will be filled with the unsigned hash
EncodingUsing System.Text.Encoding Encoding that the input is using (defaults to UTF8)
Résultat string

ToString() public méthode

String info for the manager
public ToString ( ) : string
Résultat string

VerifyHash() public méthode

Verifies a signed hash against the unsigned version
public VerifyHash ( string Hash, string SignedHash, string Key ) : bool
Hash string The unsigned hash (should be 64bit string)
SignedHash string The signed hash (should be 64bit string)
Key string The key to use in decryption
Résultat bool