C# 클래스 Utilities.IO.Encryption.Manager

Compression manager
파일 보기 프로젝트 열기: JaCraig/Craig-s-Utility-Library

공개 메소드들

메소드 설명
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