Secure AES Encryption API

Comprehensive documentation for our encryption service

HOME

Introduction

This API provides AES-256-CBC encryption and decryption services. All cryptographic operations are performed using the Web Crypto API in the browser, ensuring your data never leaves your device.

Important: The encryption key is hashed using SHA-256 before being used. You must use the same key for decryption that was used for encryption.

Authentication

This API does not require authentication. All security is handled through the encryption key you provide.

Base URL

https://asetarek.iamsigmaboy.workers.dev

Endpoints

POST

Encrypt Text

Encrypts plaintext using AES-256-CBC with a key derived from your input.

Request Parameters

Parameter Type Required Description
action String Required Must be set to "encrypt"
text String Required Plaintext to encrypt
key String Required Encryption key (will be hashed with SHA-256)

Example Request

{
  "action": "encrypt",
  "text": "This is a secret message",
  "key": "my-secret-password"
}

Example Response

{
  "status": "success",
  "action": "encrypt",
  "result": "8J+UkQ...long-encrypted-string...QkJCQ==",
  "algorithm": "AES-CBC",
  "key_hash": "SHA-256"
}
POST

Decrypt Text

Decrypts ciphertext using AES-256-CBC with the original key.

Request Parameters

Parameter Type Required Description
action String Required Must be set to "decrypt"
text String Required Encrypted text to decrypt (base64 encoded)
key String Required Original encryption key

Example Request

{
  "action": "decrypt",
  "text": "8J+UkQ...long-encrypted-string...QkJCQ==",
  "key": "my-secret-password"
}

Example Response

{
  "status": "success",
  "action": "decrypt",
  "result": "This is a secret message",
  "algorithm": "AES-CBC",
  "key_hash": "SHA-256"
}

Error Responses

Missing Parameters

{
  "status": "error",
  "message": "Missing parameters",
  "required": ["action", "text", "key"],
  "received": ["action", "text"]
}

Invalid Action

{
  "status": "error",
  "message": "Invalid action",
  "valid_actions": ["encrypt", "decrypt"]
}

Decryption Error

{
  "status": "error",
  "message": "Processing error",
  "details": "The operation failed for some reason"
}

© 2026 Secure AES Encryption Service. All rights reserved.