Cipherion
API Key Reference

Decrypt

Decrypt an encrypted package back to plain text using the Cipherion API

Decrypt Data

Decrypts an encrypted package back to its original plain text using the passphrase that was used during encryption.

Endpoint

POST /decrypt/:projectId

You must use the same passphrase that was used to encrypt the data. Using a different passphrase will result in a 400 error.


Request

Path Parameters

ParameterTypeRequiredDescription
projectIdstringYesYour project identifier

Headers

HeaderRequiredDescription
x-api-keyYesYour Cipherion API key
Content-TypeYesMust be application/json

Body

ParameterTypeRequiredDescription
datastringYesThe encrypted package to decrypt (the encrypted_output from /encrypt)
passphrasestringYesThe original passphrase used during encryption

Example Request

Method: POST
URL: https://api.cipherion.in/api/v1/crypto/decrypt/YOUR_PROJECT_ID

Headers:
x-api-key: YOUR_API_KEY
Content-Type: application/json

Body (raw JSON):
{
  "data": "a2c8d832ab28c....Encrypted Package",
  "passphrase": "your-secure-passphrase"
}
{
  "data": "a2c8d832ab28c....Encrypted Package",
  "passphrase": "your-secure-passphrase"
}
curl -X POST https://api.cipherion.in/api/v1/crypto/decrypt/YOUR_PROJECT_ID \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": "a2c8d832ab28c....Encrypted Package",
    "passphrase": "your-secure-passphrase"
  }'

Responses

200 OK — Success

{
  "success": true,
  "statusCode": 200,
  "message": "Data decrypted successfully",
  "data": {
    "plaintext": "Hello"
  },
  "timestamp": "2025-12-24T06:20:46.618Z"
}
FieldTypeDescription
data.plaintextstringThe decrypted original string

400 Bad Request — Missing Fields

Returned when projectId, x-api-key, data (encrypted package), or passphrase is absent.

{
  "success": false,
  "statusCode": 400,
  "message": "Missing required fields: projectId, x-api-key header, encrypted_package, or passphrase",
  "data": null,
  "timestamp": "2026-05-29T00:00:00.000Z"
}

400 Bad Request — Corrupted Package

Returned when the encrypted package is malformed or has been modified.

{
  "success": false,
  "statusCode": 400,
  "message": "Encrypted package is corrupted or malformed.",
  "data": null,
  "error": {
    "statusCode": 400,
    "isOperational": "Encrypted package is corrupted or malformed."
  },
  "timestamp": "2025-12-24T06:22:04.208Z"
}

400 Bad Request — Invalid or wrong Passphrase

Returned when the passphrase is invalid.

{
    "success": false,
    "statusCode": 400,
    "message": "Failed to unwrap AES key: possible invalid passphrase or corrupted data.",
    "data": null,
    "error": {
        "statusCode": 400,
        "isOperational": true
    },
    "timestamp": "2026-05-29T11:00:42.946Z"
}

401 Unauthorized

{
  "success": false,
  "statusCode": 401,
  "message": "Invalid project or API key",
  "data": null,
  "error": {
    "statusCode": 401,
    "isOperational": true
  },
  "timestamp": "2025-12-24T06:18:26.585Z"
}

429 Too Many Requests

Returned when your billing period quota is exhausted and overage is not enabled.

{
  "success": false,
  "statusCode": 429,
  "message": "decryption quota exceeded: your plan includes X calls per billing period...",
  "data": null,
  "timestamp": "2026-05-29T00:00:00.000Z"
}

500 Internal Server Error

{
  "success": false,
  "statusCode": 500,
  "message": "Decryption failed",
  "data": null,
  "error": {},
  "timestamp": "2026-05-29T00:00:00.000Z"
}

Notes

  • The data field must be the unmodified encrypted_output value returned by the /encrypt endpoint.
  • Never manually alter the encrypted package string. Even a single character change will cause decryption to fail.
  • See the Encrypted Package Format section for details on the internal structure.

On this page