Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Jwt Signature Algorithm Hmac Laravel Package

web-token/jwt-signature-algorithm-hmac

HMAC signature algorithm support for the web-token/jwt framework. Provides HS256, HS384, and HS512 signing and verification using shared secrets, integrating with JWT creation and validation in PHP.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Authentication architecture: symmetric vs. asymmetric signing. This package is the HS256/HS384/HS512 implementation for the web-token/jwt-framework. Adopting it is an explicit decision that issuer and verifier share a secret. That is the right call for first-party, server-to-server traffic (internal microservices, queue workers, cron jobs, service mesh tokens) and the wrong call for anything a third party or a browser must verify.
  • Build vs. buy for token signing. The alternative is hand-rolling hash_hmac plus base64url encoding and constant-time comparison, or pulling in a monolith like firebase/php-jwt or tymon/jwt-auth. This is a "buy" in the sense that you adopt a spec-compliant, separately versioned algorithm implementation instead of owning crypto correctness. At 14 stars and 0 listed dependents, evaluate it as a component of the JWT Framework, not as a standalone dependency — the framework's reputation and release cadence are the real signal.
  • Feature scoping for Laravel API auth. Directly enables stateless API authentication, short-lived access tokens, signed webhook payloads, and password-reset / email-verification tokens where a shared secret is acceptable. It does not by itself give you refresh-token rotation, key management, revocation, or JWKS — those are product decisions layered on top.
  • Roadmap: the algorithm matrix. If the roadmap includes external API consumers, OIDC/Social login, or "let customers verify our tokens," you will need RS256/ES256, which lives in a sibling package. Deciding to ship HMAC first and asymmetric later is fine, but it must be a planned migration (dual-accept window, key rotation, client coordination), not a swap.
  • Make vs. integrate at the framework level. Because the JWT Framework is modular, this package is only worth adopting alongside web-token/jwt-framework (or the relevant core packages). The PM decision is really "standardize on web-token/jwt-framework for JWT in our PHP services," and this package is one leaf of that decision.
  • Risk posture. MIT license, no cost, no vendor lock-in, no telemetry. The risk is maintenance surface: a low-visibility algorithm plugin is exactly the kind of transitive dependency that goes unpatched. Budget for dependency monitoring.

When to Consider This Package

Adopt when:

  • You already use (or are standardizing on) web-token/jwt-framework and need HS256/384/512 — this is the canonical, spec-correct implementation for that framework.
  • You control both the issuing and verifying service, and secret distribution is already solved (env vars, secrets manager, Vault/KMS).
  • You want narrow, auditable crypto code rather than importing an entire JWT stack, and you're comfortable composing several small packages.
  • You need strict JWT/JWS compliance (alg handling, alg: none rejection, base64url correctness) and don't want to defend a hand-rolled implementation in a security review.
  • You're building internal-only tokens: service-to-service auth, signed webhooks, short-lived job tokens, integration test fixtures.

Look elsewhere when:

  • You need asymmetric signing or public-key verification — use the RSA/ECDSA/EdDSA algorithm packages instead; do not ship a shared secret to clients you don't control.
  • You want one dependency that "just does JWT" in Laravel — tymon/jwt-auth or firebase/php-jwt already bundle HMAC and have far larger install bases and community support.
  • You need key rotation, JWKS endpoints, revocation, or multi-tenant key isolation out of the box; this package provides the primitive, not the key-management product.
  • Your team has no existing investment in web-token/jwt-framework. Adding a 14-star, 0-dependent leaf package as a new dependency chain is hard to justify when a single mature library covers the same ground.
  • You need HS* in a non-PHP service — the algorithm is trivial to implement elsewhere; consistency across languages argues for OIDC-standard asymmetric flows.

How to Pitch It (Stakeholders)

For executives: We need signed tokens to authenticate service-to-service calls and API requests. Rather than write our own signing code — a classic source of security incidents — we can adopt a small, MIT-licensed, standards-compliant component from an established PHP JWT framework. It costs nothing, adds no vendor relationship, and reduces the chance of a token-forgery or timing-attack bug reaching production. The trade-off is that it is a narrow component, not a platform: it signs tokens, it does not manage keys or revocation, so we still own operational key handling. It is also symmetric-only, meaning it fits internal traffic today but will not support external partners or social login without a follow-on asymmetric algorithm package — a known, plannable piece of work.

For engineering: This is the HMAC algorithm plugin for web-token/jwt-framework. It gives us HS256/384/512 with correct base64url handling and constant-time verification, instead of us maintaining that logic. Adoption assumes the framework's core packages come with it, so the real review is "do we standardize on web-token/jwt-framework?" The repo itself is low-traffic (14 stars, no listed dependents), so treat the framework's release cadence as the maintenance signal and add it to dependency scanning. Secret distribution and rotation remain our problem — plan for a secrets manager and a key-id (kid) strategy from day one, so the eventual move to RS256/ES256 is a configuration change rather than a rewrite.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels