Otp.NET icon indicating copy to clipboard operation
Otp.NET copied to clipboard

TOTP not match If we pass totpSize = 6 and step = 60

Open kalpesh2804 opened this issue 5 months ago • 0 comments

This code result match with Google Authenticator

var base32Bytes = Base32Encoding.ToBytes(key);
var totp = new Totp(base32Bytes);
var totpCode = totp.ComputeTotp();

This code result not match with Google Authenticator

var base32Bytes = Base32Encoding.ToBytes(key);
var totp = new Totp(base32Bytes, totpSize: 6, step: 60);
var totpCode = totp.ComputeTotp();

Google Authenticator URI example

var uriString = new OtpUri(OtpType.Totp, key, "[email protected]", "Test Not Working", digits: 6, period: 60).ToString();

kalpesh2804 avatar Sep 12 '24 18:09 kalpesh2804