Crypto & Security 1 credit COMPUTE

AES Encrypt API

Encrypt data using AES-256-GCM authenticated encryption via REST API. AES-256-GCM provides both confidentiality and integrity — the authentication tag detects any tampering with the ciphertext. Each call generates a random IV for semantic security.

Try it live →

How it works

POST your plaintext and a 256-bit key (64 hex characters). The API generates a random 12-byte IV, encrypts with AES-256-GCM, and returns the IV, ciphertext, and authentication tag as hex strings. Store all three together — you need them all to decrypt.

Use cases

API Reference

POST https://slopshop.gg/v1/crypto-encrypt-aes
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input parameters

ParameterTypeRequiredDescription
input / data string required The input data to hash or process

Example response

{
  "data": {
    "result": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "algorithm": "encrypt-aes"
  },
  "meta": {
    "credits_used": 1,
    "engine": "real",
    "ms": 4
  }
}

Examples

Three real-world scenarios showing how developers use AES Encrypt in production.

Example 1
Encrypt API credentials
Encrypt a third-party API key before storing it in the database.
curl -X POST https://slopshop.gg/v1/crypto-encrypt-aes \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"plaintext": "sk-openai-abc123xyz", "key": "0000000000000000000000000000000000000000000000000000000000000001"}'
Example 2
Encrypt PII field
Encrypt a Social Security Number before saving to a record.
curl -X POST https://slopshop.gg/v1/crypto-encrypt-aes \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"plaintext": "123-45-6789", "key": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"}'
Example 3
Encrypt config value
Encrypt a database password to store in a config file.
curl -X POST https://slopshop.gg/v1/crypto-encrypt-aes \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"plaintext": "prod-db-password-super-secret", "key": "cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabe"}'

Code examples

curl

curl -X POST https://slopshop.gg/v1/crypto-encrypt-aes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "your data here"}'

Python

import requests

response = requests.post(
    "https://slopshop.gg/v1/crypto-encrypt-aes",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"input": "your data here"}
)
result = response.json()
print(result["data"])

Node.js

const response = await fetch("https://slopshop.gg/v1/crypto-encrypt-aes", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);

CLI

# Install the Slopshop CLI
npm install -g slopshop

# Set your API key
export SLOPSHOP_KEY=your_api_key

# Call crypto-encrypt-aes
slop crypto-encrypt-aes '{"input": "your data here"}'

Pricing

Credits per call
1
credits
Cost per call
$0.001
at Starter tier
Tier
COMPUTE
Pure compute

Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 1 credit per call — that's $0.001. See all pricing tiers.

Related APIs in Crypto & Security

View the full API catalog · Try in playground · Documentation