C# Class Utilities.IO.Encryption.Default.RSA

RSA Encryptor
Inheritance: Utilities.IO.Encryption.BaseClasses.AsymmetricBase
Exibir arquivo Open project: JaCraig/Craig-s-Utility-Library

Public Methods

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

Decrypts a byte array using RSA

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

Encrypts a string using RSA

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

Takes a string and creates a signed hash of it

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

Verifies a signed hash against the unsigned version

Protected Methods

Method Description
GetProvider ( ) : AsymmetricAlgorithm

Gets the provider used

Method Details

Decrypt() public method

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
return byte[]

Encrypt() public method

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
return byte[]

GetProvider() protected method

Gets the provider used
protected GetProvider ( ) : AsymmetricAlgorithm
return System.Security.Cryptography.AsymmetricAlgorithm

SignHash() public method

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)
return string

VerifyHash() public method

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
return bool