C# Class EfficientlyLazy.Crypto.Engines.DPAPIEngine

Encryption/Decryption using the windows crypto API.
Inheritance: ICryptoEngine
Afficher le fichier Open project: jasonlaflair/EfficientlyLazy.Crypto Class Usage Examples

Méthodes publiques

Méthode Description
DPAPIEngine ( DPAPIKeyType keyType ) : System

Initializes a new instance of the DPAPIEngine object.

Decrypt ( byte cipherText ) : byte[]

Decrypts the specified cipher text.

Decrypt ( string cipherText ) : string

Decrypts the specified cipher text.

Dispose ( ) : void

Encrypt ( byte plaintext ) : byte[]

Encrypts the specified plain text to a byte array.

Encrypt ( string plaintext ) : string

Encrypts the specified plain text to a string.

GetSetting ( string key ) : string

GetSqlConnectionString ( string key ) : System.Data.SqlClient.SqlConnectionStringBuilder

SetEncoding ( Encoding encoding ) : DPAPIEngine

Sets character encoding to use during encryption/decryption.

SetEntropy ( SecureString entropy ) : DPAPIEngine

Sets additional entropy used for encryption/decryption

SetEntropy ( string entropy ) : DPAPIEngine

Sets additional entropy used for encryption/decryption

Private Methods

Méthode Description
CryptProtectData ( DPAPINativeDataBlob &plainText, string description, DPAPINativeDataBlob &entropy, IntPtr reserved, DPAPINativeCryptPotectPromptStruct &prompt, int flags, DPAPINativeDataBlob &cipherText ) : bool
CryptUnprotectData ( DPAPINativeDataBlob &cipherText, string &description, DPAPINativeDataBlob &entropy, IntPtr reserved, DPAPINativeCryptPotectPromptStruct &prompt, int flags, DPAPINativeDataBlob &plainText ) : bool
DPAPIDecrypt ( byte cipherText, byte entropy ) : byte[]
DPAPIEncrypt ( DPAPIKeyType keyType, byte plainTextBytes, byte entropyBytes ) : byte[]
Dispose ( bool disposing ) : void
GetSecureConfigSection ( ) : SecureSection
ToSecureString ( IEnumerable text ) : SecureString
ToString ( SecureString secureString ) : string

Method Details

DPAPIEngine() public méthode

Initializes a new instance of the DPAPIEngine object.
public DPAPIEngine ( DPAPIKeyType keyType ) : System
keyType DPAPIKeyType Defines the method () to use for encryption/decryption.
Résultat System

Decrypt() public méthode

Decrypts the specified cipher text.
public Decrypt ( byte cipherText ) : byte[]
cipherText byte The cipher text.
Résultat byte[]

Decrypt() public méthode

Decrypts the specified cipher text.
public Decrypt ( string cipherText ) : string
cipherText string The cipher text.
Résultat string

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Encrypt() public méthode

Encrypts the specified plain text to a byte array.
public Encrypt ( byte plaintext ) : byte[]
plaintext byte The plain text to encrypt.
Résultat byte[]

Encrypt() public méthode

Encrypts the specified plain text to a string.
public Encrypt ( string plaintext ) : string
plaintext string The plain text to encrypt.
Résultat string

GetSetting() public méthode

public GetSetting ( string key ) : string
key string
Résultat string

GetSqlConnectionString() public méthode

public GetSqlConnectionString ( string key ) : System.Data.SqlClient.SqlConnectionStringBuilder
key string
Résultat System.Data.SqlClient.SqlConnectionStringBuilder

SetEncoding() public méthode

Sets character encoding to use during encryption/decryption.
encoding is null
public SetEncoding ( Encoding encoding ) : DPAPIEngine
encoding System.Text.Encoding Character encoding to use during encryption/decryption.
Résultat DPAPIEngine

SetEntropy() public méthode

Sets additional entropy used for encryption/decryption
public SetEntropy ( SecureString entropy ) : DPAPIEngine
entropy System.Security.SecureString Additional entropy used for encryption/decryption
Résultat DPAPIEngine

SetEntropy() public méthode

Sets additional entropy used for encryption/decryption
public SetEntropy ( string entropy ) : DPAPIEngine
entropy string Additional entropy used for encryption/decryption
Résultat DPAPIEngine