post https://{domain}/api/StartAuthentication
The StartAuthentication
endpoint is the first step in any Spark transaction. It authenticates the transaction request using a pre-shared token and a cryptographically signed payload.
Build cipher
cipher
Your ciphertext combines the following:
- A 36-character Spark Transaction ID (a GUID with hyphens).
- A single "=" character.
- A 17-character alphanumeric Random String.
- A 10-character
YYMMDDhhmm
UTC Timestamp.
Follow these steps to generate and encrypt your cipher:
- Concatenate the Spark Transaction ID, the "=" character, the Random String, and the Timestamp to form the 64-character ciphertext, as in the example below:
12c7cec2-c690-4425-9a1f db0db60e2d8c=123456789qwertyui2306061021
- Extract the 32 rightmost characters from your provided Token to create the 256-bit AES encryption key. For example, suppose the token is the following:
The encryption key is as follows:some_long_token_wRvTVTkungMIKThTVbj_fiXdfoGclhn0
wRvTVTkungMIKThTVbj_fiXdfoGclhn0
- Encrypt the 64-character ciphertext using AES in ECB mode. Ensure the plaintext is padded (e.g., using PKCS7) to a multiple of 16 bytes. Base64 encode the resulting encrypted bytes for transmission, which yields an output similar to the example below:
X305dITNTAw2vHsxE+taVcn6UvgBC3fdI6QbqeABgHbo8CKsoZhqISJfslehCiA+L7XYrqvKFci7C6BNj/trzBuNJwBEjgBzKhhgpJ5ggnw=