프로퍼티 | 타입 | 설명 | |
---|---|---|---|
EncryptionKey | string |
메소드 | 설명 | |
---|---|---|
BinHexToBinary ( string hex ) : byte[] |
Turns a BinHex string that contains raw byte values into a byte array
|
|
BinaryToBinHex ( byte data ) : string |
Converts a byte array into a BinHex string. Example: 01552233 where the numbers are packed byte values.
|
|
ComputeHash ( byte byteData, string hashAlgorithm, byte saltBytes, bool useBinHex = false ) : string |
Generates a hash for the given plain text value and returns a base64-encoded result. Before the hash is computed, a random salt is generated and appended to the plain text. This salt is stored at the end of the hash value, so it can be used later for hash verification.
|
|
ComputeHash ( string plainText, string hashAlgorithm, byte saltBytes, bool useBinHex = false ) : string |
Generates a hash for the given plain text value and returns a base64-encoded result. Before the hash is computed, a random salt is generated and appended to the plain text. This salt is stored at the end of the hash value, so it can be used later for hash verification.
|
|
ComputeHash ( string plainText, string hashAlgorithm, string salt, bool useBinHex = false ) : string |
Generates a hash for the given plain text value and returns a base64-encoded result. Before the hash is computed, a random salt is generated and appended to the plain text. This salt is stored at the end of the hash value, so it can be used later for hash verification.
|
|
DecryptBytes ( byte decryptBuffer, byte encryptionKey ) : byte[] |
Decrypts a byte buffer with a byte based encryption key
|
|
DecryptBytes ( byte decryptBuffer, string encryptionKey ) : byte[] |
Decrypts a Byte array from DES with an Encryption Key.
|
|
DecryptBytes ( string decryptString, string encryptionKey, bool useBinHex = false ) : byte[] |
Decrypts a string using DES encryption and a pass key that was used for encryption and returns a byte buffer.
|
|
DecryptString ( string decryptString, byte encryptionKey, bool useBinHex = false ) : string |
Decrypts a string using DES encryption and a pass key that was used for encryption.
|
|
DecryptString ( string decryptString, string encryptionKey, bool useBinHex = false ) : string |
Decrypts a string using DES encryption and a pass key that was used for encryption.
|
|
EncryptBytes ( byte inputBytes, byte encryptionKey ) : byte[] |
Encrypts a byte buffer with a byte encryption key
|
|
EncryptBytes ( byte inputBytes, string encryptionKey ) : byte[] |
Encodes a stream of bytes using DES encryption with a pass key. Lowest level method that handles all work.
|
|
EncryptBytes ( string inputString, string encryptionKey ) : byte[] |
Encrypts a string into bytes using DES encryption with a Passkey.
|
|
EncryptString ( string inputString, byte encryptionKey, bool useBinHex = false ) : string |
Encrypts a string using Triple DES encryption with a two way encryption key.String is returned as Base64 or BinHex encoded value rather than binary.
|
|
EncryptString ( string inputString, string encryptionKey, bool useBinHex = false ) : string |
Encrypts a string using Triple DES encryption with a two way encryption key.String is returned as Base64 encoded value rather than binary.
|
|
GZipFile ( string Filename, string OutputFile ) : bool |
Encodes one file to another file that is gzip compressed. File is overwritten if it exists and not locked.
|
|
GZipMemory ( byte buffer ) : byte[] |
GZip encodes a memory buffer to a compressed memory buffer
|
|
GZipMemory ( string Input ) : byte[] |
Encodes a string to a gzip compressed memory buffer
|
|
GZipMemory ( string Filename, bool IsFile ) : byte[] |
Encodes a file to a gzip memory buffer
|
|
GetChecksumFromBytes ( byte fileData, string mode ) : string |
Create a SHA256 or MD5 checksum from a bunch of bytes
|
|
GetChecksumFromFile ( string file, string mode, bool useBinHex = false ) : string |
Creates an SHA256 or MD5 checksum of a file
|
|
ProtectBytes ( byte encryptBytes, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
ProtectBytes ( byte encryptBytes, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
ProtectString ( string encryptString, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
ProtectString ( string encryptString, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
UnprotectBytes ( byte encryptBytes, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] |
Decrypts bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
UnprotectBytes ( byte encryptBytes, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
UnprotectString ( string encryptString, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
|
UnprotectString ( string encryptString, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string |
Encrypt bytes using the Data Protection API on Windows. This API uses internal keys to encrypt data which is valid for decryption only on the same machine. This is an idea storage mechanism for application registraions, service passwords and other semi-transient data that is specific to the software used on the current machine DO NOT USE FOR DATA THAT WILL CROSS MACHINE BOUNDARIES |
메소드 | 설명 | |
---|---|---|
ParseHexChar ( char c ) : int |
public static BinHexToBinary ( string hex ) : byte[] | ||
hex | string | BinHex string (011a031f) just two byte hex digits strung together) |
리턴 | byte[] |
public static BinaryToBinHex ( byte data ) : string | ||
data | byte | Raw data to send |
리턴 | string |
public static ComputeHash ( byte byteData, string hashAlgorithm, byte saltBytes, bool useBinHex = false ) : string | ||
byteData | byte | /// Plaintext value to be hashed. /// |
hashAlgorithm | string | /// Name of the hash algorithm. Allowed values are: "MD5", "SHA1", /// "SHA256", "SHA384", "SHA512", "HMACMD5", "HMACSHA1", "HMACSHA256", /// "HMACSHA512" (if any other value is specified MD5 will be used). /// /// HMAC algorithms uses Hash-based Message Authentication Code. /// The HMAC process mixes a secret key with the message data, hashes /// the result with the hash function, mixes that hash value with /// the secret key again, and then applies the hash function /// a second time. HMAC hashes are fixed lenght and generally /// much longer than non-HMAC hashes of the same type. /// /// https://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha256(v=vs.110).aspx /// /// This value is case-insensitive. /// |
saltBytes | byte | /// Optional but recommended salt bytes to apply to the hash. If not passed the /// raw encoding is used. If salt is nullthe raw algorithm is used (useful for /// file hashes etc.) HMAC versions REQUIRE that salt is passed. /// |
useBinHex | bool | if true returns the data as BinHex byte pair string. Otherwise Base64 is returned. |
리턴 | string |
public static ComputeHash ( string plainText, string hashAlgorithm, byte saltBytes, bool useBinHex = false ) : string | ||
plainText | string | /// Plaintext value to be hashed. /// |
hashAlgorithm | string | /// Name of the hash algorithm. Allowed values are: "MD5", "SHA1", /// "SHA256", "SHA384", "SHA512", "HMACMD5", "HMACSHA1", "HMACSHA256", /// "HMACSHA512" (if any other value is specified MD5 will be used). /// /// HMAC algorithms uses Hash-based Message Authentication Code. /// The HMAC process mixes a secret key with the message data, hashes /// the result with the hash function, mixes that hash value with /// the secret key again, and then applies the hash function /// a second time. HMAC hashes are fixed lenght and generally /// much longer than non-HMAC hashes of the same type. /// /// https://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha256(v=vs.110).aspx /// /// This value is case-insensitive. /// |
saltBytes | byte | |
useBinHex | bool | if true returns the data as BinHex byte pair string. Otherwise Base64 is returned. |
리턴 | string |
public static ComputeHash ( string plainText, string hashAlgorithm, string salt, bool useBinHex = false ) : string | ||
plainText | string | /// Plaintext value to be hashed. /// |
hashAlgorithm | string | /// Name of the hash algorithm. Allowed values are: "MD5", "SHA1", /// "SHA256", "SHA384", "SHA512", "HMACMD5", "HMACSHA1", "HMACSHA256", /// "HMACSHA512" (if any other value is specified MD5 will be used). /// /// HMAC algorithms uses Hash-based Message Authentication Code. /// The HMAC process mixes a secret key with the message data, hashes /// the result with the hash function, mixes that hash value with /// the secret key again, and then applies the hash function /// a second time. HMAC hashes are fixed lenght and generally /// much longer than non-HMAC hashes of the same type. /// /// https://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha256(v=vs.110).aspx /// /// This value is case-insensitive. /// |
salt | string | /// Optional but recommended salt string to apply to the hash. If not passed the /// raw encoding is used. If salt is nullthe raw algorithm is used (useful for /// file hashes etc.) HMAC versions REQUIRE that salt is passed. /// |
useBinHex | bool | if true returns the data as BinHex byte pair string. Otherwise Base64 is returned. |
리턴 | string |
public static DecryptBytes ( byte decryptBuffer, byte encryptionKey ) : byte[] | ||
decryptBuffer | byte | |
encryptionKey | byte | |
리턴 | byte[] |
public static DecryptBytes ( byte decryptBuffer, string encryptionKey ) : byte[] | ||
decryptBuffer | byte | |
encryptionKey | string | |
리턴 | byte[] |
public static DecryptBytes ( string decryptString, string encryptionKey, bool useBinHex = false ) : byte[] | ||
decryptString | string | |
encryptionKey | string | |
useBinHex | bool | Returns data in useBinHex format (12afb1c3f1). Otherwise base64 is returned. |
리턴 | byte[] |
public static DecryptString ( string decryptString, byte encryptionKey, bool useBinHex = false ) : string | ||
decryptString | string | |
encryptionKey | byte | |
useBinHex | bool | Returns data in useBinHex format (12afb1c3f1). Otherwise base64 is returned |
리턴 | string |
public static DecryptString ( string decryptString, string encryptionKey, bool useBinHex = false ) : string | ||
decryptString | string | |
encryptionKey | string | |
useBinHex | bool | Returns data in useBinHex format (12afb1c3f1). Otherwise base64 is returned. |
리턴 | string |
public static EncryptBytes ( byte inputBytes, byte encryptionKey ) : byte[] | ||
inputBytes | byte | |
encryptionKey | byte | |
리턴 | byte[] |
public static EncryptBytes ( byte inputBytes, string encryptionKey ) : byte[] | ||
inputBytes | byte | |
encryptionKey | string | |
리턴 | byte[] |
public static EncryptBytes ( string inputString, string encryptionKey ) : byte[] | ||
inputString | string | |
encryptionKey | string | |
리턴 | byte[] |
public static EncryptString ( string inputString, byte encryptionKey, bool useBinHex = false ) : string | ||
inputString | string | |
encryptionKey | byte | |
useBinHex | bool | if true returns bin hex rather than base64 |
리턴 | string |
public static EncryptString ( string inputString, string encryptionKey, bool useBinHex = false ) : string | ||
inputString | string | |
encryptionKey | string | |
useBinHex | bool | |
리턴 | string |
public static GZipFile ( string Filename, string OutputFile ) : bool | ||
Filename | string | |
OutputFile | string | |
리턴 | bool |
public static GZipMemory ( string Filename, bool IsFile ) : byte[] | ||
Filename | string | |
IsFile | bool | |
리턴 | byte[] |
public static GetChecksumFromBytes ( byte fileData, string mode ) : string | ||
fileData | byte | |
mode | string | SHA256,SHA512,MD5 |
리턴 | string |
public static GetChecksumFromFile ( string file, string mode, bool useBinHex = false ) : string | ||
file | string | |
mode | string | SHA256,SHA512,MD5 |
useBinHex | bool | |
리턴 | string |
public static ProtectBytes ( byte encryptBytes, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] | ||
encryptBytes | byte | |
key | byte | |
scope | DataProtectionScope | |
리턴 | byte[] |
public static ProtectBytes ( byte encryptBytes, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] | ||
encryptBytes | byte | |
key | string | |
scope | DataProtectionScope | |
리턴 | byte[] |
public static ProtectString ( string encryptString, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string | ||
encryptString | string | |
key | byte | |
scope | DataProtectionScope | |
useBinHex | bool | returns bin hex data when set (010A0D10AF) |
리턴 | string |
public static ProtectString ( string encryptString, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string | ||
encryptString | string | |
key | string | |
scope | DataProtectionScope | |
useBinHex | bool | returns bin hex data when set (010A0D10AF) |
리턴 | string |
public static UnprotectBytes ( byte encryptBytes, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] | ||
encryptBytes | byte | |
key | byte | |
scope | DataProtectionScope | |
리턴 | byte[] |
public static UnprotectBytes ( byte encryptBytes, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine ) : byte[] | ||
encryptBytes | byte | |
key | string | |
scope | DataProtectionScope | |
리턴 | byte[] |
public static UnprotectString ( string encryptString, byte key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string | ||
encryptString | string | |
key | byte | |
scope | DataProtectionScope | |
useBinHex | bool | returns bin hex data when set (010A0D10AF) |
리턴 | string |
public static UnprotectString ( string encryptString, string key, DataProtectionScope scope = DataProtectionScope.LocalMachine, bool useBinHex = false ) : string | ||
encryptString | string | |
key | string | |
scope | DataProtectionScope | |
useBinHex | bool | returns bin hex data when set (010A0D10AF) |
리턴 | string |