Download the PHP package infocyph/otp without Composer

On this page you can find all versions of the php package infocyph/otp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package otp

Infocyph OTP

Security & Standards Packagist Downloads License: MIT Packagist Version Packagist PHP Version GitHub Code Size Documentation

Framework-agnostic PHP 8.4 primitives for Generic OTP, HOTP (RFC 4226), TOTP (RFC 6238), OCRA (RFC 6287), recovery codes, provisioning URIs, SVG QR codes, secret rotation planning, and atomic replay boundaries.

Requirements

TOTP quickstart

The default SHA-1/6-digit/30-second configuration has the broadest authenticator compatibility.

For replay protection, a factor ID and an atomic store are both required:

factorId must identify one factor and secret generation, not merely a user. Production stores must implement atomic conditional updates in shared durable storage. The in-memory stores are process-local and are not production replay protection.

HOTP

Persist nextCounter, not matchedCounter. Supported counters are 0..PHP_INT_MAX; HOTP/TOTP use 6..9 digits and require at least 128-bit decoded secrets.

Generic OTP

Issuing again for the same binding atomically replaces the previous code. A successful verification consumes it. A mismatch decrements attempts without changing the absolute expiration. HMAC-SHA-256 storage is mandatory and bound to the challenge. Applications remain responsible for transport, resend cooldowns, endpoint/account throttling, and anti-enumeration behavior.

OCRA

OCRA operation inputs are explicit and suite-driven; an input is rejected when the suite does not authenticate it.

Use fromBase32() for enrolled Base32 secrets. generateMutual() models client/server challenge composition explicitly. Session input is actual UTF-8; sessionHex() is an explicit integration helper. Time suites accept a bounded VerificationWindow. Suites with t=0 return uppercase hexadecimal; truncated suites allow 4..9 digits. Challenge replay tokens are SHA-256 digests, and a challenge replay TTL is optional; high-volume systems should choose a retention policy that covers the complete acceptance window.

otpauth://ocra is a library/client convention, not an RFC-standardized provisioning format. The consuming client must explicitly support it.

Recovery codes

The active batch is replaced on regeneration. Consumption and its returned counts are one atomic mutation. Custom configurations must provide at least 40 bits of entropy. Submitted input is bounded before normalization.

Security boundary

Correct OTP math is not a complete authentication workflow. Store factor secrets encrypted, keep Generic OTP and recovery HMAC keys separate, use TLS, apply rate limits, protect provisioning URIs/QR SVGs as secrets, rotate factor IDs when secrets rotate, and implement atomic stores in Redis or a database. See the security and storage guides for the required atomic semantics.

Security

Do not disclose suspected vulnerabilities in a public issue, discussion or pull request. Review the GitHub private vulnerability reporting to contact the maintainers confidentially.

OTP is protected by PHPForge, an automated quality and security gate covering tests, static and taint analysis, dependency auditing, architecture checks, and release readiness. Automated controls reduce risk but do not replace responsible disclosure or manual review.


Made with ❤️ for the PHP community
MIT Licensed
Documentation • Security • Code of Conduct • Contributing
🗂️ BugFeatureDocumentationQuestionCI failure
🔀 GeneralBug fixFeatureRefactorPerformanceSecurity & reliabilityDocumentationMaintenance

All versions of otp with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
php-64bit Version ^8.4
ext-ctype Version *
bacon/bacon-qr-code Version ^3.1.1
infocyph/cachelayer Version ^3.1.1
paragonie/constant_time_encoding Version ^3.1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package infocyph/otp contains the following files

Loading the files please wait ...