Hash/Kripto
TOTP Generator/Verifier
Kata sandi sekali pakai berbasis waktu (TOTP, RFC 6238) — hasilkan kode saat ini dari secret dan verifikasi kode yang dimasukkan dengan toleransi pergeseran waktu.
------
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.
Artikel tentang alat ini: TOTP: bagaimana kode sekali pakai di aplikasi autentikator bekerja
Pertanyaan yang sering diajukan
Mengapa kode yang dihasilkan cepat kedaluwarsa?
Kode TOTP berbasis waktu — secara default berputar setiap 30 detik, dihitung dari waktu Unix saat ini dan rahasia bersama. Jendela singkat ini membatasi berapa lama kode yang bocor tetap berguna.
Apa yang terjadi jika jam perangkat saya tidak sinkron?
TOTP bergantung pada kedua belah pihak yang sepakat mendekati waktu saat ini. Sebagian besar aplikasi autentikator dan server mengizinkan toleransi pergeseran jam kecil (biasanya satu langkah waktu), tetapi pergeseran lebih besar akan menyebabkan kode valid ditolak.
Apakah kunci rahasia saya dikirim ke suatu tempat saat menghasilkan kode di sini?
Tidak. Kode TOTP dihitung sepenuhnya di browser Anda — kunci rahasia tidak pernah meninggalkan perangkat Anda.
Apakah TOTP melindungi dari phishing?
Tidak sepenuhnya. Jika korban memasukkan kata sandi dan kode TOTP saat ini di situs palsu, penyerang dapat langsung menggunakan kedua nilai tersebut di situs asli selagi kode masih berlaku. Hanya kunci perangkat keras dengan standar FIDO2/WebAuthn yang melindungi dari serangan real-time semacam ini.
Mengapa server juga menerima interval waktu sebelumnya, bukan hanya yang saat ini?
Ini mengompensasi sedikit keterlambatan jaringan antara pembuatan kode di ponsel dan saat server menerima serta memverifikasinya. Tanpa toleransi ini, kode yang sah kadang akan ditolak hanya karena keterlambatan beberapa detik yang wajar.