ns_totp - Returns a decimal-coded time-based one-time password (TOTP)
The function returns a time-based one time password (TOTP) as described in RFC-6238. The function uses the HOTP function of RFC-4226 but adds the possibility to restrict the validity of the password to a time window.
RFC-6238 defines TOTP as:
TOTP = HOTP(K, T), where T is an integer K: key T: time slice (moving factor for one time passwd)
The implemented function ns_totp is a generalization by allowing to specify the message digest algorithm, the number of characters of the returned truncated value, a used_id and a time.
The listed command is available in installations when NaviServer is compiled with OpenSSL support and where the nsf package is installed.
nscp 2> ns_totp -key "tweedie123" -time 1471107671 33888450
ns_section "ns/server/server1" ns_param serversecret "swordfish"