# End-to-End Encryption

Numpay employs strict end-to-end encryption (E2EE) protocols to protect all sensitive user data during verification, binding, and transaction processing phases. This ensures that user identifiers such as emails or phone numbers are encrypted on the client side and remain confidential until they reach the authorized verification endpoint, preventing exposure to any intermediaries or external attackers.

## Encryption Methodology

### **1. Client-Side Encryption**

Data encryption starts on the user’s device before transmission. The protocol uses Elliptic Curve Cryptography (ECC) for secure key exchange, combined with symmetric encryption for data confidentiality:

* The user’s client generates an ephemeral private key and derives a shared secret with the verifier’s public key using Elliptic Curve Diffie-Hellman (ECDH).
* This shared secret is used as a symmetric key to encrypt the payload with AES-256 in Galois/Counter Mode (GCM). AES-GCM provides both confidentiality and integrity via authenticated encryption.
* This process guarantees that only the verifier with the matching private key can decrypt the data.

### **2. Secure Transmission**

Even though the payload is encrypted, Numpay also leverages Transport Layer Security (TLS) version 1.3 for an additional encryption layer during data transit. TLS protects against network-level attacks like man-in-the-middle or replay attacks by establishing a secure, authenticated channel.

### **3. Verifier-Side Decryption and Processing**

* Upon receipt, the verifier uses its private key to perform ECDH key agreement, recreating the shared secret.
* The verifier then decrypts the payload using AES-256-GCM.
* Sensitive data such as phone numbers are only decrypted within the verifier’s secure environment and never stored in plaintext longer than necessary.
* After verification steps (e.g., OTP confirmation) succeed, the verifier produces a signed cryptographic attestation using its private signing key (often Ed25519 or secp256k1 signatures) that certifies ownership of the identifier by the wallet owner.

### **4. Secure Data Disposal**

To reduce attack surface, raw decrypted data and encryption keys are securely wiped from memory and any temporary storage immediately after use. The verifier maintains no long-term storage of user identifiers or plaintext data.


---

# Agent Instructions: 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:

```
GET https://numpay.gitbook.io/numpay/data-privacy-and-security/end-to-end-encryption.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
