protocol
otp_protocol
Protocol for HOTP and TOTP generation and verification as specified in RFC 4226 and RFC 6238.
logtalk_load(otp(loader))staticPublic predicates
hotp/5
Computes an HOTP value for the given hash object, secret, moving counter, and number of digits. The secret can be either a raw byte list or a Base32 wrapper term of the form base32(atom(Atom)), base32(chars(Chars)), or base32(codes(Codes)).
statichotp(Hash,Secret,Counter,Digits,OTP)hotp(+object_identifier,+term,+integer,+integer,--atom) - onetotp/5
Computes a TOTP value using the standard 30-second time step and Unix epoch T0 = 0 for the given hash object, secret, Unix time, and number of digits.
statictotp(Hash,Secret,UnixTime,Digits,OTP)totp(+object_identifier,+term,+integer,+integer,--atom) - onehotp_verify/7
Verifies an HOTP value by searching from the given counter through the bounded forward counter window. Returns the matched counter on success.
statichotp_verify(Hash,Secret,Counter,Window,Digits,OTP,MatchedCounter)hotp_verify(+object_identifier,+term,+integer,+integer,+integer,+atom,--integer) - zero_or_one_or_errortotp_verify/7
Verifies a TOTP value by searching within the bounded symmetric time-step window around the current time step. Returns the matched time step on success.
statictotp_verify(Hash,Secret,UnixTime,Window,Digits,OTP,MatchedTimeStep)totp_verify(+object_identifier,+term,+integer,+integer,+integer,+atom,--integer) - zero_or_one_or_errorProtected predicates
(none)
Private predicates
(none)
Operators
(none)
See also