Docs/Security Utils/GET /v1/secure-compare

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

ParameterTypeRequiredDescription
astringYesFirst string
bstringYesSecond string
encodingstringNoInput 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())