Crittora Logo
Getting StartedChangelogContact Support

Decrypt API

POST

https://managed.crittoraapis.com/v1/decrypt

This endpoint authenticates a user via AWS Cognito and securely decrypts data using Crittora's API. It's intended for secure backend decryption operations using valid credentials.

Purpose

The Decrypt API provides a secure way to decrypt previously encrypted data by authenticating users through AWS Cognito and leveraging the Crittora Decryption API. This endpoint acts as a secure proxy, ensuring your encrypted data is safely decrypted using industry-standard methods.


API Details

Headers
HeaderTypeDescriptionRequired
usernamestringCognito username
Yes
passwordstringCognito password
Yes
api_keystringPartner-level API key from Crittora
Yes
access_keystringPartner access key from Crittora
Yes
secret_keystringPartner secret key from Crittora
Yes
Request Body
{
  "encrypted_data": "base64_encoded_ciphertext"
}
FieldTypeDescriptionRequired
encrypted_datastringBase64-encoded encrypted data to decrypt
Yes
Response

Successful response (HTTP 200) returns the decrypted payload from Crittora in JSON format.

Example Response:
{
  "statusCode": 200,
  "body": {
    "decrypted_data": "sensitive information to encrypt"
  }
}
Status Codes

HTTP status codes returned by the decrypt endpoint.

Success Codes
CodeNameDescriptionUsageExample

200

OK

Successfully decrypted data

Request completed successfully

Decryption operation completed

Error Codes
CodeNameDescriptionUsageExample

500

Internal Server Error

Username and/or Password Incorrect

Authentication credentials are invalid

Invalid AWS Cognito username or password

Code Examples
cURL Example:
curl -X POST https://managed.crittoraapis.com/v1/decrypt \
  -H "Content-Type: application/json" \
  -H "username: your_cognito_username" \
  -H "password: your_cognito_password" \
  -H "api_key: your_crittora_api_key" \
  -H "access_key: your_crittora_access_key" \
  -H "secret_key: your_crittora_secret_key" \
  -d '{
    "encrypted_data": "eyJkYXRhIjoiZW5jcnlwdGVkX2Jhc2U2NF9zdHJpbmciLCJhbGdvcml0aG0iOiJBQ0VTLTI1Ni1HQ00ifQ=="
  }'

JavaScript Example:
// Using fetch API
const decryptData = async (encryptedData) => {
  const response = await fetch('https://managed.crittoraapis.com/v1/decrypt', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'username': 'your_cognito_username',
      'password': 'your_cognito_password',
      'api_key': 'your_crittora_api_key',
      'access_key': 'your_crittora_access_key',
      'secret_key': 'your_crittora_secret_key'
    },
    body: JSON.stringify({ encrypted_data: encryptedData })
  });
  
  return await response.json();
};

Python Example:
import requests

def decrypt_data(encrypted_data):
    url = "https://managed.crittoraapis.com/v1/decrypt"
    headers = {
        "Content-Type": "application/json",
        "username": "your_cognito_username",
        "password": "your_cognito_password",
        "api_key": "your_crittora_api_key",
        "access_key": "your_crittora_access_key",
        "secret_key": "your_crittora_secret_key"
    }
    
    payload = {"encrypted_data": encrypted_data}
    response = requests.post(url, headers=headers, json=payload)
    return response.json()
Process Flow
  1. Client sends a POST request with Cognito credentials (username, password), Crittora partner credentials (api_key, access_key, secret_key), and encrypted data in JSON body.
  2. Lambda authenticates with AWS Cognito to get an access token.
  3. Lambda constructs a request to Crittora's /decrypt endpoint:
    • Includes auth token and partner credentials
    • Sends the encrypted data
  4. The decrypted data is returned from Crittora and passed directly back to the client.

Try it out: Use the interactive API interface below to test the decrypt endpoint with your encrypted data.

Loading API specification...

Powered by AWS • Partner Technology • Patent Pending PQC Technology