GET /v1/secure-compareSecure constant-time compare
Security Utils lf-security-utils
Checks whether two secret strings match without leaking clues to anyone watching. Performs a constant-time string comparison that is safe against timing attacks. Returns whether two strings match.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
a | string | Yes | First string |
b | string | Yes | Second string |
encoding | string | No | Input encoding |
Response Schema
success (boolean): Operation success
match (boolean): Whether strings match
length (integer): Length compared
cURL Example
curl 'https://lf-security-utils.laminarforge.dev/v1/secure-compare?a=hello&b=hello' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-security-utils.laminarforge.dev/v1/secure-compare'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'a': 'hello', 'b': 'hello'}
response = requests.get(url, headers=headers, params=params)
print(response.json())