C# Класс CmisSync.Lib.Config.Crypto

Obfuscation for sensitive data, making password harvesting a little less straightforward. Web browsers employ the same technique to store user passwords.
Показать файл Открыть проект

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

Метод Описание
CalculateChecksum ( string hashAlgorithm, IFileInfo file ) : byte[]

Calculates the checksum over the given stream with a former created hashAlgorithm

CalculateChecksum ( string hashAlgorithm, Stream inputStream ) : byte[]

Calculates the checksum over the given stream.

CreateHashAlgorithm ( string name ) : HashAlgorithm

Creates the hash algorithm by the given name.

Deobfuscate ( string value ) : string

Deobfuscate a string.

GetCryptoKey ( ) : byte[]

Salt for the obfuscation.

Obfuscate ( string value ) : string

Obfuscate a string.

Приватные методы

Метод Описание
UnixDeobfuscate ( string value ) : string

Deobfuscate a string on UNIX.

UnixObfuscate ( string value ) : string

Obfuscate a string on Unix. AES is used.

WindowsDeobfuscate ( string value ) : string

Deobfuscate a string on Windows.

WindowsObfuscate ( string value ) : string

Obfuscate a string on Windows. We use the recommended API for this: DPAPI (Windows Data Protection API) http://msdn.microsoft.com/en-us/library/ms995355.aspx Warning: Even though it uses the Windows user's password, it is not uncrackable.

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

CalculateChecksum() публичный статический Метод

Calculates the checksum over the given stream with a former created hashAlgorithm
public static CalculateChecksum ( string hashAlgorithm, IFileInfo file ) : byte[]
hashAlgorithm string Hash algorithm.
file IFileInfo File to be hashed.
Результат byte[]

CalculateChecksum() публичный статический Метод

Calculates the checksum over the given stream.
public static CalculateChecksum ( string hashAlgorithm, Stream inputStream ) : byte[]
hashAlgorithm string Hash algorithm.
inputStream Stream Input Stream.
Результат byte[]

CreateHashAlgorithm() публичный статический Метод

Creates the hash algorithm by the given name.
public static CreateHashAlgorithm ( string name ) : HashAlgorithm
name string Name of the has algorithm.
Результат System.Security.Cryptography.HashAlgorithm

Deobfuscate() публичный статический Метод

Deobfuscate a string.
public static Deobfuscate ( string value ) : string
value string The string to deobfuscate
Результат string

GetCryptoKey() публичный статический Метод

Salt for the obfuscation.
public static GetCryptoKey ( ) : byte[]
Результат byte[]

Obfuscate() публичный статический Метод

Obfuscate a string.
public static Obfuscate ( string value ) : string
value string The string to obfuscate
Результат string