All Projects → antonioribeiro → recovery

antonioribeiro / recovery

Licence: MIT license
Create recovery/backup codes for 2FA

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to recovery

2FAuth
A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
Stars: ✭ 664 (+822.22%)
Mutual labels:  two-factor-authentication, 2fa
crystal-two-factor-auth
Two Factor Authentication Crystal code implementing the Time-based One-time Password Algorithm
Stars: ✭ 24 (-66.67%)
Mutual labels:  two-factor-authentication, 2fa
2fa
Two-factor authentication for Symfony applications 🔐 (bunde version ≥ 5)
Stars: ✭ 162 (+125%)
Mutual labels:  two-factor-authentication, 2fa
Twofa
A TouchID-aware 2-factor authenticator for macOS
Stars: ✭ 105 (+45.83%)
Mutual labels:  two-factor-authentication, 2fa
SimpleTOTP
A highly configurable yet simple to use TOTP based two-factor authentication processing module for SimpleSAMLphp.
Stars: ✭ 16 (-77.78%)
Mutual labels:  two-factor-authentication, 2fa
One Time
One Time Password (TOTP and HOTP) library for Clojure. TOTP/HOTP is widely used for Two Factor / Multi Factor Authentication.
Stars: ✭ 129 (+79.17%)
Mutual labels:  two-factor-authentication, 2fa
Onetimepassword
🔑 A small library for generating TOTP and HOTP one-time passwords on iOS.
Stars: ✭ 243 (+237.5%)
Mutual labels:  two-factor-authentication, 2fa
Otplib
🔑 One Time Password (OTP) / 2FA for Node.js and Browser - Supports HOTP, TOTP and Google Authenticator
Stars: ✭ 916 (+1172.22%)
Mutual labels:  two-factor-authentication, 2fa
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-66.67%)
Mutual labels:  two-factor-authentication, 2fa
crotp
CrOTP - One Time Passwords for Crystal
Stars: ✭ 62 (-13.89%)
Mutual labels:  two-factor-authentication, 2fa
Webauthn
A simple PHP WebAuthn (FIDO2) server library
Stars: ✭ 96 (+33.33%)
Mutual labels:  two-factor-authentication, 2fa
totp
Time-Based One-Time Password Code Generator
Stars: ✭ 76 (+5.56%)
Mutual labels:  two-factor-authentication, 2fa
Google2fa
A One Time Password Authentication package, compatible with Google Authenticator.
Stars: ✭ 1,330 (+1747.22%)
Mutual labels:  two-factor-authentication, 2fa
Authenticatorpro
📱 Two-Factor Authentication (2FA) client for Android + Wear OS
Stars: ✭ 155 (+115.28%)
Mutual labels:  two-factor-authentication, 2fa
Privacyidea
🔐 multi factor authentication system (2FA, MFA, OTP Server)
Stars: ✭ 1,027 (+1326.39%)
Mutual labels:  two-factor-authentication, 2fa
Twofactor totp
🔑 Second factor TOTP (RFC 6238) provider for Nextcloud
Stars: ✭ 203 (+181.94%)
Mutual labels:  two-factor-authentication, 2fa
Authelia
The Single Sign-On Multi-Factor portal for web apps
Stars: ✭ 11,094 (+15308.33%)
Mutual labels:  two-factor-authentication, 2fa
Authenticator
Two-Factor Authentication Client for iOS
Stars: ✭ 648 (+800%)
Mutual labels:  two-factor-authentication, 2fa
extract otp secret keys
Extract two-factor authentication (2FA, TFA) secret keys from export QR codes of "Google Authenticator" app
Stars: ✭ 217 (+201.39%)
Mutual labels:  recovery, 2fa
otp-java
A small and easy-to-use one-time password generator library for Java according to RFC 4226 (HOTP) and RFC 6238 (TOTP).
Stars: ✭ 107 (+48.61%)
Mutual labels:  two-factor-authentication, 2fa

Recovery Codes

Latest Stable Version Software License Build Status Code Coverage Scrutinizer Code Quality StyleCI

Generate recovery/backup codes to provide a way for your users to recover from a lost two factor auth, or any problem with it.

Install

Via Composer

$ composer require pragmarx/recovery

Usage

Basic array usage

$this->recovery = new PragmaRX\Recovery();

$this->recovery->toArray();

Collection

If you are using Laravel or install a package like Collect, you can:

$this->recovery->toCollection();

You can also define a different collection function to be used:

$this->recovery->collectionFunction('alternateCollection');

$this->recovery->setCount(8)->toCollection();

Json result

$this->recovery->toJson();

Should give you

[  
   "C0r2Xp4o1v-oG3pteKXw3",
   "oLuSmVeJ7D-t4wnJVwkuC",
   "XdPXXJy3J6-Gl3d0EwWt7",
   "Bn8twjUJRt-Lv3KaAFwjR",
   "SrnMagyGRg-eC7WPyFQ17",
   "mRO4WPJpRN-hgfrUZqqZd",
   "xBZtyFOrJZ-Tbpg0pSvzf",
   "eiPFmwvJp0-oSqdNKclDH"
]

Changing the result values/sizes

$this->recovery
     ->setCount(8)     // Generate 8 codes
     ->setBlocks(5)    // Every code must have 7 blocks
     ->setChars(16)    // Each block must have 16 chars
     ->toArray();

Should give you

[  
   "0ldZb4vhamHEd8B3-Tmri54Lb0t52wefR-gbJaHTN44O9C1igf-HRdF185SXxDwcdRf",
   "sFyrtezhjbFhCube-MszCKzvdsNL7QEY1-IY5OtpsFqM5d7jA7-t2mjCViRMHcMDdNZ",
   "bjKMlcsPhNrpFpSN-IbJR2ebOeXCxXVVb-omZLu3Ki9ImIEqZh-1sK74zOADl86GGRs",
   "wpa23eFj8PJcPdMG-E8A4LCwmd8iF8jt4-bVi2ltUEv29zoPJJ-pSetq2GD6euvZ9RA",
   "EJ3SRDQlddr2e2hT-eF79n1lqndwhRM7G-HrjHEVyA9zHSLi8g-TrHzl5oaqPi1NgCT",
   "lL7p4zjFxhQLND24-MEV1lmmyEKObjhhT-ldRWbOEnJLjBHmuc-Iex10bYAZ3NBljo2",
   "uomVxkrjGYqOqmdm-AtI9MiqFEJjTlSRi-AUNEwwUfrJVP5iaH-uyrsFCrqzC3WcaAa"
]

Numeric or alpha?

$this->recovery
     ->numeric()       // Generate numeric only codes
     ->toArray();
     
$this->recovery
     ->alpha()        // Get back to default alpha generation
     ->toArray();

Upper, lower and mixed case

$this->recovery
     ->lowercase()    // All lower
     ->toArray();
     
$this->recovery
     ->uppercase()    // All upper
     ->toArray();
     
$this->recovery
     ->mixedcase()    // Get back to default mixed case
     ->toArray();

Block separator

Usually - is used as a block separator, but you can change it with:

$this->recovery->setBlockSeparator('|')->toJson();

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer update
$ vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].