You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README-RU.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,13 +226,15 @@ int otp = get_totp_code_at(key, time_at);
226
226
227
227
### 🕓 Временные токены на основе HMAC (Custom HMAC Time Tokens)
228
228
229
-
Библиотека также включает **облегчённую реализацию временных HMAC-токенов**, не связанную напрямую с RFC 4226/6238 (HOTP/TOTP). Эти токены:
230
-
231
-
- Основаны на `HMAC(timestamp)`
232
-
- Возвращаются в виде `hex`-строки
233
-
- Не требуют хранения состояния (stateless)
234
-
- Поддерживают привязку к отпечатку клиента (например, ID устройства)
235
-
- Поддерживают `SHA1`, `SHA256` и `SHA512`
229
+
Библиотека также включает **облегчённую реализацию временных HMAC-токенов**. Это **не** TOTP/HOTP; используется простой механизм `HMAC(timestamp)`. Эти токены:
230
+
231
+
- Основаны на `HMAC(timestamp)` — не TOTP/HOTP
232
+
- По умолчанию применяется `SHA256` (поддерживаются также `SHA1` и `SHA512`)
233
+
- Тег — полный HMAC: 32 байта (64 hex-символа) при `SHA256`
234
+
- Кодирование: `hex` в нижнем регистре
235
+
- Токен принимается для предыдущего, текущего и следующего интервала (±`interval_sec`)
236
+
- Не требуют хранения состояния и могут привязываться к *отпечатку клиента* (например, ID устройства)
237
+
- Обеспечивают базовую защиту от повторного воспроизведения и подходят только для задач с низким риском
Copy file name to clipboardExpand all lines: README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -267,13 +267,16 @@ int otp = get_totp_code_at(key, time_at);
267
267
268
268
### 🕓 Time-Based HMAC Tokens (Custom HMAC Time Tokens)
269
269
270
-
The library also includes a **lightweight implementation of time-based HMAC tokens**, which are not directly based on RFC 4226/6238 (HOTP/TOTP). These tokens:
270
+
The library also includes a **lightweight implementation of time-based HMAC tokens**. This is *not* TOTP or HOTP; it's a simple `HMAC(timestamp)` approach. These tokens:
271
271
272
272
- Are based on `HMAC(timestamp)`
273
-
- Are returned as `hex` strings
273
+
- Default to `SHA256` but also support `SHA1` and `SHA512`
274
+
- Use the full HMAC digest as the tag (32 bytes → 64 hex chars with `SHA256`)
275
+
- Are returned as lowercase `hex` strings
276
+
- Are valid for the previous, current, and next interval (±`interval_sec`)
274
277
- Require no server-side state (stateless)
275
278
- Support binding to a *client fingerprint* (e.g. device ID)
276
-
-Support `SHA1`, `SHA256`, and `SHA512`
279
+
-Provide basic replay protection and are intended for low-risk scenarios
0 commit comments