Skip to main content
You can encrypt and decrypt card details using cryptographic functions. This method ensures only authorized users can securely retrieve full card details (PAN and CVC).

Security best practices

  • Never store decrypted card details.
  • Only request full card details when absolutely necessary.
  • Always use the latest encryption libraries to maintain security.
Follow the steps below to generate a session ID, send an API request, and decrypt the response manually.

Step 1: Generating the session ID

Use the generateSessionID method to generate the SessionId. This ensures that only the correct user can decrypt the data. You’ll need the public RSA key for your environment:

Requirements

  • The secret must be a 32-character hexadecimal string with no spaces or dashes.
  • The encryption must use RSA-OAEP padding.

Example session ID generation

  • The sessionId is required for making an API request.
  • The secretKey will be needed for decryption later.

Step 2: Sending the API request

Once the sessionId is generated, you can send a request to retrieve encrypted card details. Send a request to the get a card’s encrypted data endpoint.

Example API request

Example API response

The API will return the encrypted card number (PAN) and CVC, each with an initialization vector (IV) for decryption.

Step 3: Decrypting the encrypted card data

To decrypt the received encrypted card details, use AES-128-GCM decryption.

Example card data decryption

Example final output