> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/api-and-command-reference/scra-dynafamily-programmers-manual/commands/security-command-group-0xennn/get-challenge-command-0xe001.md).

# Get Challenge - Command 0xE001

The host uses this command to request challenge data from the device, which the host can then use to perform a specific sensitive operation / modify a specific type of device setting. Information about how the host should pass the required challenge data to the device is included in the documentation for all commands that use this security mechanism.

The sequence of events is as follows:

{% stepper %}
{% step %}
The host already wants to perform a secured operation that requires a challenge (for example Command 0xEEEE - Send Secured Command to Device).
{% endstep %}

{% step %}
The host constructs the command request for **Get Challenge -** **Command 0xE001** in the format below.
{% endstep %}

{% step %}
The host sends the command request to the device.
{% endstep %}

{% step %}
The device generates a random number for the challenge, stores it locally, and sends a response in the format below to the host.
{% endstep %}

{% step %}
The device starts a 5 minute countdown timer during which the challenge is valid. If the host takes no action within 5 minutes, the timer expires, the device erases the challenge data, and the device must retrieve a fresh challenge to perform the operation it wants to perform. This binding of the command to a specific time period allows the device to detect and reject commands that have been captured/intercepted at one point in time and replayed later.
{% endstep %}
{% endstepper %}

## Table GCH-1 - Request Data for Get Challenge - Command 0xE001&#x20;

<table><thead><tr><th>Tag</th><th width="73.3333740234375">Len</th><th width="230.33331298828125">Value / Description</th><th width="75">Typ</th><th width="75.3333740234375">Req</th><th width="97.333251953125">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Request Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>E001 = <strong>Get Challenge - Command 0xE001</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>81</td><td>02</td><td>Request ID to be protected</td><td>B</td><td>R</td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Request Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Table GCH-1 - Response Data for Get Challenge - Command 0xE001

<table><thead><tr><th width="233">Tag</th><th width="72.6666259765625">Len</th><th>Value / Description</th><th width="72.66668701171875">Typ</th><th width="74">Req</th><th width="96.666748046875">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Response Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>E001 = <strong>Get Challenge - Command 0xE001</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>81</td><td>02</td><td>Request ID to be protected</td><td>B</td><td>R</td><td></td></tr><tr><td>82</td><td>04</td><td>Device Serial Number</td><td>B</td><td>R</td><td></td></tr><tr><td>83</td><td>08</td><td>Challenge Token A challenge token includes 8 byte random numbers and must be used within 5 minutes of being issued. Only one token can be active at a time. Attempts to use a token for requests other than the one specified will cause the token to be revoked/erased</td><td>B</td><td>R</td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Response Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Table GCH-2 - Request Example

{% code title="Example (hex)" %}

```
AA 00 81 04 01 13 E0 01 84 06 E0 01 81 02 F0 12
```

{% endcode %}

## Table GCH-3 - Response Example

{% code title="Example (hex)" %}

```
AA 00 81 04 82 13 E0 01 82 04 00 00 00 00 84 16 A2 14 81 02 E0 01 82 04 B5 03 3D A0 83 08 
3B 4F A0 62 69 BB 73 38
```

{% endcode %}


---

# 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://developer.magtek.com/api-and-command-reference/scra-dynafamily-programmers-manual/commands/security-command-group-0xennn/get-challenge-command-0xe001.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.
