Skip to main content
The card number (PAN), CVC and expiry are only ever returned encrypted to a public key that you register. Only your private key can decrypt them. Endl doesn’t log or store them. You receive encrypted card details from:

Register your public key

You do this once, and again when you rotate your key.
1

Create an RSA key pair of at least 2048 bits

Keep the private key on your servers.
2

Send the public key to Endl support

Send card-details-public.pem (PEM, BEGIN PUBLIC KEY). You can also give a keyId label of up to 64 characters. Without one, the keyId is the first 16 hex characters of the SHA-256 hash of the public key (DER).
You have one active key. Registering a new key replaces the old one at once, so keep the old private key until you no longer need to decrypt earlier responses. Each response names its key in keyId. Keys are per environment: register one key for sandbox and another for production. Without a registered key, card details and single-use card creation return 400 ERRCRD_1004.

EncryptedCard object

All binary values are standard Base64 with padding.

Decrypt the card details

  1. Decrypt encryptedKey with your private key, using RSA-OAEP with SHA-256 (and MGF1 with SHA-256). This gives a 32-byte AES key.
  2. Decrypt ciphertext with that key using AES-256-GCM, with iv, tag, and the UTF-8 bytes of aad as additional authenticated data.
  3. Check that aad is the card id you asked for.
  4. The result is JSON:
Don’t log or store the decrypted values. Handling card data falls under PCI DSS.