NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #1355 most downloaded on pub.dev
RFC6238 Time-Based One-Time Password / Google Authenticator Library
Latest stable
3.2.1
Last release 1 months ago
28 Sep 2026
Release timing varies
gaps range from 4 weeks to 2.3 years
Nearly every release is documented
notes for 29 of 30 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
31 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
Update timezone to 0.11.0 (Thanks @EdsonMello-code)
Update timezone to 0.10.0 (Thanks @NM4ik)
Full Changelog: https://github.com/daegalus/dart-otp/compare/3.1.4...3.2.0
Allow lowercase base32 strings if isGoogle is set to true by @amadejkastelic in https://github.com/daegalus/dart-otp/pull/46
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: https://github.com/daegalus/dart-otp/compare/v3.1.2...3.1.4
Fix incorrect padding logic
Fix incorrect padding logic
- Allow isGoogle flag for HOTP
Loosen version constraint on the crypto so that there is no conflict between our library and those requiring 3.0.1 or 3.0.0. crypto versions 3.0.1 and
crypto so that there is no conflict between our library and those requiring 3.0.1 or 3.0.0. crypto versions 3.0.1 and 3.0.2 don't affect this library or are just doc/link fixes.Bug where all secrets were being treated as Base32 by default, when RFC default is ASCII. Base32 is only when using Google Authenticator mode. This ca
notp and otplib to verify my outputs.Partially change behavior, if it is invalid Base32, it should throw, but in certain cases, it still doesn't throw, so we do fallback behavior.
Fix when secrets are not Base32 causing infinite loops because the resulting list is size 0.
Add remainingSeconds() in order to calculate the remaining seconds based on lastUsedTime. (thanks @AkbarAsghari)
remainingSeconds() in order to calculate the remaining seconds based on lastUsedTime. (thanks @AkbarAsghari)Add lastUsedTime and lastUsedCounter to provide additional information for users and potential debugging points.
lastUsedTime and lastUsedCounter to provide additional information for users and potential debugging points.- Docs and file cleanup
Jump to bottom Edit New page
Yulian Kuncheff edited this page Jun 20, 2022 · 1 revision
This page is written to better explain the semi-breaking changes made from 3.0 to 3.1.
So for a bit of background. the RFC specs for TOTP codes specifies that the secret passed into TOTP just needs to be a string of any content. It gets decoded into bytes, and used as the secret. But Google and Google Authenticator decided that the string needs to be Base32 and decoded from Base32 into the bytes it needs to be.
Since I think all or almost all Authenticators clients (the apps or tools used to generate the code for logging in) are implemented to be compatible with Google Authenticator, they all default to taking in Base32 codes so they can properly work with Google. Now most websites and companies also follow this pattern, all using Base32 because Google did it.
Problem here is the RFC spec doesn't specify anything about Base32, and ignores encoding. This causes a split in logic that I somewhat forgot about when implementing my functions. The main problem was I was enforcing all secrets be Base32, even when isGoogle was set to false .
Now this went under the radar for nearly 3 major versions. I have tests using the RFC data sets, but they didn't catch this because I was encoding the secret as Base32 so that it would go into my functions cleanly, again not realizing why I was doing that and that I shouldn't.
Then recently, Issue #39 was opened, stating that I wasn't generating the same codes as javascript libraries otplib and notp . While I can understand 1 library being different, and I have had issues in the past where I wasn't matching a third party library, but it was a bug in the other library, this was 2 libraries at the same time, with very different implementations.
So once I started digging, I realized the mistake in the code. I was forcing Base32 decoding, but if you used a Base32 valid string, that wasn't supposed to be treated as base32 (aka isGoogle: false ) then I would be generating the wrong Base32 code.
So, once I fixed that, fixed my tests, and verified against multiple other libraries, I released 3.1. While this was a fairly important bug fix, I didn't think it was big enough for a Major version change. Also, this was fixing a bug that was generating the wrong codes in this particular situation, and now generating the right codes.
So you might be asking how this affects you?
If you were using isGoogle: true , then nothing changes. The same codes will generate, and you won't notice a thing. (this is also because Google uses a different padding pattern than the RFC, so there were already differences in the codes generated).
If you were using isGoogle: false , then the codes you generate, will be different. But they will be correct, so they shouldn't break any end-user experience. If anything it will improve it. If you were using dart on backend and frontend though, you won't notice a change as the codes will still match because your secret didn't change, it just how I was processing the secret.
Hopefully this makes more sense on why the change was made and how it affects you.
Add a custom footer
Add a custom sidebar
You can’t perform that action at this time.
- Nullsafety conversion
Improve pub package score (thanks @DavBfr)
Update quick_log to latest version
Correctly use Google Auth flag (isGoogle) to disable padding. (thanks hpoul)
isGoogle) to disable padding. (thanks hpoul)Add Google Auth flag, because they do SHA1 TOTP without Padding the secret.
Fix secret paddding to follow proper TOTP secret padding and sizing for SHA256, SHA512
Fix type error at runtime for RandomSecret generation. MR #14 (thanks readytopark)
Switch to crypto lib inplace of PointyCastle for HMAC
No changes from rc1, accepting the 1-3 second timing difference between constant time code checks until someone can help me figure out how to make it
Nothing published for this version
Switched to PointyCastle for crypto and support for more than SHA1 hashing for tokens (amadejkastelic)
Add new TOTP interval parameters (optional)
- Cleanup and remove dead code
- Dart 2.0 updates
- Dart 1.0 Readiness
- Fixing crypto library.
- Fixing language changes.
No functionality changes, just fixing a bad file state it git and in the package involving the case of the file.
- Initial Documented Release
One column per quarter.