CryptoSysAPI Namespace
======================
.NET interface to CryptoSys API.


Classes
-------

| Class             | Description                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------- |
| [Aead](#aead_aead)         | Provides generic authenticated encryption.                                                                           |
| [Aes128](#aes128_aes128)       | Advanced Encryption Standard (AES) with 128-bit key                                                                  |
| [Aes192](#aes192_aes192)       | Advanced Encryption Standard (AES) with 192-bit key                                                                  |
| [Aes256](#aes256_aes256)       | Advanced Encryption Standard (AES) with 256-bit key                                                                  |
| [Blowfish](#blowfish_blowfish)     | Blowfish cipher algorithm                                                                                            |
| [Cipher](#cipher_cipher)       | Block cipher utilities                                                                                               |
| [CipherStream](#cipherstream_cipherstream) | Stream cipher algorithms                                                                                             |
| [Cnv](#cnv_cnv)          | Character conversion routines                                                                                        |
| [Compr](#compr_compr)        | Compression utilities                                                                                                |
| [Crc](#crc_crc)         | CRC-32 computations                                                                                                  |
| [Des](#des_des)         | Data Encryption Standard (DES) Cipher (legacy applications only)                                                     |
| [Gcm](#gcm_gcm)         | Provides authenticated encryption using the Galois/Counter Mode (GCM) of operation with the AES algorithm (AES-GCM). |
| [General](#general_general)     | General functions                                                                                                    |
| [Hash](#hash_hash)        | Message Digest Hash Functions                                                                                        |
| [Mac](#mac_mac)         | Message authentication code (MAC) functions                                                                          |
| [Md5](#md5_md5)         | MD5 Hash Algorithm                                                                                                   |
| [Pbe](#pbe_pbe)         | Password-based encryption                                                                                            |
| [Pc1](#pc1_pc1)         | RC4-compatible stream cipher algorithm (superseded by Cipher.Stream methods)                                         |
| [Prf](#prf_prf)         | Pseudorandom function (PRF) methods.                                                                                 |
| [Rng](#rng_rng)         | Random Number Generator to NIST SP800-90                                                                             |
| [Sha1](#sha1_sha1)        | Secure Hash Algorithm 1 (SHA-1)                                                                                      |
| [Sha256](#sha256_sha256)      | Secure Hash 256 Algorithm (SHA-256)                                                                                  |
| [Sha3](#sha3_sha3)        | Secure Hash Algorithm SHA-3                                                                                          |
| [Tdea](#tdea_tdea)        | Triple DES Cipher (3DES, TDEA, DES-EDE3)                                                                             |
| [Wipe](#wipe_wipe)        | Data Wiping Functions                                                                                                |
| [Xof](#xof_xof)         | Extendable-output function (XOF) methods.                                                                            |
| [Zlib](#zlib_zlib)        | ZLIB compression algorithm                                                                                           |


Enumerations
------------

| Enumeration                  | Description                                          |
| ---------------------------- | ---------------------------------------------------- |
| [Aead.Algorithm](#aead_algorithm_aead-algorithm)         | AEAD algorithm                                       |
| [Aead.Opts](#aead_opts_aead-opts)              | Advanced options                                     |
| [Cipher.Opts](#cipher_opts_cipher-opts)            | Advanced options                                     |
| [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)        | Block Cipher Algorithm                               |
| [CipherFileOption](#cipherfileoption_cipherfileoption)       | Advanced options for file cipher operations          |
| [CipherStream.Algorithm](#cipherstream_algorithm_cipherstream-algorithm) | Stream cipher algorithm                              |
| [ComprAlgorithm](#compralgorithm_compralgorithm)         | Compression algorithm.                               |
| [EncodingBase](#encodingbase_encodingbase)           | Base for encoding methods                            |
| [HashAlgorithm](#hashalgorithm_hashalgorithm)          | Message Digest Hash Algorithm                        |
| [MacAlgorithm](#macalgorithm_macalgorithm)           | Message Authentication Code (MAC) Algorithm          |
| [Mode](#mode_mode)                   | Cipher Mode                                          |
| [Padding](#padding_padding)                | Block Cipher Padding                                 |
| [PrfAlgorithm](#prfalgorithm_prfalgorithm)           | Pseudorandom function (PRF) algorithm.               |
| [Rng.Options](#rng_options_rng-options)            | Rng options                                          |
| [Rng.Strength](#rng_strength_rng-strength)           | Required security strength for user-prompted entropy |
| [Wipe.Options](#wipe_options_wipe-options)           | Wipe options.                                        |
| [XofAlgorithm](#xofalgorithm_xofalgorithm)           | Extendable-output function (XOF) algorithm.          |




<a id="aead_aead"></a>


Aead Class
==========
Provides generic authenticated encryption.


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Aead**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Aead : IDisposable
```

The **Aead** type exposes the following members.


Properties
----------

| Name         | Description                           |
| ------------ | ------------------------------------- |
| [ErrCode](#aead_errcode) | Last error code (object-related only) |


Methods
-------

| Name                                                                            | Description                                                                                                                                                       |
| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddAAD](#aead_addaad)                                                                     | Add a chunk of additional authenticated data (in incremental mode)                                                                                                |
| [Authenticate](#aead_authenticate)                                                               | Authenticate additional data using tag                                                                                                                            |
| [Decrypt](#aead_decrypt)                                                                    | Decrypt and authenticate input using specified AEAD algorithm in one-off operation                                                                                |
| [DecryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm)](#aead_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)](#aead_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](#aead_dispose)                                                                    | Dispose of this object and clear any key schedules                                                                                                                |
| [Encrypt](#aead_encrypt)                                                                    | Encrypt input using specified AEAD algorithm in one-off operation.                                                                                                |
| [EncryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm)](#aead_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)](#aead_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](#aead_finishdecrypt)                                                             | Finishes the authenticated decryption (in incremental mode)                                                                                                       |
| [FinishEncrypt](#aead_finishencrypt)                                                             | Finishes the authenticated encryption (in incremental mode)                                                                                                       |
| [InitKey](#aead_initkey)                                                                   | Initializes the context with the key and algorithm ready for repeated incremental operations                                                                      |
| [Instance](#aead_instance)                                                                  | Create the one and only instance                                                                                                                                  |
| [Mac](#aead_mac)                                                                       | Compute Message Authentication Code (tag) over input data                                                                                                         |
| [SetNonce](#aead_setnonce)                                                                  | Set the nonce (in incremental mode)                                                                                                                               |
| [StartDecrypt](#aead_startdecrypt)                                                              | Start authenticated decryption (in incremental mode)                                                                                                              |
| [StartEncrypt](#aead_startencrypt)                                                              | Start authenticated encryption (in incremental mode)                                                                                                              |
| [Update](#aead_update)                                                                    | Encrypts or decrypts a chunk of input (in incremental mode)                                                                                                       |


Fields
------

| Name             | Description                  |
| ---------------- | ---------------------------- |
| [TagMaxSize](#aead_tagmaxsize) | Maximum size of tag in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_errcode"></a>


Aead.ErrCode Property
=====================
Last error code (object-related only)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_addaad"></a>


Aead.AddAAD Method
==================
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)

Syntax
------

```csharp
public int AddAAD(
	byte[] aad
)
```

#### Parameters

##### *aad*  Byte[]
Chunk of additional data to add

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
May be repeated to add additional data in chunks. Must eventually be followed by either [StartEncrypt()](#aead_startencrypt) or [StartDecrypt()](#aead_startdecrypt).

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_error-code"></a>


General.ErrorLookup Method
==========================
Looks up error code
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string ErrorLookup(
	int errCode
)
```

#### Parameters

##### *errCode*  Int32
Code number

#### Return Value
String  
Corresponding error message

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_authenticate"></a>


Aead.Authenticate Method
========================
Authenticate additional data using tag
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static bool Authenticate(
	byte[] key,
	byte[] nonce,
	byte[] aad,
	byte[] tag,
	Aead.Algorithm alg
)
```

#### Parameters

##### *key*  Byte[]
Key of exact length for given algorithm (16 or 32 bytes).

##### *nonce*  Byte[]
Nonce of exact length for given algorithm (currently always 12 bytes)

##### *aad*  Byte[]
Data to be authenticated

##### *tag*  Byte[]
Tag value

##### *alg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
AEAD algorithm to use

#### Return Value
Boolean  
True if authentication is valid; false if failed or an error occurred.

Remarks
-------
Use [General.ErrorCode](#general_general-errorcode) to find the code of the last error. This is equivalent to [Aead.Decrypt](#aead_decrypt) with a zero-length ciphertext input.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_general-errorcode"></a>


General.ErrorCode Method
========================
Returns the [error code](#general_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)

Syntax
------

```csharp
public static int ErrorCode()
```

#### Return Value
Int32  
Error code

Remarks
-------
Not all functions set this value.

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_decrypt"></a>


Aead.Decrypt Method
===================
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)

Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	byte[] nonce,
	byte[] aad,
	byte[] tag,
	Aead.Algorithm alg
)
```

#### Parameters

##### *input*  Byte[]
Cipher text input data (required)

##### *key*  Byte[]
Key of exact length for given algorithm (16 or 32 bytes).

##### *nonce*  Byte[]
Nonce of exact length for given algorithm (currently always 12 bytes).

##### *aad*  Byte[]
Additional authentication data (optional). Pass `null`/`Nothing` to ignore.

##### *tag*  Byte[]
Tag value (required)

##### *alg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
AEAD algorithm to use

#### Return Value
Byte[]  
Decrypted plaintext in byte array, or empty array on error

Remarks
-------
Use [General.ErrorCode](#general_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.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_decryptwithtag-byte-byte-byte-aead-algorithm"></a>


Aead.DecryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) Method
==================================================================
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)

Overloads
---------

| 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)](#aead_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. |


Syntax
------

```csharp
public static byte[] DecryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	Aead.Algorithm aeadAlg
)
```

#### Parameters

##### *input*  Byte[]
Input data to be decrypted.

##### *key*  Byte[]
Key of exact length for algorithm (16 or 32 bytes).

##### *iv*  Byte[]
Initialization Vector (IV) (aka nonce) (12 or 16 bytes).

##### *aeadAlg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
Authenticated encryption algorithm.

#### Return Value
Byte[]  
Plaintext in a byte array, or empty array on error (an empty array may also be the correct result - check [General.ErrorCode](#general_general-errorcode) for details).

Remarks
-------
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).

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_decryptwithtag-byte-byte-byte-byte-aead-algorithm-aead-opts"></a>


Aead.DecryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) Method
=====================================================================================
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)

Overloads
---------

| Name                                                                          | Description                                                                                                                                                       |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DecryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm)](#aead_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. |


Syntax
------

```csharp
public static byte[] DecryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	byte[] aad,
	Aead.Algorithm aeadAlg,
	Aead.Opts opts
)
```

#### Parameters

##### *input*  Byte[]
Input data to be decrypted.

##### *key*  Byte[]
Key of exact length for algorithm (16 or 32 bytes).

##### *iv*  Byte[]
(optional) Initialization Vector (IV) (aka nonce) exactly 12 bytes long. Set as `null` if already prefixed to input.

##### *aad*  Byte[]
Additional authenticated data (optional) - set as `null` to ignore.

##### *aeadAlg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
Authenticated encryption algorithm.

##### *opts*  [Aead.Opts](#aead_opts_aead-opts)
Advanced options. Use [Aead.Opts.PrefixIV](#aead_opts_aead-opts-prefixiv) to expect the IV to be prepended at the start of the input.

#### Return Value
Byte[]  
Plaintext in a byte array, or empty array on error (an empty array may also be the correct result - check [General.ErrorCode](#general_general-errorcode) for details).

Remarks
-------
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.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_dispose"></a>


Aead.Dispose Method
===================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_encrypt"></a>


Aead.Encrypt Method
===================
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)

Syntax
------

```csharp
public static byte[] Encrypt(
	out byte[] tag,
	byte[] input,
	byte[] key,
	byte[] nonce,
	byte[] aad,
	Aead.Algorithm alg
)
```

#### Parameters

##### *tag*  Byte[]
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).

##### *input*  Byte[]
Plain text input data (required)

##### *key*  Byte[]
Key of exact length for given algorithm (16 or 32 bytes)

##### *nonce*  Byte[]
Nonce of exact length for given algorithm (currently always 12 bytes)

##### *aad*  Byte[]
Additional authentication data (optional). Pass `null`/`Nothing` to ignore.

##### *alg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
AEAD algorithm to use

#### Return Value
Byte[]  
Encrypted ciphertext in byte array, or empty array on error

Remarks
-------
Use [General.ErrorCode](#general_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.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_encryptwithtag-byte-byte-byte-aead-algorithm"></a>


Aead.EncryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm) Method
==================================================================
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)

Overloads
---------

| 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)](#aead_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. |


Syntax
------

```csharp
public static byte[] EncryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	Aead.Algorithm aeadAlg
)
```

#### Parameters

##### *input*  Byte[]
Input data to be encrypted.

##### *key*  Byte[]
Key of exact length for algorithm (16 or 32 bytes).

##### *iv*  Byte[]
Initialization Vector (IV) (aka nonce) (16 bytes for ASCON-128 else 12 bytes).

##### *aeadAlg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
Authenticated encryption algorithm.

#### Return Value
Byte[]  
Ciphertext with tag appended in a byte array, or empty array on error.

Remarks
-------
The output will be exactly 16 bytes longer than the input.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_encryptwithtag-byte-byte-byte-byte-aead-algorithm-aead-opts"></a>


Aead.EncryptWithTag(Byte[], Byte[], Byte[], Byte[], Aead.Algorithm, Aead.Opts) Method
=====================================================================================
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)

Overloads
---------

| Name                                                                          | Description                                                                                                                              |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [EncryptWithTag(Byte[], Byte[], Byte[], Aead.Algorithm)](#aead_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. |


Syntax
------

```csharp
public static byte[] EncryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	byte[] aad,
	Aead.Algorithm aeadAlg,
	Aead.Opts opts = Aead.Opts.Default
)
```

#### Parameters

##### *input*  Byte[]
Input data to be encrypted.

##### *key*  Byte[]
Key of exact length for algorithm (16 or 32 bytes).

##### *iv*  Byte[]
Initialization Vector (IV) (aka nonce) (16 bytes for ASCON-128 else 12 bytes).

##### *aad*  Byte[]
Additional authenticated data (optional) - set as `null` to ignore.

##### *aeadAlg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
Authenticated encryption algorithm.

##### *opts*  [Aead.Opts](#aead_opts_aead-opts)  (Optional)
Advanced options (optional). Use [Opts.PrefixIV](#aead_opts_opts-prefixiv) to prepend the IV to the output

#### Return Value
Byte[]  
Ciphertext with tag appended in a byte array, or empty array on error.

Remarks
-------
The output will either be exactly 16 bytes longer than the input, or 28/32 bytes longer if `Aead.Opts.PrefixIV` is used.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_finishdecrypt"></a>


Aead.FinishDecrypt Method
=========================
Finishes the authenticated decryption (in incremental mode)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public bool FinishDecrypt()
```

#### Return Value
Boolean  
`True` if the decryption is authenticated; `false` otherwise.

Remarks
-------
Must be preceded by [StartDecrypt()](#aead_startdecrypt) and zero or more calls to [Update()](#aead_update). May be followed by [SetNonce()](#aead_setnonce) to begin processing another packet with the same key and algorithm; otherwise should be followed by [Dispose()](#aead_dispose).

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_finishencrypt"></a>


Aead.FinishEncrypt Method
=========================
Finishes the authenticated encryption (in incremental mode)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] FinishEncrypt()
```

#### Return Value
Byte[]  
Authentication tag value

Remarks
-------
Must be preceded by [StartEncrypt()](#aead_startencrypt) and zero or more calls to [Update()](#aead_update). May be followed by [SetNonce()](#aead_setnonce) to begin processing another packet with the same key and algorithm; otherwise should be followed by [Dispose()](#aead_dispose).

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_initkey"></a>


Aead.InitKey Method
===================
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)

Syntax
------

```csharp
public int InitKey(
	byte[] key,
	Aead.Algorithm alg
)
```

#### Parameters

##### *key*  Byte[]
Key of exact length for given algorithm (16 or 32 bytes).

##### *alg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
AEAD algorithm to use

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
Must be followed by [SetNonce()](#aead_setnonce). Can be called at any time to cancel any previous incremental settings.

Example
-------

```csharp
Aead o = Aead.Instance();
o.InitKey(key, alg);
o.SetNonce(nonce);
//...
o.Dispose();
```


See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_instance"></a>


Aead.Instance Method
====================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Aead Instance()
```

#### Return Value
[Aead](#aead_aead)  
Single instance to class

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_mac"></a>


Aead.Mac Method
===============
Compute Message Authentication Code (tag) over input data
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] Mac(
	byte[] key,
	byte[] nonce,
	byte[] aad,
	Aead.Algorithm alg
)
```

#### Parameters

##### *key*  Byte[]
Key of exact length for given algorithm (16 or 32 bytes).

##### *nonce*  Byte[]
Nonce of exact length for given algorithm (currently always 12 bytes)

##### *aad*  Byte[]
Data to be authenticated

##### *alg*  [Aead.Algorithm](#aead_algorithm_aead-algorithm)
AEAD algorithm to use

#### Return Value
Byte[]  
Tag value in byte array, or empty array on error

Remarks
-------
Use [General.ErrorCode](#general_general-errorcode) to find the code of the last error. This is equivalent to [Aead.Encrypt](#aead_encrypt) with a zero-length plaintext input.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_setnonce"></a>


Aead.SetNonce Method
====================
Set the nonce (in incremental mode)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int SetNonce(
	byte[] nonce
)
```

#### Parameters

##### *nonce*  Byte[]
Nonce of exact length for given algorithm (currently always 12 bytes)

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
May be followed by zero or more calls to [AddAAD()](#aead_addaad) and then either [StartEncrypt()](#aead_startencrypt) or [StartDecrypt()](#aead_startdecrypt).

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_startdecrypt"></a>


Aead.StartDecrypt Method
========================
Start authenticated decryption (in incremental mode)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int StartDecrypt(
	byte[] tagToCheck
)
```

#### Parameters

##### *tagToCheck*  Byte[]
Tag value to be authenticated

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
May be followed by zero or more calls to [Update()](#aead_update) to decrypt data in chunks. Must eventually be followed by [FinishDecrypt()](#aead_finishdecrypt). **Caution:** do not trust decrypted data until final authentication.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_startencrypt"></a>


Aead.StartEncrypt Method
========================
Start authenticated encryption (in incremental mode)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int StartEncrypt()
```

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
May be followed by zero or more calls to [Update()](#aead_update) to encrypt data in chunks. Must eventually be followed by [FinishEncrypt()](#aead_finishencrypt).

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_update"></a>


Aead.Update Method
==================
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)

Syntax
------

```csharp
public byte[] Update(
	byte[] input
)
```

#### Parameters

##### *input*  Byte[]
Data to be encrypted or decrypted

#### Return Value
Byte[]  
Encrypted or decrypted data in array of exactly the same length as input; or an empty array on error

Remarks
-------
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()](#aead_startencrypt) or [StartDecrypt()](#aead_startdecrypt), respectively. It must eventually be followed by either [FinishEncrypt()](#aead_finishencrypt) or [FinishDecrypt()](#aead_finishdecrypt), which must match the start mode.

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_tagmaxsize"></a>


Aead.TagMaxSize Field
=====================
Maximum size of tag in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int TagMaxSize = 16
```

#### Field Value
Int32

See Also
--------


[Aead Class](#aead_aead)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_aes128"></a>


Aes128 Class
============
Advanced Encryption Standard (AES) with 128-bit key


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Aes128**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Aes128 : IDisposable
```

The **Aes128** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#aes128_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name                                                                      | Description                                                                   |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes128_decrypt-byte-byte-mode-byte)                                | Decrypt data in byte array                                                    |
| [Decrypt(String, String, Mode, String)](#aes128_decrypt-string-string-mode-string)                                | Decrypt hex-encoded data string                                               |
| [Decrypt(String, String, Mode, String, EncodingBase)](#aes128_decrypt-string-string-mode-string-encodingbase)                  | Decrypt encoded data string                                                   |
| [Dispose](#aes128_dispose)                                                              | Dispose of this object and clear any key schedules                            |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes128_encrypt-byte-byte-mode-byte)                                | Encrypt data in byte array                                                    |
| [Encrypt(String, String, Mode, String)](#aes128_encrypt-string-string-mode-string)                                | Encrypt hex-encoded data string                                               |
| [Encrypt(String, String, Mode, String, EncodingBase)](#aes128_encrypt-string-string-mode-string-encodingbase)                  | Encrypt encoded data string                                                   |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes128_filedecrypt-string-string-byte-mode-byte)                   | Decrypt a file                                                                |
| [FileDecrypt(String, String, String, Mode, String)](#aes128_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings                              |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes128_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options                                          |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes128_fileencrypt-string-string-byte-mode-byte)                   | Encrypt a file                                                                |
| [FileEncrypt(String, String, String, Mode, String)](#aes128_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings                              |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes128_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options                                          |
| [InitDecrypt(Byte[], Mode, Byte[])](#aes128_initdecrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start decrypting                   |
| [InitDecrypt(String, Mode, String)](#aes128_initdecrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start decrypting           |
| [InitEncrypt(Byte[], Mode, Byte[])](#aes128_initencrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start encrypting                   |
| [InitEncrypt(String, Mode, String)](#aes128_initencrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start encrypting           |
| [Instance](#aes128_instance)                                                            | Create the one and only instance                                              |
| [Pad(Byte[])](#aes128_pad-byte)                                                         | Pads byte array to correct length for ECB and CBC encryption                  |
| [Pad(String)](#aes128_pad-string)                                                         | Pads hex-encoded string to correct length for ECB and CBC encryption          |
| [Unpad(Byte[])](#aes128_unpad-byte)                                                       | Removes the padding from an encryption block                                  |
| [Unpad(String)](#aes128_unpad-string)                                                       | Removes the padding from a hex-encoded encryption block                       |
| [Update(Byte[])](#aes128_update-byte)                                                      | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#aes128_update-string)                                                      | Transform hex string data with previously initialized key, mode and direction |


Fields
------

| Name            | Description         |
| --------------- | ------------------- |
| [BlockSize](#aes128_blocksize) | Block size in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_errcode"></a>


Aes128.ErrCode Property
=======================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_decrypt-byte-byte-mode-byte"></a>


Aes128.Decrypt(Byte[], Byte[], Mode, Byte[]) Method
===================================================
Decrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Decrypt(Byte[], Byte[], Mode, Byte[])**                | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#aes128_decrypt-string-string-mode-string)               | Decrypt hex-encoded data string |
| [Decrypt(String, String, Mode, String, EncodingBase)](#aes128_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Decrypted data in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_decrypt-string-string-mode-string"></a>


Aes128.Decrypt(String, String, Mode, String) Method
===================================================
Decrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes128_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)](#aes128_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 16 bytes or `""` for ECB mode

#### Return Value
String  
Decrypted data in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_decrypt-string-string-mode-string-encodingbase"></a>


Aes128.Decrypt(String, String, Mode, String, EncodingBase) Method
=================================================================
Decrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes128_decrypt-byte-byte-mode-byte)              | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#aes128_decrypt-string-string-mode-string)              | Decrypt hex-encoded data string |
| **Decrypt(String, String, Mode, String, EncodingBase)** | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 16 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Decrypted data in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_dispose"></a>


Aes128.Dispose Method
=====================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_encrypt-byte-byte-mode-byte"></a>


Aes128.Encrypt(Byte[], Byte[], Mode, Byte[]) Method
===================================================
Encrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Encrypt(Byte[], Byte[], Mode, Byte[])**                | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#aes128_encrypt-string-string-mode-string)               | Encrypt hex-encoded data string |
| [Encrypt(String, String, Mode, String, EncodingBase)](#aes128_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_encrypt-string-string-mode-string"></a>


Aes128.Encrypt(String, String, Mode, String) Method
===================================================
Encrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes128_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)](#aes128_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 16 bytes or `""` for ECB mode

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_encrypt-string-string-mode-string-encodingbase"></a>


Aes128.Encrypt(String, String, Mode, String, EncodingBase) Method
=================================================================
Encrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes128_encrypt-byte-byte-mode-byte)              | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#aes128_encrypt-string-string-mode-string)              | Encrypt hex-encoded data string |
| **Encrypt(String, String, Mode, String, EncodingBase)** | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 16 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Ciphertext in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_filedecrypt-string-string-byte-mode-byte"></a>


Aes128.FileDecrypt(String, String, Byte[], Mode, Byte[]) Method
===============================================================
Decrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileDecrypt(String, String, Byte[], Mode, Byte[])**                    | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#aes128_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes128_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_filedecrypt-string-string-string-mode-string"></a>


Aes128.FileDecrypt(String, String, String, Mode, String) Method
===============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes128_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)](#aes128_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_filedecrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Aes128.FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
=================================================================================
Decrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes128_filedecrypt-string-string-byte-mode-byte)                  | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#aes128_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             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes. Use `null`/`Nothing` for ECB mode or when using CipherFileOption.PrefixIV option

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_fileencrypt-string-string-byte-mode-byte"></a>


Aes128.FileEncrypt(String, String, Byte[], Mode, Byte[]) Method
===============================================================
Encrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileEncrypt(String, String, Byte[], Mode, Byte[])**                    | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#aes128_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes128_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_fileencrypt-string-string-string-mode-string"></a>


Aes128.FileEncrypt(String, String, String, Mode, String) Method
===============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes128_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)](#aes128_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_fileencrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Aes128.FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
=================================================================================
Encrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes128_fileencrypt-string-string-byte-mode-byte)                  | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#aes128_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             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_initdecrypt-byte-mode-byte"></a>


Aes128.InitDecrypt(Byte[], Mode, Byte[]) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitDecrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start decrypting         |
| [InitDecrypt(String, Mode, String)](#aes128_initdecrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start decrypting |


Syntax
------

```csharp
public int InitDecrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_initdecrypt-string-mode-string"></a>


Aes128.InitDecrypt(String, Mode, String) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Mode, Byte[])](#aes128_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 |


Syntax
------

```csharp
public int InitDecrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_initencrypt-byte-mode-byte"></a>


Aes128.InitEncrypt(Byte[], Mode, Byte[]) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitEncrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start encrypting         |
| [InitEncrypt(String, Mode, String)](#aes128_initencrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start encrypting |


Syntax
------

```csharp
public int InitEncrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 16 bytes (128 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_initencrypt-string-mode-string"></a>


Aes128.InitEncrypt(String, Mode, String) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Mode, Byte[])](#aes128_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 |


Syntax
------

```csharp
public int InitEncrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_instance"></a>


Aes128.Instance Method
======================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Aes128 Instance()
```

#### Return Value
[Aes128](#aes128_aes128)  
Single instance to class

Remarks
-------
CAUTION: Instances of Aes128, Aes192 and Aes256 are not independent in the same thread.

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_pad-byte"></a>


Aes128.Pad(Byte[]) Method
=========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| **Pad(Byte[])**  | Pads byte array to correct length for ECB and CBC encryption         |
| [Pad(String)](#aes128_pad-string) | Pads hex-encoded string to correct length for ECB and CBC encryption |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be padded

#### Return Value
Byte[]  
padded data in byte array

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_pad-string"></a>


Aes128.Pad(String) Method
=========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| [Pad(Byte[])](#aes128_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 |


Syntax
------

```csharp
public static string Pad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded data to be padded

#### Return Value
String  
padded data in hex-encoded string

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_unpad-byte"></a>


Aes128.Unpad(Byte[]) Method
===========================
Removes the padding from an encryption block
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| **Unpad(Byte[])**  | Removes the padding from an encryption block            |
| [Unpad(String)](#aes128_unpad-string) | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
padded data

#### Return Value
Byte[]  
Unpadded data in byte array or unchanged data on error

Remarks
-------
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.

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_unpad-string"></a>


Aes128.Unpad(String) Method
===========================
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)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| [Unpad(Byte[])](#aes128_unpad-byte) | Removes the padding from an encryption block            |
| **Unpad(String)**  | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static string Unpad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded padded data

#### Return Value
String  
Unpadded data in hex-encoded string or unchanged data on error

Remarks
-------
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.

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_update-byte"></a>


Aes128.Update(Byte[]) Method
============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| **Update(Byte[])**  | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#aes128_update-string) | Transform hex string data with previously initialized key, mode and direction |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data in byte array

#### Return Value
Byte[]  
transformed data in byte array

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_update-string"></a>


Aes128.Update(String) Method
============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| [Update(Byte[])](#aes128_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 |


Syntax
------

```csharp
public string Update(
	string data
)
```

#### Parameters

##### *data*  String
hex-encoded input data

#### Return Value
String  
hex-encoded data

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes128_blocksize"></a>


Aes128.BlockSize Field
======================
Block size in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int BlockSize = 16
```

#### Field Value
Int32

See Also
--------


[Aes128 Class](#aes128_aes128)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_aes192"></a>


Aes192 Class
============
Advanced Encryption Standard (AES) with 192-bit key


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Aes192**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Aes192 : IDisposable
```

The **Aes192** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#aes192_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name                                                                      | Description                                                                   |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes192_decrypt-byte-byte-mode-byte)                                | Decrypt data in byte array                                                    |
| [Decrypt(String, String, Mode, String)](#aes192_decrypt-string-string-mode-string)                                | Decrypt hex-encoded data string                                               |
| [Decrypt(String, String, Mode, String, EncodingBase)](#aes192_decrypt-string-string-mode-string-encodingbase)                  | Decrypt encoded data string                                                   |
| [Dispose](#aes192_dispose)                                                              | Dispose of this object and clear any key schedules                            |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes192_encrypt-byte-byte-mode-byte)                                | Encrypt data in byte array                                                    |
| [Encrypt(String, String, Mode, String)](#aes192_encrypt-string-string-mode-string)                                | Encrypt hex-encoded data string                                               |
| [Encrypt(String, String, Mode, String, EncodingBase)](#aes192_encrypt-string-string-mode-string-encodingbase)                  | Encrypt encoded data string                                                   |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes192_filedecrypt-string-string-byte-mode-byte)                   | Decrypt a file                                                                |
| [FileDecrypt(String, String, String, Mode, String)](#aes192_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings                              |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes192_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options                                          |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes192_fileencrypt-string-string-byte-mode-byte)                   | Encrypt a file                                                                |
| [FileEncrypt(String, String, String, Mode, String)](#aes192_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings                              |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes192_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options                                          |
| [InitDecrypt(Byte[], Mode, Byte[])](#aes192_initdecrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start decrypting                   |
| [InitDecrypt(String, Mode, String)](#aes192_initdecrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start decrypting           |
| [InitEncrypt(Byte[], Mode, Byte[])](#aes192_initencrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start encrypting                   |
| [InitEncrypt(String, Mode, String)](#aes192_initencrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start encrypting           |
| [Instance](#aes192_instance)                                                            | Create the one and only instance                                              |
| [Pad(Byte[])](#aes192_pad-byte)                                                         | Pads byte array to correct length for ECB and CBC encryption                  |
| [Pad(String)](#aes192_pad-string)                                                         | Pads hex-encoded string to correct length for ECB and CBC encryption          |
| [Unpad(Byte[])](#aes192_unpad-byte)                                                       | Removes the padding from an encryption block                                  |
| [Unpad(String)](#aes192_unpad-string)                                                       | Removes the padding from a hex-encoded encryption block                       |
| [Update(Byte[])](#aes192_update-byte)                                                      | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#aes192_update-string)                                                      | Transform hex string data with previously initialized key, mode and direction |


Fields
------

| Name            | Description         |
| --------------- | ------------------- |
| [BlockSize](#aes192_blocksize) | Block size in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_errcode"></a>


Aes192.ErrCode Property
=======================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_decrypt-byte-byte-mode-byte"></a>


Aes192.Decrypt(Byte[], Byte[], Mode, Byte[]) Method
===================================================
Decrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Decrypt(Byte[], Byte[], Mode, Byte[])**                | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#aes192_decrypt-string-string-mode-string)               | Decrypt hex-encoded data string |
| [Decrypt(String, String, Mode, String, EncodingBase)](#aes192_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Decrypted data in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_decrypt-string-string-mode-string"></a>


Aes192.Decrypt(String, String, Mode, String) Method
===================================================
Decrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes192_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)](#aes192_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 16 bytes or `""` for ECB mode

#### Return Value
String  
Decrypted data in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_decrypt-string-string-mode-string-encodingbase"></a>


Aes192.Decrypt(String, String, Mode, String, EncodingBase) Method
=================================================================
Decrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes192_decrypt-byte-byte-mode-byte)              | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#aes192_decrypt-string-string-mode-string)              | Decrypt hex-encoded data string |
| **Decrypt(String, String, Mode, String, EncodingBase)** | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 16 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Decrypted data in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_dispose"></a>


Aes192.Dispose Method
=====================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_encrypt-byte-byte-mode-byte"></a>


Aes192.Encrypt(Byte[], Byte[], Mode, Byte[]) Method
===================================================
Encrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Encrypt(Byte[], Byte[], Mode, Byte[])**                | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#aes192_encrypt-string-string-mode-string)               | Encrypt hex-encoded data string |
| [Encrypt(String, String, Mode, String, EncodingBase)](#aes192_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_encrypt-string-string-mode-string"></a>


Aes192.Encrypt(String, String, Mode, String) Method
===================================================
Encrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes192_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)](#aes192_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 16 bytes or `""` for ECB mode

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_encrypt-string-string-mode-string-encodingbase"></a>


Aes192.Encrypt(String, String, Mode, String, EncodingBase) Method
=================================================================
Encrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes192_encrypt-byte-byte-mode-byte)              | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#aes192_encrypt-string-string-mode-string)              | Encrypt hex-encoded data string |
| **Encrypt(String, String, Mode, String, EncodingBase)** | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 16 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Ciphertext in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_filedecrypt-string-string-byte-mode-byte"></a>


Aes192.FileDecrypt(String, String, Byte[], Mode, Byte[]) Method
===============================================================
Decrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileDecrypt(String, String, Byte[], Mode, Byte[])**                    | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#aes192_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes192_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_filedecrypt-string-string-string-mode-string"></a>


Aes192.FileDecrypt(String, String, String, Mode, String) Method
===============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes192_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)](#aes192_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_filedecrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Aes192.FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
=================================================================================
Decrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes192_filedecrypt-string-string-byte-mode-byte)                  | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#aes192_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             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes. Use `null`/`Nothing` for ECB mode or when using CipherFileOption.PrefixIV option

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_fileencrypt-string-string-byte-mode-byte"></a>


Aes192.FileEncrypt(String, String, Byte[], Mode, Byte[]) Method
===============================================================
Encrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileEncrypt(String, String, Byte[], Mode, Byte[])**                    | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#aes192_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes192_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_fileencrypt-string-string-string-mode-string"></a>


Aes192.FileEncrypt(String, String, String, Mode, String) Method
===============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes192_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)](#aes192_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_fileencrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Aes192.FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
=================================================================================
Encrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes192_fileencrypt-string-string-byte-mode-byte)                  | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#aes192_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             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_initdecrypt-byte-mode-byte"></a>


Aes192.InitDecrypt(Byte[], Mode, Byte[]) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitDecrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start decrypting         |
| [InitDecrypt(String, Mode, String)](#aes192_initdecrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start decrypting |


Syntax
------

```csharp
public int InitDecrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_initdecrypt-string-mode-string"></a>


Aes192.InitDecrypt(String, Mode, String) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Mode, Byte[])](#aes192_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 |


Syntax
------

```csharp
public int InitDecrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_initencrypt-byte-mode-byte"></a>


Aes192.InitEncrypt(Byte[], Mode, Byte[]) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitEncrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start encrypting         |
| [InitEncrypt(String, Mode, String)](#aes192_initencrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start encrypting |


Syntax
------

```csharp
public int InitEncrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_initencrypt-string-mode-string"></a>


Aes192.InitEncrypt(String, Mode, String) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Mode, Byte[])](#aes192_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 |


Syntax
------

```csharp
public int InitEncrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_instance"></a>


Aes192.Instance Method
======================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Aes192 Instance()
```

#### Return Value
[Aes192](#aes192_aes192)  
Single instance to class

Remarks
-------
CAUTION: Instances of Aes128, Aes192 and Aes256 are not independent in the same thread.

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_pad-byte"></a>


Aes192.Pad(Byte[]) Method
=========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| **Pad(Byte[])**  | Pads byte array to correct length for ECB and CBC encryption         |
| [Pad(String)](#aes192_pad-string) | Pads hex-encoded string to correct length for ECB and CBC encryption |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be padded

#### Return Value
Byte[]  
padded data in byte array

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_pad-string"></a>


Aes192.Pad(String) Method
=========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| [Pad(Byte[])](#aes192_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 |


Syntax
------

```csharp
public static string Pad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded data to be padded

#### Return Value
String  
padded data in hex-encoded string

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_unpad-byte"></a>


Aes192.Unpad(Byte[]) Method
===========================
Removes the padding from an encryption block
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| **Unpad(Byte[])**  | Removes the padding from an encryption block            |
| [Unpad(String)](#aes192_unpad-string) | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
padded data

#### Return Value
Byte[]  
Unpadded data in byte array or unchanged data on error

Remarks
-------
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.

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_unpad-string"></a>


Aes192.Unpad(String) Method
===========================
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)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| [Unpad(Byte[])](#aes192_unpad-byte) | Removes the padding from an encryption block            |
| **Unpad(String)**  | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static string Unpad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded padded data

#### Return Value
String  
Unpadded data in hex-encoded string or unchanged data on error

Remarks
-------
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.

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_update-byte"></a>


Aes192.Update(Byte[]) Method
============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| **Update(Byte[])**  | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#aes192_update-string) | Transform hex string data with previously initialized key, mode and direction |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data in byte array

#### Return Value
Byte[]  
transformed data in byte array

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_update-string"></a>


Aes192.Update(String) Method
============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| [Update(Byte[])](#aes192_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 |


Syntax
------

```csharp
public string Update(
	string data
)
```

#### Parameters

##### *data*  String
hex-encoded input data

#### Return Value
String  
hex-encoded data

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes192_blocksize"></a>


Aes192.BlockSize Field
======================
Block size in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int BlockSize = 16
```

#### Field Value
Int32

See Also
--------


[Aes192 Class](#aes192_aes192)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_aes256"></a>


Aes256 Class
============
Advanced Encryption Standard (AES) with 256-bit key


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Aes256**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Aes256 : IDisposable
```

The **Aes256** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#aes256_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name                                                                      | Description                                                                   |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes256_decrypt-byte-byte-mode-byte)                                | Decrypt data in byte array                                                    |
| [Decrypt(String, String, Mode, String)](#aes256_decrypt-string-string-mode-string)                                | Decrypt hex-encoded data string                                               |
| [Decrypt(String, String, Mode, String, EncodingBase)](#aes256_decrypt-string-string-mode-string-encodingbase)                  | Decrypt encoded data string                                                   |
| [Dispose](#aes256_dispose)                                                              | Dispose of this object and clear any key schedules                            |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes256_encrypt-byte-byte-mode-byte)                                | Encrypt data in byte array                                                    |
| [Encrypt(String, String, Mode, String)](#aes256_encrypt-string-string-mode-string)                                | Encrypt hex-encoded data string                                               |
| [Encrypt(String, String, Mode, String, EncodingBase)](#aes256_encrypt-string-string-mode-string-encodingbase)                  | Encrypt encoded data string                                                   |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes256_filedecrypt-string-string-byte-mode-byte)                   | Decrypt a file                                                                |
| [FileDecrypt(String, String, String, Mode, String)](#aes256_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings                              |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes256_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options                                          |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes256_fileencrypt-string-string-byte-mode-byte)                   | Encrypt a file                                                                |
| [FileEncrypt(String, String, String, Mode, String)](#aes256_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings                              |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes256_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options                                          |
| [InitDecrypt(Byte[], Mode, Byte[])](#aes256_initdecrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start decrypting                   |
| [InitDecrypt(String, Mode, String)](#aes256_initdecrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start decrypting           |
| [InitEncrypt(Byte[], Mode, Byte[])](#aes256_initencrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start encrypting                   |
| [InitEncrypt(String, Mode, String)](#aes256_initencrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start encrypting           |
| [Instance](#aes256_instance)                                                            | Create the one and only instance                                              |
| [Pad(Byte[])](#aes256_pad-byte)                                                         | Pads byte array to correct length for ECB and CBC encryption                  |
| [Pad(String)](#aes256_pad-string)                                                         | Pads hex-encoded string to correct length for ECB and CBC encryption          |
| [Unpad(Byte[])](#aes256_unpad-byte)                                                       | Removes the padding from an encryption block                                  |
| [Unpad(String)](#aes256_unpad-string)                                                       | Removes the padding from a hex-encoded encryption block                       |
| [Update(Byte[])](#aes256_update-byte)                                                      | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#aes256_update-string)                                                      | Transform hex string data with previously initialized key, mode and direction |


Fields
------

| Name            | Description         |
| --------------- | ------------------- |
| [BlockSize](#aes256_blocksize) | Block size in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_errcode"></a>


Aes256.ErrCode Property
=======================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_decrypt-byte-byte-mode-byte"></a>


Aes256.Decrypt(Byte[], Byte[], Mode, Byte[]) Method
===================================================
Decrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Decrypt(Byte[], Byte[], Mode, Byte[])**                | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#aes256_decrypt-string-string-mode-string)               | Decrypt hex-encoded data string |
| [Decrypt(String, String, Mode, String, EncodingBase)](#aes256_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Decrypted data in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_decrypt-string-string-mode-string"></a>


Aes256.Decrypt(String, String, Mode, String) Method
===================================================
Decrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes256_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)](#aes256_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 16 bytes or `""` for ECB mode

#### Return Value
String  
Decrypted data in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_decrypt-string-string-mode-string-encodingbase"></a>


Aes256.Decrypt(String, String, Mode, String, EncodingBase) Method
=================================================================
Decrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#aes256_decrypt-byte-byte-mode-byte)              | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#aes256_decrypt-string-string-mode-string)              | Decrypt hex-encoded data string |
| **Decrypt(String, String, Mode, String, EncodingBase)** | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 16 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Decrypted data in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_dispose"></a>


Aes256.Dispose Method
=====================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_encrypt-byte-byte-mode-byte"></a>


Aes256.Encrypt(Byte[], Byte[], Mode, Byte[]) Method
===================================================
Encrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Encrypt(Byte[], Byte[], Mode, Byte[])**                | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#aes256_encrypt-string-string-mode-string)               | Encrypt hex-encoded data string |
| [Encrypt(String, String, Mode, String, EncodingBase)](#aes256_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_encrypt-string-string-mode-string"></a>


Aes256.Encrypt(String, String, Mode, String) Method
===================================================
Encrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes256_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)](#aes256_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 16 bytes or `""` for ECB mode

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_encrypt-string-string-mode-string-encodingbase"></a>


Aes256.Encrypt(String, String, Mode, String, EncodingBase) Method
=================================================================
Encrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#aes256_encrypt-byte-byte-mode-byte)              | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#aes256_encrypt-string-string-mode-string)              | Encrypt hex-encoded data string |
| **Encrypt(String, String, Mode, String, EncodingBase)** | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 16 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Ciphertext in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_filedecrypt-string-string-byte-mode-byte"></a>


Aes256.FileDecrypt(String, String, Byte[], Mode, Byte[]) Method
===============================================================
Decrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileDecrypt(String, String, Byte[], Mode, Byte[])**                    | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#aes256_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes256_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_filedecrypt-string-string-string-mode-string"></a>


Aes256.FileDecrypt(String, String, String, Mode, String) Method
===============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes256_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)](#aes256_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_filedecrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Aes256.FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
=================================================================================
Decrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#aes256_filedecrypt-string-string-byte-mode-byte)                  | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#aes256_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             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes. Use `null`/`Nothing` for ECB mode or when using CipherFileOption.PrefixIV option

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_fileencrypt-string-string-byte-mode-byte"></a>


Aes256.FileEncrypt(String, String, Byte[], Mode, Byte[]) Method
===============================================================
Encrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileEncrypt(String, String, Byte[], Mode, Byte[])**                    | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#aes256_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#aes256_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_fileencrypt-string-string-string-mode-string"></a>


Aes256.FileEncrypt(String, String, String, Mode, String) Method
===============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes256_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)](#aes256_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_fileencrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Aes256.FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
=================================================================================
Encrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#aes256_fileencrypt-string-string-byte-mode-byte)                  | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#aes256_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             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_initdecrypt-byte-mode-byte"></a>


Aes256.InitDecrypt(Byte[], Mode, Byte[]) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitDecrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start decrypting         |
| [InitDecrypt(String, Mode, String)](#aes256_initdecrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start decrypting |


Syntax
------

```csharp
public int InitDecrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_initdecrypt-string-mode-string"></a>


Aes256.InitDecrypt(String, Mode, String) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Mode, Byte[])](#aes256_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 |


Syntax
------

```csharp
public int InitDecrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_initencrypt-byte-mode-byte"></a>


Aes256.InitEncrypt(Byte[], Mode, Byte[]) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitEncrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start encrypting         |
| [InitEncrypt(String, Mode, String)](#aes256_initencrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start encrypting |


Syntax
------

```csharp
public int InitEncrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 32 bytes (256 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 16 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_initencrypt-string-mode-string"></a>


Aes256.InitEncrypt(String, Mode, String) Method
===============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Mode, Byte[])](#aes256_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 |


Syntax
------

```csharp
public int InitEncrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_instance"></a>


Aes256.Instance Method
======================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Aes256 Instance()
```

#### Return Value
[Aes256](#aes256_aes256)  
Single instance to class

Remarks
-------
CAUTION: Instances of Aes128, Aes192 and Aes256 are not independent in the same thread.

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_pad-byte"></a>


Aes256.Pad(Byte[]) Method
=========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| **Pad(Byte[])**  | Pads byte array to correct length for ECB and CBC encryption         |
| [Pad(String)](#aes256_pad-string) | Pads hex-encoded string to correct length for ECB and CBC encryption |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be padded

#### Return Value
Byte[]  
padded data in byte array

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_pad-string"></a>


Aes256.Pad(String) Method
=========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| [Pad(Byte[])](#aes256_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 |


Syntax
------

```csharp
public static string Pad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded data to be padded

#### Return Value
String  
padded data in hex-encoded string

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_unpad-byte"></a>


Aes256.Unpad(Byte[]) Method
===========================
Removes the padding from an encryption block
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| **Unpad(Byte[])**  | Removes the padding from an encryption block            |
| [Unpad(String)](#aes256_unpad-string) | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
padded data

#### Return Value
Byte[]  
Unpadded data in byte array or unchanged data on error

Remarks
-------
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.

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_unpad-string"></a>


Aes256.Unpad(String) Method
===========================
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)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| [Unpad(Byte[])](#aes256_unpad-byte) | Removes the padding from an encryption block            |
| **Unpad(String)**  | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static string Unpad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded padded data

#### Return Value
String  
Unpadded data in hex-encoded string or unchanged data on error

Remarks
-------
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.

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_update-byte"></a>


Aes256.Update(Byte[]) Method
============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| **Update(Byte[])**  | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#aes256_update-string) | Transform hex string data with previously initialized key, mode and direction |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data in byte array

#### Return Value
Byte[]  
transformed data in byte array

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_update-string"></a>


Aes256.Update(String) Method
============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| [Update(Byte[])](#aes256_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 |


Syntax
------

```csharp
public string Update(
	string data
)
```

#### Parameters

##### *data*  String
hex-encoded input data

#### Return Value
String  
hex-encoded data

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (16 bytes)

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aes256_blocksize"></a>


Aes256.BlockSize Field
======================
Block size in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int BlockSize = 16
```

#### Field Value
Int32

See Also
--------


[Aes256 Class](#aes256_aes256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_blowfish"></a>


Blowfish Class
==============
Blowfish cipher algorithm


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Blowfish**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Blowfish : IDisposable
```

The **Blowfish** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#blowfish_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name                                                                      | Description                                                                   |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#blowfish_decrypt-byte-byte-mode-byte)                                | Decrypt data in byte array                                                    |
| [Decrypt(String, String, Mode, String)](#blowfish_decrypt-string-string-mode-string)                                | Decrypt hex-encoded data string                                               |
| [Decrypt(String, String, Mode, String, EncodingBase)](#blowfish_decrypt-string-string-mode-string-encodingbase)                  | Decrypt encoded data string                                                   |
| [Dispose](#blowfish_dispose)                                                              | Dispose of this object and clear any key schedules                            |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#blowfish_encrypt-byte-byte-mode-byte)                                | Encrypt data in byte array                                                    |
| [Encrypt(String, String, Mode, String)](#blowfish_encrypt-string-string-mode-string)                                | Encrypt hex-encoded data string                                               |
| [Encrypt(String, String, Mode, String, EncodingBase)](#blowfish_encrypt-string-string-mode-string-encodingbase)                  | Encrypt encoded data string                                                   |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#blowfish_filedecrypt-string-string-byte-mode-byte)                   | Decrypt a file                                                                |
| [FileDecrypt(String, String, String, Mode, String)](#blowfish_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings                              |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#blowfish_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options                                          |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#blowfish_fileencrypt-string-string-byte-mode-byte)                   | Encrypt a file                                                                |
| [FileEncrypt(String, String, String, Mode, String)](#blowfish_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings                              |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#blowfish_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options                                          |
| [InitDecrypt(Byte[], Mode, Byte[])](#blowfish_initdecrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start decrypting                   |
| [InitDecrypt(String, Mode, String)](#blowfish_initdecrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start decrypting           |
| [InitEncrypt(Byte[], Mode, Byte[])](#blowfish_initencrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start encrypting                   |
| [InitEncrypt(String, Mode, String)](#blowfish_initencrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start encrypting           |
| [Instance](#blowfish_instance)                                                            | Create the one and only instance                                              |
| [Pad(Byte[])](#blowfish_pad-byte)                                                         | Pads byte array to correct length for ECB and CBC encryption                  |
| [Pad(String)](#blowfish_pad-string)                                                         | Pads hex-encoded string to correct length for ECB and CBC encryption          |
| [Unpad(Byte[])](#blowfish_unpad-byte)                                                       | Removes the padding from an encryption block                                  |
| [Unpad(String)](#blowfish_unpad-string)                                                       | Removes the padding from a hex-encoded encryption block                       |
| [Update(Byte[])](#blowfish_update-byte)                                                      | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#blowfish_update-string)                                                      | Transform hex string data with previously initialized key, mode and direction |


Fields
------

| Name            | Description         |
| --------------- | ------------------- |
| [BlockSize](#blowfish_blocksize) | Block size in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_errcode"></a>


Blowfish.ErrCode Property
=========================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_decrypt-byte-byte-mode-byte"></a>


Blowfish.Decrypt(Byte[], Byte[], Mode, Byte[]) Method
=====================================================
Decrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Decrypt(Byte[], Byte[], Mode, Byte[])**                | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#blowfish_decrypt-string-string-mode-string)               | Decrypt hex-encoded data string |
| [Decrypt(String, String, Mode, String, EncodingBase)](#blowfish_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Decrypted data in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_decrypt-string-string-mode-string"></a>


Blowfish.Decrypt(String, String, Mode, String) Method
=====================================================
Decrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#blowfish_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)](#blowfish_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 8 bytes or `""` for ECB mode

#### Return Value
String  
Decrypted data in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_decrypt-string-string-mode-string-encodingbase"></a>


Blowfish.Decrypt(String, String, Mode, String, EncodingBase) Method
===================================================================
Decrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#blowfish_decrypt-byte-byte-mode-byte)              | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#blowfish_decrypt-string-string-mode-string)              | Decrypt hex-encoded data string |
| **Decrypt(String, String, Mode, String, EncodingBase)** | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 8 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Decrypted data in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_dispose"></a>


Blowfish.Dispose Method
=======================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_encrypt-byte-byte-mode-byte"></a>


Blowfish.Encrypt(Byte[], Byte[], Mode, Byte[]) Method
=====================================================
Encrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Encrypt(Byte[], Byte[], Mode, Byte[])**                | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#blowfish_encrypt-string-string-mode-string)               | Encrypt hex-encoded data string |
| [Encrypt(String, String, Mode, String, EncodingBase)](#blowfish_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_encrypt-string-string-mode-string"></a>


Blowfish.Encrypt(String, String, Mode, String) Method
=====================================================
Encrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#blowfish_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)](#blowfish_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 8 bytes or `""` for ECB mode

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_encrypt-string-string-mode-string-encodingbase"></a>


Blowfish.Encrypt(String, String, Mode, String, EncodingBase) Method
===================================================================
Encrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#blowfish_encrypt-byte-byte-mode-byte)              | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#blowfish_encrypt-string-string-mode-string)              | Encrypt hex-encoded data string |
| **Encrypt(String, String, Mode, String, EncodingBase)** | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 8 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Ciphertext in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_filedecrypt-string-string-byte-mode-byte"></a>


Blowfish.FileDecrypt(String, String, Byte[], Mode, Byte[]) Method
=================================================================
Decrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileDecrypt(String, String, Byte[], Mode, Byte[])**                    | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#blowfish_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#blowfish_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_filedecrypt-string-string-string-mode-string"></a>


Blowfish.FileDecrypt(String, String, String, Mode, String) Method
=================================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#blowfish_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)](#blowfish_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_filedecrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Blowfish.FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
===================================================================================
Decrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#blowfish_filedecrypt-string-string-byte-mode-byte)                  | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#blowfish_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             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes. Use `null`/`Nothing` for ECB mode or when using CipherFileOption.PrefixIV option

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_fileencrypt-string-string-byte-mode-byte"></a>


Blowfish.FileEncrypt(String, String, Byte[], Mode, Byte[]) Method
=================================================================
Encrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileEncrypt(String, String, Byte[], Mode, Byte[])**                    | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#blowfish_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#blowfish_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_fileencrypt-string-string-string-mode-string"></a>


Blowfish.FileEncrypt(String, String, String, Mode, String) Method
=================================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#blowfish_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)](#blowfish_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_fileencrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Blowfish.FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
===================================================================================
Encrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#blowfish_fileencrypt-string-string-byte-mode-byte)                  | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#blowfish_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             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_initdecrypt-byte-mode-byte"></a>


Blowfish.InitDecrypt(Byte[], Mode, Byte[]) Method
=================================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitDecrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start decrypting         |
| [InitDecrypt(String, Mode, String)](#blowfish_initdecrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start decrypting |


Syntax
------

```csharp
public int InitDecrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_initdecrypt-string-mode-string"></a>


Blowfish.InitDecrypt(String, Mode, String) Method
=================================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Mode, Byte[])](#blowfish_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 |


Syntax
------

```csharp
public int InitDecrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_initencrypt-byte-mode-byte"></a>


Blowfish.InitEncrypt(Byte[], Mode, Byte[]) Method
=================================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitEncrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start encrypting         |
| [InitEncrypt(String, Mode, String)](#blowfish_initencrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start encrypting |


Syntax
------

```csharp
public int InitEncrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of length between 1 and 56 bytes (448 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_initencrypt-string-mode-string"></a>


Blowfish.InitEncrypt(String, Mode, String) Method
=================================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Mode, Byte[])](#blowfish_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 |


Syntax
------

```csharp
public int InitEncrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_instance"></a>


Blowfish.Instance Method
========================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Blowfish Instance()
```

#### Return Value
[Blowfish](#blowfish_blowfish)  
Single instance to class

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_pad-byte"></a>


Blowfish.Pad(Byte[]) Method
===========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| **Pad(Byte[])**  | Pads byte array to correct length for ECB and CBC encryption         |
| [Pad(String)](#blowfish_pad-string) | Pads hex-encoded string to correct length for ECB and CBC encryption |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be padded

#### Return Value
Byte[]  
padded data in byte array

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_pad-string"></a>


Blowfish.Pad(String) Method
===========================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| [Pad(Byte[])](#blowfish_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 |


Syntax
------

```csharp
public static string Pad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded data to be padded

#### Return Value
String  
padded data in hex-encoded string

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_unpad-byte"></a>


Blowfish.Unpad(Byte[]) Method
=============================
Removes the padding from an encryption block
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| **Unpad(Byte[])**  | Removes the padding from an encryption block            |
| [Unpad(String)](#blowfish_unpad-string) | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
padded data

#### Return Value
Byte[]  
Unpadded data in byte array or unchanged data on error

Remarks
-------
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.

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_unpad-string"></a>


Blowfish.Unpad(String) Method
=============================
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)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| [Unpad(Byte[])](#blowfish_unpad-byte) | Removes the padding from an encryption block            |
| **Unpad(String)**  | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static string Unpad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded padded data

#### Return Value
String  
Unpadded data in hex-encoded string or unchanged data on error

Remarks
-------
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.

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_update-byte"></a>


Blowfish.Update(Byte[]) Method
==============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| **Update(Byte[])**  | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#blowfish_update-string) | Transform hex string data with previously initialized key, mode and direction |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data in byte array

#### Return Value
Byte[]  
transformed data in byte array

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_update-string"></a>


Blowfish.Update(String) Method
==============================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| [Update(Byte[])](#blowfish_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 |


Syntax
------

```csharp
public string Update(
	string data
)
```

#### Parameters

##### *data*  String
hex-encoded input data

#### Return Value
String  
hex-encoded data

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="blowfish_blocksize"></a>


Blowfish.BlockSize Field
========================
Block size in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int BlockSize = 8
```

#### Field Value
Int32

See Also
--------


[Blowfish Class](#blowfish_blowfish)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_cipher"></a>


Cipher Class
============
Block cipher utilities


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Cipher**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Cipher
```

The **Cipher** type exposes the following members.


Properties
----------

| Name         | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| [ErrCode](#cipher_errcode) | Last error code (for Init, Update and Final object methods only) |


Methods
-------

| Name                                                                              | Description                                                                                                         |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [BlockBytes](#cipher_blockbytes)                                                                   | Return the block size in bytes for a given cipher algorithm                                                         |
| [Decrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts)](#cipher_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)](#cipher_decrypt-string-string-string-cipheralgorithm-mode-padding-cipher-opts) | Decrypt hex-encoded data using specified block cipher algorithm, mode and padding.                                  |
| [Dispose](#cipher_dispose)                                                                      | Dispose of this object and clear any stored data.                                                                   |
| [Encrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts)](#cipher_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)](#cipher_encrypt-string-string-string-cipheralgorithm-mode-padding-cipher-opts) | Encrypt hex-encoded data using specified block cipher algorithm, mode and padding.                                  |
| [FileDecrypt](#cipher_filedecrypt)                                                                  | Decrypt a file with block cipher                                                                                    |
| [FileEncrypt](#cipher_fileencrypt)                                                                 | Encrypt a file with block cipher                                                                                    |
| [InitDecrypt(Byte[], Byte[], CipherAlgorithm, Mode)](#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)](#cipher_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)](#cipher_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)](#cipher_initencrypt-string-string-cipheralgorithm-mode)                          | Initializes with hex-encoded key, iv, algorithm and mode ready to start encrypting with repeated update operations. |
| [Instance](#cipher_instance)                                                                    | Create the one and only instance                                                                                    |
| [KeyBytes](#cipher_keybytes)                                                                    | Return the key size in bytes for a given cipher algorithm                                                           |
| [KeyUnwrap](#cipher_keyunwrap)                                                                   | Unwraps (decrypts) key material with a key-encryption key                                                           |
| [KeyWrap](#cipher_keywrap)                                                                     | Wraps (encrypts) key material with a key-encryption key                                                             |
| [Pad(Byte[], CipherAlgorithm, Padding)](#cipher_pad-byte-cipheralgorithm-padding)                                       | Pad byte array for block cipher.                                                                                    |
| [Pad(String, CipherAlgorithm, Padding)](#cipher_pad-string-cipheralgorithm-padding)                                       | Pads hex-encoded string for block cipher.                                                                           |
| [Unpad(Byte[], CipherAlgorithm, Padding)](#cipher_unpad-byte-cipheralgorithm-padding)                                     | Remove padding from an encryption block.                                                                            |
| [Unpad(String, CipherAlgorithm, Padding)](#cipher_unpad-string-cipheralgorithm-padding)                                     | Remove padding from a hex-encoded encryption block.                                                                 |
| [Update(Byte[])](#cipher_update-byte)                                                              | Transform byte input data with previously initialized key, mode and direction.                                      |
| [Update(String)](#cipher_update-string)                                                              | Transform hex string data with previously initialized key, mode and direction                                       |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_errcode"></a>


Cipher.ErrCode Property
=======================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_blockbytes"></a>


Cipher.BlockBytes Method
========================
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)

Syntax
------

```csharp
public static int BlockBytes(
	CipherAlgorithm alg
)
```

#### Parameters

##### *alg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

#### Return Value
Int32  
Block size in bytes

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_decrypt-byte-byte-byte-cipheralgorithm-mode-padding-cipher-opts"></a>


Cipher.Decrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) Method
==========================================================================================
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)

Overloads
---------

| 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)](#cipher_decrypt-string-string-string-cipheralgorithm-mode-padding-cipher-opts) | Decrypt hex-encoded data using specified block cipher algorithm, mode and padding.         |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad,
	Cipher.Opts opts = Cipher.Opts.Default
)
```

#### Parameters

##### *input*  Byte[]
Input data to be decrypted

##### *key*  Byte[]
Key of exact length for block cipher algorithm

##### *iv*  Byte[]
Initialization Vector (IV) of exactly the block size or `null` for ECB mode, if not provided in input.

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *pad*  [Padding](#padding_padding)
Padding method to use

##### *opts*  [Cipher.Opts](#cipher_opts_cipher-opts)  (Optional)
Advanced options (optional). Use [Cipher.Opts.PrefixIV](#cipher_opts_cipher-opts-prefixiv) to expect the IV to be prepended at the start of the input.

#### Return Value
Byte[]  
Decrypted plaintext in byte array or empty array on error

Remarks
-------
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.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_decrypt-string-string-string-cipheralgorithm-mode-padding-cipher-opts"></a>


Cipher.Decrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) Method
==========================================================================================
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)

Overloads
---------

| Name                                                                              | Description                                                                                |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [Decrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts)](#cipher_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.         |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	string ivHex,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad,
	Cipher.Opts opts = Cipher.Opts.Default
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exact key length

##### *ivHex*  String
Hex-encoded IV representing exact block length or `""` for ECB mode

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher Algorithm

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *pad*  [Padding](#padding_padding)
Padding method to use

##### *opts*  [Cipher.Opts](#cipher_opts_cipher-opts)  (Optional)
Advanced options (optional). Use [Cipher.Opts.PrefixIV](#cipher_opts_cipher-opts-prefixiv) to prepend the IV to the output.

#### Return Value
String  
Decrypted plaintex in hex-encoded string or empty string on error

Remarks
-------
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.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_dispose"></a>


Cipher.Dispose Method
=====================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_encrypt-byte-byte-byte-cipheralgorithm-mode-padding-cipher-opts"></a>


Cipher.Encrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts) Method
==========================================================================================
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)

Overloads
---------

| 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)](#cipher_encrypt-string-string-string-cipheralgorithm-mode-padding-cipher-opts) | Encrypt hex-encoded data using specified block cipher algorithm, mode and padding.         |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad,
	Cipher.Opts opts = Cipher.Opts.Default
)
```

#### Parameters

##### *input*  Byte[]
Input data to be encrypted

##### *key*  Byte[]
Key of exact length for block cipher algorithm

##### *iv*  Byte[]
Initialization Vector (IV) of exactly the block size or `null` for ECB mode, if not provided in input.

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *pad*  [Padding](#padding_padding)
Padding method to use

##### *opts*  [Cipher.Opts](#cipher_opts_cipher-opts)  (Optional)
Advanced options (optional). Use [Cipher.Opts.PrefixIV](#cipher_opts_cipher-opts-prefixiv) to prepend the IV to the output.

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
Default padding is `Pkcs5` for ECB and CBC mode and `NoPad` for all other modes.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_encrypt-string-string-string-cipheralgorithm-mode-padding-cipher-opts"></a>


Cipher.Encrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) Method
==========================================================================================
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)

Overloads
---------

| Name                                                                              | Description                                                                                |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [Encrypt(Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding, Cipher.Opts)](#cipher_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.         |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	string ivHex,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad,
	Cipher.Opts opts = Cipher.Opts.Default
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exact key length

##### *ivHex*  String
Hex-encoded IV representing exact block length or `""` for ECB mode

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher Algorithm

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *pad*  [Padding](#padding_padding)
Padding method to use

##### *opts*  [Cipher.Opts](#cipher_opts_cipher-opts)  (Optional)
Advanced options (optional). Use [Cipher.Opts.PrefixIV](#cipher_opts_cipher-opts-prefixiv) to prepend the IV to the output.

#### Return Value
String  
Encrypted ciphertext in hex-encoded string or empty string on error

Remarks
-------
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.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_filedecrypt"></a>


Cipher.FileDecrypt Method
=========================
Decrypt a file with block cipher
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad,
	Cipher.Opts opts
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of of exact length for block cipher algorithm

##### *iv*  Byte[]
Initialization Vector (IV) of exactly the block size or `null` for ECB mode

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher Algorithm

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *pad*  [Padding](#padding_padding)
Padding method to use (ECB and CBC modes only)

##### *opts*  [Cipher.Opts](#cipher_opts_cipher-opts)
Advanced options

#### Return Value
Int32  
0 if successful or nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_fileencrypt"></a>


Cipher.FileEncrypt Method
=========================
Encrypt a file with block cipher
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad,
	Cipher.Opts opts
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of of exact length for block cipher algorithm

##### *iv*  Byte[]
Initialization Vector (IV) of exactly the block size or `null` for ECB mode

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher Algorithm

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *pad*  [Padding](#padding_padding)
Padding method to use (ECB and CBC modes only)

##### *opts*  [Cipher.Opts](#cipher_opts_cipher-opts)
Advanced options

#### Return Value
Int32  
0 if successful or nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_initdecrypt-byte-byte-cipheralgorithm-mode"></a>


Cipher.InitDecrypt(Byte[], Byte[], CipherAlgorithm, Mode) Method
================================================================
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)

Overloads
---------

| 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)](#cipher_initdecrypt-string-string-cipheralgorithm-mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start decrypting with repeated update operations. |


Syntax
------

```csharp
public bool InitDecrypt(
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode
)
```

#### Parameters

##### *key*  Byte[]
Key of exact length for block cipher algorithm.

##### *iv*  Byte[]
Initialization Vector (IV) of exactly the block size or `null/Nothing` for ECB mode.

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

##### *mode*  [Mode](#mode_mode)
Cipher mode

#### Return Value
Boolean  
True if successful, False if failed.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_initdecrypt-string-string-cipheralgorithm-mode"></a>


Cipher.InitDecrypt(String, String, CipherAlgorithm, Mode) Method
================================================================
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)

Overloads
---------

| Name                                                    | Description                                                                                                         |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Byte[], CipherAlgorithm, Mode)](#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. |


Syntax
------

```csharp
public bool InitDecrypt(
	string keyHex,
	string ivHex,
	CipherAlgorithm cipherAlg,
	Mode mode
)
```

#### Parameters

##### *keyHex*  String
Hex-encoded key of exact length for block cipher algorithm.

##### *ivHex*  String
Hex-encoded Initialization Vector (IV) of exactly the block size or `""` for ECB mode.

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

##### *mode*  [Mode](#mode_mode)
Cipher mode

#### Return Value
Boolean  
True if successful, False if failed.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_initencrypt-byte-byte-cipheralgorithm-mode"></a>


Cipher.InitEncrypt(Byte[], Byte[], CipherAlgorithm, Mode) Method
================================================================
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)

Overloads
---------

| 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)](#cipher_initencrypt-string-string-cipheralgorithm-mode) | Initializes with hex-encoded key, iv, algorithm and mode ready to start encrypting with repeated update operations. |


Syntax
------

```csharp
public bool InitEncrypt(
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode
)
```

#### Parameters

##### *key*  Byte[]
Key of exact length for block cipher algorithm.

##### *iv*  Byte[]
Initialization Vector (IV) of exactly the block size or `null/Nothing` for ECB mode.

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

##### *mode*  [Mode](#mode_mode)
Cipher mode

#### Return Value
Boolean  
True if successful, False if failed.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_initencrypt-string-string-cipheralgorithm-mode"></a>


Cipher.InitEncrypt(String, String, CipherAlgorithm, Mode) Method
================================================================
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)

Overloads
---------

| Name                                                    | Description                                                                                                         |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Byte[], CipherAlgorithm, Mode)](#cipher_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. |


Syntax
------

```csharp
public bool InitEncrypt(
	string keyHex,
	string ivHex,
	CipherAlgorithm cipherAlg,
	Mode mode
)
```

#### Parameters

##### *keyHex*  String
Hex-encoded key of exact length for block cipher algorithm.

##### *ivHex*  String
Hex-encoded Initialization Vector (IV) of exactly the block size or `""` for ECB mode.

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

##### *mode*  [Mode](#mode_mode)
Cipher mode

#### Return Value
Boolean  
True if successful, False if failed.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_instance"></a>


Cipher.Instance Method
======================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Cipher Instance()
```

#### Return Value
[Cipher](#cipher_cipher)  
Single instance to class

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_keybytes"></a>


Cipher.KeyBytes Method
======================
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)

Syntax
------

```csharp
public static int KeyBytes(
	CipherAlgorithm alg
)
```

#### Parameters

##### *alg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Cipher algorithm

#### Return Value
Int32  
Key size in bytes

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_keyunwrap"></a>


Cipher.KeyUnwrap Method
=======================
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)

Syntax
------

```csharp
public static byte[] KeyUnwrap(
	byte[] data,
	byte[] kek,
	CipherAlgorithm cipherAlg
)
```

#### Parameters

##### *data*  Byte[]
Wrapped key

##### *kek*  Byte[]
Key encryption key

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Block cipher to use for wrapping

#### Return Value
Byte[]  
Unwrapped key material (or empty array on error)

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_keywrap"></a>


Cipher.KeyWrap Method
=====================
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)

Syntax
------

```csharp
public static byte[] KeyWrap(
	byte[] data,
	byte[] kek,
	CipherAlgorithm cipherAlg
)
```

#### Parameters

##### *data*  Byte[]
Key material to be wrapped

##### *kek*  Byte[]
Key encryption key

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Block cipher to use for wrapping

#### Return Value
Byte[]  
Wrapped key (or empty array on error)

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_pad-byte-cipheralgorithm-padding"></a>


Cipher.Pad(Byte[], CipherAlgorithm, Padding) Method
===================================================
Pad byte array for block cipher.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                       | Description                               |
| ------------------------------------------ | ----------------------------------------- |
| **Pad(Byte[], CipherAlgorithm, Padding)**  | Pad byte array for block cipher.          |
| [Pad(String, CipherAlgorithm, Padding)](#cipher_pad-string-cipheralgorithm-padding) | Pads hex-encoded string for block cipher. |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] input,
	CipherAlgorithm cipherAlg,
	Padding pad
)
```

#### Parameters

##### *input*  Byte[]
data to be padded

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Block cipher being used

##### *pad*  [Padding](#padding_padding)
Padding method to use

#### Return Value
Byte[]  
Padded data in byte array

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_pad-string-cipheralgorithm-padding"></a>


Cipher.Pad(String, CipherAlgorithm, Padding) Method
===================================================
Pads hex-encoded string for block cipher.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                       | Description                               |
| ------------------------------------------ | ----------------------------------------- |
| [Pad(Byte[], CipherAlgorithm, Padding)](#cipher_pad-byte-cipheralgorithm-padding) | Pad byte array for block cipher.          |
| **Pad(String, CipherAlgorithm, Padding)**  | Pads hex-encoded string for block cipher. |


Syntax
------

```csharp
public static string Pad(
	string inputHex,
	CipherAlgorithm cipherAlg,
	Padding pad
)
```

#### Parameters

##### *inputHex*  String
hex-encoded data to be padded

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Block cipher being used

##### *pad*  [Padding](#padding_padding)
Padding method to use

#### Return Value
String  
Padded data in hex-encoded string

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_unpad-byte-cipheralgorithm-padding"></a>


Cipher.Unpad(Byte[], CipherAlgorithm, Padding) Method
=====================================================
Remove padding from an encryption block.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                         | Description                                         |
| -------------------------------------------- | --------------------------------------------------- |
| **Unpad(Byte[], CipherAlgorithm, Padding)**  | Remove padding from an encryption block.            |
| [Unpad(String, CipherAlgorithm, Padding)](#cipher_unpad-string-cipheralgorithm-padding) | Remove padding from a hex-encoded encryption block. |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] input,
	CipherAlgorithm cipherAlg,
	Padding pad
)
```

#### Parameters

##### *input*  Byte[]
padded data

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Block cipher being used

##### *pad*  [Padding](#padding_padding)
Padding method to use

#### Return Value
Byte[]  
Unpadded data in byte array.

Remarks
-------
Unless `pad` is `NoPad`, the unpadded output is always shorter than the padded input. An error is indicated by returning the original data.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_unpad-string-cipheralgorithm-padding"></a>


Cipher.Unpad(String, CipherAlgorithm, Padding) Method
=====================================================
Remove padding from a hex-encoded encryption block.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                         | Description                                         |
| -------------------------------------------- | --------------------------------------------------- |
| [Unpad(Byte[], CipherAlgorithm, Padding)](#cipher_unpad-byte-cipheralgorithm-padding) | Remove padding from an encryption block.            |
| **Unpad(String, CipherAlgorithm, Padding)**  | Remove padding from a hex-encoded encryption block. |


Syntax
------

```csharp
public static string Unpad(
	string inputHex,
	CipherAlgorithm cipherAlg,
	Padding pad
)
```

#### Parameters

##### *inputHex*  String
hex-encoded padded data

##### *cipherAlg*  [CipherAlgorithm](#cipheralgorithm_cipheralgorithm)
Block cipher being used

##### *pad*  [Padding](#padding_padding)
Padding method to use

#### Return Value
String  
Unpadded data in hex-encoded string.

Remarks
-------
Unless `pad` is `NoPad`, the unpadded output is always shorter than the padded input. An error is indicated by returning the original data.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_update-byte"></a>


Cipher.Update(Byte[]) Method
============================
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)

Overloads
---------

| Name                | Description                                                                    |
| ------------------- | ------------------------------------------------------------------------------ |
| **Update(Byte[])**  | Transform byte input data with previously initialized key, mode and direction. |
| [Update(String)](#cipher_update-string) | Transform hex string data with previously initialized key, mode and direction  |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
Input data in byte array.

#### Return Value
Byte[]  
Transformed data in byte array.

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_update-string"></a>


Cipher.Update(String) Method
============================
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)

Overloads
---------

| Name                | Description                                                                    |
| ------------------- | ------------------------------------------------------------------------------ |
| [Update(Byte[])](#cipher_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  |


Syntax
------

```csharp
public string Update(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
Hex-encoded input data

#### Return Value
String  
Hex-encoded data

Remarks
-------
For all modes, the length of the decoded input bytes **must** be an exact multiple of the cipher block length (8 or 16 bytes).

See Also
--------


[Cipher Class](#cipher_cipher)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_cipherstream"></a>


CipherStream Class
==================
Stream cipher algorithms


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.CipherStream**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class CipherStream : IDisposable
```

The **CipherStream** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#cipherstream_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name          | Description                                                                       |
| ------------- | --------------------------------------------------------------------------------- |
| [Bytes](#cipherstream_bytes)    | Enciphers data in array of bytes using specified stream cipher.                   |
| [Dispose](#cipherstream_dispose)  | Dispose of this object and clear any key schedules                                |
| [File](#cipherstream_file)     | Enciphers data in a file using specified stream cipher.                           |
| [Hex](#cipherstream_hex)      | Enciphers data in a hex-encoded string using specified stream cipher.             |
| [Init](#cipherstream_init)     | Initializes the context ready for repeated operations of [CipherStream.Update](#cipherstream_cipherstream-update) |
| [Instance](#cipherstream_instance) | Create the one and only instance                                                  |
| [Update](#cipherstream_cipherstream-update)   | Encrypts input using current context                                              |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_errcode"></a>


CipherStream.ErrCode Property
=============================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_bytes"></a>


CipherStream.Bytes Method
=========================
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)

Syntax
------

```csharp
public static byte[] Bytes(
	byte[] input,
	byte[] key,
	byte[] iv,
	int counter,
	CipherStream.Algorithm streamAlg
)
```

#### Parameters

##### *input*  Byte[]
Input data to be encrypted

##### *key*  Byte[]
Key

##### *iv*  Byte[]
Initialization Vector (IV, nonce) or `null` for Arcfour

##### *counter*  Int32
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.

##### *streamAlg*  [CipherStream.Algorithm](#cipherstream_algorithm_cipherstream-algorithm)
Stream cipher algorithm

#### Return Value
Byte[]  
Ciphertext in byte array, or empty array on error

Remarks
-------
**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.

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_dispose"></a>


CipherStream.Dispose Method
===========================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_file"></a>


CipherStream.File Method
========================
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)

Syntax
------

```csharp
public static int File(
	string fileOut,
	string fileIn,
	byte[] key,
	byte[] iv,
	int counter,
	CipherStream.Algorithm streamAlg
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key

##### *iv*  Byte[]
Initialization Vector (IV, nonce) or `null` for Arcfour

##### *counter*  Int32
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.

##### *streamAlg*  [CipherStream.Algorithm](#cipherstream_algorithm_cipherstream-algorithm)
Stream cipher algorithm

#### Return Value
Int32  
0 if successful or nonzero [error code](#general_error-code)

Remarks
-------
`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.

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_hex"></a>


CipherStream.Hex Method
=======================
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)

Syntax
------

```csharp
public static string Hex(
	string inputHex,
	string keyHex,
	string ivHex,
	int counter,
	CipherStream.Algorithm streamAlg
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key

##### *ivHex*  String
Hex-encoded Initialization Vector (IV, nonce) or `""` for Arcfour

##### *counter*  Int32
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.

##### *streamAlg*  [CipherStream.Algorithm](#cipherstream_algorithm_cipherstream-algorithm)
Stream cipher algorithm

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
**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.

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_init"></a>


CipherStream.Init Method
========================
Initializes the context ready for repeated operations of [CipherStream.Update](#cipherstream_cipherstream-update)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Init(
	byte[] key,
	byte[] iv,
	int counter,
	CipherStream.Algorithm streamAlg
)
```

#### Parameters

##### *key*  Byte[]
Key

##### *iv*  Byte[]
Initialization Vector (IV, nonce) or `null` for Arcfour

##### *counter*  Int32
Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.

##### *streamAlg*  [CipherStream.Algorithm](#cipherstream_algorithm_cipherstream-algorithm)
Stream cipher algorithm

#### Return Value
Int32  
0 if successful or nonzero [error code](#general_error-code)

Remarks
-------
**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.

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_cipherstream-update"></a>


CipherStream.Update Method
==========================
Encrypts input using current context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] Update(
	byte[] input
)
```

#### Parameters

##### *input*  Byte[]
Input data to be encrypted

#### Return Value
Byte[]  
Encrypted data in array of exactly the same length as input; or an empty array on error

Remarks
-------
Check [CipherStream.ErrCode](#cipherstream_errcode) for error details

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_instance"></a>


CipherStream.Instance Method
============================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static CipherStream Instance()
```

#### Return Value
[CipherStream](#cipherstream_cipherstream)  
Single instance to class

Remarks
-------
CAUTION: Instances of different algorithms are not independent in the same thread.

See Also
--------


[CipherStream Class](#cipherstream_cipherstream)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_cnv"></a>


Cnv Class
=========
Character conversion routines


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Cnv**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Cnv
```

The **Cnv** type exposes the following members.


Methods
-------

| Name                   | Description                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------------- |
| [Base64Filter](#cnv_base64filter)      | Filters non-base64 characters from a string                                              |
| [Base64FromHex](#cnv_base64fromhex)     | Converts hexadecimal-encoded data into base64-encoded data                               |
| [FromBase64](#cnv_frombase64)        | Converts a base64-encoded string to an equivalent array of 8-bit unsigned integers.      |
| [FromHex](#cnv_fromhex)           | Converts a hexadecimal-encoded string to an equivalent array of 8-bit unsigned integers. |
| [HexFilter](#cnv_hexfilter)         | Filters non-hexadecimal characters from a string                                         |
| [HexFromBase64](#cnv_hexfrombase64)     | Converts base64-encoded data into hexadecimal-encoded data                               |
| [ShortPathName](#cnv_shortpathname)     | Retrieve the Windows short path form of the specified path.                              |
| [StringFromBase64](#cnv_stringfrombase64)  | Converts a base64-encoded string into a text string                                      |
| [StringFromHex](#cnv_stringfromhex)    | Converts a hexadecimal-encoded string into a text string                                 |
| [ToBase64(Byte[])](#cnv_tobase64-byte) | Converts 8-bit binary data to equivalent base64-encoded string format                    |
| [ToBase64(String)](#cnv_tobase64-string) | Converts a string of ANSI characters to equivalent base64-encoded string format          |
| [ToHex(Byte[])](#cnv_tohex-byte)    | Converts 8-bit binary data to equivalent hexadecimal string format                       |
| [ToHex(String)](#cnv_tohex-string)    | Converts a string of ANSI characters to equivalent hexadecimal string format             |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_base64filter"></a>


Cnv.Base64Filter Method
=======================
Filters non-base64 characters from a string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string Base64Filter(
	string s
)
```

#### Parameters

##### *s*  String
String to be filtered

#### Return Value
String  
Filtered string

Remarks
-------
Valid base64 characters are [0-9A-Za-z+/=]

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_base64fromhex"></a>


Cnv.Base64FromHex Method
========================
Converts hexadecimal-encoded data into base64-encoded data
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string Base64FromHex(
	string s
)
```

#### Parameters

##### *s*  String
Hex-encoded data

#### Return Value
String  
Base64-encoded data

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_frombase64"></a>


Cnv.FromBase64 Method
=====================
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)

Syntax
------

```csharp
public static byte[] FromBase64(
	string s
)
```

#### Parameters

##### *s*  String
Base64-encoded data

#### Return Value
Byte[]  
Data as array of bytes

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_fromhex"></a>


Cnv.FromHex Method
==================
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)

Syntax
------

```csharp
public static byte[] FromHex(
	string s
)
```

#### Parameters

##### *s*  String
Hex-encoded data

#### Return Value
Byte[]  
Data as array of bytes

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_hexfilter"></a>


Cnv.HexFilter Method
====================
Filters non-hexadecimal characters from a string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string HexFilter(
	string s
)
```

#### Parameters

##### *s*  String
String to be filtered

#### Return Value
String  
Filtered string

Remarks
-------
Valid hex characters are [0-9A-Fa-f]

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_hexfrombase64"></a>


Cnv.HexFromBase64 Method
========================
Converts base64-encoded data into hexadecimal-encoded data
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string HexFromBase64(
	string s
)
```

#### Parameters

##### *s*  String
Base64-encoded data

#### Return Value
String  
Hex-encoded data

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_shortpathname"></a>


Cnv.ShortPathName Method
========================
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)

Syntax
------

```csharp
public static string ShortPathName(
	string pathName
)
```

#### Parameters

##### *pathName*  String
File path name.

#### Return Value
String  
Windows short path name of file or the empty string if file does not exist.

Remarks
-------
Windows platforms only. The file path must exist. The short path name is guaranteed to be ASCII.

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_stringfrombase64"></a>


Cnv.StringFromBase64 Method
===========================
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)

Syntax
------

```csharp
public static string StringFromBase64(
	string s
)
```

#### Parameters

##### *s*  String
Base64-encoded data

#### Return Value
String  
String value

Remarks
-------
Uses the 'Default' encoding for the system's current ANSI code page

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_stringfromhex"></a>


Cnv.StringFromHex Method
========================
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)

Syntax
------

```csharp
public static string StringFromHex(
	string s
)
```

#### Parameters

##### *s*  String
Hex-encoded data

#### Return Value
String  
String value

Remarks
-------
Uses the 'Default' encoding for the system's current ANSI code page

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_tobase64-byte"></a>


Cnv.ToBase64(Byte[]) Method
===========================
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)

Overloads
---------

| Name                  | Description                                                                     |
| --------------------- | ------------------------------------------------------------------------------- |
| **ToBase64(Byte[])**  | Converts 8-bit binary data to equivalent base64-encoded string format           |
| [ToBase64(String)](#cnv_tobase64-string) | Converts a string of ANSI characters to equivalent base64-encoded string format |


Syntax
------

```csharp
public static string ToBase64(
	byte[] binaryData
)
```

#### Parameters

##### *binaryData*  Byte[]
binary data

#### Return Value
String  
Base64-encoded string

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_tobase64-string"></a>


Cnv.ToBase64(String) Method
===========================
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)

Overloads
---------

| Name                  | Description                                                                     |
| --------------------- | ------------------------------------------------------------------------------- |
| [ToBase64(Byte[])](#cnv_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 |


Syntax
------

```csharp
public static string ToBase64(
	string s
)
```

#### Parameters

##### *s*  String
String of data to be encoded

#### Return Value
String  
Base64-encoded data

Remarks
-------
Uses the 'Default' encoding for the system's current ANSI code page

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_tohex-byte"></a>


Cnv.ToHex(Byte[]) Method
========================
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)

Overloads
---------

| Name               | Description                                                                  |
| ------------------ | ---------------------------------------------------------------------------- |
| **ToHex(Byte[])**  | Converts 8-bit binary data to equivalent hexadecimal string format           |
| [ToHex(String)](#cnv_tohex-string) | Converts a string of ANSI characters to equivalent hexadecimal string format |


Syntax
------

```csharp
public static string ToHex(
	byte[] binaryData
)
```

#### Parameters

##### *binaryData*  Byte[]
binary data

#### Return Value
String  
Hex-encoded string

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cnv_tohex-string"></a>


Cnv.ToHex(String) Method
========================
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)

Overloads
---------

| Name               | Description                                                                  |
| ------------------ | ---------------------------------------------------------------------------- |
| [ToHex(Byte[])](#cnv_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 |


Syntax
------

```csharp
public static string ToHex(
	string s
)
```

#### Parameters

##### *s*  String
String of data to be encoded

#### Return Value
String  
Hex-encoded data

Remarks
-------
Uses the 'Default' encoding for the system's current ANSI code page

See Also
--------


[Cnv Class](#cnv_cnv)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="compr_compr"></a>


Compr Class
===========
Compression utilities


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Compr**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Compr
```

The **Compr** type exposes the following members.


Methods
-------

| Name            | Description                                  |
| --------------- | -------------------------------------------- |
| [Compress](#compr_compress)   | Compress data using compression algorithm.   |
| [Uncompress](#compr_uncompress) | Uncompress data using compression algorithm. |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="compr_compress"></a>


Compr.Compress Method
=====================
Compress data using compression algorithm.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] Compress(
	byte[] data,
	ComprAlgorithm comprAlg = ComprAlgorithm.Zlib
)
```

#### Parameters

##### *data*  Byte[]
Data to be compressed.

##### *comprAlg*  [ComprAlgorithm](#compralgorithm_compralgorithm)  (Optional)
Compression algorithm.

#### Return Value
Byte[]  
Compressed data, or an empty array on error.

See Also
--------


[Compr Class](#compr_compr)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="compr_uncompress"></a>


Compr.Uncompress Method
=======================
Uncompress data using compression algorithm.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] Uncompress(
	byte[] data,
	ComprAlgorithm comprAlg = ComprAlgorithm.Zlib
)
```

#### Parameters

##### *data*  Byte[]
Compressed data to be uncompressed.

##### *comprAlg*  [ComprAlgorithm](#compralgorithm_compralgorithm)  (Optional)
Compression algorithm.

#### Return Value
Byte[]  
Uncompressed data, or an empty array on error.

Remarks
-------
An empty array may also be returned in the trivial case that the original data was the empty array itself.

See Also
--------


[Compr Class](#compr_compr)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="crc_crc"></a>


Crc Class
=========
CRC-32 computations


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Crc**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Crc
```

The **Crc** type exposes the following members.


Methods
-------

| Name              | Description                           |
| ----------------- | ------------------------------------- |
| [Data(Byte[])](#crc_data-byte) | Computes CRC-32 checksum for data     |
| [Data(String)](#crc_data-string) | Computes CRC-32 checksum for a string |
| [File](#crc_file)         | Computes CRC-32 checksum for a file   |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="crc_data-byte"></a>


Crc.Data(Byte[]) Method
=======================
Computes CRC-32 checksum for data
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name              | Description                           |
| ----------------- | ------------------------------------- |
| **Data(Byte[])**  | Computes CRC-32 checksum for data     |
| [Data(String)](#crc_data-string) | Computes CRC-32 checksum for a string |


Syntax
------

```csharp
public static int Data(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data

#### Return Value
Int32  
Value of CRC-32 checksum

See Also
--------


[Crc Class](#crc_crc)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="crc_data-string"></a>


Crc.Data(String) Method
=======================
Computes CRC-32 checksum for a string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name              | Description                           |
| ----------------- | ------------------------------------- |
| [Data(Byte[])](#crc_data-byte) | Computes CRC-32 checksum for data     |
| **Data(String)**  | Computes CRC-32 checksum for a string |


Syntax
------

```csharp
public static int Data(
	string Str
)
```

#### Parameters

##### *Str*  String
input data

#### Return Value
Int32  
Value of CRC-32 checksum

See Also
--------


[Crc Class](#crc_crc)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="crc_file"></a>


Crc.File Method
===============
Computes CRC-32 checksum for a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int File(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
Int32  
Value of CRC-32 checksum

Remarks
-------
If return value is zero, the file could not be found or read

See Also
--------


[Crc Class](#crc_crc)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_des"></a>


Des Class
=========
Data Encryption Standard (DES) Cipher (legacy applications only)


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Des**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Des : IDisposable
```

The **Des** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#des_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name                                                                      | Description                                                                    |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [CheckKey(Byte[])](#des_checkkey-byte)                                                     | Verifies that no part of the key is a weak or semi-weak DES key.               |
| [CheckKey(String)](#des_checkkey-string)                                                     | Verifies that no part of the key is a weak or semi-weak DES key.               |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#des_decrypt-byte-byte-mode-byte)                                | Decrypt data in byte array                                                     |
| [Decrypt(String, String, Mode, String)](#des_decrypt-string-string-mode-string)                                | Decrypt hex-encoded data string                                                |
| [Decrypt(String, String, Mode, String, EncodingBase)](#des_decrypt-string-string-mode-string-encodingbase)                  | Decrypt encoded data string                                                    |
| [Dispose](#des_dispose)                                                              | Dispose of this object and clear any key schedules                             |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#des_encrypt-byte-byte-mode-byte)                                | Encrypt data in byte array                                                     |
| [Encrypt(String, String, Mode, String)](#des_encrypt-string-string-mode-string)                               | Encrypt hex-encoded data string                                                |
| [Encrypt(String, String, Mode, String, EncodingBase)](#des_encrypt-string-string-mode-string-encodingbase)                 | Encrypt encoded data string                                                    |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#des_filedecrypt-string-string-byte-mode-byte)                   | Decrypt a file                                                                 |
| [FileDecrypt(String, String, String, Mode, String)](#des_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings                               |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#des_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options                                           |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#des_fileencrypt-string-string-byte-mode-byte)                   | Encrypt a file                                                                 |
| [FileEncrypt(String, String, String, Mode, String)](#des_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings                               |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#des_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options                                           |
| [InitDecrypt(Byte[], Mode, Byte[])](#des_initdecrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start decrypting                    |
| [InitDecrypt(String, Mode, String)](#des_initdecrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start decrypting            |
| [InitEncrypt(Byte[], Mode, Byte[])](#des_initencrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start encrypting                    |
| [InitEncrypt(String, Mode, String)](#des_initencrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start encrypting            |
| [Instance](#des_instance)                                                            | Create the one and only instance                                               |
| [Pad(Byte[])](#des_pad-byte)                                                         | Pads byte array to correct length for ECB and CBC encryption                   |
| [Pad(String)](#des_pad-string)                                                         | Pads hex-encoded string to correct length for ECB and CBC encryption           |
| [Unpad(Byte[])](#des_unpad-byte)                                                       | Removes the padding from an encryption block                                   |
| [Unpad(String)](#des_unpad-string)                                                       | Removes the padding from a hex-encoded encryption block                        |
| [Update(Byte[])](#des_update-byte)                                                      | Transforms byte input data with previously initialized key, mode and direction |
| [Update(String)](#des_update-string)                                                      | Transforms hex string data with previously initialized key, mode and direction |


Fields
------

| Name            | Description         |
| --------------- | ------------------- |
| [BlockSize](#des_blocksize) | Block size in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_errcode"></a>


Des.ErrCode Property
====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_checkkey-byte"></a>


Des.CheckKey(Byte[]) Method
===========================
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)

Overloads
---------

| Name                  | Description                                                      |
| --------------------- | ---------------------------------------------------------------- |
| **CheckKey(Byte[])**  | Verifies that no part of the key is a weak or semi-weak DES key. |
| [CheckKey(String)](#des_checkkey-string) | Verifies that no part of the key is a weak or semi-weak DES key. |


Syntax
------

```csharp
public static int CheckKey(
	byte[] key
)
```

#### Parameters

##### *key*  Byte[]
Key to check

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_checkkey-string"></a>


Des.CheckKey(String) Method
===========================
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)

Overloads
---------

| Name                  | Description                                                      |
| --------------------- | ---------------------------------------------------------------- |
| [CheckKey(Byte[])](#des_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. |


Syntax
------

```csharp
public static int CheckKey(
	string keyHex
)
```

#### Parameters

##### *keyHex*  String
Hex-encoded key to check

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_decrypt-byte-byte-mode-byte"></a>


Des.Decrypt(Byte[], Byte[], Mode, Byte[]) Method
================================================
Decrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Decrypt(Byte[], Byte[], Mode, Byte[])**                | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#des_decrypt-string-string-mode-string)               | Decrypt hex-encoded data string |
| [Decrypt(String, String, Mode, String, EncodingBase)](#des_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Decrypted data in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_decrypt-string-string-mode-string"></a>


Des.Decrypt(String, String, Mode, String) Method
================================================
Decrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#des_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)](#des_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 8 bytes or `""` for ECB mode

#### Return Value
String  
Decrypted data in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_decrypt-string-string-mode-string-encodingbase"></a>


Des.Decrypt(String, String, Mode, String, EncodingBase) Method
==============================================================
Decrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#des_decrypt-byte-byte-mode-byte)              | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#des_decrypt-string-string-mode-string)              | Decrypt hex-encoded data string |
| **Decrypt(String, String, Mode, String, EncodingBase)** | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 8 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Decrypted data in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_dispose"></a>


Des.Dispose Method
==================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_encrypt-byte-byte-mode-byte"></a>


Des.Encrypt(Byte[], Byte[], Mode, Byte[]) Method
================================================
Encrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Encrypt(Byte[], Byte[], Mode, Byte[])**                | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#des_encrypt-string-string-mode-string)               | Encrypt hex-encoded data string |
| [Encrypt(String, String, Mode, String, EncodingBase)](#des_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_encrypt-string-string-mode-string"></a>


Des.Encrypt(String, String, Mode, String) Method
================================================
Encrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#des_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)](#des_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 8 bytes or `""` for ECB mode

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_encrypt-string-string-mode-string-encodingbase"></a>


Des.Encrypt(String, String, Mode, String, EncodingBase) Method
==============================================================
Encrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#des_encrypt-byte-byte-mode-byte)              | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#des_encrypt-string-string-mode-string)              | Encrypt hex-encoded data string |
| **Encrypt(String, String, Mode, String, EncodingBase)** | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 8 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Ciphertext in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_filedecrypt-string-string-byte-mode-byte"></a>


Des.FileDecrypt(String, String, Byte[], Mode, Byte[]) Method
============================================================
Decrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileDecrypt(String, String, Byte[], Mode, Byte[])**                    | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#des_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#des_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_filedecrypt-string-string-string-mode-string"></a>


Des.FileDecrypt(String, String, String, Mode, String) Method
============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#des_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)](#des_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_filedecrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Des.FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
==============================================================================
Decrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#des_filedecrypt-string-string-byte-mode-byte)                  | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#des_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             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes. Use `null`/`Nothing` for ECB mode or when using CipherFileOption.PrefixIV option

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_fileencrypt-string-string-byte-mode-byte"></a>


Des.FileEncrypt(String, String, Byte[], Mode, Byte[]) Method
============================================================
Encrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileEncrypt(String, String, Byte[], Mode, Byte[])**                    | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#des_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#des_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_fileencrypt-string-string-string-mode-string"></a>


Des.FileEncrypt(String, String, String, Mode, String) Method
============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#des_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)](#des_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_fileencrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Des.FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
==============================================================================
Encrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#des_fileencrypt-string-string-byte-mode-byte)                  | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#des_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             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_initdecrypt-byte-mode-byte"></a>


Des.InitDecrypt(Byte[], Mode, Byte[]) Method
============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitDecrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start decrypting         |
| [InitDecrypt(String, Mode, String)](#des_initdecrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start decrypting |


Syntax
------

```csharp
public int InitDecrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_initdecrypt-string-mode-string"></a>


Des.InitDecrypt(String, Mode, String) Method
============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Mode, Byte[])](#des_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 |


Syntax
------

```csharp
public int InitDecrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_initencrypt-byte-mode-byte"></a>


Des.InitEncrypt(Byte[], Mode, Byte[]) Method
============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitEncrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start encrypting         |
| [InitEncrypt(String, Mode, String)](#des_initencrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start encrypting |


Syntax
------

```csharp
public int InitEncrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 8 bytes (64 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_initencrypt-string-mode-string"></a>


Des.InitEncrypt(String, Mode, String) Method
============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Mode, Byte[])](#des_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 |


Syntax
------

```csharp
public int InitEncrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_instance"></a>


Des.Instance Method
===================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Des Instance()
```

#### Return Value
[Des](#des_des)  
Single instance to class

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_pad-byte"></a>


Des.Pad(Byte[]) Method
======================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| **Pad(Byte[])**  | Pads byte array to correct length for ECB and CBC encryption         |
| [Pad(String)](#des_pad-string) | Pads hex-encoded string to correct length for ECB and CBC encryption |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be padded

#### Return Value
Byte[]  
padded data in byte array

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_pad-string"></a>


Des.Pad(String) Method
======================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| [Pad(Byte[])](#des_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 |


Syntax
------

```csharp
public static string Pad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded data to be padded

#### Return Value
String  
padded data in hex-encoded string

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_unpad-byte"></a>


Des.Unpad(Byte[]) Method
========================
Removes the padding from an encryption block
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| **Unpad(Byte[])**  | Removes the padding from an encryption block            |
| [Unpad(String)](#des_unpad-string) | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
padded data

#### Return Value
Byte[]  
Unpadded data in byte array or unchanged data on error

Remarks
-------
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.

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_unpad-string"></a>


Des.Unpad(String) Method
========================
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)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| [Unpad(Byte[])](#des_unpad-byte) | Removes the padding from an encryption block            |
| **Unpad(String)**  | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static string Unpad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded padded data

#### Return Value
String  
Unpadded data in hex-encoded string or unchanged data on error

Remarks
-------
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.

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_update-byte"></a>


Des.Update(Byte[]) Method
=========================
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)

Overloads
---------

| Name                | Description                                                                    |
| ------------------- | ------------------------------------------------------------------------------ |
| **Update(Byte[])**  | Transforms byte input data with previously initialized key, mode and direction |
| [Update(String)](#des_update-string) | Transforms hex string data with previously initialized key, mode and direction |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data in byte array

#### Return Value
Byte[]  
transformed data in byte array

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_update-string"></a>


Des.Update(String) Method
=========================
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)

Overloads
---------

| Name                | Description                                                                    |
| ------------------- | ------------------------------------------------------------------------------ |
| [Update(Byte[])](#des_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 |


Syntax
------

```csharp
public string Update(
	string data
)
```

#### Parameters

##### *data*  String
hex-encoded input data

#### Return Value
String  
hex-encoded data

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="des_blocksize"></a>


Des.BlockSize Field
===================
Block size in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int BlockSize = 8
```

#### Field Value
Int32

See Also
--------


[Des Class](#des_des)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_gcm"></a>


Gcm Class
=========
Provides authenticated encryption using the Galois/Counter Mode (GCM) of operation with the AES algorithm (AES-GCM).


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Gcm**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Gcm : IDisposable
```

The **Gcm** type exposes the following members.


Properties
----------

| Name         | Description                           |
| ------------ | ------------------------------------- |
| [ErrCode](#gcm_errcode) | Last error code (object-related only) |


Methods
-------

| Name             | Description                                                                                                                              |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [Decrypt](#gcm_decrypt)     | Decrypt input using AES-GCM in one-off operation                                                                                         |
| [Dispose](#gcm_dispose)     | Dispose of this object and clear any key schedules                                                                                       |
| [Encrypt](#gcm_encrypt)     | Encrypt input using AES-GCM in one-off operation                                                                                         |
| [Gmac](#gcm_gmac)        | Compute GMAC using AES-GCM in one-off operation                                                                                          |
| [InitKey](#gcm_initkey)     | Initializes the context with the key ready for repeated operations of [Gcm.NextEncrypt](#gcm_gcm-nextencrypt), [Gcm.NextDecrypt](#gcm_gcm-nextdecrypt), or [Gcm.NextGmac](#gcm_gcm-nextgmac). |
| [Instance](#gcm_instance)   | Create the one and only instance                                                                                                         |
| [NextDecrypt](#gcm_gcm-nextdecrypt) | Carries out the GCM decryption operation using the key set up by an earlier call to [Gcm.InitKey](#gcm_initkey).                                    |
| [NextEncrypt](#gcm_gcm-nextencrypt) | Carries out the GCM encryption operation using the key set up by an earlier call to [Gcm.InitKey](#gcm_initkey).                                    |
| [NextGmac](#gcm_gcm-nextgmac)   | Carries out the GMAC operation using the key set up by an earlier call to [Gcm.InitKey](#gcm_initkey).                                              |


Fields
------

| Name             | Description                  |
| ---------------- | ---------------------------- |
| [TagMaxSize](#gcm_tagmaxsize) | Maximum size of tag in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_errcode"></a>


Gcm.ErrCode Property
====================
Last error code (object-related only)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_decrypt"></a>


Gcm.Decrypt Method
==================
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)

Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	byte[] iv,
	byte[] aad,
	byte[] tag
)
```

#### Parameters

##### *input*  Byte[]
Cipher text input data

##### *key*  Byte[]
Key: must be exactly 16, 24 or 32 bytes long.

##### *iv*  Byte[]
Initialization vector.

##### *aad*  Byte[]
Additional authentication data (optional). Pass `null`/`Nothing` to ignore.

##### *tag*  Byte[]
Tag value (required)

#### Return Value
Byte[]  
Decrypted plaintext in byte array, or empty array on error

Remarks
-------
Use [General.ErrorCode](#general_general-errorcode) to find the code of the last error.

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_dispose"></a>


Gcm.Dispose Method
==================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_encrypt"></a>


Gcm.Encrypt Method
==================
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)

Syntax
------

```csharp
public static byte[] Encrypt(
	out byte[] tag,
	byte[] input,
	byte[] key,
	byte[] iv,
	byte[] aad
)
```

#### Parameters

##### *tag*  Byte[]
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).

##### *input*  Byte[]
Plain text input data

##### *key*  Byte[]
Key: must be exactly 16, 24 or 32 bytes long.

##### *iv*  Byte[]
Initialization vector: can be any length but 12 bytes is recommended.

##### *aad*  Byte[]
Additional authentication data (optional). Pass `null`/`Nothing` to ignore.

#### Return Value
Byte[]  
Encrypted ciphertext in byte array, or empty array on error

Remarks
-------
If you just require a GMAC value, use [Gcm.Gmac](#gcm_gmac) Use [General.ErrorCode](#general_general-errorcode) to find the code of the last error.

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_gmac"></a>


Gcm.Gmac Method
===============
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)

Syntax
------

```csharp
public static byte[] Gmac(
	byte[] key,
	byte[] iv,
	byte[] msg
)
```

#### Parameters

##### *key*  Byte[]
Key: must be exactly 16, 24 or 32 bytes long.

##### *iv*  Byte[]
Initialization vector

##### *msg*  Byte[]
Message data

#### Return Value
Byte[]  
GMAC value in 16-byte array, or empty array on error

Remarks
-------
Use [General.ErrorCode](#general_general-errorcode) to find the code of the last error.

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_initkey"></a>


Gcm.InitKey Method
==================
Initializes the context with the key ready for repeated operations of [Gcm.NextEncrypt](#gcm_gcm-nextencrypt), [Gcm.NextDecrypt](#gcm_gcm-nextdecrypt), or [Gcm.NextGmac](#gcm_gcm-nextgmac).
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int InitKey(
	byte[] key
)
```

#### Parameters

##### *key*  Byte[]
Key: must be exactly 16, 24 or 32 bytes long.

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
Once a key has been set up, Gcm.NextEncrypt, Gcm.NextDecrypt and Gcm.NextGmac can be used independently.

Example
-------

```csharp
Gcm o = Instance();
o.InitKey(key);
byte[] tag = new byte[16];
byte[] ct = o.NextEncrypt(tag, pt, iv, aad);
//...
o.Dispose();
```


See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_gcm-nextencrypt"></a>


Gcm.NextEncrypt Method
======================
Carries out the GCM encryption operation using the key set up by an earlier call to [Gcm.InitKey](#gcm_initkey).
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] NextEncrypt(
	out byte[] tag,
	byte[] input,
	byte[] iv,
	byte[] aad
)
```

#### Parameters

##### *tag*  Byte[]
Tag value, always returned exactly 16 bytes long. You may truncate as desired.

##### *input*  Byte[]
Plain text input data

##### *iv*  Byte[]
Initialization vector: can be any length but 12 bytes is recommended.

##### *aad*  Byte[]
Additional authentication data (optional). Pass `null`/`Nothing` to ignore.

#### Return Value
Byte[]  
Encrypted ciphertext in byte array, or empty array on error

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_gcm-nextdecrypt"></a>


Gcm.NextDecrypt Method
======================
Carries out the GCM decryption operation using the key set up by an earlier call to [Gcm.InitKey](#gcm_initkey).
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] NextDecrypt(
	byte[] input,
	byte[] iv,
	byte[] aad,
	byte[] tag
)
```

#### Parameters

##### *input*  Byte[]
Cipher text input data

##### *iv*  Byte[]
Initialization vector.

##### *aad*  Byte[]
Additional authentication data (optional). Pass `null`/`Nothing` to ignore.

##### *tag*  Byte[]
Tag value (required)

#### Return Value
Byte[]  
Decrypted plaintext in byte array, or empty array on error

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_gcm-nextgmac"></a>


Gcm.NextGmac Method
===================
Carries out the GMAC operation using the key set up by an earlier call to [Gcm.InitKey](#gcm_initkey).
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] NextGmac(
	byte[] iv,
	byte[] msg
)
```

#### Parameters

##### *iv*  Byte[]
Initialization vector.

##### *msg*  Byte[]
Message data.

#### Return Value
Byte[]  
GMAC value in byte array, or empty array on error

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_instance"></a>


Gcm.Instance Method
===================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Gcm Instance()
```

#### Return Value
[Gcm](#gcm_gcm)  
Single instance to class

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="gcm_tagmaxsize"></a>


Gcm.TagMaxSize Field
====================
Maximum size of tag in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int TagMaxSize = 16
```

#### Field Value
Int32

See Also
--------


[Gcm Class](#gcm_gcm)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_general"></a>


General Class
=============
General functions


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.General**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class General
```

The **General** type exposes the following members.


Methods
-------

| Name                    | Description                                                                           |
| ----------------------- | ------------------------------------------------------------------------------------- |
| [CompileTime](#general_compiletime)        | Gets date and time the CryptoSys DLL module was last compiled                         |
| [ErrorCode](#general_general-errorcode)          | Returns the [error code](#general_error-code) of the error that occurred when calling the last function |
| [ErrorLookup](#general_error-code)        | Looks up error code                                                                   |
| [FormatErrorMessage](#general_formaterrormessage) | Return an error message string for the last error.                                    |
| [IsWin64](#general_iswin64)            | Returns flag indicating the platform of the core DLL.                                 |
| [LicenceType](#general_licencetype)        | Gets licence type.                                                                    |
| [ModuleInfo](#general_moduleinfo)         | Get additional information about the core DLL module.                                 |
| [ModuleName](#general_modulename)         | Gets full path name of core CryptoSys DLL module                                      |
| [NetVersion](#general_netversion)        | Return the version of this .NET module.                                               |
| [Platform](#general_platform)          | Return the platform the core DLL was compiled for.                                    |
| [PowerUpTests](#general_poweruptests)      | Performs FIPS-140-2 start-up tests                                                    |
| [Version](#general_version)           | Returns version number of core CryptoSys DLL.                                         |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_compiletime"></a>


General.CompileTime Method
==========================
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)

Syntax
------

```csharp
public static string CompileTime()
```

#### Return Value
String  
Date and time string

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_formaterrormessage"></a>


General.FormatErrorMessage Method
=================================
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)

Syntax
------

```csharp
public static string FormatErrorMessage(
	int errCode = 0
)
```

#### Parameters

##### *errCode*  Int32  (Optional)
Error code returned by last call (optional)

#### Return Value
String  
Error message as a string `Error ({errCode}): {errorlookup}[: {lasterror}]`

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_iswin64"></a>


General.IsWin64 Method
======================
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)

Syntax
------

```csharp
public static int IsWin64()
```

#### Return Value
Int32  
1 if platform is Win64 (X64) or 0 if Win32

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_licencetype"></a>


General.LicenceType Method
==========================
Gets licence type.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static char LicenceType()
```

#### Return Value
Char  
D=Developer T=Trial

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_moduleinfo"></a>


General.ModuleInfo Method
=========================
Get additional information about the core DLL module.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string ModuleInfo()
```

#### Return Value
String  
STring containing additional information, e.g. `"Licensed Developer Edition"`

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_modulename"></a>


General.ModuleName Method
=========================
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)

Syntax
------

```csharp
public static string ModuleName()
```

#### Return Value
String  
File name

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_netversion"></a>


General.NetVersion Method
=========================
Return the version of this .NET module.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string NetVersion()
```

#### Return Value
String  
Version string, e.g. `"03.05.00"`

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_platform"></a>


General.Platform Method
=======================
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)

Syntax
------

```csharp
public static string Platform()
```

#### Return Value
String  
`"Win32"` or `"X64"`

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_poweruptests"></a>


General.PowerUpTests Method
===========================
Performs FIPS-140-2 start-up tests
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int PowerUpTests()
```

#### Return Value
Int32  
Zero on success

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="general_version"></a>


General.Version Method
======================
Returns version number of core CryptoSys DLL.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int Version()
```

#### Return Value
Int32  
Version number in form Major * 10000 + Minor * 100 + Release

Remarks
-------
For example, version 5.2.1 returns 50201

See Also
--------


[General Class](#general_general)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hash"></a>


Hash Class
==========
Message Digest Hash Functions


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Hash**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Hash
```

The **Hash** type exposes the following members.


Properties
----------

| Name         | Description                                                       |
| ------------ | ----------------------------------------------------------------- |
| [ErrCode](#hash_errcode) | Last error code (for Init, AddData and Final object methods only) |


Methods
-------

| Name                  | Description                                                                           |
| --------------------- | ------------------------------------------------------------------------------------- |
| [AddData(Byte[])](#hash_adddata-byte)  | Adds a chunk of data in a byte array to be digested by the Hash object.               |
| [AddData(String)](#hash_adddata-string)  | Adds a chunk of data in a string to be digested by the Hash object.                   |
| [BytesFromBytes](#hash_bytesfrombytes)   | Computes hash value in byte format of byte input                                      |
| [BytesFromFile](#hash_bytesfromfile)    | Computes hash value in byte format of a binary file                                   |
| [Dispose](#hash_dispose)          | Dispose of this object and clear any stored data.                                     |
| [Final](#hash_final)            | Computes final message digest for the Hash object.                                    |
| [HexFromBits](#hash_hexfrombits)      | Computes hash value in hex format from bit-oriented input                             |
| [HexFromBytes](#hash_hexfrombytes)    | Computes hash value in hex format of byte input                                       |
| [HexFromFile](#hash_hexfromfile)     | Computes hash value in hex format of a binary file                                    |
| [HexFromHex](#hash_hexfromhex)      | Computes hash value in hex format of hex-encoded input                                |
| [HexFromString](#hash_hexfromstring)   | Computes hash value in hex format of string input                                     |
| [HexFromTextFile](#hash_hexfromtextfile) | Computes hash value in hex format of a text file, treating CR-LF pairs as a single LF |
| [Init](#hash_init)            | Initialises the Hash object ready for repeated incremental operations.                |
| [Instance](#hash_instance)        | Create the one and only instance                                                      |
| [LengthInBytes](#hash_lengthinbytes)   | Returns the number of bytes in the message digest for the given hash algorithm.       |
| [Reset](#hash_reset)           | Resets the context of the Hash object.                                                |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_errcode"></a>


Hash.ErrCode Property
=====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_adddata-byte"></a>


Hash.AddData(Byte[]) Method
===========================
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)

Overloads
---------

| Name                 | Description                                                             |
| -------------------- | ----------------------------------------------------------------------- |
| **AddData(Byte[])**  | Adds a chunk of data in a byte array to be digested by the Hash object. |
| [AddData(String)](#hash_adddata-string) | Adds a chunk of data in a string to be digested by the Hash object.     |


Syntax
------

```csharp
public int AddData(
	byte[] b
)
```

#### Parameters

##### *b*  Byte[]
Data to add

#### Return Value
Int32  
0 on success or nonzero [error code](#general_error-code)

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_adddata-string"></a>


Hash.AddData(String) Method
===========================
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)

Overloads
---------

| Name                 | Description                                                             |
| -------------------- | ----------------------------------------------------------------------- |
| [AddData(Byte[])](#hash_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.     |


Syntax
------

```csharp
public int AddData(
	string s
)
```

#### Parameters

##### *s*  String
Data to add

#### Return Value
Int32  
0 on success or nonzero [error code](#general_error-code)

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_bytesfrombytes"></a>


Hash.BytesFromBytes Method
==========================
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)

Syntax
------

```csharp
public static byte[] BytesFromBytes(
	byte[] message,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *message*  Byte[]
Message data in byte format

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used

#### Return Value
Byte[]  
Message digest in byte format

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_bytesfromfile"></a>


Hash.BytesFromFile Method
=========================
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)

Syntax
------

```csharp
public static byte[] BytesFromFile(
	string fileName,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *fileName*  String
Name of file containing message data

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used (ASCON-HASH not supported in file mode)

#### Return Value
Byte[]  
Message digest in byte format

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_dispose"></a>


Hash.Dispose Method
===================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_final"></a>


Hash.Final Method
=================
Computes final message digest for the Hash object.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] Final()
```

#### Return Value
Byte[]  
Digest value in a byte array.

Remarks
-------
This operation delivers the final result of Add operations since the [Hash.Init()](#hash_init) operation. Once called, the Hash object is invalid.

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hexfrombits"></a>


Hash.HexFromBits Method
=======================
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)

Syntax
------

```csharp
public static string HexFromBits(
	byte[] data,
	int dataBitLen,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *data*  Byte[]
Bit-oriented message data in byte array

##### *dataBitLen*  Int32
Number of bits in data to digest

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used (SHA-1, SHA-2, SHA-3 only)

#### Return Value
String  
Message digest in hex-encoded format

Remarks
-------
Only the SHA families of hash functions (SHA-1, SHA-2, SHA-3) are supported in bit-oriented mode

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hexfrombytes"></a>


Hash.HexFromBytes Method
========================
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)

Syntax
------

```csharp
public static string HexFromBytes(
	byte[] message,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *message*  Byte[]
Message data in byte format

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used

#### Return Value
String  
Message digest in hex-encoded format

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hexfromfile"></a>


Hash.HexFromFile Method
=======================
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)

Syntax
------

```csharp
public static string HexFromFile(
	string fileName,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *fileName*  String
Name of file containing message data

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used (ASCON-HASH not supported in file mode)

#### Return Value
String  
Message digest in hex-encoded format

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hexfromhex"></a>


Hash.HexFromHex Method
======================
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)

Syntax
------

```csharp
public static string HexFromHex(
	string messageHex,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *messageHex*  String
Message data in hex-encoded format

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used

#### Return Value
String  
Message digest in hex-encoded format

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hexfromstring"></a>


Hash.HexFromString Method
=========================
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)

Syntax
------

```csharp
public static string HexFromString(
	string message,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *message*  String
Message data string

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used

#### Return Value
String  
Message digest in hex-encoded format

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_hexfromtextfile"></a>


Hash.HexFromTextFile Method
===========================
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)

Syntax
------

```csharp
public static string HexFromTextFile(
	string fileName,
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *fileName*  String
Name of file containing message data

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used (ASCON-HASH not supported in file mode)

#### Return Value
String  
Message digest in hex format

Remarks
-------
Use for passing message digest of file between Unix and Windows systems.

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_init"></a>


Hash.Init Method
================
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)

Syntax
------

```csharp
public bool Init(
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm to be used (SHA-1, SHA-2, SHA-3 only)

#### Return Value
Boolean  
True if successful, False if failed

Remarks
-------
Only the SHA families of hash functions (SHA-1, SHA-2, SHA-3) are supported in object mode.

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_instance"></a>


Hash.Instance Method
====================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Hash Instance()
```

#### Return Value
[Hash](#hash_hash)  
Single instance to class

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_lengthinbytes"></a>


Hash.LengthInBytes Method
=========================
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)

Syntax
------

```csharp
public static int LengthInBytes(
	HashAlgorithm hashAlg
)
```

#### Parameters

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)
Hash algorithm

#### Return Value
Int32  
The length in bytes of the message digest output.

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hash_reset"></a>


Hash.Reset Method
=================
Resets the context of the Hash object.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Reset()
```

#### Return Value
Int32  
0 on success or a nonzero [error code](#general_error-code).

See Also
--------


[Hash Class](#hash_hash)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_mac"></a>


Mac Class
=========
Message authentication code (MAC) functions


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Mac**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Mac
```

The **Mac** type exposes the following members.


Properties
----------

| Name         | Description                                                       |
| ------------ | ----------------------------------------------------------------- |
| [ErrCode](#mac_errcode) | Last error code (for Init, AddData and Final object methods only) |


Methods
-------

| Name                 | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| [AddData(Byte[])](#mac_adddata-byte) | Adds a chunk of data in a byte array to be authenticated by the Mac object. |
| [AddData(String)](#mac_adddata-string) | Adds a chunk of data in a string to be authenticated by the Mac object.     |
| [BytesFromBytes](#mac_bytesfrombytes)  | Computes MAC value in byte format from byte input                           |
| [Dispose](#mac_dispose)         | Dispose of this object and clear any stored data.                           |
| [Final](#mac_final)           | Computes final MAC value for the Mac object.                                |
| [HexFromBytes](#mac_hexfrombytes)    | Computes MAC value in hex-encoded format from byte input                    |
| [HexFromHex](#mac_hexfromhex)      | Computes MAC value in hex-encoded format from hex-encoded input             |
| [Init](#mac_init)           | Initialises the Mac object ready for repeated incremental operations.       |
| [Instance](#mac_instance)       | Create the one and only instance                                            |
| [Reset](#mac_reset)          | Resets the context of the Mac object.                                       |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_errcode"></a>


Mac.ErrCode Property
====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_adddata-byte"></a>


Mac.AddData(Byte[]) Method
==========================
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)

Overloads
---------

| Name                 | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| **AddData(Byte[])**  | Adds a chunk of data in a byte array to be authenticated by the Mac object. |
| [AddData(String)](#mac_adddata-string) | Adds a chunk of data in a string to be authenticated by the Mac object.     |


Syntax
------

```csharp
public int AddData(
	byte[] b
)
```

#### Parameters

##### *b*  Byte[]
Data to add

#### Return Value
Int32  
0 on success or nonzero [error code](#general_error-code)

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_adddata-string"></a>


Mac.AddData(String) Method
==========================
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)

Overloads
---------

| Name                 | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| [AddData(Byte[])](#mac_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.     |


Syntax
------

```csharp
public int AddData(
	string s
)
```

#### Parameters

##### *s*  String
Data to add

#### Return Value
Int32  
0 on success or nonzero [error code](#general_error-code)

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_bytesfrombytes"></a>


Mac.BytesFromBytes Method
=========================
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)

Syntax
------

```csharp
public static byte[] BytesFromBytes(
	byte[] message,
	byte[] key,
	MacAlgorithm macAlg
)
```

#### Parameters

##### *message*  Byte[]
Message to be signed in byte format

##### *key*  Byte[]
Key in byte format

##### *macAlg*  [MacAlgorithm](#macalgorithm_macalgorithm)
MAC algorithm to be used

#### Return Value
Byte[]  
MAC in byte format

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_dispose"></a>


Mac.Dispose Method
==================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_final"></a>


Mac.Final Method
================
Computes final MAC value for the Mac object.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public byte[] Final()
```

#### Return Value
Byte[]  
MAC value in a byte array.

Remarks
-------
This operation delivers the final result of Add operations since the [Mac.Init()](#mac_init) operation. Once called, the Mac object is invalid.

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_hexfrombytes"></a>


Mac.HexFromBytes Method
=======================
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)

Syntax
------

```csharp
public static string HexFromBytes(
	byte[] message,
	byte[] key,
	MacAlgorithm macAlg
)
```

#### Parameters

##### *message*  Byte[]
Message to be signed in byte format

##### *key*  Byte[]
Key in byte format

##### *macAlg*  [MacAlgorithm](#macalgorithm_macalgorithm)
MAC algorithm to be used

#### Return Value
String  
MAC in hex-encoded format

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_hexfromhex"></a>


Mac.HexFromHex Method
=====================
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)

Syntax
------

```csharp
public static string HexFromHex(
	string messageHex,
	string keyHex,
	MacAlgorithm macAlg
)
```

#### Parameters

##### *messageHex*  String
Message to be signed in hex-encoded format

##### *keyHex*  String
Key in hex-encoded format

##### *macAlg*  [MacAlgorithm](#macalgorithm_macalgorithm)
MAC algorithm to be used

#### Return Value
String  
MAC in hex-encoded format

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_init"></a>


Mac.Init Method
===============
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)

Syntax
------

```csharp
public bool Init(
	byte[] key,
	MacAlgorithm macAlg
)
```

#### Parameters

##### *key*  Byte[]
Key

##### *macAlg*  [MacAlgorithm](#macalgorithm_macalgorithm)
HMAC algorithm to be used.

#### Return Value
Boolean  
True if successful, False if failed.

Remarks
-------
Only the HMAC-SHA-1 and HMAC-SHA-2 families of MAC algorithms are currently supported in object mode.

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_instance"></a>


Mac.Instance Method
===================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Mac Instance()
```

#### Return Value
[Mac](#mac_mac)  
Single instance to class

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mac_reset"></a>


Mac.Reset Method
================
Resets the context of the Mac object.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Reset()
```

#### Return Value
Int32  
0 on success or a nonzero [error code](#general_error-code).

See Also
--------


[Mac Class](#mac_mac)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_md5"></a>


Md5 Class
=========
MD5 Hash Algorithm


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Md5**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Md5
```

The **Md5** type exposes the following members.


Properties
----------

| Name         | Description                                                    |
| ------------ | -------------------------------------------------------------- |
| [ErrCode](#md5_errcode) | Last error code (for Init, AddData and HexDigest methods only) |


Methods
-------

| Name                       | Description                                                                        |
| -------------------------- | ---------------------------------------------------------------------------------- |
| [AddData(Byte[])](#md5_adddata-byte)       | Adds an array of 8-bit bytes to the digest                                         |
| [AddData(String)](#md5_adddata-string)       | Adds a string of Ansi characters to the digest                                     |
| [BytesHash](#md5_byteshash)             | Creates message digest as array of bytes from message in byte array                |
| [Dispose](#md5_dispose)               | Dispose of this object and clear any stored data                                   |
| [FileHexHash](#md5_filehexhash)           | Creates hash digest of a binary file                                               |
| [FileTextHexHash](#md5_filetexthexhash)       | Creates hash digest of a "text" file treating CR-LF pairs as a single newline char |
| [HexDigest](#md5_hexdigest)             | Computes final message digest in hex format                                        |
| [HexHash(Byte[])](#md5_hexhash-byte)      | Creates message digest in hex format from message in byte array                    |
| [HexHash(String)](#md5_hexhash-string)      | Creates message digest in hex format from message in Ansi string                   |
| [Hmac(Byte[], Byte[])](#md5_hmac-byte-byte) | Computes the keyed hash digest of binary data using HMAC algorithm                 |
| [Hmac(String, String)](#md5_hmac-string-string) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings    |
| [Init](#md5_init)                 | Initializes the context                                                            |
| [Instance](#md5_instance)             | Create the one and only instance                                                   |
| [Reset](#md5_reset)                | Resets the context                                                                 |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_errcode"></a>


Md5.ErrCode Property
====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_adddata-byte"></a>


Md5.AddData(Byte[]) Method
==========================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| **AddData(Byte[])**  | Adds an array of 8-bit bytes to the digest     |
| [AddData(String)](#md5_adddata-string) | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	byte[] b
)
```

#### Parameters

##### *b*  Byte[]
Data to add

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_adddata-string"></a>


Md5.AddData(String) Method
==========================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| [AddData(Byte[])](#md5_adddata-byte) | Adds an array of 8-bit bytes to the digest     |
| **AddData(String)**  | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	string s
)
```

#### Parameters

##### *s*  String
String of Ansi characters

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_byteshash"></a>


Md5.BytesHash Method
====================
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)

Syntax
------

```csharp
public static byte[] BytesHash(
	byte[] message
)
```

#### Parameters

##### *message*  Byte[]
Message data to be digested

#### Return Value
Byte[]  
Digest in array of bytes

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_dispose"></a>


Md5.Dispose Method
==================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_filehexhash"></a>


Md5.FileHexHash Method
======================
Creates hash digest of a binary file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string FileHexHash(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
String  
Message digest in hex format

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_filetexthexhash"></a>


Md5.FileTextHexHash Method
==========================
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)

Syntax
------

```csharp
public static string FileTextHexHash(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
String  
Message digest in hex format

Remarks
-------
Use when comparing text data on a Unix system

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_hexdigest"></a>


Md5.HexDigest Method
====================
Computes final message digest in hex format
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public string HexDigest()
```

#### Return Value
String  
Digest in hex format

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_hexhash-byte"></a>


Md5.HexHash(Byte[]) Method
==========================
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)

Overloads
---------

| Name                 | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| **HexHash(Byte[])**  | Creates message digest in hex format from message in byte array  |
| [HexHash(String)](#md5_hexhash-string) | Creates message digest in hex format from message in Ansi string |


Syntax
------

```csharp
public static string HexHash(
	byte[] message
)
```

#### Parameters

##### *message*  Byte[]
Message data to be digested

#### Return Value
String  
Digest in hex format

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_hexhash-string"></a>


Md5.HexHash(String) Method
==========================
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)

Overloads
---------

| Name                 | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| [HexHash(Byte[])](#md5_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 |


Syntax
------

```csharp
public static string HexHash(
	string message
)
```

#### Parameters

##### *message*  String
Message text to be digested

#### Return Value
String  
Digest in hex format

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_hmac-byte-byte"></a>


Md5.Hmac(Byte[], Byte[]) Method
===============================
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)

Overloads
---------

| Name                      | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| **Hmac(Byte[], Byte[])**  | Computes the keyed hash digest of binary data using HMAC algorithm              |
| [Hmac(String, String)](#md5_hmac-string-string) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |


Syntax
------

```csharp
public static string Hmac(
	byte[] data,
	byte[] key
)
```

#### Parameters

##### *data*  Byte[]
Data in array of bytes

##### *key*  Byte[]
Key in array of bytes

#### Return Value
String  
Digest in hex format

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_hmac-string-string"></a>


Md5.Hmac(String, String) Method
===============================
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)

Overloads
---------

| Name                      | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| [Hmac(Byte[], Byte[])](#md5_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 |


Syntax
------

```csharp
public static string Hmac(
	string dataHex,
	string keyHex
)
```

#### Parameters

##### *dataHex*  String
Data in hex format

##### *keyHex*  String
Key in hex format

#### Return Value
String  
Digest in hex format

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_init"></a>


Md5.Init Method
===============
Initializes the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public bool Init()
```

#### Return Value
Boolean  
True if successful, False if failed

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_instance"></a>


Md5.Instance Method
===================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Md5 Instance()
```

#### Return Value
[Md5](#md5_md5)  
Single instance to class

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="md5_reset"></a>


Md5.Reset Method
================
Resets the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Reset()
```

#### Return Value
Int32  
0 on success or a nonzero error code

See Also
--------


[Md5 Class](#md5_md5)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pbe_pbe"></a>


Pbe Class
=========
Password-based encryption


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Pbe**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Pbe
```

The **Pbe** type exposes the following members.


Methods
-------

| Name                                                    | Description                                                                                                          |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [Kdf2(Int32, Byte[], Byte[], Int32, HashAlgorithm)](#pbe_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)](#pbe_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)](#pbe_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)](#pbe_scrypt-int32-string-string-int32-int32-int32) | Derives a key in hex format from a password with the salt in hex format                                              |


Remarks
-------
Password-based encryption

See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pbe_kdf2-int32-byte-byte-int32-hashalgorithm"></a>


Pbe.Kdf2(Int32, Byte[], Byte[], Int32, HashAlgorithm) Method
============================================================
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)

Overloads
---------

| 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)](#pbe_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 |


Syntax
------

```csharp
public static byte[] Kdf2(
	int dkLen,
	byte[] pwdBytes,
	byte[] salt,
	int count,
	HashAlgorithm hashAlg = HashAlgorithm.Sha1
)
```

#### Parameters

##### *dkLen*  Int32
Required length of key in bytes

##### *pwdBytes*  Byte[]
Password encoded in byte format

##### *salt*  Byte[]
Salt in byte format

##### *count*  Int32
Iteration count

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)  (Optional)
Hash algorithm to use in HMAC PRF (optional, default=SHA-1)

#### Return Value
Byte[]  
Key in byte[] format

See Also
--------


[Pbe Class](#pbe_pbe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pbe_kdf2-int32-string-string-int32-hashalgorithm"></a>


Pbe.Kdf2(Int32, String, String, Int32, HashAlgorithm) Method
============================================================
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)

Overloads
---------

| Name                                                   | Description                                                                                                          |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| [Kdf2(Int32, Byte[], Byte[], Int32, HashAlgorithm)](#pbe_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 |


Syntax
------

```csharp
public static string Kdf2(
	int dkLen,
	string pwdStr,
	string saltHex,
	int count,
	HashAlgorithm hashAlg = HashAlgorithm.Sha1
)
```

#### Parameters

##### *dkLen*  Int32
Required length of key in bytes

##### *pwdStr*  String
Password

##### *saltHex*  String
Salt in hex format

##### *count*  Int32
Iteration count

##### *hashAlg*  [HashAlgorithm](#hashalgorithm_hashalgorithm)  (Optional)
Hash algorithm to use in HMAC PRF (optional, default=SHA-1)

#### Return Value
String  
Key in hex format

Remarks
-------
Password `pwdStr` is normal text, not hexadecimal

Example
-------

```csharp
string keyHex = Pbe.Kdf2(24, "password", "78578e5a5d63cb06", 2048);
// BFDE6BE94DF7E11DD409BCE20A0255EC327CB936FFE93643
```


See Also
--------


[Pbe Class](#pbe_pbe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pbe_scrypt-int32-byte-byte-int32-int32-int32"></a>


Pbe.Scrypt(Int32, Byte[], Byte[], Int32, Int32, Int32) Method
=============================================================
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)

Overloads
---------

| 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)](#pbe_scrypt-int32-string-string-int32-int32-int32) | Derives a key in hex format from a password with the salt in hex format |


Syntax
------

```csharp
public static byte[] Scrypt(
	int dkLen,
	byte[] pwdBytes,
	byte[] salt,
	int N,
	int r,
	int p
)
```

#### Parameters

##### *dkLen*  Int32
Required length of key in bytes

##### *pwdBytes*  Byte[]
Password encoded in byte format

##### *salt*  Byte[]
Salt in byte format

##### *N*  Int32
CPU/Memory cost parameter, a number greater than one and a power of 2.

##### *r*  Int32
Block size r

##### *p*  Int32
Parallelization parameter p

#### Return Value
Byte[]  
Key in byte[] format

See Also
--------


[Pbe Class](#pbe_pbe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pbe_scrypt-int32-string-string-int32-int32-int32"></a>


Pbe.Scrypt(Int32, String, String, Int32, Int32, Int32) Method
=============================================================
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)

Overloads
---------

| Name                                                    | Description                                                             |
| ------------------------------------------------------- | ----------------------------------------------------------------------- |
| [Scrypt(Int32, Byte[], Byte[], Int32, Int32, Int32)](#pbe_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 |


Syntax
------

```csharp
public static string Scrypt(
	int dkLen,
	string pwdStr,
	string saltHex,
	int N,
	int r,
	int p
)
```

#### Parameters

##### *dkLen*  Int32
Required length of key in bytes

##### *pwdStr*  String
Password (normal text)

##### *saltHex*  String
Salt in hex format

##### *N*  Int32
CPU/Memory cost parameter, a number greater than one and a power of 2.

##### *r*  Int32
Block size r

##### *p*  Int32
Parallelization parameter p

#### Return Value
String  
Key in hex format

Remarks
-------
Password `pwdStr` is normal text, not hexadecimal

Example
-------

```csharp
string keyHex = Pbe.Scrypt(64, "password", "4E61436C", 1024, 8, 16);
```


See Also
--------


[Pbe Class](#pbe_pbe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pc1_pc1"></a>


Pc1 Class
=========
RC4-compatible stream cipher algorithm (superseded by Cipher.Stream methods)


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Pc1**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Pc1
```

The **Pc1** type exposes the following members.


Methods
-------

| Name                         | Description                                              |
| ---------------------------- | -------------------------------------------------------- |
| [Encrypt(Byte[], Byte[])](#pc1_encrypt-byte-byte) | Encrypt byte array input using RC4-compatible algorithm  |
| [Encrypt(String, String)](#pc1_encrypt-string-string) | Encrypt hex-encoded input using RC4-compatible algorithm |
| [File](#pc1_file)                    | Encrypt a file using RC4-compatible algorithm            |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pc1_encrypt-byte-byte"></a>


Pc1.Encrypt(Byte[], Byte[]) Method
==================================
Encrypt byte array input using RC4-compatible algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                         | Description                                              |
| ---------------------------- | -------------------------------------------------------- |
| **Encrypt(Byte[], Byte[])**  | Encrypt byte array input using RC4-compatible algorithm  |
| [Encrypt(String, String)](#pc1_encrypt-string-string) | Encrypt hex-encoded input using RC4-compatible algorithm |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key
)
```

#### Parameters

##### *input*  Byte[]
input byte array, any length

##### *key*  Byte[]
key byte array, any length

#### Return Value
Byte[]  
byte array

Remarks
-------
Superseded by Cipher.StreamBytes()

See Also
--------


[Pc1 Class](#pc1_pc1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pc1_encrypt-string-string"></a>


Pc1.Encrypt(String, String) Method
==================================
Encrypt hex-encoded input using RC4-compatible algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                         | Description                                              |
| ---------------------------- | -------------------------------------------------------- |
| [Encrypt(Byte[], Byte[])](#pc1_encrypt-byte-byte) | Encrypt byte array input using RC4-compatible algorithm  |
| **Encrypt(String, String)**  | Encrypt hex-encoded input using RC4-compatible algorithm |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex
)
```

#### Parameters

##### *inputHex*  String
hex-encoded input, any length

##### *keyHex*  String
hex-encoded key, any length

#### Return Value
String  
hex-encoded string

Remarks
-------
Superseded by Cipher.StreamHex()

See Also
--------


[Pc1 Class](#pc1_pc1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="pc1_file"></a>


Pc1.File Method
===============
Encrypt a file using RC4-compatible algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int File(
	string fileOut,
	string fileIn,
	byte[] key
)
```

#### Parameters

##### *fileOut*  String
Full pathname of output file to be created. Must be different from fileIn

##### *fileIn*  String
Full pathname of input file

##### *key*  Byte[]
Key byte array, any length

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
Superseded by Cipher.StreamFile()

See Also
--------


[Pc1 Class](#pc1_pc1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="prf_prf"></a>


Prf Class
=========
Pseudorandom function (PRF) methods.


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Prf**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Prf
```

The **Prf** type exposes the following members.


Methods
-------

| Name       | Description                                                |
| ---------- | ---------------------------------------------------------- |
| [Bytes](#prf_bytes) | Generate output bytes using a pseudorandom function (PRF). |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="prf_bytes"></a>


Prf.Bytes Method
================
Generate output bytes using a pseudorandom function (PRF).
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] Bytes(
	int numBytes,
	byte[] message,
	byte[] key,
	string customStr,
	PrfAlgorithm prfAlg
)
```

#### Parameters

##### *numBytes*  Int32
Required number of output bytes.

##### *message*  Byte[]
Input message data.

##### *key*  Byte[]
Key.

##### *customStr*  String
Customization string (optional).

##### *prfAlg*  [PrfAlgorithm](#prfalgorithm_prfalgorithm)
PRF algorithm.

#### Return Value
Byte[]  
Output data in byte array.

See Also
--------


[Prf Class](#prf_prf)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_rng"></a>


Rng Class
=========
Random Number Generator to NIST SP800-90


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Rng**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Rng
```

The **Rng** type exposes the following members.


Methods
-------

| Name                                              | Description                                                                                                                                                                  |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BytesWithPrompt(Int32, Rng.Strength)](#rng_byteswithprompt-int32-rng-strength)         | Generates an array of random bytes with a prompt for keyboard input                                                                                                          |
| [BytesWithPrompt(Int32, String, Rng.Strength)](#rng_byteswithprompt-int32-string-rng-strength) | Generates an array of random bytes with a prompt for keyboard input                                                                                                          |
| [HexWithPrompt(Int32)](#rng_hexwithprompt-int32)                         | Generates random bytes in hex format with a prompt for keyboard input                                                                                                        |
| [HexWithPrompt(Int32, String, Rng.Strength)](#rng_hexwithprompt-int32-string-rng-strength)   | Generates random bytes in hex format with a prompt for keyboard input                                                                                                        |
| [Initialize](#rng_initialize)                                   | Initialize the RNG generator with a seed file.                                                                                                                               |
| [InitializeEx](#rng_initializeex)                                 | Query and initialize the RNG generator using Intel(R) DRNG, if available.                                                                                                    |
| [KeyBytes(Int32, Byte[])](#rng_keybytes-int32-byte)                      | Generates a random key with user-supplied entropy                                                                                                                            |
| [KeyBytes(Int32, String)](#rng_keybytes-int32-string)                      | Generates a random key                                                                                                                                                       |
| [KeyHex(Int32, Byte[])](#rng_keyhex-int32-byte)                       | Generates a random key in hex format with user-supplied entropy                                                                                                              |
| [KeyHex(Int32, String)](#rng_keyhex-int32-string)                       | Generates a random key in hex format                                                                                                                                         |
| [MakeSeedFile(String, Rng.Strength)](#rng_makeseedfile-string-rng-strength)          | Create a new seed file suitable for use with Rng.Initialize                                                                                                                  |
| [MakeSeedFile(String, String, Rng.Strength)](#rng_makeseedfile-string-string-rng-strength)  | Create a new seed file suitable for use with Rng.Initialize                                                                                                                  |
| [NonceBytes](#rng_noncebytes)                                  | Generates a random nonce                                                                                                                                                     |
| [NonceHex](#rng_noncehex)                                    | Generates a random nonce in hex format                                                                                                                                       |
| [Number](#rng_number)                                      | Generates a random integer in a given range                                                                                                                                  |
| [Octet](#rng_octet)                                       | Generates a single random octet (byte)                                                                                                                                       |
| [Test](#rng_test)                                        | Carries out a NIST SP800-90 health check and FIPS140-2 statistical tests on the random number generator                                                                      |
| [TestDrbgvs](#rng_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](#rng_updateseedfile)                              | Updates the RNG seed file                                                                                                                                                    |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_byteswithprompt-int32-rng-strength"></a>


Rng.BytesWithPrompt(Int32, Rng.Strength) Method
===============================================
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)

Overloads
---------

| Name                                              | Description                                                         |
| ------------------------------------------------- | ------------------------------------------------------------------- |
| **BytesWithPrompt(Int32, Rng.Strength)**          | Generates an array of random bytes with a prompt for keyboard input |
| [BytesWithPrompt(Int32, String, Rng.Strength)](#rng_byteswithprompt-int32-string-rng-strength) | Generates an array of random bytes with a prompt for keyboard input |


Syntax
------

```csharp
public static byte[] BytesWithPrompt(
	int numBytes,
	Rng.Strength strength = Rng.Strength.Default
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *strength*  [Rng.Strength](#rng_strength_rng-strength)  (Optional)
Required security strength (default=112 bits)

#### Return Value
Byte[]  
Array of random bytes

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_byteswithprompt-int32-string-rng-strength"></a>


Rng.BytesWithPrompt(Int32, String, Rng.Strength) Method
=======================================================
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)

Overloads
---------

| Name                                             | Description                                                         |
| ------------------------------------------------ | ------------------------------------------------------------------- |
| [BytesWithPrompt(Int32, Rng.Strength)](#rng_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 |


Syntax
------

```csharp
public static byte[] BytesWithPrompt(
	int numBytes,
	string prompt,
	Rng.Strength strength
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *prompt*  String
Alternative prompt. Set as an empty string `""` for the default prompt.

##### *strength*  [Rng.Strength](#rng_strength_rng-strength)
Required security strength

#### Return Value
Byte[]  
Array of random bytes

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_hexwithprompt-int32"></a>


Rng.HexWithPrompt(Int32) Method
===============================
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)

Overloads
---------

| Name                                            | Description                                                           |
| ----------------------------------------------- | --------------------------------------------------------------------- |
| **HexWithPrompt(Int32)**                        | Generates random bytes in hex format with a prompt for keyboard input |
| [HexWithPrompt(Int32, String, Rng.Strength)](#rng_hexwithprompt-int32-string-rng-strength) | Generates random bytes in hex format with a prompt for keyboard input |


Syntax
------

```csharp
public static string HexWithPrompt(
	int numBytes
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

#### Return Value
String  
Random bytes in hex format

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_hexwithprompt-int32-string-rng-strength"></a>


Rng.HexWithPrompt(Int32, String, Rng.Strength) Method
=====================================================
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)

Overloads
---------

| Name                                           | Description                                                           |
| ---------------------------------------------- | --------------------------------------------------------------------- |
| [HexWithPrompt(Int32)](#rng_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 |


Syntax
------

```csharp
public static string HexWithPrompt(
	int numBytes,
	string prompt,
	Rng.Strength strength
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *prompt*  String
Alternative prompt. Set as an empty string `""` for the default prompt.

##### *strength*  [Rng.Strength](#rng_strength_rng-strength)
Required security strength

#### Return Value
String  
Random bytes in hex format

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_initialize"></a>


Rng.Initialize Method
=====================
Initialize the RNG generator with a seed file.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static bool Initialize(
	string seedFile
)
```

#### Parameters

##### *seedFile*  String
Full path name of seed file

#### Return Value
Boolean  
`true` if successful; `false` if fails

Remarks
-------
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).

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_initializeex"></a>


Rng.InitializeEx Method
=======================
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)

Syntax
------

```csharp
public static int InitializeEx(
	Rng.Options opts = Rng.Options.Default
)
```

#### Parameters

##### *opts*  [Rng.Options](#rng_options_rng-options)  (Optional)
Specify `Rng.Options.NoIntelDrng` to explicitly turn off support.

#### Return Value
Int32  
Support status for Intel(R) DRNG. If available, then a positive value (1,2,3); else a negative error code.

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_keybytes-int32-byte"></a>


Rng.KeyBytes(Int32, Byte[]) Method
==================================
Generates a random key with user-supplied entropy
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                         | Description                                       |
| ---------------------------- | ------------------------------------------------- |
| **KeyBytes(Int32, Byte[])**  | Generates a random key with user-supplied entropy |
| [KeyBytes(Int32, String)](#rng_keybytes-int32-string) | Generates a random key                            |


Syntax
------

```csharp
public static byte[] KeyBytes(
	int numBytes,
	byte[] arrSeed
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *arrSeed*  Byte[]
User-supplied entropy in byte format

#### Return Value
Byte[]  
Array of random bytes

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_keybytes-int32-string"></a>


Rng.KeyBytes(Int32, String) Method
==================================
Generates a random key
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                         | Description                                       |
| ---------------------------- | ------------------------------------------------- |
| [KeyBytes(Int32, Byte[])](#rng_keybytes-int32-byte) | Generates a random key with user-supplied entropy |
| **KeyBytes(Int32, String)**  | Generates a random key                            |


Syntax
------

```csharp
public static byte[] KeyBytes(
	int numBytes,
	string seedStr = ""
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *seedStr*  String  (Optional)
User-supplied entropy in string format. Set as an empty string `""` to ignore.

#### Return Value
Byte[]  
Array of random bytes

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_keyhex-int32-byte"></a>


Rng.KeyHex(Int32, Byte[]) Method
================================
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)

Overloads
---------

| Name                       | Description                                                     |
| -------------------------- | --------------------------------------------------------------- |
| **KeyHex(Int32, Byte[])**  | Generates a random key in hex format with user-supplied entropy |
| [KeyHex(Int32, String)](#rng_keyhex-int32-string) | Generates a random key in hex format                            |


Syntax
------

```csharp
public static string KeyHex(
	int numBytes,
	byte[] arrSeed
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *arrSeed*  Byte[]
User-supplied entropy in byte format

#### Return Value
String  
Random bytes in hex format

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_keyhex-int32-string"></a>


Rng.KeyHex(Int32, String) Method
================================
Generates a random key in hex format
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                       | Description                                                     |
| -------------------------- | --------------------------------------------------------------- |
| [KeyHex(Int32, Byte[])](#rng_keyhex-int32-byte) | Generates a random key in hex format with user-supplied entropy |
| **KeyHex(Int32, String)**  | Generates a random key in hex format                            |


Syntax
------

```csharp
public static string KeyHex(
	int numBytes,
	string seedStr = ""
)
```

#### Parameters

##### *numBytes*  Int32
Required number of random bytes

##### *seedStr*  String  (Optional)
User-supplied entropy in string format. Set as an empty string `""` to ignore.

#### Return Value
String  
Random bytes in hex format

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_makeseedfile-string-rng-strength"></a>


Rng.MakeSeedFile(String, Rng.Strength) Method
=============================================
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)

Overloads
---------

| Name                                            | Description                                                 |
| ----------------------------------------------- | ----------------------------------------------------------- |
| **MakeSeedFile(String, Rng.Strength)**          | Create a new seed file suitable for use with Rng.Initialize |
| [MakeSeedFile(String, String, Rng.Strength)](#rng_makeseedfile-string-string-rng-strength) | Create a new seed file suitable for use with Rng.Initialize |


Syntax
------

```csharp
public static bool MakeSeedFile(
	string seedFile,
	Rng.Strength strength = Rng.Strength.Default
)
```

#### Parameters

##### *seedFile*  String
Name of seed file to be created

##### *strength*  [Rng.Strength](#rng_strength_rng-strength)  (Optional)
Required security strength (default=112 bits)

#### Return Value
Boolean  
`true` if successful; `false` if fails

Remarks
-------
Any existing file of the same name will be overwritten without warning.

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_makeseedfile-string-string-rng-strength"></a>


Rng.MakeSeedFile(String, String, Rng.Strength) Method
=====================================================
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)

Overloads
---------

| Name                                           | Description                                                 |
| ---------------------------------------------- | ----------------------------------------------------------- |
| [MakeSeedFile(String, Rng.Strength)](#rng_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 |


Syntax
------

```csharp
public static bool MakeSeedFile(
	string seedFile,
	string prompt,
	Rng.Strength strength
)
```

#### Parameters

##### *seedFile*  String
Name of seed file to be created

##### *prompt*  String
Prompt for dialog

##### *strength*  [Rng.Strength](#rng_strength_rng-strength)
Required security strength

#### Return Value
Boolean  
`true` if successful; `false` if fails

Remarks
-------
Any existing file of the same name will be overwritten without warning.

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_noncebytes"></a>


Rng.NonceBytes Method
=====================
Generates a random nonce
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] NonceBytes(
	int numBytes
)
```

#### Parameters

##### *numBytes*  Int32
Number of bytes required

#### Return Value
Byte[]  
Array of bytes

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_noncehex"></a>


Rng.NonceHex Method
===================
Generates a random nonce in hex format
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string NonceHex(
	int numBytes
)
```

#### Parameters

##### *numBytes*  Int32
Number of bytes required

#### Return Value
String  
Nonce in hex format

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_number"></a>


Rng.Number Method
=================
Generates a random integer in a given range
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static int Number(
	int lower,
	int upper
)
```

#### Parameters

##### *lower*  Int32
lower value of range

##### *upper*  Int32
upper value of range

#### Return Value
Int32  
Random integer

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_octet"></a>


Rng.Octet Method
================
Generates a single random octet (byte)
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte Octet()
```

#### Return Value
Byte  
Single byte value randomly chosen between 0 and 255

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_test"></a>


Rng.Test Method
===============
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)

Syntax
------

```csharp
public static bool Test(
	string resultFile
)
```

#### Parameters

##### *resultFile*  String
Name of results file to be created, or `null`/`Nothing` not to create a results file.

#### Return Value
Boolean  
`true` if successful; `false` if fails.

Remarks
-------
Any existing file of the same name will be overwritten without warning.

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_testdrbgvs"></a>


Rng.TestDrbgvs Method
=====================
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)

Syntax
------

```csharp
public static string TestDrbgvs(
	int returnedBitsLen,
	string entropyInput,
	string nonce,
	string personalizationString,
	string additionalInput1,
	string entropyReseed,
	string additionalInputReseed,
	string additionalInput2
)
```

#### Parameters

##### *returnedBitsLen*  Int32
Number of bits to be returned from each call to the generate function in the test

##### *entropyInput*  String
the EntropyInput value in hex format

##### *nonce*  String
the Nonce value in hex format

##### *personalizationString*  String
the PersonalizationString value in hex format

##### *additionalInput1*  String
the first AdditionalInput value in hex format

##### *entropyReseed*  String
the EntropyReseed value in hex format

##### *additionalInputReseed*  String
the AdditionalInputReseed value in hex format

##### *additionalInput2*  String
the second AdditionalInput value in hex format

#### Return Value
String  
the ReturnedBits as a string in hexadecimal format

Remarks
-------
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.

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_updateseedfile"></a>


Rng.UpdateSeedFile Method
=========================
Updates the RNG seed file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static bool UpdateSeedFile(
	string seedFile
)
```

#### Parameters

##### *seedFile*  String
Full path name of seed file

#### Return Value
Boolean  
`true` if successful; `false` if fails

Remarks
-------
Any existing file of the same name will be overwritten without warning.

See Also
--------


[Rng Class](#rng_rng)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_sha1"></a>


Sha1 Class
==========
Secure Hash Algorithm 1 (SHA-1)


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Sha1**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Sha1
```

The **Sha1** type exposes the following members.


Properties
----------

| Name         | Description                                                    |
| ------------ | -------------------------------------------------------------- |
| [ErrCode](#sha1_errcode) | Last error code (for Init, AddData and HexDigest methods only) |


Methods
-------

| Name                       | Description                                                                        |
| -------------------------- | ---------------------------------------------------------------------------------- |
| [AddData(Byte[])](#sha1_adddata-byte)       | Adds an array of 8-bit bytes to the digest                                         |
| [AddData(String)](#sha1_adddata-string)       | Adds a string of Ansi characters to the digest                                     |
| [BytesHash](#sha1_byteshash)             | Creates message digest as array of bytes from message in byte array                |
| [Dispose](#sha1_dispose)               | Dispose of this object and clear any stored data                                   |
| [FileHexHash](#sha1_filehexhash)           | Creates hash digest of a binary file                                               |
| [FileTextHexHash](#sha1_filetexthexhash)       | Creates hash digest of a "text" file treating CR-LF pairs as a single newline char |
| [HexDigest](#sha1_hexdigest)             | Computes final message digest in hex format                                        |
| [HexHash(Byte[])](#sha1_hexhash-byte)      | Creates message digest in hex format from message in byte array                    |
| [HexHash(String)](#sha1_hexhash-string)      | Creates message digest in hex format from message in Ansi string                   |
| [Hmac(Byte[], Byte[])](#sha1_hmac-byte-byte) | Computes the keyed hash digest of binary data using HMAC algorithm                 |
| [Hmac(String, String)](#sha1_hmac-string-string) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings    |
| [Init](#sha1_init)                 | Initializes the context                                                            |
| [Instance](#sha1_instance)             | Create the one and only instance                                                   |
| [Reset](#sha1_reset)                | Resets the context                                                                 |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_errcode"></a>


Sha1.ErrCode Property
=====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_adddata-byte"></a>


Sha1.AddData(Byte[]) Method
===========================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| **AddData(Byte[])**  | Adds an array of 8-bit bytes to the digest     |
| [AddData(String)](#sha1_adddata-string) | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	byte[] b
)
```

#### Parameters

##### *b*  Byte[]
Data to add

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_adddata-string"></a>


Sha1.AddData(String) Method
===========================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| [AddData(Byte[])](#sha1_adddata-byte) | Adds an array of 8-bit bytes to the digest     |
| **AddData(String)**  | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	string s
)
```

#### Parameters

##### *s*  String
String of Ansi characters

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_byteshash"></a>


Sha1.BytesHash Method
=====================
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)

Syntax
------

```csharp
public static byte[] BytesHash(
	byte[] message
)
```

#### Parameters

##### *message*  Byte[]
Message data to be digested

#### Return Value
Byte[]  
Digest in array of bytes

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_dispose"></a>


Sha1.Dispose Method
===================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_filehexhash"></a>


Sha1.FileHexHash Method
=======================
Creates hash digest of a binary file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string FileHexHash(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
String  
Message digest in hex format

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_filetexthexhash"></a>


Sha1.FileTextHexHash Method
===========================
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)

Syntax
------

```csharp
public static string FileTextHexHash(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
String  
Message digest in hex format

Remarks
-------
Use when comparing text data on a Unix system

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_hexdigest"></a>


Sha1.HexDigest Method
=====================
Computes final message digest in hex format
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public string HexDigest()
```

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_hexhash-byte"></a>


Sha1.HexHash(Byte[]) Method
===========================
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)

Overloads
---------

| Name                 | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| **HexHash(Byte[])**  | Creates message digest in hex format from message in byte array  |
| [HexHash(String)](#sha1_hexhash-string) | Creates message digest in hex format from message in Ansi string |


Syntax
------

```csharp
public static string HexHash(
	byte[] message
)
```

#### Parameters

##### *message*  Byte[]
Message data to be digested

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_hexhash-string"></a>


Sha1.HexHash(String) Method
===========================
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)

Overloads
---------

| Name                 | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| [HexHash(Byte[])](#sha1_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 |


Syntax
------

```csharp
public static string HexHash(
	string message
)
```

#### Parameters

##### *message*  String
Message text to be digested

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_hmac-byte-byte"></a>


Sha1.Hmac(Byte[], Byte[]) Method
================================
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)

Overloads
---------

| Name                      | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| **Hmac(Byte[], Byte[])**  | Computes the keyed hash digest of binary data using HMAC algorithm              |
| [Hmac(String, String)](#sha1_hmac-string-string) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |


Syntax
------

```csharp
public static string Hmac(
	byte[] data,
	byte[] key
)
```

#### Parameters

##### *data*  Byte[]
Data in array of bytes

##### *key*  Byte[]
Key in array of bytes

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_hmac-string-string"></a>


Sha1.Hmac(String, String) Method
================================
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)

Overloads
---------

| Name                      | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| [Hmac(Byte[], Byte[])](#sha1_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 |


Syntax
------

```csharp
public static string Hmac(
	string dataHex,
	string keyHex
)
```

#### Parameters

##### *dataHex*  String
Data in hex format

##### *keyHex*  String
Key in hex format

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_init"></a>


Sha1.Init Method
================
Initializes the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public bool Init()
```

#### Return Value
Boolean  
True if successful, False if failed

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_instance"></a>


Sha1.Instance Method
====================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Sha1 Instance()
```

#### Return Value
[Sha1](#sha1_sha1)  
Single instance to class

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha1_reset"></a>


Sha1.Reset Method
=================
Resets the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Reset()
```

#### Return Value
Int32  
0 on success or a nonzero error code

See Also
--------


[Sha1 Class](#sha1_sha1)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_sha256"></a>


Sha256 Class
============
Secure Hash 256 Algorithm (SHA-256)


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Sha256**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Sha256
```

The **Sha256** type exposes the following members.


Properties
----------

| Name         | Description                                                    |
| ------------ | -------------------------------------------------------------- |
| [ErrCode](#sha256_errcode) | Last error code (for Init, AddData and HexDigest methods only) |


Methods
-------

| Name                       | Description                                                                        |
| -------------------------- | ---------------------------------------------------------------------------------- |
| [AddData(Byte[])](#sha256_adddata-byte)       | Adds an array of 8-bit bytes to the digest                                         |
| [AddData(String)](#sha256_adddata-string)       | Adds a string of Ansi characters to the digest                                     |
| [BytesHash](#sha256_byteshash)             | Creates message digest as array of bytes from message in byte array                |
| [Dispose](#sha256_dispose)               | Dispose of this object and clear any stored data                                   |
| [FileHexHash](#sha256_filehexhash)           | Creates hash digest of a binary file                                               |
| [FileTextHexHash](#sha256_filetexthexhash)       | Creates hash digest of a "text" file treating CR-LF pairs as a single newline char |
| [HexDigest](#sha256_hexdigest)             | Computes final message digest in hex format                                        |
| [HexHash(Byte[])](#sha256_hexhash-byte)      | Creates message digest in hex format from message in byte array                    |
| [HexHash(String)](#sha256_hexhash-string)      | Creates message digest in hex format from message in Ansi string                   |
| [Hmac(Byte[], Byte[])](#sha256_hmac-byte-byte) | Computes the keyed hash digest of binary data using HMAC algorithm                 |
| [Hmac(String, String)](#sha256_hmac-string-string) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings    |
| [Init](#sha256_init)                 | Initializes the context                                                            |
| [Instance](#sha256_instance)             | Create the one and only instance                                                   |
| [Reset](#sha256_reset)                | Resets the context                                                                 |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_errcode"></a>


Sha256.ErrCode Property
=======================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_adddata-byte"></a>


Sha256.AddData(Byte[]) Method
=============================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| **AddData(Byte[])**  | Adds an array of 8-bit bytes to the digest     |
| [AddData(String)](#sha256_adddata-string) | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	byte[] b
)
```

#### Parameters

##### *b*  Byte[]
Data to add

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_adddata-string"></a>


Sha256.AddData(String) Method
=============================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| [AddData(Byte[])](#sha256_adddata-byte) | Adds an array of 8-bit bytes to the digest     |
| **AddData(String)**  | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	string s
)
```

#### Parameters

##### *s*  String
String of Ansi characters

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_byteshash"></a>


Sha256.BytesHash Method
=======================
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)

Syntax
------

```csharp
public static byte[] BytesHash(
	byte[] message
)
```

#### Parameters

##### *message*  Byte[]
Message data to be digested

#### Return Value
Byte[]  
Digest in array of bytes

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_dispose"></a>


Sha256.Dispose Method
=====================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_filehexhash"></a>


Sha256.FileHexHash Method
=========================
Creates hash digest of a binary file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static string FileHexHash(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
String  
Message digest in hex format

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_filetexthexhash"></a>


Sha256.FileTextHexHash Method
=============================
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)

Syntax
------

```csharp
public static string FileTextHexHash(
	string fileName
)
```

#### Parameters

##### *fileName*  String
Name of input file

#### Return Value
String  
Message digest in hex format

Remarks
-------
Use when comparing text data on a Unix system

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_hexdigest"></a>


Sha256.HexDigest Method
=======================
Computes final message digest in hex format
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public string HexDigest()
```

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_hexhash-byte"></a>


Sha256.HexHash(Byte[]) Method
=============================
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)

Overloads
---------

| Name                 | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| **HexHash(Byte[])**  | Creates message digest in hex format from message in byte array  |
| [HexHash(String)](#sha256_hexhash-string) | Creates message digest in hex format from message in Ansi string |


Syntax
------

```csharp
public static string HexHash(
	byte[] message
)
```

#### Parameters

##### *message*  Byte[]
Message data to be digested

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_hexhash-string"></a>


Sha256.HexHash(String) Method
=============================
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)

Overloads
---------

| Name                 | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| [HexHash(Byte[])](#sha256_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 |


Syntax
------

```csharp
public static string HexHash(
	string message
)
```

#### Parameters

##### *message*  String
Message text to be digested

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_hmac-byte-byte"></a>


Sha256.Hmac(Byte[], Byte[]) Method
==================================
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)

Overloads
---------

| Name                      | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| **Hmac(Byte[], Byte[])**  | Computes the keyed hash digest of binary data using HMAC algorithm              |
| [Hmac(String, String)](#sha256_hmac-string-string) | Computes the keyed hash digest using HMAC algorithm passing data as hex strings |


Syntax
------

```csharp
public static string Hmac(
	byte[] data,
	byte[] key
)
```

#### Parameters

##### *data*  Byte[]
Data in array of bytes

##### *key*  Byte[]
Key in array of bytes

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_hmac-string-string"></a>


Sha256.Hmac(String, String) Method
==================================
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)

Overloads
---------

| Name                      | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| [Hmac(Byte[], Byte[])](#sha256_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 |


Syntax
------

```csharp
public static string Hmac(
	string dataHex,
	string keyHex
)
```

#### Parameters

##### *dataHex*  String
Data in hex format

##### *keyHex*  String
Key in hex format

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_init"></a>


Sha256.Init Method
==================
Initializes the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public bool Init()
```

#### Return Value
Boolean  
True if successful, False if failed

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_instance"></a>


Sha256.Instance Method
======================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Sha256 Instance()
```

#### Return Value
[Sha256](#sha256_sha256)  
Single instance to class

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha256_reset"></a>


Sha256.Reset Method
===================
Resets the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Reset()
```

#### Return Value
Int32  
0 on success or a nonzero error code

See Also
--------


[Sha256 Class](#sha256_sha256)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_sha3"></a>


Sha3 Class
==========
Secure Hash Algorithm SHA-3


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Sha3**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Sha3
```

The **Sha3** type exposes the following members.


Properties
----------

| Name               | Description                                                    |
| ------------------ | -------------------------------------------------------------- |
| [ErrCode](#sha3_errcode)       | Last error code (for Init, AddData and HexDigest methods only) |
| [LengthInBytes](#sha3_lengthinbytes) | Length in bytes of hash output (i.e. length in bits / 8)       |


Methods
-------

| Name                 | Description                                            |
| -------------------- | ------------------------------------------------------ |
| [AddData(Byte[])](#sha3_adddata-byte) | Adds an array of 8-bit bytes to the digest             |
| [AddData(String)](#sha3_adddata-string) | Adds a string of Ansi characters to the digest         |
| [Dispose](#sha3_dispose)         | Dispose of this object and clear any stored data       |
| [HexDigest](#sha3_hexdigest)       | Computes final message digest in hex format            |
| [Init](#sha3_init)            | Initialises the object ready to receive data to digest |
| [Instance](#sha3_instance)        | Create the one and only instance                       |
| [Reset](#sha3_reset)          | Resets the context                                     |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_errcode"></a>


Sha3.ErrCode Property
=====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_lengthinbytes"></a>


Sha3.LengthInBytes Property
===========================
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)

Syntax
------

```csharp
public int LengthInBytes { get; }
```

#### Property Value
Int32

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_adddata-byte"></a>


Sha3.AddData(Byte[]) Method
===========================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| **AddData(Byte[])**  | Adds an array of 8-bit bytes to the digest     |
| [AddData(String)](#sha3_adddata-string) | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	byte[] b
)
```

#### Parameters

##### *b*  Byte[]
Data to add

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_adddata-string"></a>


Sha3.AddData(String) Method
===========================
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)

Overloads
---------

| Name                 | Description                                    |
| -------------------- | ---------------------------------------------- |
| [AddData(Byte[])](#sha3_adddata-byte) | Adds an array of 8-bit bytes to the digest     |
| **AddData(String)**  | Adds a string of Ansi characters to the digest |


Syntax
------

```csharp
public int AddData(
	string s
)
```

#### Parameters

##### *s*  String
String of Ansi characters

#### Return Value
Int32  
0 on success or nonzero error code

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_dispose"></a>


Sha3.Dispose Method
===================
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)

Syntax
------

```csharp
public void Dispose()
```


See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_hexdigest"></a>


Sha3.HexDigest Method
=====================
Computes final message digest in hex format
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public string HexDigest()
```

#### Return Value
String  
Digest in hex format

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_init"></a>


Sha3.Init Method
================
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)

Syntax
------

```csharp
public bool Init(
	int hashBitLen
)
```

#### Parameters

##### *hashBitLen*  Int32
Size of SHA-3 algorithm in bits. Must be one of {224, 256, 384, 512}.

#### Return Value
Boolean  
True if successful, False if failed

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_instance"></a>


Sha3.Instance Method
====================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Sha3 Instance()
```

#### Return Value
[Sha3](#sha3_sha3)  
Single instance to class

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="sha3_reset"></a>


Sha3.Reset Method
=================
Resets the context
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public int Reset()
```

#### Return Value
Int32  
0 on success or a nonzero error code

See Also
--------


[Sha3 Class](#sha3_sha3)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_tdea"></a>


Tdea Class
==========
Triple DES Cipher (3DES, TDEA, DES-EDE3)


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Tdea**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Tdea : IDisposable
```

The **Tdea** type exposes the following members.


Properties
----------

| Name         | Description                                        |
| ------------ | -------------------------------------------------- |
| [ErrCode](#tdea_errcode) | Last error code (for Init and Update methods only) |


Methods
-------

| Name                                                                      | Description                                                                   |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [CheckKey(Byte[])](#tdea_checkkey-byte)                                                     | Verifies that no part of the key is a weak or semi-weak TDEA key.             |
| [CheckKey(String)](#tdea_checkkey-string)                                                     | Verifies that no part of the key is a weak or semi-weak TDEA key.             |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#tdea_decrypt-byte-byte-mode-byte)                                | Decrypt data in byte array                                                    |
| [Decrypt(String, String, Mode, String)](#tdea_decrypt-string-string-mode-string)                                | Decrypt hex-encoded data string                                               |
| [Decrypt(String, String, Mode, String, EncodingBase)](#tdea_decrypt-string-string-mode-string-encodingbase)                  | Decrypt encoded data string                                                   |
| [Dispose](#tdea_dispose)                                                              | Dispose of this object and clear any key schedules                            |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#tdea_encrypt-byte-byte-mode-byte)                                | Encrypt data in byte array                                                    |
| [Encrypt(String, String, Mode, String)](#tdea_encrypt-string-string-mode-string)                               | Encrypt hex-encoded data string                                               |
| [Encrypt(String, String, Mode, String, EncodingBase)](#tdea_encrypt-string-string-mode-string-encodingbase)                 | Encrypt encoded data string                                                   |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#tdea_filedecrypt-string-string-byte-mode-byte)                   | Decrypt a file                                                                |
| [FileDecrypt(String, String, String, Mode, String)](#tdea_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings                              |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#tdea_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options                                          |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#tdea_fileencrypt-string-string-byte-mode-byte)                   | Encrypt a file                                                                |
| [FileEncrypt(String, String, String, Mode, String)](#tdea_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings                              |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#tdea_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options                                          |
| [InitDecrypt(Byte[], Mode, Byte[])](#tdea_initdecrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start decrypting                   |
| [InitDecrypt(String, Mode, String)](#tdea_initdecrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start decrypting           |
| [InitEncrypt(Byte[], Mode, Byte[])](#tdea_initencrypt-byte-mode-byte)                                   | Initializes with key, mode and IV ready to start encrypting                   |
| [InitEncrypt(String, Mode, String)](#tdea_initencrypt-string-mode-string)                                   | Initializes with hex key, mode and hex IV ready to start encrypting           |
| [Instance](#tdea_instance)                                                            | Create the one and only instance                                              |
| [Pad(Byte[])](#tdea_pad-byte)                                                         | Pads byte array to correct length for ECB and CBC encryption                  |
| [Pad(String)](#tdea_pad-string)                                                         | Pads hex-encoded string to correct length for ECB and CBC encryption          |
| [Unpad(Byte[])](#tdea_unpad-byte)                                                       | Removes the padding from an encryption block                                  |
| [Unpad(String)](#tdea_unpad-string)                                                       | Removes the padding from a hex-encoded encryption block                       |
| [Update(Byte[])](#tdea_update-byte)                                                      | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#tdea_update-string)                                                      | Transform hex string data with previously initialized key, mode and direction |


Fields
------

| Name            | Description         |
| --------------- | ------------------- |
| [BlockSize](#tdea_blocksize) | Block size in bytes |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_errcode"></a>


Tdea.ErrCode Property
=====================
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)

Syntax
------

```csharp
public int ErrCode { get; }
```

#### Property Value
Int32

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_checkkey-byte"></a>


Tdea.CheckKey(Byte[]) Method
============================
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)

Overloads
---------

| Name                  | Description                                                       |
| --------------------- | ----------------------------------------------------------------- |
| **CheckKey(Byte[])**  | Verifies that no part of the key is a weak or semi-weak TDEA key. |
| [CheckKey(String)](#tdea_checkkey-string) | Verifies that no part of the key is a weak or semi-weak TDEA key. |


Syntax
------

```csharp
public static int CheckKey(
	byte[] key
)
```

#### Parameters

##### *key*  Byte[]
Key to check

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_checkkey-string"></a>


Tdea.CheckKey(String) Method
============================
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)

Overloads
---------

| Name                  | Description                                                       |
| --------------------- | ----------------------------------------------------------------- |
| [CheckKey(Byte[])](#tdea_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. |


Syntax
------

```csharp
public static int CheckKey(
	string keyHex
)
```

#### Parameters

##### *keyHex*  String
Hex-encoded key to check

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_decrypt-byte-byte-mode-byte"></a>


Tdea.Decrypt(Byte[], Byte[], Mode, Byte[]) Method
=================================================
Decrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Decrypt(Byte[], Byte[], Mode, Byte[])**                | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#tdea_decrypt-string-string-mode-string)               | Decrypt hex-encoded data string |
| [Decrypt(String, String, Mode, String, EncodingBase)](#tdea_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Decrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Decrypted data in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_decrypt-string-string-mode-string"></a>


Tdea.Decrypt(String, String, Mode, String) Method
=================================================
Decrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#tdea_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)](#tdea_decrypt-string-string-mode-string-encodingbase) | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 8 bytes or `""` for ECB mode

#### Return Value
String  
Decrypted data in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_decrypt-string-string-mode-string-encodingbase"></a>


Tdea.Decrypt(String, String, Mode, String, EncodingBase) Method
===============================================================
Decrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Decrypt(Byte[], Byte[], Mode, Byte[])](#tdea_decrypt-byte-byte-mode-byte)              | Decrypt data in byte array      |
| [Decrypt(String, String, Mode, String)](#tdea_decrypt-string-string-mode-string)              | Decrypt hex-encoded data string |
| **Decrypt(String, String, Mode, String, EncodingBase)** | Decrypt encoded data string     |


Syntax
------

```csharp
public static string Decrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 8 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Decrypted data in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_dispose"></a>


Tdea.Dispose Method
===================
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)

Syntax
------

```csharp
public void Dispose()
```

#### Implements
IDisposable.Dispose()  


See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_encrypt-byte-byte-mode-byte"></a>


Tdea.Encrypt(Byte[], Byte[], Mode, Byte[]) Method
=================================================
Encrypt data in byte array
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| **Encrypt(Byte[], Byte[], Mode, Byte[])**                | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#tdea_encrypt-string-string-mode-string)               | Encrypt hex-encoded data string |
| [Encrypt(String, String, Mode, String, EncodingBase)](#tdea_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *input*  Byte[]
Input data

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Byte[]  
Ciphertext in byte array or empty array on error

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_encrypt-string-string-mode-string"></a>


Tdea.Encrypt(String, String, Mode, String) Method
=================================================
Encrypt hex-encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                     | Description                     |
| -------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#tdea_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)](#tdea_encrypt-string-string-mode-string-encodingbase) | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputHex,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *inputHex*  String
Hex-encoded input data

##### *keyHex*  String
Hex-encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV representing exactly 8 bytes or `""` for ECB mode

#### Return Value
String  
Ciphertext in hex-encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_encrypt-string-string-mode-string-encodingbase"></a>


Tdea.Encrypt(String, String, Mode, String, EncodingBase) Method
===============================================================
Encrypt encoded data string
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                    | Description                     |
| ------------------------------------------------------- | ------------------------------- |
| [Encrypt(Byte[], Byte[], Mode, Byte[])](#tdea_encrypt-byte-byte-mode-byte)              | Encrypt data in byte array      |
| [Encrypt(String, String, Mode, String)](#tdea_encrypt-string-string-mode-string)              | Encrypt hex-encoded data string |
| **Encrypt(String, String, Mode, String, EncodingBase)** | Encrypt encoded data string     |


Syntax
------

```csharp
public static string Encrypt(
	string inputStr,
	string keyStr,
	Mode mode,
	string ivStr,
	EncodingBase encodingBase
)
```

#### Parameters

##### *inputStr*  String
Encoded input data

##### *keyStr*  String
Encoded key representing exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivStr*  String
Encoded IV representing exactly 8 bytes or `""` for ECB mode

##### *encodingBase*  [EncodingBase](#encodingbase_encodingbase)
Type of encoding used

#### Return Value
String  
Ciphertext in encoded string or empty string on error

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_filedecrypt-string-string-byte-mode-byte"></a>


Tdea.FileDecrypt(String, String, Byte[], Mode, Byte[]) Method
=============================================================
Decrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileDecrypt(String, String, Byte[], Mode, Byte[])**                    | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#tdea_filedecrypt-string-string-string-mode-string)                   | Decrypt a file passing key and IV as hex strings |
| [FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#tdea_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_filedecrypt-string-string-string-mode-string"></a>


Tdea.FileDecrypt(String, String, String, Mode, String) Method
=============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#tdea_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)](#tdea_filedecrypt-string-string-byte-mode-byte-cipherfileoption) | Decrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_filedecrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Tdea.FileDecrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
===============================================================================
Decrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileDecrypt(String, String, Byte[], Mode, Byte[])](#tdea_filedecrypt-string-string-byte-mode-byte)                  | Decrypt a file                                   |
| [FileDecrypt(String, String, String, Mode, String)](#tdea_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             |


Syntax
------

```csharp
public static int FileDecrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes. Use `null`/`Nothing` for ECB mode or when using CipherFileOption.PrefixIV option

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_fileencrypt-string-string-byte-mode-byte"></a>


Tdea.FileEncrypt(String, String, Byte[], Mode, Byte[]) Method
=============================================================
Encrypt a file
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| **FileEncrypt(String, String, Byte[], Mode, Byte[])**                    | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#tdea_fileencrypt-string-string-string-mode-string)                   | Encrypt a file passing key and IV as hex strings |
| [FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption)](#tdea_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_fileencrypt-string-string-string-mode-string"></a>


Tdea.FileEncrypt(String, String, String, Mode, String) Method
=============================================================
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)

Overloads
---------

| Name                                                                     | Description                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#tdea_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)](#tdea_fileencrypt-string-string-byte-mode-byte-cipherfileoption) | Encrypt a file with advanced options             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *keyHex*  String
Hex-encoded key of exact length

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *ivHex*  String
Hex-encoded IV or `""` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same. The output file is in binary format.

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_fileencrypt-string-string-byte-mode-byte-cipherfileoption"></a>


Tdea.FileEncrypt(String, String, Byte[], Mode, Byte[], CipherFileOption) Method
===============================================================================
Encrypt a file with advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                                                                    | Description                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| [FileEncrypt(String, String, Byte[], Mode, Byte[])](#tdea_fileencrypt-string-string-byte-mode-byte)                  | Encrypt a file                                   |
| [FileEncrypt(String, String, String, Mode, String)](#tdea_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             |


Syntax
------

```csharp
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	Mode mode,
	byte[] iv,
	CipherFileOption advOptions
)
```

#### Parameters

##### *fileOut*  String
Name of output file to be created or overwritten

##### *fileIn*  String
Name of input file

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

##### *advOptions*  [CipherFileOption](#cipherfileoption_cipherfileoption)
Advanced options. See [CipherFileOption](#cipherfileoption_cipherfileoption).

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

Remarks
-------
`fileOut` and `fileIn` must **not** be the same

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_initdecrypt-byte-mode-byte"></a>


Tdea.InitDecrypt(Byte[], Mode, Byte[]) Method
=============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitDecrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start decrypting         |
| [InitDecrypt(String, Mode, String)](#tdea_initdecrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start decrypting |


Syntax
------

```csharp
public int InitDecrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_initdecrypt-string-mode-string"></a>


Tdea.InitDecrypt(String, Mode, String) Method
=============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitDecrypt(Byte[], Mode, Byte[])](#tdea_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 |


Syntax
------

```csharp
public int InitDecrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_initencrypt-byte-mode-byte"></a>


Tdea.InitEncrypt(Byte[], Mode, Byte[]) Method
=============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| **InitEncrypt(Byte[], Mode, Byte[])**  | Initializes with key, mode and IV ready to start encrypting         |
| [InitEncrypt(String, Mode, String)](#tdea_initencrypt-string-mode-string) | Initializes with hex key, mode and hex IV ready to start encrypting |


Syntax
------

```csharp
public int InitEncrypt(
	byte[] key,
	Mode mode,
	byte[] iv
)
```

#### Parameters

##### *key*  Byte[]
Key of exactly 24 bytes (192 bits)

##### *mode*  [Mode](#mode_mode)
Cipher Mode

##### *iv*  Byte[]
IV of exactly 8 bytes or `null`/`Nothing` for ECB mode

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_initencrypt-string-mode-string"></a>


Tdea.InitEncrypt(String, Mode, String) Method
=============================================
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)

Overloads
---------

| Name                                   | Description                                                         |
| -------------------------------------- | ------------------------------------------------------------------- |
| [InitEncrypt(Byte[], Mode, Byte[])](#tdea_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 |


Syntax
------

```csharp
public int InitEncrypt(
	string keyHex,
	Mode mode,
	string ivHex
)
```

#### Parameters

##### *keyHex*  String
Key in hex-encoded format

##### *mode*  [Mode](#mode_mode)
Cipher mode

##### *ivHex*  String
IV in hex-encoded format

#### Return Value
Int32  
Zero (0) if successful; otherwise it returns a nonzero [error code](#general_error-code)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_instance"></a>


Tdea.Instance Method
====================
Create the one and only instance
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static Tdea Instance()
```

#### Return Value
[Tdea](#tdea_tdea)  
Single instance to class

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_pad-byte"></a>


Tdea.Pad(Byte[]) Method
=======================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| **Pad(Byte[])**  | Pads byte array to correct length for ECB and CBC encryption         |
| [Pad(String)](#tdea_pad-string) | Pads hex-encoded string to correct length for ECB and CBC encryption |


Syntax
------

```csharp
public static byte[] Pad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be padded

#### Return Value
Byte[]  
padded data in byte array

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_pad-string"></a>


Tdea.Pad(String) Method
=======================
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)

Overloads
---------

| Name             | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| [Pad(Byte[])](#tdea_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 |


Syntax
------

```csharp
public static string Pad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded data to be padded

#### Return Value
String  
padded data in hex-encoded string

Remarks
-------
Uses PKCS#5/#7/CMS method of padding

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_unpad-byte"></a>


Tdea.Unpad(Byte[]) Method
=========================
Removes the padding from an encryption block
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| **Unpad(Byte[])**  | Removes the padding from an encryption block            |
| [Unpad(String)](#tdea_unpad-string) | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static byte[] Unpad(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
padded data

#### Return Value
Byte[]  
Unpadded data in byte array or unchanged data on error

Remarks
-------
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.

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_unpad-string"></a>


Tdea.Unpad(String) Method
=========================
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)

Overloads
---------

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| [Unpad(Byte[])](#tdea_unpad-byte) | Removes the padding from an encryption block            |
| **Unpad(String)**  | Removes the padding from a hex-encoded encryption block |


Syntax
------

```csharp
public static string Unpad(
	string dataHex
)
```

#### Parameters

##### *dataHex*  String
hex-encoded padded data

#### Return Value
String  
Unpadded data in hex-encoded string or unchanged data on error

Remarks
-------
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.

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_update-byte"></a>


Tdea.Update(Byte[]) Method
==========================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| **Update(Byte[])**  | Transform byte input data with previously initialized key, mode and direction |
| [Update(String)](#tdea_update-string) | Transform hex string data with previously initialized key, mode and direction |


Syntax
------

```csharp
public byte[] Update(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
input data in byte array

#### Return Value
Byte[]  
transformed data in byte array

Remarks
-------
For ECB and CBC modes, input data length **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_update-string"></a>


Tdea.Update(String) Method
==========================
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)

Overloads
---------

| Name                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| [Update(Byte[])](#tdea_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 |


Syntax
------

```csharp
public string Update(
	string data
)
```

#### Parameters

##### *data*  String
hex-encoded input data

#### Return Value
String  
hex-encoded data

Remarks
-------
For ECB and CBC modes, the length of the decoded input bytes **must** be an exact multiple of the block length (8 bytes)

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="tdea_blocksize"></a>


Tdea.BlockSize Field
====================
Block size in bytes
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public const int BlockSize = 8
```

#### Field Value
Int32

See Also
--------


[Tdea Class](#tdea_tdea)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="wipe_wipe"></a>


Wipe Class
==========
Data Wiping Functions


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Wipe**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Wipe
```

The **Wipe** type exposes the following members.


Methods
-------

| Name        | Description                      |
| ----------- | -------------------------------- |
| [Data](#wipe_data)   | Zeroises data in memory          |
| [File](#wipe_file)   | Securely wipe and delete a file. |
| [String](#wipe_string) | Zeroises a StringBuilder         |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="wipe_data"></a>


Wipe.Data Method
================
Zeroises data in memory
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static bool Data(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
data to be wiped

#### Return Value
Boolean  
**true** if successful; **false** if fails

See Also
--------


[Wipe Class](#wipe_wipe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="wipe_file"></a>


Wipe.File Method
================
Securely wipe and delete a file.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static bool File(
	string fileName,
	Wipe.Options opts = Wipe.Options.Default
)
```

#### Parameters

##### *fileName*  String
Name of file to be wiped

##### *opts*  [Wipe.Options](#wipe_options_wipe-options)  (Optional)
Options (optional) Default is DOD 7-pass.

#### Return Value
Boolean  
`true` if successful; `false` if fails

See Also
--------


[Wipe Class](#wipe_wipe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="wipe_string"></a>


Wipe.String Method
==================
Zeroises a StringBuilder
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static bool String(
	StringBuilder sb
)
```

#### Parameters

##### *sb*  StringBuilder
StringBuilder to be wiped

#### Return Value
Boolean  
**true** if successful; **false** if fails

Remarks
-------
NB You can't wipe an ordinary string as they are immutable in C#, so store any sensitive string data in a StringBuilder.

See Also
--------


[Wipe Class](#wipe_wipe)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="xof_xof"></a>


Xof Class
=========
Extendable-output function (XOF) methods.


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Xof**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Xof
```

The **Xof** type exposes the following members.


Methods
-------

| Name       | Description                                               |
| ---------- | --------------------------------------------------------- |
| [Bytes](#xof_bytes) | Generate bytes using an extendable-output function (XOF). |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="xof_bytes"></a>


Xof.Bytes Method
================
Generate bytes using an extendable-output function (XOF).
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] Bytes(
	int numBytes,
	byte[] message,
	XofAlgorithm xofAlg
)
```

#### Parameters

##### *numBytes*  Int32
Required number of output bytes.

##### *message*  Byte[]
Input message data.

##### *xofAlg*  [XofAlgorithm](#xofalgorithm_xofalgorithm)
XOF algorithm.

#### Return Value
Byte[]  
Output data in byte array.

See Also
--------


[Xof Class](#xof_xof)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="zlib_zlib"></a>


Zlib Class
==========
ZLIB compression algorithm


Inheritance Hierarchy
---------------------
System.Object  
  **CryptoSysAPI.Zlib**  
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public class Zlib
```

The **Zlib** type exposes the following members.


Methods
-------

| Name                        | Description                                                    |
| --------------------------- | -------------------------------------------------------------- |
| [Deflate](#zlib_deflate)                | Compress data using the ZLIB deflate algorithm                 |
| [Inflate(Byte[])](#zlib_inflate-byte)        | Inflate compressed data using the ZLIB algorithm.              |
| [Inflate(Byte[], Int32)](#zlib_inflate-byte-int32) | Inflate compressed data using the ZLIB algorithm [superseded]. |


Remarks
-------
ZLIB Compression to RFC 1950

See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="zlib_deflate"></a>


Zlib.Deflate Method
===================
Compress data using the ZLIB deflate algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public static byte[] Deflate(
	byte[] dataToComp
)
```

#### Parameters

##### *dataToComp*  Byte[]
Data to be compressed

#### Return Value
Byte[]  
Compressed data

See Also
--------


[Zlib Class](#zlib_zlib)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="zlib_inflate-byte"></a>


Zlib.Inflate(Byte[]) Method
===========================
Inflate compressed data using the ZLIB algorithm.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                        | Description                                                    |
| --------------------------- | -------------------------------------------------------------- |
| **Inflate(Byte[])**         | Inflate compressed data using the ZLIB algorithm.              |
| [Inflate(Byte[], Int32)](#zlib_inflate-byte-int32) | Inflate compressed data using the ZLIB algorithm [superseded]. |


Syntax
------

```csharp
public static byte[] Inflate(
	byte[] data
)
```

#### Parameters

##### *data*  Byte[]
Compressed data to be uncompressed.

#### Return Value
Byte[]  
Uncompressed data, or an empty array on error.

Remarks
-------
An empty array may also be returned if the original data was the empty array itself.

See Also
--------


[Zlib Class](#zlib_zlib)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="zlib_inflate-byte-int32"></a>


Zlib.Inflate(Byte[], Int32) Method
==================================
Inflate compressed data using the ZLIB algorithm [superseded].
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Overloads
---------

| Name                       | Description                                                    |
| -------------------------- | -------------------------------------------------------------- |
| [Inflate(Byte[])](#zlib_inflate-byte)       | Inflate compressed data using the ZLIB algorithm.              |
| **Inflate(Byte[], Int32)** | Inflate compressed data using the ZLIB algorithm [superseded]. |


Syntax
------

```csharp
public static byte[] Inflate(
	byte[] data,
	int lenUncompressed
)
```

#### Parameters

##### *data*  Byte[]
Data to be uncompressed

##### *lenUncompressed*  Int32
Length of uncompressed data

#### Return Value
Byte[]  
Uncompressed data

Remarks
-------
Superseded by [Zlib.Inflate(Byte[])](#zlib_inflate-byte)

See Also
--------


[Zlib Class](#zlib_zlib)  
[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_algorithm_aead-algorithm"></a>


Aead.Algorithm Enumeration
==========================
AEAD algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Algorithm
```


Members
-------

| 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) |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="aead_opts_aead-opts"></a>


Aead.Opts Enumeration
=====================
Advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
[FlagsAttribute]
public enum Opts
```


Members
-------

| Member name | Description                                                         |
| ----------- | ------------------------------------------------------------------- |
| Default     | Default options                                                     |
| PrefixIV    | Prefix (prepend) the IV (nonce) before the ciphertext in the output |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipher_opts_cipher-opts"></a>


Cipher.Opts Enumeration
=======================
Advanced options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
[FlagsAttribute]
public enum Opts
```


Members
-------

| Member name | Description                                                                             |
| ----------- | --------------------------------------------------------------------------------------- |
| Default     | Default options                                                                         |
| PrefixIV    | Prefix (prepend) the IV before the ciphertext in the output file (ignored for ECB mode) |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipheralgorithm_cipheralgorithm"></a>


CipherAlgorithm Enumeration
===========================
Block Cipher Algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum CipherAlgorithm
```


Members
-------

| Member name | Description                       |
| ----------- | --------------------------------- |
| Tdea        | Triple DES (TDEA, 3DES, des-ede3) |
| Aes128      | AES-128                           |
| Aes192      | AES-192                           |
| Aes256      | AES-256                           |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherfileoption_cipherfileoption"></a>


CipherFileOption Enumeration
============================
Advanced options for file cipher operations
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
[FlagsAttribute]
public enum CipherFileOption
```


Members
-------

| 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) |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="cipherstream_algorithm_cipherstream-algorithm"></a>


CipherStream.Algorithm Enumeration
==================================
Stream cipher algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Algorithm
```


Members
-------

| Member name | Description             |
| ----------- | ----------------------- |
| Arcfour     | ARCFOUR (RC4) algorithm |
| Salsa20     | Salsa20 algorithm       |
| Chacha20    | ChaCha20 algorithm      |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="compralgorithm_compralgorithm"></a>


ComprAlgorithm Enumeration
==========================
Compression algorithm.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum ComprAlgorithm
```


Members
-------

| Member name | Description          |
| ----------- | -------------------- |
| Zlib        | zlib as per RFC 1950 |
| Zstd        | zstd as per RFC 8878 |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="encodingbase_encodingbase"></a>


EncodingBase Enumeration
========================
Base for encoding methods
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum EncodingBase
```


Members
-------

| Member name | Description                        |
| ----------- | ---------------------------------- |
| Base64      | Base64 encoding                    |
| Base16      | Base16 encoding (i.e. hexadecimal) |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="hashalgorithm_hashalgorithm"></a>


HashAlgorithm Enumeration
=========================
Message Digest Hash Algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum HashAlgorithm
```


Members
-------

| 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) |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="macalgorithm_macalgorithm"></a>


MacAlgorithm Enumeration
========================
Message Authentication Code (MAC) Algorithm
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum MacAlgorithm
```


Members
-------

| 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) |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="mode_mode"></a>


Mode Enumeration
================
Cipher Mode
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Mode
```


Members
-------

| Member name | Description                |
| ----------- | -------------------------- |
| ECB         | Electronic Code Book mode  |
| CBC         | Cipher Block Chaining mode |
| OFB         | Output Feedback mode       |
| CFB         | Cipher Feedback mode       |
| CTR         | Counter mode               |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="padding_padding"></a>


Padding Enumeration
===================
Block Cipher Padding
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Padding
```


Members
-------

| 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 |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="prfalgorithm_prfalgorithm"></a>


PrfAlgorithm Enumeration
========================
Pseudorandom function (PRF) algorithm.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum PrfAlgorithm
```


Members
-------

| Member name | Description                    |
| ----------- | ------------------------------ |
| Kmac128     | KMAC128 as per NIST SP 800-185 |
| Kmac256     | KMAC256 as per NIST SP 800-185 |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_options_rng-options"></a>


Rng.Options Enumeration
=======================
Rng options
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Options
```


Members
-------

| Member name | Description                                                 |
| ----------- | ----------------------------------------------------------- |
| Default     | Default option                                              |
| NoIntelDrng | Turn off support for INTEL(R) DRNG for the current session. |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="rng_strength_rng-strength"></a>


Rng.Strength Enumeration
========================
Required security strength for user-prompted entropy
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Strength
```


Members
-------

| 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           |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="wipe_options_wipe-options"></a>


Wipe.Options Enumeration
========================
Wipe options.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum Options
```


Members
-------

| 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). |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)




<a id="xofalgorithm_xofalgorithm"></a>


XofAlgorithm Enumeration
========================
Extendable-output function (XOF) algorithm.
  
**Namespace:** CryptoSysAPI  
**Assembly:**  diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.36349 (6.22.2.0)

Syntax
------

```csharp
public enum XofAlgorithm
```


Members
-------

| 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)          |


See Also
--------


[CryptoSysAPI Namespace](#cryptosysapi-namespace)



***
Created: 2025-10-20 20:12:37  
Copyright (C) 2025 D.I. Management Services Pty Ltd t/a CryptoSys [https://cryptosys.net](https://cryptosys.net)
