Hash & Encrypt API Documentation
Complete reference for the Hash & Encrypt API
Authentication
Pass your API key via header or query parameter:
Authorization: Bearer sk_live_your_key_here
Query: ?api_key=sk_live_your_key_here
POST /v1/crypto/process
A single endpoint for all crypto operations. The action parameter determines the operation.
Common Parameters
| Field | Type | Description |
|---|---|---|
action | string | Operation: hash, hmac, bcrypt_hash, bcrypt_verify, encrypt, decrypt, uuid, random_password, base64_encode, base64_decode |
input | string | Input text (required for most actions, not uuid/random_password) |
Actions
hash
Hash input with any algorithm. Extra param: algorithm (default: sha256)
hmac
HMAC signature. Extra params: algorithm, key (required)
bcrypt_hash
Bcrypt hash. Extra param: cost (4-15, default: 10)
bcrypt_verify
Verify password against bcrypt hash. Extra param: hash (required)
encrypt / decrypt
AES-256-CBC encryption/decryption. Extra param: passphrase (required)
uuid
Generate a cryptographically secure UUID v4. No input needed.
random_password
Generate secure password. Extra params: length (8-128), uppercase, lowercase, numbers, symbols (booleans)
base64_encode / base64_decode
Encode or decode base64 strings.
Examples
SHA-256 Hash
curl -X POST "https://snapapis.com/api/v1/crypto/process" \ -H "Authorization: Bearer YOUR_KEY" \ -d '{"action":"hash","input":"hello world","algorithm":"sha256"}'
Generate Password
curl -X POST "https://snapapis.com/api/v1/crypto/process" \ -H "Authorization: Bearer YOUR_KEY" \ -d '{"action":"random_password","length":24,"symbols":true}'