Encryption of card data

Working with the JWE Encryption Standard

To ensure data confidentiality during transmission, the JWE (JSON Web Encryption) standard is used, which defines the format for encrypted JSON messages.

To encrypt the Card Number (PAN), the public payment key (payment_public_key) is used, which is provided during key generation (see "Key Generation" documentation).

The key conforms to the JWK (JSON Web Key) format:

JSON

"paymentPublicKey": 
{
    "kty": "EC",
    "x": "Hp833OY6a0VbFD1j8xFyXWcAA-HOlyr7B_-B05esZUy32RA41s0oGAMTal23AX9d",
    "y": "WGHeR9PhKRymoA-ggsR3VkQTgdfzt7PWa8P2qNpu0cV83lmLxE57b8rR7ajBurvj",
    "crv": "P-384"
}

The Public Payment Key (payment_public_key) corresponds to the parameters:

  • "kty": "EC" - Key type (Elliptic Curve)

  • "crv": "P-384" - Elliptic Curve type

  • "use": "enc" – Parameter used for key encryption

  • "alg": ECDH-ES+A256KW - Algorithm for which the key is used

Example Endpoint for Encryption:

Warning:

The request is for testing purposes only. It is forbidden to execute the request with real keys. Encryption must be implemented on your side.

Encrypting a Message using JWK

post

Encrypts the transmitted message (e.g., card number, or card expiration date and CVV) using the public JWK key (EC).

Query parameters
messagestringRequired

Message to encrypt (e.g., card number, or card expiration date and CVV)

Example: 5232441010000177
Body
ktystring · enumRequired

Key Type (EC)

Example: ECPossible values:
crvstringRequired

Curve Type

Example: P-384
xstringRequired

X-coordinate of the public key (base64url)

Example: kG1pVAvnrGKuTyiq0p9ixfmdMP6lZ6-429uUsEV5...
ystringRequired

Y-coordinate of the public key (base64url)

Example: uq2IMAsebJeH5RUNLds5czh7cesCqbs3ZZad9lNX...
Responses
200

Successful encryption. Returns the encrypted message (e.g., JWE token).

text/plain
ResponsestringExample: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
post
/cipher/encrypt_by_jwk

Last updated