A Delphi library for generating one-time passwords according to RFC 4226 (HOTP Algorithm) and RFC 6238 (TOTP Algorithm).
uses
OTP;
var
LSecret: string;
begin
LSecret := TOTPSecretGenerator.New
.SetKeyLength(10)
.Generate;
end.
uses
OTP;
var
LToken: UInt32;
begin
LToken := TOTPCalculator.New
.SetSecret('MYSECRETBASE32')
.SetAlgorithm(TAlgorithm.SHA1) //sha1, sha2*, md5
.Calculate;
end.
uses
OTP;
begin
TOTPValidator.New(
TOTPCalculator
.New
.SetSecret('MYSECRETBASE32')
)
.SetToken(102030)
.Validate;
end.