Text

AES Advanced Decryption

0calls
1 credits / call

Need to decrypt data encrypted through the advanced encryption endpoint? This endpoint provides decryption functionality fully paired with the encryption endpoint, supporting the same 6 encryption modes and 3 padding methods.

Important

Decryption parameters must match encryption When decrypting, you must provide the same key, mode, and padding method used during encryption. For non-GCM modes, you also need to provide the IV returned during encryption.

Overview

This is a complete AES decryption endpoint capable of decrypting all ciphertexts encrypted through the advanced encryption endpoint. Supports all 6 encryption modes and 3 padding methods, fully paired with the encryption endpoint.

Decryption Process

  1. Obtain ciphertext and configuration parameters returned during encryption
  2. Use the same key, mode, padding method and IV (if required)
  3. Call this endpoint for decryption
  4. Retrieve original plaintext

Supported Decryption Modes

  • GCM Mode (Recommended): Automatically verifies data integrity, decryption will fail if ciphertext is tampered
  • CBC Mode: Classic block decryption mode, requires IV from encryption
  • CTR/OFB/CFB Mode: Stream cipher decryption, requires IV from encryption
  • ECB Mode: Does not require IV, but has lower security

Padding Method Handling

  • PKCS7 Padding: Automatically removes padding after decryption
  • Zero Padding: Automatically removes 0x00 padding after decryption
  • None Padding: No padding processing

Parameter Description

  • text: Ciphertext to decrypt (Base64 encoded, from ciphertext field returned by encryption endpoint)
  • key: Decryption key (must be same as encryption)
  • mode: Encryption mode (must be same as encryption)
  • padding: Padding method (optional, default PKCS7, must be same as encryption)
  • iv: Initialization vector (required for non-GCM modes, Base64 encoded)

Common Error Handling

If decryption fails, please check the following:

  • Whether the key is exactly the same as during encryption
  • Whether mode and padding method match
  • Whether correct IV was provided for non-GCM modes
  • Whether ciphertext is complete and unmodified
  • Whether ciphertext was tampered in GCM mode

Request body

text
stringrequired

Ciphertext to decrypt (Base64 encoded). This value comes from the ciphertext field returned by the encryption interface

key
stringrequired

Decryption key (must be the same as encryption)

mode
stringrequired

Encryption mode (must be the same as encryption): GCM/CBC/ECB/CTR/OFB/CFB

padding
stringoptional

Padding method (optional, must be the same as encryption): PKCS7/ZERO/NONE. GCM mode defaults to NONE

iv
stringoptional

Initialization vector (required for non-GCM modes, Base64 encoded). This value comes from the iv field returned by the encryption interface

Response

200 / OK

Decryption successful, returns original plaintext

JSON

400 / Bad Request

Invalid request parameters or decryption failed

JSON