Open Encrypt REST API (1.0.0)

Download OpenAPI specification:

Generate a key pair

header Parameters
X-API-Key
string
Default: open-encrypt-public-api-key

The public API key for authentication.

Request Body schema: application/json
required
method
required
string

The cryptographic method to use.

Responses

Request samples

Content type
application/json
{
  • "method": "ring_lwe"
}

Response samples

Content type
application/json
{
  • "public_key": "AAgAAAAAAAB+BwAAAAAAAI0N...",
  • "secret_key": "AAQAAAAAAAAAAAAAAAAAAP..."
}

Encrypt a plaintext message

header Parameters
X-API-Key
string
Default: open-encrypt-public-api-key

The public API key for authentication.

Request Body schema: application/json
required
method
required
string
plaintext
required
string
public_key
required
string

Base64-encoded public key

Responses

Request samples

Content type
application/json
{
  • "method": "ring_lwe",
  • "plaintext": "Hello world!",
  • "public_key": "AAgAAAAAAAB+BwAAAAAAAI0N..."
}

Response samples

Content type
application/json
{
  • "ciphertext": "AAgAAAAAAAATEgAAAAAAAPT3..."
}

Decrypt a ciphertext message

header Parameters
X-API-Key
string
Default: open-encrypt-public-api-key

The public API key for authentication.

Request Body schema: application/json
required
method
required
string
secret_key
required
string

Base64-encoded secret key

ciphertext
required
string

Responses

Request samples

Content type
application/json
{
  • "method": "ring_lwe",
  • "secret_key": "AAQAAAAAAAAAAAAAAAAAAP...",
  • "ciphertext": "AAgAAAAAAAATEgAAAAAAAPT3..."
}

Response samples

Content type
application/json
{
  • "plaintext": "Hello world!"
}

API health check

header Parameters
X-API-Key
string
Default: open-encrypt-public-api-key

The public API key for authentication.

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "timestamp": 1700000000,
  • "message": "API is healthy"
}