-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to match the code with a flutter library? #44
Comments
I just encountered this myself and had to investigate since i needed interoperability. The problem is that dart-otp has a different behavior due to the
However this library hardcodes a zero-extension padding and always extends the key to a multiple of 16 bytes here: Otp.NET/src/Otp.NET/InMemoryKey.cs Lines 71 to 74 in 0ac3c31
in OP's case the fix is to set
This produces the OTP value 500288 which is different from what OP claims but i get the same result when running the first dart snippet, not sure why. As i don't know the RFC standard i can't tell which library is wrong here, i can say that i also tested a nodejs library and with no additional tweaking it seems to agree with otp-dart, making this implementation the odd one out (at least as far as defaults go) |
@tareq2 Is the DateTime value passed to ComputeTotp in UTC format? It should be a UTC DateTime value. |
Hello everyone,
I am using the library dart-otp in a flutter app that generate the code and i need to validate this code in c# but i couldn't validate this code nor generate the same code from the two libraries.
The code in flutter/dart is
In C# the code is
Can anyone help to figure this difference?
The text was updated successfully, but these errors were encountered: