secret.php 433 B

12345678910
  1. <?php
  2. use RobThree\Auth\TwoFactorAuth;
  3. require_once __DIR__ . "/../vendor/autoload.php";
  4. $tfa = new TwoFactorAuth("Hestia Control Panel");
  5. $secret = $tfa->createSecret(160); // Though the default is an 80 bits secret (for backwards compatibility reasons) we recommend creating 160+ bits secrets (see RFC 4226 - Algorithm Requirements)
  6. $qrcode = $tfa->getQRCodeImageAsDataUri(gethostname(), $secret);
  7. echo $secret . "-" . $qrcode;