C# Класс Utilities.IO.Encryption.Manager

Compression manager
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Описание методов

CreateKey() публичный Метод

Creates a new set of keys
public CreateKey ( bool PrivatePublic ) : string
PrivatePublic bool True if private key should be included, false otherwise
Результат string

Decrypt() публичный Метод

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) ///
Результат byte[]

Decrypt() публичный Метод

Decrypt the data based on the key
public Decrypt ( byte Data, byte Key ) : byte[]
Data byte Data to encrypt
Key byte Key to use
Результат byte[]

Decrypt() публичный Метод

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
Результат byte[]

Decrypt() публичный Метод

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) ///
Результат byte[]

Encrypt() публичный Метод

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) ///
Результат byte[]

Encrypt() публичный Метод

Encrypts the data based on the key
public Encrypt ( byte Data, byte Key ) : byte[]
Data byte Data to encrypt
Key byte Key to use
Результат byte[]

Encrypt() публичный Метод

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
Результат byte[]

Encrypt() публичный Метод

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) ///
Результат byte[]

Hash() публичный Метод

Hashes the data
public Hash ( byte Data, string Algorithm ) : byte[]
Data byte Data to hash
Algorithm string Algorithm
Результат byte[]

Manager() публичный Метод

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.
Результат System

SignHash() публичный Метод

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)
Результат string

ToString() публичный Метод

String info for the manager
public ToString ( ) : string
Результат string

VerifyHash() публичный Метод

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
Результат bool