> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet/nfc-wallet-backend/card-enrollment/encrypt-card-information.md).

# Encrypt card information

## Overview

Card credentials are sensitive information. Encrypt them before starting card enrollment with the NFC Wallet SDK.

## Card encryption requirements

Card information uses the PKCS#7 encryption format defined in RFC 2315 and RFC 5652 with the following encryption criteria:

* Content encryption algorithm: AES256/CBC/PKCS7Padding
* Key encryption algorithm: RSA with Issuer Public Key length of 2048 bytes.

The card payload to encrypt must contain the following JSON fields:

<table><thead><tr><th width="123.88885498046875">JSON field</th><th width="402.66668701171875">Description</th><th width="89.7777099609375">MOC</th><th>Length</th></tr></thead><tbody><tr><td><code>fpan</code></td><td>The funding PAN to digitize.</td><td>M</td><td>16-20</td></tr><tr><td><code>exp</code></td><td>The card expiry date in the format MMYY.</td><td>M</td><td>4</td></tr><tr><td><code>cvv</code></td><td>The security code is optional. Its presence depends on the card issuer.</td><td>C</td><td>3-4</td></tr><tr><td><code>nonce</code></td><td>This ephemeral value is used only for the green enrollment flow. If it is provided, the SHA256 hash of the nonce must also be provided in the authentication token.</td><td>O</td><td>1-50</td></tr></tbody></table>

The encryption result must then be encoded in base64.


---

# 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.payments.thalescloud.io/nfc-wallet/nfc-wallet-backend/card-enrollment/encrypt-card-information.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.
