Hi!
I have a little problem. The code generated by ComputeTotp is different from the one shown in Google Authenticator.
I generate a base32 key like this (code in VB)
Dim secretKey As Byte() = KeyGeneration.GenerateRandomKey()
Dim base32String As String = Base32Encoding.ToString(secretKey )
I pass this base32String as secret to the QR I generate (I also tried entering the key manually, both generates the same random codes)
Then, when I try to validate the code, the generated code is different from the one in Google. Heres my code:
Dim secretKeyData As Byte() = Base32Encoding.ToBytes(secretKey)
Dim totp As New Totp(secretKeyData)
Dim validCode As String = totp.ComputeTotp()
'validCode is different from the one that appears on Google Authenticator
This is one of the keys that was randomly generated: 4FY2PLSR6WZ5V72YQS5SAE3VRPQRGWLQ
Hi! I have a little problem. The code generated by ComputeTotp is different from the one shown in Google Authenticator.
I generate a base32 key like this (code in VB)
I pass this base32String as secret to the QR I generate (I also tried entering the key manually, both generates the same random codes)
Then, when I try to validate the code, the generated code is different from the one in Google. Heres my code:
This is one of the keys that was randomly generated: 4FY2PLSR6WZ5V72YQS5SAE3VRPQRGWLQ
Any clue in what im doing wrong?
Thanks!