PackageTrack
Sign in Get early access

pragmarx/google2fa

A One Time Password Authentication package, compatible with Google Authenticator.

v9.1.0 109M downloads/mo #190 most downloaded on composer antonioribeiro/google2fa

What this package is like to depend on

Last release 8 days ago

15 Aug 2026

Release timing varies

gaps range from 9 days to 2.2 years

Some releases are documented

notes for 20 of 36 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

36 releases · first in 2014

2 releases in the last 12 months

see the full history below

Release timeline

36 releases · Sep 2014 to Aug 2026
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 36
  1. v9.1.0 15 Aug 2026
    Release notes

    PHP 8.6 (beta) support, Psalm static analysis, and CI/governance modernization.

    Added

    • PHP 8.6 (beta) added to the CI matrix, with automatic fallback while the
      toolchain catches up
    • Psalm static analysis alongside PHPStan, including psalm/plugin-phpunit so
      the test suite resolves cleanly
    • SECURITY.md, SUPPORT.md, and a Version Support policy documenting which
      branches receive fixes
    • CONTRIBUTING.md, issue/PR templates, CODEOWNERS, and Dependabot
      (composer + github-actions)
    • composer.json support block and expanded keywords

    Changed

    • Widened dev-tooling constraints: PHPUnit ~9-13, PHPStan ^1.0|^2.0
    • Modernized CI: explicit PHP<->PHPUnit compatibility matrix, pcov coverage,
      updated action versions, added a legacy-stack verification job
    • Simplified getTimestamp()'s division (credit: Michal Spacek, #232)

    Fixed

    • Codecov upload no longer hard-fails CI when the token is unavailable
      (e.g. fork pull requests)
    • Removed the dead code-quality job and retired Scrutinizer (unused,
      pointed at a coverage file no longer produced)
    • Three separate GitHub Actions were stuck on deprecated Node.js 20
      (actions/cache, codecov-action's internal pin, actions/setup-node)

    No behavioral changes to secret generation, HMAC computation, or OTP
    verification. See docs/audit/9.x-ci-and-governance/03-src-security-review.md
    for the line-by-line review.

    Open source →
    Release notes

    Added

    • Support for PHP 8.6 (beta) in the CI test matrix, with automatic fallback (continue-on-error) while the toolchain catches up
    • Psalm static analysis alongside PHPStan, including the psalm/plugin-phpunit plugin so PHPUnit's TestCase hierarchy resolves correctly
    • SECURITY.md, SUPPORT.md, and a Version Support policy documenting which branches receive fixes
    • composer.json support block (issues/source/docs/security) and expanded keywords (totp, hotp, otp, mfa, rfc4226, rfc6238)

    Changed

    • Widened dev-tooling constraints: PHPUnit ~9|~10|~11|~12|~13, PHPStan ^1.0|^2.0
    • Modernized CI: explicit PHP↔PHPUnit compatibility matrix, pcov coverage, updated action versions, added a legacy-stack verification job
    • Simplified getTimestamp()'s division (credit: Michal Špaček, cherry-picked from #232)

    Fixed

    • Codecov upload no longer hard-fails CI when secrets.CODECOV_TOKEN is unavailable (e.g. on fork pull requests)
    • Removed the dead code-quality job (Prettier/Node.js) that never ran against this PHP-only package
    • Retired .scrutinizer.yml, which pointed at a coverage file no longer produced; Codecov already covers this

    Security

    • No behavioral change to secret generation, HMAC computation, or OTP verification — see docs/audit/9.x-ci-and-governance/03-src-security-review.md for the line-by-line review
    Open source →
  2. v9.0.0 19 Sep 2025
    Release notes

    ⚠️ Version 9.0.0 Breaking Change

    Default Secret Key Length Increased

    Version 9.0.0 introduces a breaking change: The default secret key length has been increased from 16 to 32 characters for enhanced security.

    What Changed?

    • generateSecretKey() now generates 32-character secrets by default (previously 16)
    • This increases cryptographic entropy from 80 bits to 160 bits
    • Maintains full compatibility with Google Authenticator and other TOTP apps

    Migration Guide

    If you want to keep the previous behavior (16-character secrets):

    // Old default behavior (v8.x and below)
    $secret = $google2fa->generateSecretKey();
    
    // New way to get 16-character secrets (v9.0+)
    $secret = $google2fa->generateSecretKey(16);
    
    If you want to use the new default (32-character secrets):
    
    // This now generates 32-character secrets by default
    $secret = $google2fa->generateSecretKey();
    
    Potential Impact Areas
    
    - Database schemas: Check if your google2fa_secret columns can handle 32 characters
    - Validation rules: Update any length validations that expect exactly 16 characters
    - Tests: Update test assertions expecting 16-character secrets
    - UI components: Ensure QR code displays and secret key fields accommodate longer secrets
    
    Important: Existing 16-character secrets remain fully functional. Database updates are only needed if you want to use the new 32-character default behavior.
    
    Why This Change?
    
    While 16-character secrets meet RFC 6238 minimum requirements, 32-character secrets provide significantly better security:
    
    - 16 chars: 80 bits of entropy (adequate but minimal)
    - 32 chars: 160 bits of entropy (much stronger against brute force)
    
    This change aligns with modern security best practices for cryptographic applications.
    Open source →
    Release notes

    ⚠️ Breaking Change

    Added

    • Increased default secret key length from 16 to 32 characters for enhanced security
    • Cryptographic entropy increased from 80 bits to 160 bits
    • Maintains full compatibility with Google Authenticator and other TOTP apps

    Changed

    • generateSecretKey() now generates 32-character secrets by default
    • To maintain previous behavior, use generateSecretKey(16)
    • Updated tests to reflect new default behavior

    Security

    • This change significantly improves security against brute force attacks
    • 32-character secrets provide stronger cryptographic protection while maintaining RFC 6238 compliance
    Open source →
  3. v8.0.3 05 Sep 2024

    Nothing published for this version

  4. v8.0.2 13 Jul 2024

    Nothing published for this version

  5. v8.0.1 13 Jun 2022
    Release notes

    Added

    • Test using GitHub Actions

    Fixed

    • Improve PHP 8.1 compatibility
    Open source →
  6. 8.0.0 05 Apr 2020
    Release notes

    Merge pull request #153 from antonioribeiro/analysis-YjDN3K

    Apply fixes from StyleCI

    [ci skip] [skip ci]

    Open source →
    Release notes

    Added

    • PHP 8 Support
    • Tests
    • Extract som test helpers
    • PHPStan checks

    Changed

    • PHP required version bumped to >= 7.1
    • Exception interfaces extending Throwable
    Open source →
  7. v7.0.0 21 Oct 2019
    Release notes

    Added

    • PHPStan checks

    Removed

    • Constants::ARGUMENT_NOT_SET - This is a BC break
    Open source →
  8. v6.1.3 02 Oct 2019
    Release notes

    Drafted

    • To fix inserted BC break
    Open source →
  9. v6.1.0 23 Sep 2019

    Nothing published for this version

  10. v6.0.1 18 Sep 2019

    Nothing published for this version

  11. v6.0.0 11 Sep 2019
    Release notes

    Added

    • Base exception class and interfaces

    Removed

    • Support for PHP 5.4 to 7.0, will keep supporting PHP 7.1, 7.2, 7.3 & 7.4
    Open source →
  12. v5.0.0 19 Mar 2019
    Release notes

    Changed

    • Remove dead Google Charts API
    Open source →
  13. v4.0.2 19 Mar 2019

    Nothing published for this version

  14. v4.0.1 19 Mar 2019

    Nothing published for this version

  15. v4.0.0 06 Oct 2018
    Release notes

    Changed

    • Bacon QRCode package removed
    Open source →
  16. v3.0.3 29 Aug 2018

    Nothing published for this version

  17. v3.0.2 31 Jul 2018

    Nothing published for this version

  18. v3.0.1 15 Mar 2018
    Release notes

    Changed

    • Relicensed to MIT
    Open source →
  19. v3.0.0 07 Mar 2018
    Release notes

    Changed

    • It's now mandatory to enable Google Api secret key access by executing setAllowInsecureCallToGoogleApis(true);
    Open source →
  20. v2.0.7 06 Jan 2018

    Nothing published for this version

  21. v2.0.6 12 Sep 2017

    Nothing published for this version

  22. v2.0.5 03 Jul 2017

    Nothing published for this version

  23. v2.0.4 22 Jun 2017
    Release notes

    Fixed

    • Fix Base32 to keep supporting PHP 5.4 && 5.5.
    Open source →
  24. v2.0.3 22 Jun 2017

    Nothing published for this version

  25. v2.0.2 21 Jun 2017

    Nothing published for this version

  26. v2.0.1 21 Jun 2017
    Release notes

    Fixed

    • Minor bugs
    Open source →
  27. v2.0.0 20 Jun 2017
    Release notes

    Changed

    • Drop the Laravel support in favor of a bridge package (https://github.com/antonioribeiro/google2fa-laravel).
    • Using a more secure Base 32 algorithm, to prevent cache-timing attacks.
    • Added verifyKeyNewer() method to prevent reuse of keys.
    • Refactored to remove complexity, by extracting support methods.
    • Created a package playground page (https://pragmarx.com/google2fa)
    Open source →
  28. v1.0.1 18 Jul 2016
    Release notes

    Changed

    • Drop support for PHP 5.3.7, require PHP 5.4+.
    • Coding style is now PSR-2 automatically enforced by StyleCI.
    Open source →
  29. v1.0.0 17 Jul 2016
    Release notes

    Changed

    • Package bacon/bacon-qr-code was moved to "suggest".
    Open source →
  30. v0.8.1 17 Jul 2016
    Release notes

    Fixed

    • Allow paragonie/random_compat ~1.4|~2.0.
    Open source →
  31. v0.8.0 17 Jul 2016
    Release notes

    Changed

    • Bumped christian-riesen/base32 to ~1.3
    • Use paragonie/random_compat to generate cryptographically secure random secret keys
    • Readme improvements
    • Drop simple-qrcode in favor of bacon/bacon-qr-code
    • Fix tavis setup for phpspec, PHP 7, hhvm and improve cache
    Open source →
  32. v0.7.1 07 Nov 2015

    Nothing published for this version

  33. v0.7.0 07 Nov 2015
    Release notes

    Changed

    • Fixed URL generation for QRCodes
    • Avoid time attacks
    Open source →
  34. v0.6.0 06 Nov 2015

    Nothing published for this version

  35. v0.5.0 20 Feb 2015

    Nothing published for this version

  36. v0.1.0 22 Sep 2014
    Release notes

    Added

    • First version.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive