> For the complete documentation index, see [llms.txt](https://docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verifone.com/kld/key-information/key-import/cryptogram-file-formats.md).

# Cryptogram File Formats

### DUKPT-BDK (Cryptogram)

Line format:

```
Key Name, KEK Algorithm(optional), KEK (optional), KEK-KCV (optional), Key Algorithm, Cryptogram, KCV, KSI, EKSI (optional)
```

Rules:

* Key Name is mandatory.
* KEK Algorithm, KEK, and KEK-KCV are optional.
  * If present, KEK is encrypted with ZMK.
  * Or use the KEK created on the UI.
  * This in-file KEK encrypts the cryptogram.
* Key Algorithm is mandatory.
* Cryptogram is mandatory.
* KCV is mandatory.
* KSI is mandatory.
  * Exactly 10 HEX bytes.
* EKSI is optional.
  * Use it to avoid KSI modification.
  * Provide KSI encrypted with KEK.
* Each line is one key.
* Missing optional fields must still keep commas.
  * Unless optional fields are only at the end.

### FIXED (Cryptogram)

Line format:

{% code overflow="wrap" %}

```
Key Name, KEK Algorithm(optional), KEK (optional), KEK-KCV (optional), Key Algorithm, Cryptogram, KCV
```

{% endcode %}

Rules:

* Key Name is mandatory.
* KEK Algorithm, KEK, and KEK-KCV are optional.
  * If present, KEK is encrypted with ZMK.
  * Or use the KEK created on the UI.
  * This in-file KEK encrypts the cryptogram.
* Key Algorithm is mandatory.
* Cryptogram is mandatory.
* KCV is mandatory.
* Each line is one key.
* Missing optional fields must still keep commas.
  * Unless optional fields are only at the end.

### Master Session (MS) (Cryptogram)

Line format:

{% code overflow="wrap" %}

```
Key Name, KEK-Algorithm(optional), KEK (optional), KEK-KCV (optional), Key Algorithm, Cryptogram, KCV, KRD-S/N(optional)
```

{% endcode %}

Rules:

* Key Name is mandatory.
* KEK Algorithm, KEK, and KEK-KCV are optional.
  * If present, KEK is encrypted with ZMK.
  * Or use the KEK created on the UI.
  * This in-file KEK encrypts the cryptogram.
* Key Algorithm is mandatory.
* Cryptogram is mandatory.
* KCV is mandatory.
* KRD-S/N is optional.
  * Terminal S/N.
  * Use it to target a specific terminal.
* Each line is one key.
* Missing optional fields must still keep commas.
  * Unless optional fields are only at the end.

Samples:

* See the `MS` sample folder in [Cryptogram-Key-Sample-Files.zip](https://cryptogram-key-sample-files.zip).
* Use the same naming concept as TR-31 Master Session keys.

### DUKPT-Initial Keys (IK) (Cryptogram)

Line format:

{% code overflow="wrap" %}

```
Key Name, KEK algorithm (optional), KEK (optional), KEK-KCV (optional), Cryptogram, KCV, IKSN, EIKSN (optional), KRD-S/N (optional)
```

{% endcode %}

Rules:

* Key Name is mandatory.
* KEK Algorithm, KEK, and KEK-KCV are optional.
  * If present, KEK is encrypted with ZMK.
  * Or use the KEK created on the UI.
  * This in-file KEK encrypts the cryptogram.
* Cryptogram is mandatory.
* KCV is mandatory.
* IKSN is mandatory.
  * Exactly 20 HEX bytes.
* EIKSN is optional.
  * Use it to avoid IKSN modification.
  * Provide IKSN encrypted with KEK.
* KRD-S/N is optional.
  * Terminal S/N.
  * Use it to target a specific terminal.
* Each line is one key.
* Missing optional fields must still keep commas.
  * Unless optional fields are only at the end.

Samples:

* See the `IK` sample folder in [Cryptogram-Key-Sample-Files.zip](https://cryptogram-key-sample-files.zip).
* Use the same naming concept as TR-31 IK keys.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verifone.com/kld/key-information/key-import/cryptogram-file-formats.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
