Server gửi một challenge (nonce ngẫu nhiên). Client biết secret sẽ trả lời response = HMAC-SHA256(secret, challenge). Server tính lại và so sánh — secret không bao giờ truyền trên đường truyền.
Cho secret, challenge, và response (hex) client gửi, in ACCEPT nếu đúng, ngược lại REJECT.
Input:
sharedsecret
nonce-42
(response hex)
Output:
ACCEPT / REJECT
Dòng 1: secret. Dòng 2: challenge. Dòng 3: response (HMAC-SHA256 hex).
secret, challenge dài 1..256 ký tự; response 64 ký tự hex.
Một dòng: ACCEPT hoặc REJECT.
Ví dụ:
Đầu vào:
sharedsecret
nonce-42
8c0a3f9d0c1e...
Đầu ra:
REJECT
Giải thích:
Đang tải editor...