Skip to main content
Skip table of contents

Encryption API

The purpose of this encryption API is to provide an open API, which can be called via JavaScript for example executed in browser to securely encrypt PII like an email address so that it can be used as lookup identifier and logged without introducing PII.

The encryption algorithm produces a non-deterministic and authenticated ciphertext using AES-GCM that is base64 URL encoded.

Request

The POST method API handles a JSON object with multiple key-value pairs. The key name remains unchanged and the value gets encrypted and returned.

The key and value have an optional maximum specified length that is configurable by pipeline.

HTTP-Method

POST

Content-Type

application/json

Path

/api/v1/encr/<pipeline>

Body

JSON
{"name-1":"value-1", "name-2": "value-2"}

Example

JS
curl 'https://encryption-api.test.teavaro.systems/api/v1/encr/test1' \
  -H 'Content-Type: application/json' \
  --data-raw '{"email":"demo@teavaro.com"}'

Response

The response body contains a JSON object, with all key-value pairs from the request, where the keys are left unchanged and the values are replaced with their respective encrypted values.

Content-Type

application/json

Body

JSON
{"email":"peXpe_IG8zX9lLMx58zpyj6DmjWexJmll6e9NYQPWK1tl5qiLLFu_hgbhG9Fag=="}

HTTP Status Codes

200

Success. Request was successfully processed.

400

Bad Request. The JSON body is invalid.

404

Not Found. Incorrect request method, path or pipeline does not exist.

413

Payload Too Large. The request headers, body or any key or value of the key-value pairs is larger than the configured maximum on the server.

500

Server error.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.