Hash/Kripto
TOTP Generator/Verifier
Zamana dayalı tek kullanımlık parolalar (TOTP, RFC 6238) — bir gizli anahtardan mevcut kodu üretin ve saat kaymasına tolerans göstererek girilen bir kodu doğrulayın.
------
TOTP (Time-based One-Time Password, RFC 6238) is a two-factor authentication algorithm that generates a one-time code from a secret and the current time. It's exactly what runs under the hood in Google Authenticator, Authy, and similar apps.
How to use it
- Generate: paste a secret key (usually Base32, the same one encoded in a 2FA setup QR code) and the tool shows the current 6-digit code along with the time left before it changes.
- Verify: enter a secret and a code from an authenticator app to check whether they match.
- Verification tolerates a small amount of clock drift — it accepts a code from a neighboring time step, not just the current one.
Common uses
- Debugging your own 2FA implementation on the backend — checking that the server generates and accepts codes correctly.
- Manually generating a code for an account when you don't have your phone with the authenticator app handy.
- Figuring out why an app's code is being rejected by the server (usually the cause is a clock out of sync).
Things to keep in mind
A TOTP code is only valid for a short window (usually 30 seconds) — that time limit is the main protection, not the secret alone.
Code accuracy depends directly on the device's clock being synced; a noticeable clock drift is the most common cause of rejected 2FA codes.
Sıkça sorulan sorular
Oluşturduğum kod neden bu kadar hızlı sona eriyor?
TOTP kodları zamana dayalıdır — varsayılan olarak, mevcut Unix zamanı ve paylaşılan sırdan hesaplanarak her 30 saniyede bir değişirler. Bu kısa pencere, sızan bir kodun ne kadar süre kullanışlı kalacağını sınırlar.
Cihazımın saati senkron değilse ne olur?
TOTP, her iki tarafın mevcut zaman konusunda birbirine yakın olmasına dayanır. Çoğu doğrulayıcı uygulama ve sunucu küçük bir saat kayması toleransına (genellikle bir zaman adımı) izin verir, ancak daha büyük bir kayma geçerli kodların reddedilmesine neden olur.
Burada kod oluştururken gizli anahtarım bir yere gönderiliyor mu?
Hayır. TOTP kodu tamamen tarayıcınızda hesaplanır — gizli anahtar cihazınızdan asla çıkmaz.
TOTP kimlik avına karşı korur mu?
Tam olarak değil. Kurban parolasını ve geçerli TOTP kodunu sahte bir sitede girerse, saldırgan kod hâlâ geçerliyken her iki değeri de gerçek sitede anında kullanabilir. Bu gerçek zamanlı saldırıya karşı yalnızca FIDO2/WebAuthn standardına dayalı donanım anahtarları koruma sağlar.
Sunucu neden yalnızca geçerli değil, bir önceki zaman aralığını da kabul eder?
Bu, telefonda kod oluşturma anı ile sunucunun kodu alıp doğruladığı an arasındaki küçük ağ gecikmesini telafi eder. Böyle bir tolerans olmadan, geçerli kodlar birkaç saniyelik sıradan bir gecikme yüzünden bazen reddedilirdi.