/encrypt Endpoint
The /encrypt
endpoint accepts plaintext input and returns an encrypted result using a time-derived encryption key. It supports encryption of short messages, sensitive strings, or login values.
📤 Request
POST https://api.epochlock.com/encrypt
🔐 Required Headers
X-TIMESTAMP
: Client-side UNIX timestamp in millisecondsX-API-KEY
: SHA-256 hash of the timestamp + secretX-EMAIL
: Your EpochLock account email
📝 JSON Body Parameters
- data (string): The plaintext string to encrypt
- mode ("text" | "file"): Defaults to
"text"
- include_decryption_info (boolean): Set to
true
to includeentropy
andtimestamp
in the response (recommended)
📥 Response
Returns JSON containing:
encrypted
: The encrypted string (Base64 encoded)timestamp
: Timestamp used (optional if requested)entropy
: Entropy seed (optional if requested)
{
"encrypted": "MDAwQkM1QzY...",
"timestamp": "1713904356241",
"entropy": 412189412
}
❌ Error Responses
403
- Invalid or expired API key429
- Rate limit exceeded400
- Missing or invalid parameters
📚 Next Step:
To decrypt encrypted values, proceed to the /decrypt documentation.