> For the complete documentation index, see [llms.txt](https://learn.cypherock.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.cypherock.com/design-decision/cypherock-x0-hardware-architecture/encrypted-nfc-communication-for-x0-cards.md).

# Encrypted NFC communication for X0 cards

The X0 Cards interface with the X0 Wallet App using the NFC technology built into the user's smartphone. Every interaction with the wallet, from creating it to signing a transaction, happens with a simple tap of an X0 Card on the phone. A common criticism for NFC is that it may be possible for an attacker to read and modify the information that is exchanged with the card.

To address the concerns of NFC communication, Cypherock X0 encrypts every exchange at two levels:

{% stepper %}
{% step %}

## Between the X0 Wallet App and the X0 Card

Each NFC session begins with an Elliptic-curve Diffie–Hellman (ECDH) key exchange, from which fresh session keys are derived. Every message exchanged during the session is then encrypted and authenticated with these keys.

At the start of the session, the X0 Card signs its response, which includes fresh random data, with a key provisioned inside it by Cypherock. This proves to the X0 Wallet App that it is communicating with a genuine X0 Card and prevents the response from being replayed.
{% endstep %}

{% step %}

## Between X0 Cards

When a shard needs to move from one X0 Card to another, for example when a wallet is created or restored on a new phone, it travels through the smartphone inside a dedicated card-to-card secure channel.

The keys for this channel are established when the X0 Cards are paired with each other during setup, and they are never exchanged through the phone. The X0 Wallet App only relays these messages and has no way to read them.
{% endstep %}
{% endstepper %}

This implementation ensures that an attacker listening to the NFC communication of Cypherock X0 cannot extract any meaningful information from it.
