⚡
LootlyCasher SDK Documentation
Dashboard

Security

Protect your integration from fraud and ensure reward integrity with these best practices.

Signature Verification

⚠️ Always Verify Signatures
Never skip signature verification. Without it, attackers can forge postback requests and credit themselves rewards they did not earn.

Every postback includes an HMAC-SHA256 signature. To verify:

1
Concatenate Parameters

Join user_id + offer_id + payout + timestamp into a single string.

2
Generate HMAC

Compute HMAC-SHA256 of the concatenated string using your secret key.

3
Compare Signatures

Use a constant-time comparison (e.g. hash_equals in PHP) to compare expected vs received signature.

Replay Attack Prevention

Always check the timestamp parameter:

PSEUDOCODE
// Reject callbacks older than 5 minutes
const MAX_DELAY = 300; // seconds
const now = Math.floor(Date.now() / 1000);
if (Math.abs(now - timestamp) > MAX_DELAY) {
  return res.status(400).send("Timestamp expired");
}