.NET interface to CryptoSys API.
| Class | Description |
|---|---|
| Aead | Provides generic authenticated encryption. |
| Aes128 | Advanced Encryption Standard (AES) with 128-bit key |
| Aes192 | Advanced Encryption Standard (AES) with 192-bit key |
| Aes256 | Advanced Encryption Standard (AES) with 256-bit key |
| Blowfish | Blowfish cipher algorithm |
| Cipher | Block cipher utilities |
| CipherStream | Stream cipher algorithms |
| Cnv | Character conversion routines |
| Compr | Compression utilities |
| Crc | CRC-32 computations |
| Des | Data Encryption Standard (DES) Cipher (legacy applications only) |
| Gcm | Provides authenticated encryption using the Galois/Counter Mode (GCM) of operation with the AES algorithm (AES-GCM). |
| General | General functions |
| Hash | Message Digest Hash Functions |
| Mac | Message authentication code (MAC) functions |
| Md5 | MD5 Hash Algorithm |
| Pbe | Password-based encryption |
| Pc1 | RC4-compatible stream cipher algorithm (superseded by Cipher.Stream methods) |
| Prf | Pseudorandom function (PRF) methods. |
| Rng | Random Number Generator to NIST SP800-90 |
| Sha1 | Secure Hash Algorithm 1 (SHA-1) |
| Sha256 | Secure Hash 256 Algorithm (SHA-256) |
| Sha3 | Secure Hash Algorithm SHA-3 |
| Tdea | Triple DES Cipher (3DES, TDEA, DES-EDE3) |
| Wipe | Data Wiping Functions |
| Xof | Extendable-output function (XOF) methods. |
| Zlib | ZLIB compression algorithm |
| Enumeration | Description |
|---|---|
| Aead.Algorithm | AEAD algorithm |
| Aead.Opts | Advanced options |
| Cipher.Opts | Advanced options |
| CipherAlgorithm | Block Cipher Algorithm |
| CipherFileOption | Advanced options for file cipher operations |
| CipherStream.Algorithm | Stream cipher algorithm |
| ComprAlgorithm | Compression algorithm. |
| EncodingBase | Base for encoding methods |
| HashAlgorithm | Message Digest Hash Algorithm |
| MacAlgorithm | Message Authentication Code (MAC) Algorithm |
| Mode | Cipher Mode |
| Padding | Block Cipher Padding |
| PrfAlgorithm | Pseudorandom function (PRF) algorithm. |
| Rng.Options | Rng options |
| Rng.Strength | Required security strength for user-prompted entropy |
| Wipe.Options | Wipe options. |
| XofAlgorithm | Extendable-output function (XOF) algorithm. |
Provides generic authenticated encryption.
System.Object
CryptoSysAPI.Aead
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Aead : IDisposableThe Aead type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (object-related only) |
| Name | Description |
|---|---|
| AddAAD | Add a chunk of additional authenticated data (in incremental mode) |
| Authenticate | Authenticate additional data using tag |
| Decrypt | Decrypt and authenticate input using specified AEAD algorithm in one-off operation |
| DecryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) | Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext. |
| DecryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) | Decrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is expected to be appended to the input ciphertext. |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt | Encrypt input using specified AEAD algorithm in one-off operation. |
| EncryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) | Encrypt data using specified AEAD algorithm in one-off operation. The authentication tag is appended to the output. |
| EncryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) | Encrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is appended to the output. |
| FinishDecrypt | Finishes the authenticated decryption (in incremental mode) |
| FinishEncrypt | Finishes the authenticated encryption (in incremental mode) |
| InitKey | Initializes the context with the key and algorithm ready for repeated incremental operations |
| Instance | Create the one and only instance |
| Mac | Compute Message Authentication Code (tag) over input data |
| SetNonce | Set the nonce (in incremental mode) |
| StartDecrypt | Start authenticated decryption (in incremental mode) |
| StartEncrypt | Start authenticated encryption (in incremental mode) |
| Update | Encrypts or decrypts a chunk of input (in incremental mode) |
| Name | Description |
|---|---|
| TagMaxSize | Maximum size of tag in bytes |
Last error code (object-related only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Aead Class
CryptoSysAPI Namespace
Add a chunk of additional authenticated data (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int AddAAD(
byte[] aad
)Chunk of additional data to add
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
May be repeated to add additional data in chunks. Must eventually be followed by either StartEncrypt() or StartDecrypt().
Aead Class
CryptoSysAPI Namespace
Looks up error code
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string ErrorLookup(
int errCode
)Code number
String
Corresponding error message
General Class
CryptoSysAPI Namespace
Authenticate additional data using tag
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool Authenticate(
byte[] key,
byte[] nonce,
byte[] aad,
byte[] tag,
Aead.Algorithm alg
)Key of exact length for given algorithm (16 or 32 bytes).
Nonce of exact length for given algorithm (currently always 12 bytes)
Data to be authenticated
Tag value
AEAD algorithm to use
Boolean
True if authentication is valid; false if failed or an error
occurred.
Use General.ErrorCode to find the code of the last error. This is equivalent to Aead.Decrypt with a zero-length ciphertext input.
Aead Class
CryptoSysAPI Namespace
Returns the error code of the error that occurred when calling the last function
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int ErrorCode()Int32
Error code
Not all functions set this value.
General Class
CryptoSysAPI Namespace
Decrypt and authenticate input using specified AEAD algorithm in one-off operation
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Decrypt(
byte[] input,
byte[] key,
byte[] nonce,
byte[] aad,
byte[] tag,
Aead.Algorithm alg
)Cipher text input data (required)
Key of exact length for given algorithm (16 or 32 bytes).
Nonce of exact length for given algorithm (currently always 12 bytes).
Additional authentication data (optional). Pass
null/Nothing to ignore.
Tag value (required)
AEAD algorithm to use
Byte[]
Decrypted plaintext in byte array, or empty array on error
Use General.ErrorCode to find the code of the last error. The plaintext is always the same length as the ciphertext. The tag must be input separately.
Aead Class
CryptoSysAPI Namespace
Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| DecryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) | Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext. |
| DecryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) | Decrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is expected to be appended to the input ciphertext. |
public static byte[] DecryptWithTag(
byte[] input,
byte[] key,
byte[] iv,
Aead.Algorithm aeadAlg
)Input data to be decrypted.
Key of exact length for algorithm (16 or 32 bytes).
Initialization Vector (IV) (aka nonce) (12 or 16 bytes).
Authenticated encryption algorithm.
Byte[]
Plaintext in a byte array, or empty array on error (an empty array may
also be the correct result - check General.ErrorCode for
details).
The input must include the 16-byte tag appended to the ciphertext. The output will be exactly 16 bytes shorter than the input. In all cases the tag must be exactly 16 bytes (128 bits). The IV must be 16 bytes (128 bits) for ASCON-128 otherwise 12 bytes (96 bits).
Aead Class
CryptoSysAPI Namespace
Decrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is expected to be appended to the input ciphertext.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| DecryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) | Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext. |
| DecryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) | Decrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is expected to be appended to the input ciphertext. |
public static byte[] DecryptWithTag(
byte[] input,
byte[] key,
byte[] iv,
byte[] aad,
Aead.Algorithm aeadAlg,
Aead.Opts opts
)Input data to be decrypted.
Key of exact length for algorithm (16 or 32 bytes).
(optional) Initialization Vector (IV) (aka nonce) exactly 12 bytes
long. Set as null if already prefixed to input.
Additional authenticated data (optional) - set as null
to ignore.
Authenticated encryption algorithm.
Advanced options. Use Aead.Opts.PrefixIV to expect the IV to be prepended at the start of the input.
Byte[]
Plaintext in a byte array, or empty array on error (an empty array may
also be the correct result - check General.ErrorCode for
details).
The input must include the 16-byte tag appended to the ciphertext and
may include a 12-byte prefixed IV. The output will either be exactly 16
bytes shorter than the input, or exactly 28 bytes shorter if the
Cipher.Opts.PrefixIV option is used. In all cases the tag
must be exactly 16 bytes (128 bits). The IV must be 16 bytes (128 bits)
for ASCON-128 otherwise 12 bytes (96 bits). If additional authentication
data (AAD) was provided during encryption then the exact same AAD data
must be provided here.
Aead Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Aead Class
CryptoSysAPI Namespace
Encrypt input using specified AEAD algorithm in one-off operation.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Encrypt(
out byte[] tag,
byte[] input,
byte[] key,
byte[] nonce,
byte[] aad,
Aead.Algorithm alg
)To receive the output authentication tag value. Currently always returned exactly 16 bytes long. This is a by-reference parameter. There is no need to initialize (but the VB compiler may complain).
Plain text input data (required)
Key of exact length for given algorithm (16 or 32 bytes)
Nonce of exact length for given algorithm (currently always 12 bytes)
Additional authentication data (optional). Pass
null/Nothing to ignore.
AEAD algorithm to use
Byte[]
Encrypted ciphertext in byte array, or empty array on error
Use General.ErrorCode to find the code of the last error. The ciphertext is always the same length as the plaintext. The authentication tag is output separately.
Aead Class
CryptoSysAPI Namespace
Encrypt data using specified AEAD algorithm in one-off operation. The authentication tag is appended to the output.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| EncryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) | Encrypt data using specified AEAD algorithm in one-off operation. The authentication tag is appended to the output. |
| EncryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) | Encrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is appended to the output. |
public static byte[] EncryptWithTag(
byte[] input,
byte[] key,
byte[] iv,
Aead.Algorithm aeadAlg
)Input data to be encrypted.
Key of exact length for algorithm (16 or 32 bytes).
Initialization Vector (IV) (aka nonce) (16 bytes for ASCON-128 else 12 bytes).
Authenticated encryption algorithm.
Byte[]
Ciphertext with tag appended in a byte array, or empty array on
error.
The output will be exactly 16 bytes longer than the input.
Aead Class
CryptoSysAPI Namespace
Encrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is appended to the output.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| EncryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) | Encrypt data using specified AEAD algorithm in one-off operation. The authentication tag is appended to the output. |
| EncryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) | Encrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is appended to the output. |
public static byte[] EncryptWithTag(
byte[] input,
byte[] key,
byte[] iv,
byte[] aad,
Aead.Algorithm aeadAlg,
Aead.Opts opts = Aead.Opts.Default
)Input data to be encrypted.
Key of exact length for algorithm (16 or 32 bytes).
Initialization Vector (IV) (aka nonce) (16 bytes for ASCON-128 else 12 bytes).
Additional authenticated data (optional) - set as null
to ignore.
Authenticated encryption algorithm.
Advanced options (optional). Use Opts.PrefixIV to prepend the IV to the output
Byte[]
Ciphertext with tag appended in a byte array, or empty array on
error.
The output will either be exactly 16 bytes longer than the input, or
28/32 bytes longer if Aead.Opts.PrefixIV is used.
Aead Class
CryptoSysAPI Namespace
Finishes the authenticated decryption (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool FinishDecrypt()Boolean
True if the decryption is authenticated; false
otherwise.
Must be preceded by StartDecrypt() and zero or more calls to Update(). May be followed by SetNonce() to begin processing another packet with the same key and algorithm; otherwise should be followed by Dispose().
Aead Class
CryptoSysAPI Namespace
Finishes the authenticated encryption (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] FinishEncrypt()Byte[]
Authentication tag value
Must be preceded by StartEncrypt() and zero or more calls to Update(). May be followed by SetNonce() to begin processing another packet with the same key and algorithm; otherwise should be followed by Dispose().
Aead Class
CryptoSysAPI Namespace
Initializes the context with the key and algorithm ready for repeated incremental operations
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int InitKey(
byte[] key,
Aead.Algorithm alg
)Key of exact length for given algorithm (16 or 32 bytes).
AEAD algorithm to use
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Must be followed by SetNonce(). Can be called at any time to cancel any previous incremental settings.
Aead o = Aead.Instance();
o.InitKey(key, alg);
o.SetNonce(nonce);
//...
o.Dispose();Aead Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Aead Instance()Aead
Single instance to class
Aead Class
CryptoSysAPI Namespace
Compute Message Authentication Code (tag) over input data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Mac(
byte[] key,
byte[] nonce,
byte[] aad,
Aead.Algorithm alg
)Key of exact length for given algorithm (16 or 32 bytes).
Nonce of exact length for given algorithm (currently always 12 bytes)
Data to be authenticated
AEAD algorithm to use
Byte[]
Tag value in byte array, or empty array on error
Use General.ErrorCode to find the code of the last error. This is equivalent to Aead.Encrypt with a zero-length plaintext input.
Aead Class
CryptoSysAPI Namespace
Set the nonce (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int SetNonce(
byte[] nonce
)Nonce of exact length for given algorithm (currently always 12 bytes)
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
May be followed by zero or more calls to AddAAD() and then either StartEncrypt() or StartDecrypt().
Aead Class
CryptoSysAPI Namespace
Start authenticated decryption (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int StartDecrypt(
byte[] tagToCheck
)Tag value to be authenticated
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
May be followed by zero or more calls to Update() to decrypt data in chunks. Must eventually be followed by FinishDecrypt(). Caution: do not trust decrypted data until final authentication.
Aead Class
CryptoSysAPI Namespace
Start authenticated encryption (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int StartEncrypt()Int32
Zero (0) if successful; otherwise it returns a nonzero error code
May be followed by zero or more calls to Update() to encrypt data in chunks. Must eventually be followed by FinishEncrypt().
Aead Class
CryptoSysAPI Namespace
Encrypts or decrypts a chunk of input (in incremental mode)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] Update(
byte[] input
)Data to be encrypted or decrypted
Byte[]
Encrypted or decrypted data in array of exactly the same length as
input; or an empty array on error
This function may be repeated to add data in chunks. The input data is encrypted or decrypted depending on the start mode set by a preceding call to StartEncrypt() or StartDecrypt(), respectively. It must eventually be followed by either FinishEncrypt() or FinishDecrypt(), which must match the start mode.
Aead Class
CryptoSysAPI Namespace
Maximum size of tag in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int TagMaxSize = 16Int32
Aead Class
CryptoSysAPI Namespace
Advanced Encryption Standard (AES) with 128-bit key
System.Object
CryptoSysAPI.Aes128
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Aes128 : IDisposableThe Aes128 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
| Instance | Create the one and only instance |
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
| Name | Description |
|---|---|
| BlockSize | Block size in bytes |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Aes128 Class
CryptoSysAPI Namespace
Decrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static byte[] Decrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Byte[]
Decrypted data in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Decrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 16 bytes (128 bits)
Cipher Mode
Hex-encoded IV representing exactly 16 bytes or "" for
ECB mode
String
Decrypted data in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Decrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 16 bytes (128 bits)
Cipher Mode
Encoded IV representing exactly 16 bytes or "" for ECB
mode
Type of encoding used
String
Decrypted data in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Aes128 Class
CryptoSysAPI Namespace
Encrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static byte[] Encrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Byte[]
Ciphertext in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Encrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 16 bytes (128 bits)
Cipher Mode
Hex-encoded IV representing exactly 16 bytes or "" for
ECB mode
String
Ciphertext in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Encrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 16 bytes (128 bits)
Cipher Mode
Encoded IV representing exactly 16 bytes or "" for ECB
mode
Type of encoding used
String
Ciphertext in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Decrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes128 Class
CryptoSysAPI Namespace
Decrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Aes128 Class
CryptoSysAPI Namespace
Decrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes. Use null/Nothing
for ECB mode or when using CipherFileOption.PrefixIV option
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes128 Class
CryptoSysAPI Namespace
Encrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes128 Class
CryptoSysAPI Namespace
Encrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Aes128 Class
CryptoSysAPI Namespace
Encrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes128 Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes128 Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes128 Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 16 bytes (128 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes128 Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes128 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Aes128 Instance()Aes128
Single instance to class
CAUTION: Instances of Aes128, Aes192 and Aes256 are not independent in the same thread.
Aes128 Class
CryptoSysAPI Namespace
Pads byte array to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static byte[] Pad(
byte[] data
)data to be padded
Byte[]
padded data in byte array
Uses PKCS#5/#7/CMS method of padding
Aes128 Class
CryptoSysAPI Namespace
Pads hex-encoded string to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static string Pad(
string dataHex
)hex-encoded data to be padded
String
padded data in hex-encoded string
Uses PKCS#5/#7/CMS method of padding
Aes128 Class
CryptoSysAPI Namespace
Removes the padding from an encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static byte[] Unpad(
byte[] data
)padded data
Byte[]
Unpadded data in byte array or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Aes128 Class
CryptoSysAPI Namespace
Removes the padding from a hex-encoded encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static string Unpad(
string dataHex
)hex-encoded padded data
String
Unpadded data in hex-encoded string or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Aes128 Class
CryptoSysAPI Namespace
Transform byte input data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)input data in byte array
Byte[]
transformed data in byte array
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Transform hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public string Update(
string data
)hex-encoded input data
String
hex-encoded data
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes128 Class
CryptoSysAPI Namespace
Block size in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int BlockSize = 16Int32
Aes128 Class
CryptoSysAPI Namespace
Advanced Encryption Standard (AES) with 192-bit key
System.Object
CryptoSysAPI.Aes192
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Aes192 : IDisposableThe Aes192 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
| Instance | Create the one and only instance |
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
| Name | Description |
|---|---|
| BlockSize | Block size in bytes |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Aes192 Class
CryptoSysAPI Namespace
Decrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static byte[] Decrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Byte[]
Decrypted data in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Decrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Hex-encoded IV representing exactly 16 bytes or "" for
ECB mode
String
Decrypted data in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Decrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Encoded IV representing exactly 16 bytes or "" for ECB
mode
Type of encoding used
String
Decrypted data in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Aes192 Class
CryptoSysAPI Namespace
Encrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static byte[] Encrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Byte[]
Ciphertext in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Encrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Hex-encoded IV representing exactly 16 bytes or "" for
ECB mode
String
Ciphertext in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Encrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Encoded IV representing exactly 16 bytes or "" for ECB
mode
Type of encoding used
String
Ciphertext in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Decrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes192 Class
CryptoSysAPI Namespace
Decrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Aes192 Class
CryptoSysAPI Namespace
Decrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes. Use null/Nothing
for ECB mode or when using CipherFileOption.PrefixIV option
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes192 Class
CryptoSysAPI Namespace
Encrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes192 Class
CryptoSysAPI Namespace
Encrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Aes192 Class
CryptoSysAPI Namespace
Encrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes192 Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes192 Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes192 Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes192 Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes192 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Aes192 Instance()Aes192
Single instance to class
CAUTION: Instances of Aes128, Aes192 and Aes256 are not independent in the same thread.
Aes192 Class
CryptoSysAPI Namespace
Pads byte array to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static byte[] Pad(
byte[] data
)data to be padded
Byte[]
padded data in byte array
Uses PKCS#5/#7/CMS method of padding
Aes192 Class
CryptoSysAPI Namespace
Pads hex-encoded string to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static string Pad(
string dataHex
)hex-encoded data to be padded
String
padded data in hex-encoded string
Uses PKCS#5/#7/CMS method of padding
Aes192 Class
CryptoSysAPI Namespace
Removes the padding from an encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static byte[] Unpad(
byte[] data
)padded data
Byte[]
Unpadded data in byte array or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Aes192 Class
CryptoSysAPI Namespace
Removes the padding from a hex-encoded encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static string Unpad(
string dataHex
)hex-encoded padded data
String
Unpadded data in hex-encoded string or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Aes192 Class
CryptoSysAPI Namespace
Transform byte input data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)input data in byte array
Byte[]
transformed data in byte array
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Transform hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public string Update(
string data
)hex-encoded input data
String
hex-encoded data
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes192 Class
CryptoSysAPI Namespace
Block size in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int BlockSize = 16Int32
Aes192 Class
CryptoSysAPI Namespace
Advanced Encryption Standard (AES) with 256-bit key
System.Object
CryptoSysAPI.Aes256
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Aes256 : IDisposableThe Aes256 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
| Instance | Create the one and only instance |
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
| Name | Description |
|---|---|
| BlockSize | Block size in bytes |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Aes256 Class
CryptoSysAPI Namespace
Decrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static byte[] Decrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Byte[]
Decrypted data in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Decrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 32 bytes (256 bits)
Cipher Mode
Hex-encoded IV representing exactly 16 bytes or "" for
ECB mode
String
Decrypted data in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Decrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 32 bytes (256 bits)
Cipher Mode
Encoded IV representing exactly 16 bytes or "" for ECB
mode
Type of encoding used
String
Decrypted data in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Aes256 Class
CryptoSysAPI Namespace
Encrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static byte[] Encrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Byte[]
Ciphertext in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Encrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 32 bytes (256 bits)
Cipher Mode
Hex-encoded IV representing exactly 16 bytes or "" for
ECB mode
String
Ciphertext in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Encrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 32 bytes (256 bits)
Cipher Mode
Encoded IV representing exactly 16 bytes or "" for ECB
mode
Type of encoding used
String
Ciphertext in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Decrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes256 Class
CryptoSysAPI Namespace
Decrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Aes256 Class
CryptoSysAPI Namespace
Decrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes. Use null/Nothing
for ECB mode or when using CipherFileOption.PrefixIV option
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes256 Class
CryptoSysAPI Namespace
Encrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes256 Class
CryptoSysAPI Namespace
Encrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Aes256 Class
CryptoSysAPI Namespace
Encrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Aes256 Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes256 Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes256 Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 32 bytes (256 bits)
Cipher Mode
IV of exactly 16 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes256 Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Aes256 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Aes256 Instance()Aes256
Single instance to class
CAUTION: Instances of Aes128, Aes192 and Aes256 are not independent in the same thread.
Aes256 Class
CryptoSysAPI Namespace
Pads byte array to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static byte[] Pad(
byte[] data
)data to be padded
Byte[]
padded data in byte array
Uses PKCS#5/#7/CMS method of padding
Aes256 Class
CryptoSysAPI Namespace
Pads hex-encoded string to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static string Pad(
string dataHex
)hex-encoded data to be padded
String
padded data in hex-encoded string
Uses PKCS#5/#7/CMS method of padding
Aes256 Class
CryptoSysAPI Namespace
Removes the padding from an encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static byte[] Unpad(
byte[] data
)padded data
Byte[]
Unpadded data in byte array or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Aes256 Class
CryptoSysAPI Namespace
Removes the padding from a hex-encoded encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static string Unpad(
string dataHex
)hex-encoded padded data
String
Unpadded data in hex-encoded string or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Aes256 Class
CryptoSysAPI Namespace
Transform byte input data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)input data in byte array
Byte[]
transformed data in byte array
For ECB and CBC modes, input data length must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Transform hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public string Update(
string data
)hex-encoded input data
String
hex-encoded data
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes)
Aes256 Class
CryptoSysAPI Namespace
Block size in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int BlockSize = 16Int32
Aes256 Class
CryptoSysAPI Namespace
Blowfish cipher algorithm
System.Object
CryptoSysAPI.Blowfish
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Blowfish : IDisposableThe Blowfish type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
| Instance | Create the one and only instance |
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
| Name | Description |
|---|---|
| BlockSize | Block size in bytes |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Blowfish Class
CryptoSysAPI Namespace
Decrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static byte[] Decrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Byte[]
Decrypted data in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Decrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key
Cipher Mode
Hex-encoded IV representing exactly 8 bytes or "" for
ECB mode
String
Decrypted data in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Decrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key
Cipher Mode
Encoded IV representing exactly 8 bytes or "" for ECB
mode
Type of encoding used
String
Decrypted data in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Blowfish Class
CryptoSysAPI Namespace
Encrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static byte[] Encrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Byte[]
Ciphertext in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Encrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key
Cipher Mode
Hex-encoded IV representing exactly 8 bytes or "" for
ECB mode
String
Ciphertext in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Encrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key
Cipher Mode
Encoded IV representing exactly 8 bytes or "" for ECB
mode
Type of encoding used
String
Ciphertext in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Decrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Blowfish Class
CryptoSysAPI Namespace
Decrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Blowfish Class
CryptoSysAPI Namespace
Decrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes. Use null/Nothing for
ECB mode or when using CipherFileOption.PrefixIV option
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Blowfish Class
CryptoSysAPI Namespace
Encrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Blowfish Class
CryptoSysAPI Namespace
Encrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Blowfish Class
CryptoSysAPI Namespace
Encrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Blowfish Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Blowfish Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Blowfish Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of length between 1 and 56 bytes (448 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Blowfish Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Blowfish Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Blowfish Instance()Blowfish
Single instance to class
Blowfish Class
CryptoSysAPI Namespace
Pads byte array to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static byte[] Pad(
byte[] data
)data to be padded
Byte[]
padded data in byte array
Uses PKCS#5/#7/CMS method of padding
Blowfish Class
CryptoSysAPI Namespace
Pads hex-encoded string to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static string Pad(
string dataHex
)hex-encoded data to be padded
String
padded data in hex-encoded string
Uses PKCS#5/#7/CMS method of padding
Blowfish Class
CryptoSysAPI Namespace
Removes the padding from an encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static byte[] Unpad(
byte[] data
)padded data
Byte[]
Unpadded data in byte array or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Blowfish Class
CryptoSysAPI Namespace
Removes the padding from a hex-encoded encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static string Unpad(
string dataHex
)hex-encoded padded data
String
Unpadded data in hex-encoded string or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Blowfish Class
CryptoSysAPI Namespace
Transform byte input data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)input data in byte array
Byte[]
transformed data in byte array
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Transform hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public string Update(
string data
)hex-encoded input data
String
hex-encoded data
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Blowfish Class
CryptoSysAPI Namespace
Block size in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int BlockSize = 8Int32
Blowfish Class
CryptoSysAPI Namespace
Block cipher utilities
System.Object
CryptoSysAPI.Cipher
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class CipherThe Cipher type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, Update and Final object methods only) |
| Name | Description |
|---|---|
| BlockBytes | Return the block size in bytes for a given cipher algorithm |
| Decrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) | Decrypt data in a byte array using the specified block cipher algorithm, mode and padding. |
| Decrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) | Decrypt hex-encoded data using specified block cipher algorithm, mode and padding. |
| Dispose | Dispose of this object and clear any stored data. |
| Encrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) | Encrypt data in a byte array using the specified block cipher algorithm, mode and padding. |
| Encrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) | Encrypt hex-encoded data using specified block cipher algorithm, mode and padding. |
| FileDecrypt | Decrypt a file with block cipher |
| FileEncrypt | Encrypt a file with block cipher |
| InitDecrypt(Byte[], Byte[], CipherAlgorithm, Mode) | Initializes with key, iv, algorithm and mode ready to start decrypting with repeated update operations. |
| InitDecrypt(String, String, CipherAlgorithm, Mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start decrypting with repeated update operations. |
| InitEncrypt(Byte[], Byte[], CipherAlgorithm, Mode) | Initializes with key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
| InitEncrypt(String, String, CipherAlgorithm, Mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
| Instance | Create the one and only instance |
| KeyBytes | Return the key size in bytes for a given cipher algorithm |
| KeyUnwrap | Unwraps (decrypts) key material with a key-encryption key |
| KeyWrap | Wraps (encrypts) key material with a key-encryption key |
| Pad(Byte[], CipherAlgorithm, Padding) | Pad byte array for block cipher. |
| Pad(String, CipherAlgorithm, Padding) | Pads hex-encoded string for block cipher. |
| Unpad(Byte[], CipherAlgorithm, Padding) | Remove padding from an encryption block. |
| Unpad(String, CipherAlgorithm, Padding) | Remove padding from a hex-encoded encryption block. |
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction. |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
Last error code (for Init, Update and Final object methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Cipher Class
CryptoSysAPI Namespace
Return the block size in bytes for a given cipher algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int BlockBytes(
CipherAlgorithm alg
)Cipher algorithm
Int32
Block size in bytes
Cipher Class
CryptoSysAPI Namespace
Decrypt data in a byte array using the specified block cipher algorithm, mode and padding.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) | Decrypt data in a byte array using the specified block cipher algorithm, mode and padding. |
| Decrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) | Decrypt hex-encoded data using specified block cipher algorithm, mode and padding. |
public static byte[] Decrypt(
byte[] input,
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad,
Cipher.Opts opts = Cipher.Opts.Default
)Input data to be decrypted
Key of exact length for block cipher algorithm
Initialization Vector (IV) of exactly the block size or
null for ECB mode, if not provided in input.
Cipher algorithm
Cipher mode
Padding method to use
Advanced options (optional). Use Cipher.Opts.PrefixIV to expect the IV to be prepended at the start of the input.
Byte[]
Decrypted plaintext in byte array or empty array on error
Default padding is Pkcs5 for ECB and CBC mode and
NoPad for all other modes. It is an error if the specified
padding is not found after decryption.
Cipher Class
CryptoSysAPI Namespace
Decrypt hex-encoded data using specified block cipher algorithm, mode and padding.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) | Decrypt data in a byte array using the specified block cipher algorithm, mode and padding. |
| Decrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) | Decrypt hex-encoded data using specified block cipher algorithm, mode and padding. |
public static string Decrypt(
string inputHex,
string keyHex,
string ivHex,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad,
Cipher.Opts opts = Cipher.Opts.Default
)Hex-encoded input data
Hex-encoded key representing exact key length
Hex-encoded IV representing exact block length or "" for
ECB mode
Cipher Algorithm
Cipher Mode
Padding method to use
Advanced options (optional). Use Cipher.Opts.PrefixIV to prepend the IV to the output.
String
Decrypted plaintex in hex-encoded string or empty string on error
Input data may be any even number of hex characters, but not zero.
Default padding is Pkcs5 for ECB and CBC mode and
NoPad for all other modes.
Cipher Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Cipher Class
CryptoSysAPI Namespace
Encrypt data in a byte array using the specified block cipher algorithm, mode and padding.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) | Encrypt data in a byte array using the specified block cipher algorithm, mode and padding. |
| Encrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) | Encrypt hex-encoded data using specified block cipher algorithm, mode and padding. |
public static byte[] Encrypt(
byte[] input,
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad,
Cipher.Opts opts = Cipher.Opts.Default
)Input data to be encrypted
Key of exact length for block cipher algorithm
Initialization Vector (IV) of exactly the block size or
null for ECB mode, if not provided in input.
Cipher algorithm
Cipher mode
Padding method to use
Advanced options (optional). Use Cipher.Opts.PrefixIV to prepend the IV to the output.
Byte[]
Ciphertext in byte array or empty array on error
Default padding is Pkcs5 for ECB and CBC mode and
NoPad for all other modes.
Cipher Class
CryptoSysAPI Namespace
Encrypt hex-encoded data using specified block cipher algorithm, mode and padding.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) | Encrypt data in a byte array using the specified block cipher algorithm, mode and padding. |
| Encrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) | Encrypt hex-encoded data using specified block cipher algorithm, mode and padding. |
public static string Encrypt(
string inputHex,
string keyHex,
string ivHex,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad,
Cipher.Opts opts = Cipher.Opts.Default
)Hex-encoded input data
Hex-encoded key representing exact key length
Hex-encoded IV representing exact block length or "" for
ECB mode
Cipher Algorithm
Cipher Mode
Padding method to use
Advanced options (optional). Use Cipher.Opts.PrefixIV to prepend the IV to the output.
String
Encrypted ciphertext in hex-encoded string or empty string on error
Input data may be any even number of hex characters, but not zero.
Default padding is Pkcs5 for ECB and CBC mode and
NoPad for all other modes.
Cipher Class
CryptoSysAPI Namespace
Decrypt a file with block cipher
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad,
Cipher.Opts opts
)Name of output file to be created or overwritten
Name of input file
Key of of exact length for block cipher algorithm
Initialization Vector (IV) of exactly the block size or
null for ECB mode
Cipher Algorithm
Cipher Mode
Padding method to use (ECB and CBC modes only)
Advanced options
Int32
0 if successful or nonzero error
code
fileOut and fileIn must
not be the same
Cipher Class
CryptoSysAPI Namespace
Encrypt a file with block cipher
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad,
Cipher.Opts opts
)Name of output file to be created or overwritten
Name of input file
Key of of exact length for block cipher algorithm
Initialization Vector (IV) of exactly the block size or
null for ECB mode
Cipher Algorithm
Cipher Mode
Padding method to use (ECB and CBC modes only)
Advanced options
Int32
0 if successful or nonzero error
code
fileOut and fileIn must
not be the same
Cipher Class
CryptoSysAPI Namespace
Initializes with key, iv, algorithm and mode ready to start decrypting with repeated update operations.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Byte[], CipherAlgorithm, Mode) | Initializes with key, iv, algorithm and mode ready to start decrypting with repeated update operations. |
| InitDecrypt(String, String, CipherAlgorithm, Mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start decrypting with repeated update operations. |
public bool InitDecrypt(
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode
)Key of exact length for block cipher algorithm.
Initialization Vector (IV) of exactly the block size or
null/Nothing for ECB mode.
Cipher algorithm
Cipher mode
Boolean
True if successful, False if failed.
Cipher Class
CryptoSysAPI Namespace
Initializes with hex-encoded key, iv, algorithm and mode ready to start decrypting with repeated update operations.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Byte[], CipherAlgorithm, Mode) | Initializes with key, iv, algorithm and mode ready to start decrypting with repeated update operations. |
| InitDecrypt(String, String, CipherAlgorithm, Mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start decrypting with repeated update operations. |
public bool InitDecrypt(
string keyHex,
string ivHex,
CipherAlgorithm cipherAlg,
Mode mode
)Hex-encoded key of exact length for block cipher algorithm.
Hex-encoded Initialization Vector (IV) of exactly the block size or
"" for ECB mode.
Cipher algorithm
Cipher mode
Boolean
True if successful, False if failed.
Cipher Class
CryptoSysAPI Namespace
Initializes with key, iv, algorithm and mode ready to start encrypting with repeated update operations.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Byte[], CipherAlgorithm, Mode) | Initializes with key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
| InitEncrypt(String, String, CipherAlgorithm, Mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
public bool InitEncrypt(
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode
)Key of exact length for block cipher algorithm.
Initialization Vector (IV) of exactly the block size or
null/Nothing for ECB mode.
Cipher algorithm
Cipher mode
Boolean
True if successful, False if failed.
Cipher Class
CryptoSysAPI Namespace
Initializes with hex-encoded key, iv, algorithm and mode ready to start encrypting with repeated update operations.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Byte[], CipherAlgorithm, Mode) | Initializes with key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
| InitEncrypt(String, String, CipherAlgorithm, Mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
public bool InitEncrypt(
string keyHex,
string ivHex,
CipherAlgorithm cipherAlg,
Mode mode
)Hex-encoded key of exact length for block cipher algorithm.
Hex-encoded Initialization Vector (IV) of exactly the block size or
"" for ECB mode.
Cipher algorithm
Cipher mode
Boolean
True if successful, False if failed.
Cipher Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Cipher Instance()Cipher
Single instance to class
Cipher Class
CryptoSysAPI Namespace
Return the key size in bytes for a given cipher algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int KeyBytes(
CipherAlgorithm alg
)Cipher algorithm
Int32
Key size in bytes
Cipher Class
CryptoSysAPI Namespace
Unwraps (decrypts) key material with a key-encryption key
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] KeyUnwrap(
byte[] data,
byte[] kek,
CipherAlgorithm cipherAlg
)Wrapped key
Key encryption key
Block cipher to use for wrapping
Byte[]
Unwrapped key material (or empty array on error)
Cipher Class
CryptoSysAPI Namespace
Wraps (encrypts) key material with a key-encryption key
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] KeyWrap(
byte[] data,
byte[] kek,
CipherAlgorithm cipherAlg
)Key material to be wrapped
Key encryption key
Block cipher to use for wrapping
Byte[]
Wrapped key (or empty array on error)
Cipher Class
CryptoSysAPI Namespace
Pad byte array for block cipher.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[], CipherAlgorithm, Padding) | Pad byte array for block cipher. |
| Pad(String, CipherAlgorithm, Padding) | Pads hex-encoded string for block cipher. |
public static byte[] Pad(
byte[] input,
CipherAlgorithm cipherAlg,
Padding pad
)data to be padded
Block cipher being used
Padding method to use
Byte[]
Padded data in byte array
Cipher Class
CryptoSysAPI Namespace
Pads hex-encoded string for block cipher.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[], CipherAlgorithm, Padding) | Pad byte array for block cipher. |
| Pad(String, CipherAlgorithm, Padding) | Pads hex-encoded string for block cipher. |
public static string Pad(
string inputHex,
CipherAlgorithm cipherAlg,
Padding pad
)hex-encoded data to be padded
Block cipher being used
Padding method to use
String
Padded data in hex-encoded string
Cipher Class
CryptoSysAPI Namespace
Remove padding from an encryption block.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[], CipherAlgorithm, Padding) | Remove padding from an encryption block. |
| Unpad(String, CipherAlgorithm, Padding) | Remove padding from a hex-encoded encryption block. |
public static byte[] Unpad(
byte[] input,
CipherAlgorithm cipherAlg,
Padding pad
)padded data
Block cipher being used
Padding method to use
Byte[]
Unpadded data in byte array.
Unless pad is NoPad, the unpadded output is
always shorter than the padded input. An error is indicated by returning
the original data.
Cipher Class
CryptoSysAPI Namespace
Remove padding from a hex-encoded encryption block.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[], CipherAlgorithm, Padding) | Remove padding from an encryption block. |
| Unpad(String, CipherAlgorithm, Padding) | Remove padding from a hex-encoded encryption block. |
public static string Unpad(
string inputHex,
CipherAlgorithm cipherAlg,
Padding pad
)hex-encoded padded data
Block cipher being used
Padding method to use
String
Unpadded data in hex-encoded string.
Unless pad is NoPad, the unpadded output is
always shorter than the padded input. An error is indicated by returning
the original data.
Cipher Class
CryptoSysAPI Namespace
Transform byte input data with previously initialized key, mode and direction.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction. |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)Input data in byte array.
Byte[]
Transformed data in byte array.
Cipher Class
CryptoSysAPI Namespace
Transform hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction. |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public string Update(
string dataHex
)Hex-encoded input data
String
Hex-encoded data
For all modes, the length of the decoded input bytes must be an exact multiple of the cipher block length (8 or 16 bytes).
Cipher Class
CryptoSysAPI Namespace
Stream cipher algorithms
System.Object
CryptoSysAPI.CipherStream
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class CipherStream : IDisposableThe CipherStream type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| Bytes | Enciphers data in array of bytes using specified stream cipher. |
| Dispose | Dispose of this object and clear any key schedules |
| File | Enciphers data in a file using specified stream cipher. |
| Hex | Enciphers data in a hex-encoded string using specified stream cipher. |
| Init | Initializes the context ready for repeated operations of CipherStream.Update |
| Instance | Create the one and only instance |
| Update | Encrypts input using current context |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
CipherStream Class
CryptoSysAPI Namespace
Enciphers data in array of bytes using specified stream cipher.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Bytes(
byte[] input,
byte[] key,
byte[] iv,
int counter,
CipherStream.Algorithm streamAlg
)Input data to be encrypted
Key
Initialization Vector (IV, nonce) or null for
Arcfour
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.
Stream cipher algorithm
Byte[]
Ciphertext in byte array, or empty array on error
Arcfour: any length key; specify null
for IV.Salsa20: key must be exactly 16 or 32 bytes and
IV exactly 8 bytes long.ChaCha20: key must be exactly
16 or 32 bytes and IV exactly 8, 12, or 16 bytes long. Counter is
ignored if IV is 16 bytes.
CipherStream Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
CipherStream Class
CryptoSysAPI Namespace
Enciphers data in a file using specified stream cipher.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int File(
string fileOut,
string fileIn,
byte[] key,
byte[] iv,
int counter,
CipherStream.Algorithm streamAlg
)Name of output file to be created or overwritten
Name of input file
Key
Initialization Vector (IV, nonce) or null for
Arcfour
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.
Stream cipher algorithm
Int32
0 if successful or nonzero error
code
fileOut and fileIn must
not be the same Arcfour: any length
key; specify null for IV.Salsa20: key must
be exactly 16 or 32 bytes and IV exactly 8 bytes
long.ChaCha20: key must be exactly 16 or 32 bytes and
IV exactly 8, 12, or 16 bytes long. Counter is ignored if IV is 16
bytes.
CipherStream Class
CryptoSysAPI Namespace
Enciphers data in a hex-encoded string using specified stream cipher.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string Hex(
string inputHex,
string keyHex,
string ivHex,
int counter,
CipherStream.Algorithm streamAlg
)Hex-encoded input data
Hex-encoded key
Hex-encoded Initialization Vector (IV, nonce) or "" for
Arcfour
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.
Stream cipher algorithm
String
Ciphertext in hex-encoded string or empty string on error
Arcfour: any length key; specify null
for IV.Salsa20: key must be exactly 16 or 32 bytes and
IV exactly 8 bytes long.ChaCha20: key must be exactly
16 or 32 bytes and IV exactly 8, 12, or 16 bytes long. Counter is
ignored if IV is 16 bytes.
CipherStream Class
CryptoSysAPI Namespace
Initializes the context ready for repeated operations of CipherStream.Update
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Init(
byte[] key,
byte[] iv,
int counter,
CipherStream.Algorithm streamAlg
)Key
Initialization Vector (IV, nonce) or null for
Arcfour
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.
Stream cipher algorithm
Int32
0 if successful or nonzero error
code
Arcfour: any length key; specify null
for IV.Salsa20: key must be exactly 16 or 32 bytes and
IV exactly 8 bytes long.ChaCha20: key must be exactly
16 or 32 bytes and IV exactly 8, 12, or 16 bytes long. Counter is
ignored if IV is 16 bytes.
CipherStream Class
CryptoSysAPI Namespace
Encrypts input using current context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] Update(
byte[] input
)Input data to be encrypted
Byte[]
Encrypted data in array of exactly the same length as input; or an empty
array on error
Check CipherStream.ErrCode for error details
CipherStream Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static CipherStream Instance()CipherStream
Single instance to class
CAUTION: Instances of different algorithms are not independent in the same thread.
CipherStream Class
CryptoSysAPI Namespace
Character conversion routines
System.Object
CryptoSysAPI.Cnv
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class CnvThe Cnv type exposes the following members.
| Name | Description |
|---|---|
| Base64Filter | Filters non-base64 characters from a string |
| Base64FromHex | Converts hexadecimal-encoded data into base64-encoded data |
| FromBase64 | Converts a base64-encoded string to an equivalent array of 8-bit unsigned integers. |
| FromHex | Converts a hexadecimal-encoded string to an equivalent array of 8-bit unsigned integers. |
| HexFilter | Filters non-hexadecimal characters from a string |
| HexFromBase64 | Converts base64-encoded data into hexadecimal-encoded data |
| ShortPathName | Retrieve the Windows short path form of the specified path. |
| StringFromBase64 | Converts a base64-encoded string into a text string |
| StringFromHex | Converts a hexadecimal-encoded string into a text string |
| ToBase64(Byte[]) | Converts 8-bit binary data to equivalent base64-encoded string format |
| ToBase64(String) | Converts a string of ANSI characters to equivalent base64-encoded string format |
| ToHex(Byte[]) | Converts 8-bit binary data to equivalent hexadecimal string format |
| ToHex(String) | Converts a string of ANSI characters to equivalent hexadecimal string format |
Filters non-base64 characters from a string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string Base64Filter(
string s
)String to be filtered
String
Filtered string
Valid base64 characters are [0-9A-Za-z+/=]
Cnv Class
CryptoSysAPI Namespace
Converts hexadecimal-encoded data into base64-encoded data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string Base64FromHex(
string s
)Hex-encoded data
String
Base64-encoded data
Cnv Class
CryptoSysAPI Namespace
Converts a base64-encoded string to an equivalent array of 8-bit unsigned integers.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] FromBase64(
string s
)Base64-encoded data
Byte[]
Data as array of bytes
Cnv Class
CryptoSysAPI Namespace
Converts a hexadecimal-encoded string to an equivalent array of 8-bit unsigned integers.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] FromHex(
string s
)Hex-encoded data
Byte[]
Data as array of bytes
Cnv Class
CryptoSysAPI Namespace
Filters non-hexadecimal characters from a string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFilter(
string s
)String to be filtered
String
Filtered string
Valid hex characters are [0-9A-Fa-f]
Cnv Class
CryptoSysAPI Namespace
Converts base64-encoded data into hexadecimal-encoded data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromBase64(
string s
)Base64-encoded data
String
Hex-encoded data
Cnv Class
CryptoSysAPI Namespace
Retrieve the Windows short path form of the specified path.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string ShortPathName(
string pathName
)File path name.
String
Windows short path name of file or the empty string if file does not
exist.
Windows platforms only. The file path must exist. The short path name is guaranteed to be ASCII.
Cnv Class
CryptoSysAPI Namespace
Converts a base64-encoded string into a text string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string StringFromBase64(
string s
)Base64-encoded data
String
String value
Uses the ‘Default’ encoding for the system’s current ANSI code page
Cnv Class
CryptoSysAPI Namespace
Converts a hexadecimal-encoded string into a text string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string StringFromHex(
string s
)Hex-encoded data
String
String value
Uses the ‘Default’ encoding for the system’s current ANSI code page
Cnv Class
CryptoSysAPI Namespace
Converts 8-bit binary data to equivalent base64-encoded string format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| ToBase64(Byte[]) | Converts 8-bit binary data to equivalent base64-encoded string format |
| ToBase64(String) | Converts a string of ANSI characters to equivalent base64-encoded string format |
public static string ToBase64(
byte[] binaryData
)binary data
String
Base64-encoded string
Cnv Class
CryptoSysAPI Namespace
Converts a string of ANSI characters to equivalent base64-encoded string format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| ToBase64(Byte[]) | Converts 8-bit binary data to equivalent base64-encoded string format |
| ToBase64(String) | Converts a string of ANSI characters to equivalent base64-encoded string format |
public static string ToBase64(
string s
)String of data to be encoded
String
Base64-encoded data
Uses the ‘Default’ encoding for the system’s current ANSI code page
Cnv Class
CryptoSysAPI Namespace
Converts 8-bit binary data to equivalent hexadecimal string format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| ToHex(Byte[]) | Converts 8-bit binary data to equivalent hexadecimal string format |
| ToHex(String) | Converts a string of ANSI characters to equivalent hexadecimal string format |
public static string ToHex(
byte[] binaryData
)binary data
String
Hex-encoded string
Cnv Class
CryptoSysAPI Namespace
Converts a string of ANSI characters to equivalent hexadecimal string format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| ToHex(Byte[]) | Converts 8-bit binary data to equivalent hexadecimal string format |
| ToHex(String) | Converts a string of ANSI characters to equivalent hexadecimal string format |
public static string ToHex(
string s
)String of data to be encoded
String
Hex-encoded data
Uses the ‘Default’ encoding for the system’s current ANSI code page
Cnv Class
CryptoSysAPI Namespace
Compression utilities
System.Object
CryptoSysAPI.Compr
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class ComprThe Compr type exposes the following members.
| Name | Description |
|---|---|
| Compress | Compress data using compression algorithm. |
| Uncompress | Uncompress data using compression algorithm. |
Compress data using compression algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Compress(
byte[] data,
ComprAlgorithm comprAlg = ComprAlgorithm.Zlib
)Data to be compressed.
Compression algorithm.
Byte[]
Compressed data, or an empty array on error.
Compr Class
CryptoSysAPI Namespace
Uncompress data using compression algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Uncompress(
byte[] data,
ComprAlgorithm comprAlg = ComprAlgorithm.Zlib
)Compressed data to be uncompressed.
Compression algorithm.
Byte[]
Uncompressed data, or an empty array on error.
An empty array may also be returned in the trivial case that the original data was the empty array itself.
Compr Class
CryptoSysAPI Namespace
CRC-32 computations
System.Object
CryptoSysAPI.Crc
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class CrcThe Crc type exposes the following members.
| Name | Description |
|---|---|
| Data(Byte[]) | Computes CRC-32 checksum for data |
| Data(String) | Computes CRC-32 checksum for a string |
| File | Computes CRC-32 checksum for a file |
Computes CRC-32 checksum for data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Data(Byte[]) | Computes CRC-32 checksum for data |
| Data(String) | Computes CRC-32 checksum for a string |
public static int Data(
byte[] data
)input data
Int32
Value of CRC-32 checksum
Crc Class
CryptoSysAPI Namespace
Computes CRC-32 checksum for a string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Data(Byte[]) | Computes CRC-32 checksum for data |
| Data(String) | Computes CRC-32 checksum for a string |
public static int Data(
string Str
)input data
Int32
Value of CRC-32 checksum
Crc Class
CryptoSysAPI Namespace
Computes CRC-32 checksum for a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int File(
string fileName
)Name of input file
Int32
Value of CRC-32 checksum
If return value is zero, the file could not be found or read
Crc Class
CryptoSysAPI Namespace
Data Encryption Standard (DES) Cipher (legacy applications only)
System.Object
CryptoSysAPI.Des
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Des : IDisposableThe Des type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| CheckKey(Byte[]) | Verifies that no part of the key is a weak or semi-weak DES key. |
| CheckKey(String) | Verifies that no part of the key is a weak or semi-weak DES key. |
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
| Instance | Create the one and only instance |
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
| Update(Byte[]) | Transforms byte input data with previously initialized key, mode and direction |
| Update(String) | Transforms hex string data with previously initialized key, mode and direction |
| Name | Description |
|---|---|
| BlockSize | Block size in bytes |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Des Class
CryptoSysAPI Namespace
Verifies that no part of the key is a weak or semi-weak DES key.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| CheckKey(Byte[]) | Verifies that no part of the key is a weak or semi-weak DES key. |
| CheckKey(String) | Verifies that no part of the key is a weak or semi-weak DES key. |
public static int CheckKey(
byte[] key
)Key to check
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Des Class
CryptoSysAPI Namespace
Verifies that no part of the key is a weak or semi-weak DES key.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| CheckKey(Byte[]) | Verifies that no part of the key is a weak or semi-weak DES key. |
| CheckKey(String) | Verifies that no part of the key is a weak or semi-weak DES key. |
public static int CheckKey(
string keyHex
)Hex-encoded key to check
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Des Class
CryptoSysAPI Namespace
Decrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static byte[] Decrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Byte[]
Decrypted data in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Decrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 8 bytes (64 bits)
Cipher Mode
Hex-encoded IV representing exactly 8 bytes or "" for
ECB mode
String
Decrypted data in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Decrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 8 bytes (64 bits)
Cipher Mode
Encoded IV representing exactly 8 bytes or "" for ECB
mode
Type of encoding used
String
Decrypted data in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Des Class
CryptoSysAPI Namespace
Encrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static byte[] Encrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Byte[]
Ciphertext in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Encrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 8 bytes (64 bits)
Cipher Mode
Hex-encoded IV representing exactly 8 bytes or "" for
ECB mode
String
Ciphertext in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Encrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 8 bytes (64 bits)
Cipher Mode
Encoded IV representing exactly 8 bytes or "" for ECB
mode
Type of encoding used
String
Ciphertext in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Decrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Des Class
CryptoSysAPI Namespace
Decrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Des Class
CryptoSysAPI Namespace
Decrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes. Use null/Nothing for
ECB mode or when using CipherFileOption.PrefixIV option
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Des Class
CryptoSysAPI Namespace
Encrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Des Class
CryptoSysAPI Namespace
Encrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Des Class
CryptoSysAPI Namespace
Encrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Des Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Des Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Des Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 8 bytes (64 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Des Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Des Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Des Instance()Des
Single instance to class
Des Class
CryptoSysAPI Namespace
Pads byte array to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static byte[] Pad(
byte[] data
)data to be padded
Byte[]
padded data in byte array
Uses PKCS#5/#7/CMS method of padding
Des Class
CryptoSysAPI Namespace
Pads hex-encoded string to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static string Pad(
string dataHex
)hex-encoded data to be padded
String
padded data in hex-encoded string
Uses PKCS#5/#7/CMS method of padding
Des Class
CryptoSysAPI Namespace
Removes the padding from an encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static byte[] Unpad(
byte[] data
)padded data
Byte[]
Unpadded data in byte array or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Des Class
CryptoSysAPI Namespace
Removes the padding from a hex-encoded encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static string Unpad(
string dataHex
)hex-encoded padded data
String
Unpadded data in hex-encoded string or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Des Class
CryptoSysAPI Namespace
Transforms byte input data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transforms byte input data with previously initialized key, mode and direction |
| Update(String) | Transforms hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)input data in byte array
Byte[]
transformed data in byte array
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Transforms hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transforms byte input data with previously initialized key, mode and direction |
| Update(String) | Transforms hex string data with previously initialized key, mode and direction |
public string Update(
string data
)hex-encoded input data
String
hex-encoded data
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Des Class
CryptoSysAPI Namespace
Block size in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int BlockSize = 8Int32
Des Class
CryptoSysAPI Namespace
Provides authenticated encryption using the Galois/Counter Mode (GCM) of operation with the AES algorithm (AES-GCM).
System.Object
CryptoSysAPI.Gcm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Gcm : IDisposableThe Gcm type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (object-related only) |
| Name | Description |
|---|---|
| Decrypt | Decrypt input using AES-GCM in one-off operation |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt | Encrypt input using AES-GCM in one-off operation |
| Gmac | Compute GMAC using AES-GCM in one-off operation |
| InitKey | Initializes the context with the key ready for repeated operations of Gcm.NextEncrypt, Gcm.NextDecrypt, or Gcm.NextGmac. |
| Instance | Create the one and only instance |
| NextDecrypt | Carries out the GCM decryption operation using the key set up by an earlier call to Gcm.InitKey. |
| NextEncrypt | Carries out the GCM encryption operation using the key set up by an earlier call to Gcm.InitKey. |
| NextGmac | Carries out the GMAC operation using the key set up by an earlier call to Gcm.InitKey. |
| Name | Description |
|---|---|
| TagMaxSize | Maximum size of tag in bytes |
Last error code (object-related only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Gcm Class
CryptoSysAPI Namespace
Decrypt input using AES-GCM in one-off operation
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Decrypt(
byte[] input,
byte[] key,
byte[] iv,
byte[] aad,
byte[] tag
)Cipher text input data
Key: must be exactly 16, 24 or 32 bytes long.
Initialization vector.
Additional authentication data (optional). Pass
null/Nothing to ignore.
Tag value (required)
Byte[]
Decrypted plaintext in byte array, or empty array on error
Use General.ErrorCode to find the code of the last error.
Gcm Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Gcm Class
CryptoSysAPI Namespace
Encrypt input using AES-GCM in one-off operation
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Encrypt(
out byte[] tag,
byte[] input,
byte[] key,
byte[] iv,
byte[] aad
)To receive the output authentication tag value. Always returned exactly 16 bytes long. You may truncate as desired. This is a by-reference parameter. There is no need to initialize (but the VB compiler may complain).
Plain text input data
Key: must be exactly 16, 24 or 32 bytes long.
Initialization vector: can be any length but 12 bytes is recommended.
Additional authentication data (optional). Pass
null/Nothing to ignore.
Byte[]
Encrypted ciphertext in byte array, or empty array on error
If you just require a GMAC value, use Gcm.Gmac Use General.ErrorCode to find the code of the last error.
Gcm Class
CryptoSysAPI Namespace
Compute GMAC using AES-GCM in one-off operation
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Gmac(
byte[] key,
byte[] iv,
byte[] msg
)Key: must be exactly 16, 24 or 32 bytes long.
Initialization vector
Message data
Byte[]
GMAC value in 16-byte array, or empty array on error
Use General.ErrorCode to find the code of the last error.
Gcm Class
CryptoSysAPI Namespace
Initializes the context with the key ready for repeated operations of Gcm.NextEncrypt, Gcm.NextDecrypt, or Gcm.NextGmac.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int InitKey(
byte[] key
)Key: must be exactly 16, 24 or 32 bytes long.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Once a key has been set up, Gcm.NextEncrypt, Gcm.NextDecrypt and Gcm.NextGmac can be used independently.
Gcm o = Instance();
o.InitKey(key);
byte[] tag = new byte[16];
byte[] ct = o.NextEncrypt(tag, pt, iv, aad);
//...
o.Dispose();Gcm Class
CryptoSysAPI Namespace
Carries out the GCM encryption operation using the key set up by an earlier call to Gcm.InitKey.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] NextEncrypt(
out byte[] tag,
byte[] input,
byte[] iv,
byte[] aad
)Tag value, always returned exactly 16 bytes long. You may truncate as desired.
Plain text input data
Initialization vector: can be any length but 12 bytes is recommended.
Additional authentication data (optional). Pass
null/Nothing to ignore.
Byte[]
Encrypted ciphertext in byte array, or empty array on error
Gcm Class
CryptoSysAPI Namespace
Carries out the GCM decryption operation using the key set up by an earlier call to Gcm.InitKey.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] NextDecrypt(
byte[] input,
byte[] iv,
byte[] aad,
byte[] tag
)Cipher text input data
Initialization vector.
Additional authentication data (optional). Pass
null/Nothing to ignore.
Tag value (required)
Byte[]
Decrypted plaintext in byte array, or empty array on error
Gcm Class
CryptoSysAPI Namespace
Carries out the GMAC operation using the key set up by an earlier call to Gcm.InitKey.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] NextGmac(
byte[] iv,
byte[] msg
)Initialization vector.
Message data.
Byte[]
GMAC value in byte array, or empty array on error
Gcm Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Gcm Instance()Gcm
Single instance to class
Gcm Class
CryptoSysAPI Namespace
Maximum size of tag in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int TagMaxSize = 16Int32
Gcm Class
CryptoSysAPI Namespace
General functions
System.Object
CryptoSysAPI.General
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class GeneralThe General type exposes the following members.
| Name | Description |
|---|---|
| CompileTime | Gets date and time the CryptoSys DLL module was last compiled |
| ErrorCode | Returns the error code of the error that occurred when calling the last function |
| ErrorLookup | Looks up error code |
| FormatErrorMessage | Return an error message string for the last error. |
| IsWin64 | Returns flag indicating the platform of the core DLL. |
| LicenceType | Gets licence type. |
| ModuleInfo | Get additional information about the core DLL module. |
| ModuleName | Gets full path name of core CryptoSys DLL module |
| NetVersion | Return the version of this .NET module. |
| Platform | Return the platform the core DLL was compiled for. |
| PowerUpTests | Performs FIPS-140-2 start-up tests |
| Version | Returns version number of core CryptoSys DLL. |
Gets date and time the CryptoSys DLL module was last compiled
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string CompileTime()String
Date and time string
General Class
CryptoSysAPI Namespace
Return an error message string for the last error.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FormatErrorMessage(
int errCode = 0
)Error code returned by last call (optional)
String
Error message as a string
Error ({errCode}): {errorlookup}[: {lasterror}]
General Class
CryptoSysAPI Namespace
Returns flag indicating the platform of the core DLL.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int IsWin64()Int32
1 if platform is Win64 (X64) or 0 if Win32
General Class
CryptoSysAPI Namespace
Gets licence type.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static char LicenceType()Char
D=Developer T=Trial
General Class
CryptoSysAPI Namespace
Get additional information about the core DLL module.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string ModuleInfo()String
STring containing additional information,
e.g. "Licensed Developer Edition"
General Class
CryptoSysAPI Namespace
Gets full path name of core CryptoSys DLL module
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string ModuleName()String
File name
General Class
CryptoSysAPI Namespace
Return the version of this .NET module.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string NetVersion()String
Version string, e.g. "03.05.00"
General Class
CryptoSysAPI Namespace
Return the platform the core DLL was compiled for.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string Platform()String
"Win32" or "X64"
General Class
CryptoSysAPI Namespace
Performs FIPS-140-2 start-up tests
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int PowerUpTests()Int32
Zero on success
General Class
CryptoSysAPI Namespace
Returns version number of core CryptoSys DLL.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int Version()Int32
Version number in form Major * 10000 + Minor * 100 + Release
For example, version 5.2.1 returns 50201
General Class
CryptoSysAPI Namespace
Message Digest Hash Functions
System.Object
CryptoSysAPI.Hash
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class HashThe Hash type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, AddData and Final object methods only) |
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds a chunk of data in a byte array to be digested by the Hash object. |
| AddData(String) | Adds a chunk of data in a string to be digested by the Hash object. |
| BytesFromBytes | Computes hash value in byte format of byte input |
| BytesFromFile | Computes hash value in byte format of a binary file |
| Dispose | Dispose of this object and clear any stored data. |
| Final | Computes final message digest for the Hash object. |
| HexFromBits | Computes hash value in hex format from bit-oriented input |
| HexFromBytes | Computes hash value in hex format of byte input |
| HexFromFile | Computes hash value in hex format of a binary file |
| HexFromHex | Computes hash value in hex format of hex-encoded input |
| HexFromString | Computes hash value in hex format of string input |
| HexFromTextFile | Computes hash value in hex format of a text file, treating CR-LF pairs as a single LF |
| Init | Initialises the Hash object ready for repeated incremental operations. |
| Instance | Create the one and only instance |
| LengthInBytes | Returns the number of bytes in the message digest for the given hash algorithm. |
| Reset | Resets the context of the Hash object. |
Last error code (for Init, AddData and Final object methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Hash Class
CryptoSysAPI Namespace
Adds a chunk of data in a byte array to be digested by the Hash object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds a chunk of data in a byte array to be digested by the Hash object. |
| AddData(String) | Adds a chunk of data in a string to be digested by the Hash object. |
public int AddData(
byte[] b
)Data to add
Int32
0 on success or nonzero error code
Hash Class
CryptoSysAPI Namespace
Adds a chunk of data in a string to be digested by the Hash object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds a chunk of data in a byte array to be digested by the Hash object. |
| AddData(String) | Adds a chunk of data in a string to be digested by the Hash object. |
public int AddData(
string s
)Data to add
Int32
0 on success or nonzero error code
Hash Class
CryptoSysAPI Namespace
Computes hash value in byte format of byte input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] BytesFromBytes(
byte[] message,
HashAlgorithm hashAlg
)Message data in byte format
Hash algorithm to be used
Byte[]
Message digest in byte format
Hash Class
CryptoSysAPI Namespace
Computes hash value in byte format of a binary file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] BytesFromFile(
string fileName,
HashAlgorithm hashAlg
)Name of file containing message data
Hash algorithm to be used (ASCON-HASH not supported in file mode)
Byte[]
Message digest in byte format
Hash Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Hash Class
CryptoSysAPI Namespace
Computes final message digest for the Hash object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] Final()Byte[]
Digest value in a byte array.
This operation delivers the final result of Add operations since the Hash.Init() operation. Once called, the Hash object is invalid.
Hash Class
CryptoSysAPI Namespace
Computes hash value in hex format from bit-oriented input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromBits(
byte[] data,
int dataBitLen,
HashAlgorithm hashAlg
)Bit-oriented message data in byte array
Number of bits in data to digest
Hash algorithm to be used (SHA-1, SHA-2, SHA-3 only)
String
Message digest in hex-encoded format
Only the SHA families of hash functions (SHA-1, SHA-2, SHA-3) are supported in bit-oriented mode
Hash Class
CryptoSysAPI Namespace
Computes hash value in hex format of byte input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromBytes(
byte[] message,
HashAlgorithm hashAlg
)Message data in byte format
Hash algorithm to be used
String
Message digest in hex-encoded format
Hash Class
CryptoSysAPI Namespace
Computes hash value in hex format of a binary file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromFile(
string fileName,
HashAlgorithm hashAlg
)Name of file containing message data
Hash algorithm to be used (ASCON-HASH not supported in file mode)
String
Message digest in hex-encoded format
Hash Class
CryptoSysAPI Namespace
Computes hash value in hex format of hex-encoded input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromHex(
string messageHex,
HashAlgorithm hashAlg
)Message data in hex-encoded format
Hash algorithm to be used
String
Message digest in hex-encoded format
Hash Class
CryptoSysAPI Namespace
Computes hash value in hex format of string input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromString(
string message,
HashAlgorithm hashAlg
)Message data string
Hash algorithm to be used
String
Message digest in hex-encoded format
Hash Class
CryptoSysAPI Namespace
Computes hash value in hex format of a text file, treating CR-LF pairs as a single LF
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromTextFile(
string fileName,
HashAlgorithm hashAlg
)Name of file containing message data
Hash algorithm to be used (ASCON-HASH not supported in file mode)
String
Message digest in hex format
Use for passing message digest of file between Unix and Windows systems.
Hash Class
CryptoSysAPI Namespace
Initialises the Hash object ready for repeated incremental operations.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool Init(
HashAlgorithm hashAlg
)Hash algorithm to be used (SHA-1, SHA-2, SHA-3 only)
Boolean
True if successful, False if failed
Only the SHA families of hash functions (SHA-1, SHA-2, SHA-3) are supported in object mode.
Hash Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Hash Instance()Hash
Single instance to class
Hash Class
CryptoSysAPI Namespace
Returns the number of bytes in the message digest for the given hash algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int LengthInBytes(
HashAlgorithm hashAlg
)Hash algorithm
Int32
The length in bytes of the message digest output.
Hash Class
CryptoSysAPI Namespace
Resets the context of the Hash object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Reset()Int32
0 on success or a nonzero error
code.
Hash Class
CryptoSysAPI Namespace
Message authentication code (MAC) functions
System.Object
CryptoSysAPI.Mac
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class MacThe Mac type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, AddData and Final object methods only) |
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds a chunk of data in a byte array to be authenticated by the Mac object. |
| AddData(String) | Adds a chunk of data in a string to be authenticated by the Mac object. |
| BytesFromBytes | Computes MAC value in byte format from byte input |
| Dispose | Dispose of this object and clear any stored data. |
| Final | Computes final MAC value for the Mac object. |
| HexFromBytes | Computes MAC value in hex-encoded format from byte input |
| HexFromHex | Computes MAC value in hex-encoded format from hex-encoded input |
| Init | Initialises the Mac object ready for repeated incremental operations. |
| Instance | Create the one and only instance |
| Reset | Resets the context of the Mac object. |
Last error code (for Init, AddData and Final object methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Mac Class
CryptoSysAPI Namespace
Adds a chunk of data in a byte array to be authenticated by the Mac object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds a chunk of data in a byte array to be authenticated by the Mac object. |
| AddData(String) | Adds a chunk of data in a string to be authenticated by the Mac object. |
public int AddData(
byte[] b
)Data to add
Int32
0 on success or nonzero error code
Mac Class
CryptoSysAPI Namespace
Adds a chunk of data in a string to be authenticated by the Mac object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds a chunk of data in a byte array to be authenticated by the Mac object. |
| AddData(String) | Adds a chunk of data in a string to be authenticated by the Mac object. |
public int AddData(
string s
)Data to add
Int32
0 on success or nonzero error code
Mac Class
CryptoSysAPI Namespace
Computes MAC value in byte format from byte input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] BytesFromBytes(
byte[] message,
byte[] key,
MacAlgorithm macAlg
)Message to be signed in byte format
Key in byte format
MAC algorithm to be used
Byte[]
MAC in byte format
Mac Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Mac Class
CryptoSysAPI Namespace
Computes final MAC value for the Mac object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public byte[] Final()Byte[]
MAC value in a byte array.
This operation delivers the final result of Add operations since the Mac.Init() operation. Once called, the Mac object is invalid.
Mac Class
CryptoSysAPI Namespace
Computes MAC value in hex-encoded format from byte input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromBytes(
byte[] message,
byte[] key,
MacAlgorithm macAlg
)Message to be signed in byte format
Key in byte format
MAC algorithm to be used
String
MAC in hex-encoded format
Mac Class
CryptoSysAPI Namespace
Computes MAC value in hex-encoded format from hex-encoded input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string HexFromHex(
string messageHex,
string keyHex,
MacAlgorithm macAlg
)Message to be signed in hex-encoded format
Key in hex-encoded format
MAC algorithm to be used
String
MAC in hex-encoded format
Mac Class
CryptoSysAPI Namespace
Initialises the Mac object ready for repeated incremental operations.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool Init(
byte[] key,
MacAlgorithm macAlg
)Key
HMAC algorithm to be used.
Boolean
True if successful, False if failed.
Only the HMAC-SHA-1 and HMAC-SHA-2 families of MAC algorithms are currently supported in object mode.
Mac Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Mac Instance()Mac
Single instance to class
Mac Class
CryptoSysAPI Namespace
Resets the context of the Mac object.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Reset()Int32
0 on success or a nonzero error
code.
Mac Class
CryptoSysAPI Namespace
MD5 Hash Algorithm
System.Object
CryptoSysAPI.Md5
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Md5The Md5 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, AddData and HexDigest methods only) |
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
| BytesHash | Creates message digest as array of bytes from message in byte array |
| Dispose | Dispose of this object and clear any stored data |
| FileHexHash | Creates hash digest of a binary file |
| FileTextHexHash | Creates hash digest of a “text” file treating CR-LF pairs as a single newline char |
| HexDigest | Computes final message digest in hex format |
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
| Init | Initializes the context |
| Instance | Create the one and only instance |
| Reset | Resets the context |
Last error code (for Init, AddData and HexDigest methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Md5 Class
CryptoSysAPI Namespace
Adds an array of 8-bit bytes to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
byte[] b
)Data to add
Int32
0 on success or nonzero error code
Md5 Class
CryptoSysAPI Namespace
Adds a string of Ansi characters to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
string s
)String of Ansi characters
Int32
0 on success or nonzero error code
Md5 Class
CryptoSysAPI Namespace
Creates message digest as array of bytes from message in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] BytesHash(
byte[] message
)Message data to be digested
Byte[]
Digest in array of bytes
Md5 Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Md5 Class
CryptoSysAPI Namespace
Creates hash digest of a binary file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FileHexHash(
string fileName
)Name of input file
String
Message digest in hex format
Md5 Class
CryptoSysAPI Namespace
Creates hash digest of a “text” file treating CR-LF pairs as a single newline char
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FileTextHexHash(
string fileName
)Name of input file
String
Message digest in hex format
Use when comparing text data on a Unix system
Md5 Class
CryptoSysAPI Namespace
Computes final message digest in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public string HexDigest()String
Digest in hex format
Md5 Class
CryptoSysAPI Namespace
Creates message digest in hex format from message in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
public static string HexHash(
byte[] message
)Message data to be digested
String
Digest in hex format
Md5 Class
CryptoSysAPI Namespace
Creates message digest in hex format from message in Ansi string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
public static string HexHash(
string message
)Message text to be digested
String
Digest in hex format
Md5 Class
CryptoSysAPI Namespace
Computes the keyed hash digest of binary data using HMAC algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
public static string Hmac(
byte[] data,
byte[] key
)Data in array of bytes
Key in array of bytes
String
Digest in hex format
Md5 Class
CryptoSysAPI Namespace
Computes the keyed hash digest using HMAC algorithm passing data as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
public static string Hmac(
string dataHex,
string keyHex
)Data in hex format
Key in hex format
String
Digest in hex format
Md5 Class
CryptoSysAPI Namespace
Initializes the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool Init()Boolean
True if successful, False if failed
Md5 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Md5 Instance()Md5
Single instance to class
Md5 Class
CryptoSysAPI Namespace
Resets the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Reset()Int32
0 on success or a nonzero error code
Md5 Class
CryptoSysAPI Namespace
Password-based encryption
System.Object
CryptoSysAPI.Pbe
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class PbeThe Pbe type exposes the following members.
| Name | Description |
|---|---|
| Kdf2(Int32, Byte[], Byte[], Int32, HashAlgorithm) | Derives a key of any length from a password using the PBKDF2 algorithm using specified HMAC algorithm |
| Kdf2(Int32, String, String, Int32, HashAlgorithm) | Derives a key in hex format of any length from a password with the salt in hex format using specified HMAC algorithm |
| Scrypt(Int32, Byte[], Byte[], Int32, Int32, Int32) | Derives a key of any length from a password using the SCRYPT algorithm. |
| Scrypt(Int32, String, String, Int32, Int32, Int32) | Derives a key in hex format from a password with the salt in hex format |
Password-based encryption
Derives a key of any length from a password using the PBKDF2 algorithm using specified HMAC algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Kdf2(Int32, Byte[], Byte[], Int32, HashAlgorithm) | Derives a key of any length from a password using the PBKDF2 algorithm using specified HMAC algorithm |
| Kdf2(Int32, String, String, Int32, HashAlgorithm) | Derives a key in hex format of any length from a password with the salt in hex format using specified HMAC algorithm |
public static byte[] Kdf2(
int dkLen,
byte[] pwdBytes,
byte[] salt,
int count,
HashAlgorithm hashAlg = HashAlgorithm.Sha1
)Required length of key in bytes
Password encoded in byte format
Salt in byte format
Iteration count
Hash algorithm to use in HMAC PRF (optional, default=SHA-1)
Byte[]
Key in byte[] format
Pbe Class
CryptoSysAPI Namespace
Derives a key in hex format of any length from a password with the salt in hex format using specified HMAC algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Kdf2(Int32, Byte[], Byte[], Int32, HashAlgorithm) | Derives a key of any length from a password using the PBKDF2 algorithm using specified HMAC algorithm |
| Kdf2(Int32, String, String, Int32, HashAlgorithm) | Derives a key in hex format of any length from a password with the salt in hex format using specified HMAC algorithm |
public static string Kdf2(
int dkLen,
string pwdStr,
string saltHex,
int count,
HashAlgorithm hashAlg = HashAlgorithm.Sha1
)Required length of key in bytes
Password
Salt in hex format
Iteration count
Hash algorithm to use in HMAC PRF (optional, default=SHA-1)
String
Key in hex format
Password pwdStr is normal text, not hexadecimal
string keyHex = Pbe.Kdf2(24, "password", "78578e5a5d63cb06", 2048);
// BFDE6BE94DF7E11DD409BCE20A0255EC327CB936FFE93643Pbe Class
CryptoSysAPI Namespace
Derives a key of any length from a password using the SCRYPT algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Scrypt(Int32, Byte[], Byte[], Int32, Int32, Int32) | Derives a key of any length from a password using the SCRYPT algorithm. |
| Scrypt(Int32, String, String, Int32, Int32, Int32) | Derives a key in hex format from a password with the salt in hex format |
public static byte[] Scrypt(
int dkLen,
byte[] pwdBytes,
byte[] salt,
int N,
int r,
int p
)Required length of key in bytes
Password encoded in byte format
Salt in byte format
CPU/Memory cost parameter, a number greater than one and a power of 2.
Block size r
Parallelization parameter p
Byte[]
Key in byte[] format
Pbe Class
CryptoSysAPI Namespace
Derives a key in hex format from a password with the salt in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Scrypt(Int32, Byte[], Byte[], Int32, Int32, Int32) | Derives a key of any length from a password using the SCRYPT algorithm. |
| Scrypt(Int32, String, String, Int32, Int32, Int32) | Derives a key in hex format from a password with the salt in hex format |
public static string Scrypt(
int dkLen,
string pwdStr,
string saltHex,
int N,
int r,
int p
)Required length of key in bytes
Password (normal text)
Salt in hex format
CPU/Memory cost parameter, a number greater than one and a power of 2.
Block size r
Parallelization parameter p
String
Key in hex format
Password pwdStr is normal text, not hexadecimal
string keyHex = Pbe.Scrypt(64, "password", "4E61436C", 1024, 8, 16);Pbe Class
CryptoSysAPI Namespace
RC4-compatible stream cipher algorithm (superseded by Cipher.Stream methods)
System.Object
CryptoSysAPI.Pc1
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Pc1The Pc1 type exposes the following members.
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[]) | Encrypt byte array input using RC4-compatible algorithm |
| Encrypt(String, String) | Encrypt hex-encoded input using RC4-compatible algorithm |
| File | Encrypt a file using RC4-compatible algorithm |
Encrypt byte array input using RC4-compatible algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[]) | Encrypt byte array input using RC4-compatible algorithm |
| Encrypt(String, String) | Encrypt hex-encoded input using RC4-compatible algorithm |
public static byte[] Encrypt(
byte[] input,
byte[] key
)input byte array, any length
key byte array, any length
Byte[]
byte array
Superseded by Cipher.StreamBytes()
Pc1 Class
CryptoSysAPI Namespace
Encrypt hex-encoded input using RC4-compatible algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[]) | Encrypt byte array input using RC4-compatible algorithm |
| Encrypt(String, String) | Encrypt hex-encoded input using RC4-compatible algorithm |
public static string Encrypt(
string inputHex,
string keyHex
)hex-encoded input, any length
hex-encoded key, any length
String
hex-encoded string
Superseded by Cipher.StreamHex()
Pc1 Class
CryptoSysAPI Namespace
Encrypt a file using RC4-compatible algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int File(
string fileOut,
string fileIn,
byte[] key
)Full pathname of output file to be created. Must be different from fileIn
Full pathname of input file
Key byte array, any length
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Superseded by Cipher.StreamFile()
Pc1 Class
CryptoSysAPI Namespace
Pseudorandom function (PRF) methods.
System.Object
CryptoSysAPI.Prf
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class PrfThe Prf type exposes the following members.
| Name | Description |
|---|---|
| Bytes | Generate output bytes using a pseudorandom function (PRF). |
Generate output bytes using a pseudorandom function (PRF).
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Bytes(
int numBytes,
byte[] message,
byte[] key,
string customStr,
PrfAlgorithm prfAlg
)Required number of output bytes.
Input message data.
Key.
Customization string (optional).
PRF algorithm.
Byte[]
Output data in byte array.
Prf Class
CryptoSysAPI Namespace
Random Number Generator to NIST SP800-90
System.Object
CryptoSysAPI.Rng
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class RngThe Rng type exposes the following members.
| Name | Description |
|---|---|
| BytesWithPrompt(Int32, Rng.Strength) | Generates an array of random bytes with a prompt for keyboard input |
| BytesWithPrompt(Int32, String, Rng.Strength) | Generates an array of random bytes with a prompt for keyboard input |
| HexWithPrompt(Int32) | Generates random bytes in hex format with a prompt for keyboard input |
| HexWithPrompt(Int32, String, Rng.Strength) | Generates random bytes in hex format with a prompt for keyboard input |
| Initialize | Initialize the RNG generator with a seed file. |
| InitializeEx | Query and initialize the RNG generator using Intel(R) DRNG, if available. |
| KeyBytes(Int32, Byte[]) | Generates a random key with user-supplied entropy |
| KeyBytes(Int32, String) | Generates a random key |
| KeyHex(Int32, Byte[]) | Generates a random key in hex format with user-supplied entropy |
| KeyHex(Int32, String) | Generates a random key in hex format |
| MakeSeedFile(String, Rng.Strength) | Create a new seed file suitable for use with Rng.Initialize |
| MakeSeedFile(String, String, Rng.Strength) | Create a new seed file suitable for use with Rng.Initialize |
| NonceBytes | Generates a random nonce |
| NonceHex | Generates a random nonce in hex format |
| Number | Generates a random integer in a given range |
| Octet | Generates a single random octet (byte) |
| Test | Carries out a NIST SP800-90 health check and FIPS140-2 statistical tests on the random number generator |
| TestDrbgvs | Tests the random number generator for conformance to NIST SP 800-90A using the relevant test specified in the Deterministic Random Bit Generator Validation System (DRBGVS). |
| UpdateSeedFile | Updates the RNG seed file |
Generates an array of random bytes with a prompt for keyboard input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| BytesWithPrompt(Int32, Rng.Strength) | Generates an array of random bytes with a prompt for keyboard input |
| BytesWithPrompt(Int32, String, Rng.Strength) | Generates an array of random bytes with a prompt for keyboard input |
public static byte[] BytesWithPrompt(
int numBytes,
Rng.Strength strength = Rng.Strength.Default
)Required number of random bytes
Required security strength (default=112 bits)
Byte[]
Array of random bytes
Rng Class
CryptoSysAPI Namespace
Generates an array of random bytes with a prompt for keyboard input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| BytesWithPrompt(Int32, Rng.Strength) | Generates an array of random bytes with a prompt for keyboard input |
| BytesWithPrompt(Int32, String, Rng.Strength) | Generates an array of random bytes with a prompt for keyboard input |
public static byte[] BytesWithPrompt(
int numBytes,
string prompt,
Rng.Strength strength
)Required number of random bytes
Alternative prompt. Set as an empty string "" for the
default prompt.
Required security strength
Byte[]
Array of random bytes
Rng Class
CryptoSysAPI Namespace
Generates random bytes in hex format with a prompt for keyboard input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexWithPrompt(Int32) | Generates random bytes in hex format with a prompt for keyboard input |
| HexWithPrompt(Int32, String, Rng.Strength) | Generates random bytes in hex format with a prompt for keyboard input |
public static string HexWithPrompt(
int numBytes
)Required number of random bytes
String
Random bytes in hex format
Rng Class
CryptoSysAPI Namespace
Generates random bytes in hex format with a prompt for keyboard input
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexWithPrompt(Int32) | Generates random bytes in hex format with a prompt for keyboard input |
| HexWithPrompt(Int32, String, Rng.Strength) | Generates random bytes in hex format with a prompt for keyboard input |
public static string HexWithPrompt(
int numBytes,
string prompt,
Rng.Strength strength
)Required number of random bytes
Alternative prompt. Set as an empty string "" for the
default prompt.
Required security strength
String
Random bytes in hex format
Rng Class
CryptoSysAPI Namespace
Initialize the RNG generator with a seed file.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool Initialize(
string seedFile
)Full path name of seed file
Boolean
true if successful; false if fails
A seed file maintains the entropy state between sessions. It is automatically updated by this procedure. If the seed file does not exist, it will be created (with any available entropy).
Rng Class
CryptoSysAPI Namespace
Query and initialize the RNG generator using Intel(R) DRNG, if available.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int InitializeEx(
Rng.Options opts = Rng.Options.Default
)Specify Rng.Options.NoIntelDrng to explicitly turn off
support.
Int32
Support status for Intel(R) DRNG. If available, then a positive value
(1,2,3); else a negative error code.
Rng Class
CryptoSysAPI Namespace
Generates a random key with user-supplied entropy
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| KeyBytes(Int32, Byte[]) | Generates a random key with user-supplied entropy |
| KeyBytes(Int32, String) | Generates a random key |
public static byte[] KeyBytes(
int numBytes,
byte[] arrSeed
)Required number of random bytes
User-supplied entropy in byte format
Byte[]
Array of random bytes
Rng Class
CryptoSysAPI Namespace
Generates a random key
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| KeyBytes(Int32, Byte[]) | Generates a random key with user-supplied entropy |
| KeyBytes(Int32, String) | Generates a random key |
public static byte[] KeyBytes(
int numBytes,
string seedStr = ""
)Required number of random bytes
User-supplied entropy in string format. Set as an empty string
"" to ignore.
Byte[]
Array of random bytes
Rng Class
CryptoSysAPI Namespace
Generates a random key in hex format with user-supplied entropy
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| KeyHex(Int32, Byte[]) | Generates a random key in hex format with user-supplied entropy |
| KeyHex(Int32, String) | Generates a random key in hex format |
public static string KeyHex(
int numBytes,
byte[] arrSeed
)Required number of random bytes
User-supplied entropy in byte format
String
Random bytes in hex format
Rng Class
CryptoSysAPI Namespace
Generates a random key in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| KeyHex(Int32, Byte[]) | Generates a random key in hex format with user-supplied entropy |
| KeyHex(Int32, String) | Generates a random key in hex format |
public static string KeyHex(
int numBytes,
string seedStr = ""
)Required number of random bytes
User-supplied entropy in string format. Set as an empty string
"" to ignore.
String
Random bytes in hex format
Rng Class
CryptoSysAPI Namespace
Create a new seed file suitable for use with Rng.Initialize
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| MakeSeedFile(String, Rng.Strength) | Create a new seed file suitable for use with Rng.Initialize |
| MakeSeedFile(String, String, Rng.Strength) | Create a new seed file suitable for use with Rng.Initialize |
public static bool MakeSeedFile(
string seedFile,
Rng.Strength strength = Rng.Strength.Default
)Name of seed file to be created
Required security strength (default=112 bits)
Boolean
true if successful; false if fails
Any existing file of the same name will be overwritten without warning.
Rng Class
CryptoSysAPI Namespace
Create a new seed file suitable for use with Rng.Initialize
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| MakeSeedFile(String, Rng.Strength) | Create a new seed file suitable for use with Rng.Initialize |
| MakeSeedFile(String, String, Rng.Strength) | Create a new seed file suitable for use with Rng.Initialize |
public static bool MakeSeedFile(
string seedFile,
string prompt,
Rng.Strength strength
)Name of seed file to be created
Prompt for dialog
Required security strength
Boolean
true if successful; false if fails
Any existing file of the same name will be overwritten without warning.
Rng Class
CryptoSysAPI Namespace
Generates a random nonce
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] NonceBytes(
int numBytes
)Number of bytes required
Byte[]
Array of bytes
Rng Class
CryptoSysAPI Namespace
Generates a random nonce in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string NonceHex(
int numBytes
)Number of bytes required
String
Nonce in hex format
Rng Class
CryptoSysAPI Namespace
Generates a random integer in a given range
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static int Number(
int lower,
int upper
)lower value of range
upper value of range
Int32
Random integer
Rng Class
CryptoSysAPI Namespace
Generates a single random octet (byte)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte Octet()Byte
Single byte value randomly chosen between 0 and 255
Rng Class
CryptoSysAPI Namespace
Carries out a NIST SP800-90 health check and FIPS140-2 statistical tests on the random number generator
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool Test(
string resultFile
)Name of results file to be created, or
null/Nothing not to create a results file.
Boolean
true if successful; false if fails.
Any existing file of the same name will be overwritten without warning.
Rng Class
CryptoSysAPI Namespace
Tests the random number generator for conformance to NIST SP 800-90A using the relevant test specified in the Deterministic Random Bit Generator Validation System (DRBGVS).
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string TestDrbgvs(
int returnedBitsLen,
string entropyInput,
string nonce,
string personalizationString,
string additionalInput1,
string entropyReseed,
string additionalInputReseed,
string additionalInput2
)Number of bits to be returned from each call to the generate function in the test
the EntropyInput value in hex format
the Nonce value in hex format
the PersonalizationString value in hex format
the first AdditionalInput value in hex format
the EntropyReseed value in hex format
the AdditionalInputReseed value in hex format
the second AdditionalInput value in hex format
String
the ReturnedBits as a string in hexadecimal format
The test procedure, the input values and the expected output are
described in the DRBGVS document. The relevant DRBG mechanism is
HMAC_DRBG SHA-512 without prediction resistance. Use the
empty string "" to pass a zero-length input. All hex
strings must have an even number of characters.
Rng Class
CryptoSysAPI Namespace
Updates the RNG seed file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool UpdateSeedFile(
string seedFile
)Full path name of seed file
Boolean
true if successful; false if fails
Any existing file of the same name will be overwritten without warning.
Rng Class
CryptoSysAPI Namespace
Secure Hash Algorithm 1 (SHA-1)
System.Object
CryptoSysAPI.Sha1
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Sha1The Sha1 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, AddData and HexDigest methods only) |
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
| BytesHash | Creates message digest as array of bytes from message in byte array |
| Dispose | Dispose of this object and clear any stored data |
| FileHexHash | Creates hash digest of a binary file |
| FileTextHexHash | Creates hash digest of a “text” file treating CR-LF pairs as a single newline char |
| HexDigest | Computes final message digest in hex format |
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
| Init | Initializes the context |
| Instance | Create the one and only instance |
| Reset | Resets the context |
Last error code (for Init, AddData and HexDigest methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Sha1 Class
CryptoSysAPI Namespace
Adds an array of 8-bit bytes to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
byte[] b
)Data to add
Int32
0 on success or nonzero error code
Sha1 Class
CryptoSysAPI Namespace
Adds a string of Ansi characters to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
string s
)String of Ansi characters
Int32
0 on success or nonzero error code
Sha1 Class
CryptoSysAPI Namespace
Creates message digest as array of bytes from message in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] BytesHash(
byte[] message
)Message data to be digested
Byte[]
Digest in array of bytes
Sha1 Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Sha1 Class
CryptoSysAPI Namespace
Creates hash digest of a binary file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FileHexHash(
string fileName
)Name of input file
String
Message digest in hex format
Sha1 Class
CryptoSysAPI Namespace
Creates hash digest of a “text” file treating CR-LF pairs as a single newline char
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FileTextHexHash(
string fileName
)Name of input file
String
Message digest in hex format
Use when comparing text data on a Unix system
Sha1 Class
CryptoSysAPI Namespace
Computes final message digest in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public string HexDigest()String
Digest in hex format
Sha1 Class
CryptoSysAPI Namespace
Creates message digest in hex format from message in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
public static string HexHash(
byte[] message
)Message data to be digested
String
Digest in hex format
Sha1 Class
CryptoSysAPI Namespace
Creates message digest in hex format from message in Ansi string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
public static string HexHash(
string message
)Message text to be digested
String
Digest in hex format
Sha1 Class
CryptoSysAPI Namespace
Computes the keyed hash digest of binary data using HMAC algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
public static string Hmac(
byte[] data,
byte[] key
)Data in array of bytes
Key in array of bytes
String
Digest in hex format
Sha1 Class
CryptoSysAPI Namespace
Computes the keyed hash digest using HMAC algorithm passing data as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
public static string Hmac(
string dataHex,
string keyHex
)Data in hex format
Key in hex format
String
Digest in hex format
Sha1 Class
CryptoSysAPI Namespace
Initializes the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool Init()Boolean
True if successful, False if failed
Sha1 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Sha1 Instance()Sha1
Single instance to class
Sha1 Class
CryptoSysAPI Namespace
Resets the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Reset()Int32
0 on success or a nonzero error code
Sha1 Class
CryptoSysAPI Namespace
Secure Hash 256 Algorithm (SHA-256)
System.Object
CryptoSysAPI.Sha256
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Sha256The Sha256 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, AddData and HexDigest methods only) |
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
| BytesHash | Creates message digest as array of bytes from message in byte array |
| Dispose | Dispose of this object and clear any stored data |
| FileHexHash | Creates hash digest of a binary file |
| FileTextHexHash | Creates hash digest of a “text” file treating CR-LF pairs as a single newline char |
| HexDigest | Computes final message digest in hex format |
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
| Init | Initializes the context |
| Instance | Create the one and only instance |
| Reset | Resets the context |
Last error code (for Init, AddData and HexDigest methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Sha256 Class
CryptoSysAPI Namespace
Adds an array of 8-bit bytes to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
byte[] b
)Data to add
Int32
0 on success or nonzero error code
Sha256 Class
CryptoSysAPI Namespace
Adds a string of Ansi characters to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
string s
)String of Ansi characters
Int32
0 on success or nonzero error code
Sha256 Class
CryptoSysAPI Namespace
Creates message digest as array of bytes from message in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] BytesHash(
byte[] message
)Message data to be digested
Byte[]
Digest in array of bytes
Sha256 Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Sha256 Class
CryptoSysAPI Namespace
Creates hash digest of a binary file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FileHexHash(
string fileName
)Name of input file
String
Message digest in hex format
Sha256 Class
CryptoSysAPI Namespace
Creates hash digest of a “text” file treating CR-LF pairs as a single newline char
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static string FileTextHexHash(
string fileName
)Name of input file
String
Message digest in hex format
Use when comparing text data on a Unix system
Sha256 Class
CryptoSysAPI Namespace
Computes final message digest in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public string HexDigest()String
Digest in hex format
Sha256 Class
CryptoSysAPI Namespace
Creates message digest in hex format from message in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
public static string HexHash(
byte[] message
)Message data to be digested
String
Digest in hex format
Sha256 Class
CryptoSysAPI Namespace
Creates message digest in hex format from message in Ansi string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| HexHash(Byte[]) | Creates message digest in hex format from message in byte array |
| HexHash(String) | Creates message digest in hex format from message in Ansi string |
public static string HexHash(
string message
)Message text to be digested
String
Digest in hex format
Sha256 Class
CryptoSysAPI Namespace
Computes the keyed hash digest of binary data using HMAC algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
public static string Hmac(
byte[] data,
byte[] key
)Data in array of bytes
Key in array of bytes
String
Digest in hex format
Sha256 Class
CryptoSysAPI Namespace
Computes the keyed hash digest using HMAC algorithm passing data as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Hmac(Byte[], Byte[]) | Computes the keyed hash digest of binary data using HMAC algorithm |
| Hmac(String, String) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |
public static string Hmac(
string dataHex,
string keyHex
)Data in hex format
Key in hex format
String
Digest in hex format
Sha256 Class
CryptoSysAPI Namespace
Initializes the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool Init()Boolean
True if successful, False if failed
Sha256 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Sha256 Instance()Sha256
Single instance to class
Sha256 Class
CryptoSysAPI Namespace
Resets the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Reset()Int32
0 on success or a nonzero error code
Sha256 Class
CryptoSysAPI Namespace
Secure Hash Algorithm SHA-3
System.Object
CryptoSysAPI.Sha3
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Sha3The Sha3 type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init, AddData and HexDigest methods only) |
| LengthInBytes | Length in bytes of hash output (i.e. length in bits / 8) |
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
| Dispose | Dispose of this object and clear any stored data |
| HexDigest | Computes final message digest in hex format |
| Init | Initialises the object ready to receive data to digest |
| Instance | Create the one and only instance |
| Reset | Resets the context |
Last error code (for Init, AddData and HexDigest methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Sha3 Class
CryptoSysAPI Namespace
Length in bytes of hash output (i.e. length in bits / 8)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int LengthInBytes { get; }Int32
Sha3 Class
CryptoSysAPI Namespace
Adds an array of 8-bit bytes to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
byte[] b
)Data to add
Int32
0 on success or nonzero error code
Sha3 Class
CryptoSysAPI Namespace
Adds a string of Ansi characters to the digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| AddData(Byte[]) | Adds an array of 8-bit bytes to the digest |
| AddData(String) | Adds a string of Ansi characters to the digest |
public int AddData(
string s
)String of Ansi characters
Int32
0 on success or nonzero error code
Sha3 Class
CryptoSysAPI Namespace
Dispose of this object and clear any stored data
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()Sha3 Class
CryptoSysAPI Namespace
Computes final message digest in hex format
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public string HexDigest()String
Digest in hex format
Sha3 Class
CryptoSysAPI Namespace
Initialises the object ready to receive data to digest
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public bool Init(
int hashBitLen
)Size of SHA-3 algorithm in bits. Must be one of {224, 256, 384, 512}.
Boolean
True if successful, False if failed
Sha3 Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Sha3 Instance()Sha3
Single instance to class
Sha3 Class
CryptoSysAPI Namespace
Resets the context
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int Reset()Int32
0 on success or a nonzero error code
Sha3 Class
CryptoSysAPI Namespace
Triple DES Cipher (3DES, TDEA, DES-EDE3)
System.Object
CryptoSysAPI.Tdea
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class Tdea : IDisposableThe Tdea type exposes the following members.
| Name | Description |
|---|---|
| ErrCode | Last error code (for Init and Update methods only) |
| Name | Description |
|---|---|
| CheckKey(Byte[]) | Verifies that no part of the key is a weak or semi-weak TDEA key. |
| CheckKey(String) | Verifies that no part of the key is a weak or semi-weak TDEA key. |
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
| Dispose | Dispose of this object and clear any key schedules |
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
| Instance | Create the one and only instance |
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
| Name | Description |
|---|---|
| BlockSize | Block size in bytes |
Last error code (for Init and Update methods only)
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public int ErrCode { get; }Int32
Tdea Class
CryptoSysAPI Namespace
Verifies that no part of the key is a weak or semi-weak TDEA key.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| CheckKey(Byte[]) | Verifies that no part of the key is a weak or semi-weak TDEA key. |
| CheckKey(String) | Verifies that no part of the key is a weak or semi-weak TDEA key. |
public static int CheckKey(
byte[] key
)Key to check
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Tdea Class
CryptoSysAPI Namespace
Verifies that no part of the key is a weak or semi-weak TDEA key.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| CheckKey(Byte[]) | Verifies that no part of the key is a weak or semi-weak TDEA key. |
| CheckKey(String) | Verifies that no part of the key is a weak or semi-weak TDEA key. |
public static int CheckKey(
string keyHex
)Hex-encoded key to check
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Tdea Class
CryptoSysAPI Namespace
Decrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static byte[] Decrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Byte[]
Decrypted data in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Decrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Hex-encoded IV representing exactly 8 bytes or "" for
ECB mode
String
Decrypted data in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Decrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Decrypt(Byte[], Byte[], Mode, Byte[]) | Decrypt data in byte array |
| Decrypt(String, String, Mode, String) | Decrypt hex-encoded data string |
| Decrypt(String, String, Mode, String, EncodingBase) | Decrypt encoded data string |
public static string Decrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Encoded IV representing exactly 8 bytes or "" for ECB
mode
Type of encoding used
String
Decrypted data in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Dispose of this object and clear any key schedules
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public void Dispose()IDisposable.Dispose()
Tdea Class
CryptoSysAPI Namespace
Encrypt data in byte array
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static byte[] Encrypt(
byte[] input,
byte[] key,
Mode mode,
byte[] iv
)Input data
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Byte[]
Ciphertext in byte array or empty array on error
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Encrypt hex-encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputHex,
string keyHex,
Mode mode,
string ivHex
)Hex-encoded input data
Hex-encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Hex-encoded IV representing exactly 8 bytes or "" for
ECB mode
String
Ciphertext in hex-encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Encrypt encoded data string
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Encrypt(Byte[], Byte[], Mode, Byte[]) | Encrypt data in byte array |
| Encrypt(String, String, Mode, String) | Encrypt hex-encoded data string |
| Encrypt(String, String, Mode, String, EncodingBase) | Encrypt encoded data string |
public static string Encrypt(
string inputStr,
string keyStr,
Mode mode,
string ivStr,
EncodingBase encodingBase
)Encoded input data
Encoded key representing exactly 24 bytes (192 bits)
Cipher Mode
Encoded IV representing exactly 8 bytes or "" for ECB
mode
Type of encoding used
String
Ciphertext in encoded string or empty string on error
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Decrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Tdea Class
CryptoSysAPI Namespace
Decrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Tdea Class
CryptoSysAPI Namespace
Decrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileDecrypt(String, String, Byte[], Mode, Byte[]) | Decrypt a file |
| FileDecrypt(String, String, String, Mode, String) | Decrypt a file passing key and IV as hex strings |
| FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Decrypt a file with advanced options |
public static int FileDecrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes. Use null/Nothing for
ECB mode or when using CipherFileOption.PrefixIV option
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Tdea Class
CryptoSysAPI Namespace
Encrypt a file
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Tdea Class
CryptoSysAPI Namespace
Encrypt a file passing key and IV as hex strings
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
string keyHex,
Mode mode,
string ivHex
)Name of output file to be created or overwritten
Name of input file
Hex-encoded key of exact length
Cipher Mode
Hex-encoded IV or "" for ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same. The output file is in binary
format.
Tdea Class
CryptoSysAPI Namespace
Encrypt a file with advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| FileEncrypt(String, String, Byte[], Mode, Byte[]) | Encrypt a file |
| FileEncrypt(String, String, String, Mode, String) | Encrypt a file passing key and IV as hex strings |
| FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) | Encrypt a file with advanced options |
public static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
Mode mode,
byte[] iv,
CipherFileOption advOptions
)Name of output file to be created or overwritten
Name of input file
Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Advanced options. See CipherFileOption.
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
fileOut and fileIn must
not be the same
Tdea Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Tdea Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start decrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitDecrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start decrypting |
| InitDecrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start decrypting |
public int InitDecrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Tdea Class
CryptoSysAPI Namespace
Initializes with key, mode and IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
byte[] key,
Mode mode,
byte[] iv
)Key of exactly 24 bytes (192 bits)
Cipher Mode
IV of exactly 8 bytes or null/Nothing for
ECB mode
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Tdea Class
CryptoSysAPI Namespace
Initializes with hex key, mode and hex IV ready to start encrypting
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| InitEncrypt(Byte[], Mode, Byte[]) | Initializes with key, mode and IV ready to start encrypting |
| InitEncrypt(String, Mode, String) | Initializes with hex key, mode and hex IV ready to start encrypting |
public int InitEncrypt(
string keyHex,
Mode mode,
string ivHex
)Key in hex-encoded format
Cipher mode
IV in hex-encoded format
Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Tdea Class
CryptoSysAPI Namespace
Create the one and only instance
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static Tdea Instance()Tdea
Single instance to class
Tdea Class
CryptoSysAPI Namespace
Pads byte array to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static byte[] Pad(
byte[] data
)data to be padded
Byte[]
padded data in byte array
Uses PKCS#5/#7/CMS method of padding
Tdea Class
CryptoSysAPI Namespace
Pads hex-encoded string to correct length for ECB and CBC encryption
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Pad(Byte[]) | Pads byte array to correct length for ECB and CBC encryption |
| Pad(String) | Pads hex-encoded string to correct length for ECB and CBC encryption |
public static string Pad(
string dataHex
)hex-encoded data to be padded
String
padded data in hex-encoded string
Uses PKCS#5/#7/CMS method of padding
Tdea Class
CryptoSysAPI Namespace
Removes the padding from an encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static byte[] Unpad(
byte[] data
)padded data
Byte[]
Unpadded data in byte array or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Tdea Class
CryptoSysAPI Namespace
Removes the padding from a hex-encoded encryption block
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Unpad(Byte[]) | Removes the padding from an encryption block |
| Unpad(String) | Removes the padding from a hex-encoded encryption block |
public static string Unpad(
string dataHex
)hex-encoded padded data
String
Unpadded data in hex-encoded string or unchanged data on error
Padding is expected according to the convention in PKCS#5/#7/CMS. An error is indicated by returning the original data which will always be longer than the expected unpadded result.
Tdea Class
CryptoSysAPI Namespace
Transform byte input data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public byte[] Update(
byte[] data
)input data in byte array
Byte[]
transformed data in byte array
For ECB and CBC modes, input data length must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Transform hex string data with previously initialized key, mode and direction
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Update(Byte[]) | Transform byte input data with previously initialized key, mode and direction |
| Update(String) | Transform hex string data with previously initialized key, mode and direction |
public string Update(
string data
)hex-encoded input data
String
hex-encoded data
For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (8 bytes)
Tdea Class
CryptoSysAPI Namespace
Block size in bytes
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public const int BlockSize = 8Int32
Tdea Class
CryptoSysAPI Namespace
Data Wiping Functions
System.Object
CryptoSysAPI.Wipe
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class WipeThe Wipe type exposes the following members.
| Name | Description |
|---|---|
| Data | Zeroises data in memory |
| File | Securely wipe and delete a file. |
| String | Zeroises a StringBuilder |
Zeroises data in memory
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool Data(
byte[] data
)data to be wiped
Boolean
true if successful; false if fails
Wipe Class
CryptoSysAPI Namespace
Securely wipe and delete a file.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool File(
string fileName,
Wipe.Options opts = Wipe.Options.Default
)Name of file to be wiped
Options (optional) Default is DOD 7-pass.
Boolean
true if successful; false if fails
Wipe Class
CryptoSysAPI Namespace
Zeroises a StringBuilder
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static bool String(
StringBuilder sb
)StringBuilder to be wiped
Boolean
true if successful; false if fails
NB You can’t wipe an ordinary string as they are immutable in C#, so store any sensitive string data in a StringBuilder.
Wipe Class
CryptoSysAPI Namespace
Extendable-output function (XOF) methods.
System.Object
CryptoSysAPI.Xof
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class XofThe Xof type exposes the following members.
| Name | Description |
|---|---|
| Bytes | Generate bytes using an extendable-output function (XOF). |
Generate bytes using an extendable-output function (XOF).
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Bytes(
int numBytes,
byte[] message,
XofAlgorithm xofAlg
)Required number of output bytes.
Input message data.
XOF algorithm.
Byte[]
Output data in byte array.
Xof Class
CryptoSysAPI Namespace
ZLIB compression algorithm
System.Object
CryptoSysAPI.Zlib
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public class ZlibThe Zlib type exposes the following members.
| Name | Description |
|---|---|
| Deflate | Compress data using the ZLIB deflate algorithm |
| Inflate(Byte[]) | Inflate compressed data using the ZLIB algorithm. |
| Inflate(Byte[], Int32) | Inflate compressed data using the ZLIB algorithm [superseded]. |
ZLIB Compression to RFC 1950
Compress data using the ZLIB deflate algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public static byte[] Deflate(
byte[] dataToComp
)Data to be compressed
Byte[]
Compressed data
Zlib Class
CryptoSysAPI Namespace
Inflate compressed data using the ZLIB algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Inflate(Byte[]) | Inflate compressed data using the ZLIB algorithm. |
| Inflate(Byte[], Int32) | Inflate compressed data using the ZLIB algorithm [superseded]. |
public static byte[] Inflate(
byte[] data
)Compressed data to be uncompressed.
Byte[]
Uncompressed data, or an empty array on error.
An empty array may also be returned if the original data was the empty array itself.
Zlib Class
CryptoSysAPI Namespace
Inflate compressed data using the ZLIB algorithm [superseded].
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
| Name | Description |
|---|---|
| Inflate(Byte[]) | Inflate compressed data using the ZLIB algorithm. |
| Inflate(Byte[], Int32) | Inflate compressed data using the ZLIB algorithm [superseded]. |
public static byte[] Inflate(
byte[] data,
int lenUncompressed
)Data to be uncompressed
Length of uncompressed data
Byte[]
Uncompressed data
Superseded by Zlib.Inflate(Byte[])
Zlib Class
CryptoSysAPI Namespace
AEAD algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Algorithm| Member name | Description |
|---|---|
| Aes_128_Gcm | AEAD_AES_128_GCM authenticated encryption algorithm (RFC 5116) |
| Aes_256_Gcm | AEAD_AES_256_GCM authenticated encryption algorithm (RFC 5116) |
| Ascon_128 | ASCON-128 authenticated encryption (Aead.[En/De]cryptWithTag only) |
| Ascon_128A | ASCON-128a authenticated encryption (Aead.[En/De]cryptWithTag only) |
| Chacha20_Poly1305 | AEAD_CHACHA20_POLY1305 authenticated encryption algorithm (RFC 7539) |
Advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
[FlagsAttribute]
public enum Opts| Member name | Description |
|---|---|
| Default | Default options |
| PrefixIV | Prefix (prepend) the IV (nonce) before the ciphertext in the output |
Advanced options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
[FlagsAttribute]
public enum Opts| Member name | Description |
|---|---|
| Default | Default options |
| PrefixIV | Prefix (prepend) the IV before the ciphertext in the output file (ignored for ECB mode) |
Block Cipher Algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum CipherAlgorithm| Member name | Description |
|---|---|
| Tdea | Triple DES (TDEA, 3DES, des-ede3) |
| Aes128 | AES-128 |
| Aes192 | AES-192 |
| Aes256 | AES-256 |
Advanced options for file cipher operations
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
[FlagsAttribute]
public enum CipherFileOption| Member name | Description |
|---|---|
| Default | Default option |
| PrefixIV | Prefix the IV before ciphertext in the output file (ignored for ECB mode) |
| LeavePadding | Leave any padding in place when decrypting (ECB and CBC modes only; ignored if encrypting) |
Stream cipher algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Algorithm| Member name | Description |
|---|---|
| Arcfour | ARCFOUR (RC4) algorithm |
| Salsa20 | Salsa20 algorithm |
| Chacha20 | ChaCha20 algorithm |
Compression algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum ComprAlgorithm| Member name | Description |
|---|---|
| Zlib | zlib as per RFC 1950 |
| Zstd | zstd as per RFC 8878 |
Base for encoding methods
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum EncodingBase| Member name | Description |
|---|---|
| Base64 | Base64 encoding |
| Base16 | Base16 encoding (i.e. hexadecimal) |
Message Digest Hash Algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum HashAlgorithm| Member name | Description |
|---|---|
| Sha1 | SHA-1 (as per FIPS PUB 180-2) |
| Md5 | MD5 (as per RFC 1321) |
| Md2 | MD2 (as per RFC 1319) |
| Sha256 | SHA-256 (as per FIPS PUB 180-4) |
| Sha384 | SHA-384 (as per FIPS PUB 180-4) |
| Sha512 | SHA-512 (as per FIPS PUB 180-4) |
| Sha224 | SHA-224 (as per FIPS PUB 180-4) |
| Ripemd160 | RIPEMD-160 |
| Sha3_224 | SHA-3-224 (as per FIPS PUB 202) |
| Sha3_256 | SHA-3-256 (as per FIPS PUB 202) |
| Sha3_384 | SHA-3-384 (as per FIPS PUB 202) |
| Sha3_512 | SHA-3-256 (as per FIPS PUB 202) |
| Ascon_Hash | ASCON-HASH (byte/hex functions only) |
| Ascon_HashA | ASCON-HASHA (byte/hex functions only) |
Message Authentication Code (MAC) Algorithm
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum MacAlgorithm| Member name | Description |
|---|---|
| HmacSha1 | HMAC-SHA-1 |
| HmacMd5 | HMAC-MD5 |
| HmacSha256 | HMAC-SHA-256 |
| HmacSha384 | HMAC-SHA-384 |
| HmacSha512 | HMAC-SHA-512 |
| HmacSha224 | HMAC-SHA-224 |
| HmacRipemd160 | HMAC-RIPEMD160 |
| HmacSha3_224 | HMAC-SHA-3-224 |
| HmacSha3_256 | HMAC-SHA-3-256 |
| HmacSha3_384 | HMAC-SHA-3-384 |
| HmacSha3_512 | HMAC-SHA-3-512 |
| CmacTdea | CMAC-TDEA (CMAC-DES-EDE) |
| CmacAes128 | CMAC-AES-128 |
| CmacAes192 | CMAC-AES-192 |
| CmacAes256 | CMAC-AES-256 |
| Poly1305 | Poly1305 |
| Kmac128 | KMAC128 with a fixed-length output of 256 bits (32 bytes) |
| Kmac256 | KMAC256 with a fixed-length output of 512 bits (64 bytes) |
Cipher Mode
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Mode| Member name | Description |
|---|---|
| ECB | Electronic Code Book mode |
| CBC | Cipher Block Chaining mode |
| OFB | Output Feedback mode |
| CFB | Cipher Feedback mode |
| CTR | Counter mode |
Block Cipher Padding
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Padding| Member name | Description |
|---|---|
| Default | Use default padding |
| NoPad | No padding is added |
| Pkcs5 | The padding scheme described in PKCS#5 |
| OneAndZeroes | Pads with 0x80 followed by as many zero bytes necessary to fill the block |
| AnsiX923 | The padding scheme described in ANSI X9.23 |
| W3CPadding | The padding scheme described in W3C https://www.w3.org/TR/xmlenc-core1/#sec-Padding |
Pseudorandom function (PRF) algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum PrfAlgorithm| Member name | Description |
|---|---|
| Kmac128 | KMAC128 as per NIST SP 800-185 |
| Kmac256 | KMAC256 as per NIST SP 800-185 |
Rng options
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Options| Member name | Description |
|---|---|
| Default | Default option |
| NoIntelDrng | Turn off support for INTEL(R) DRNG for the current session. |
Required security strength for user-prompted entropy
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Strength| Member name | Description |
|---|---|
| Default | Default option |
| Bits_112 | 112 bits of security (default) |
| Bits_128 | 128 bits of security |
| Bits_192 | 192 bits of security |
| Bits_256 | 256 bits of security |
Wipe options.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum Options| Member name | Description |
|---|---|
| Default | Default options (DOD 7-pass) |
| Dod7Pass | DOD 7-pass (default) |
| Simple | Overwrite with single pass of zero bytes (quicker but less secure). |
Extendable-output function (XOF) algorithm.
Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version:
6.22.2.36349 (6.22.2.0)
public enum XofAlgorithm| Member name | Description |
|---|---|
| Shake128 | SHAKE128 as per FIPS PUB 202 |
| Shake256 | SHAKE256 as per FIPS PUB 202 |
| Ascon_Xof | ASCON-XOF extendable output function |
| Ascon_XofA | ASCON-XOFA extendable output function |
| Mgf1_Sha1 | MGF1-SHA-1 (as per PKCS#1) |
| Mgf1_Sha256 | MGF1-SHA-256 (as per PKCS#1) |
| Mgf1_Sha512 | MGF1-SHA-512 (as per PKCS#1) |
Created: 2025-10-20 20:12:37
Copyright (C) 2025 D.I. Management Services Pty Ltd t/a CryptoSys https://cryptosys.net