sop/crypto-types
Strongly typed cryptocurrency value objects and Eloquent casts for Laravel. Store, convert, and compare Bitcoin, satoshi, and fiat amounts safely with immutable types that avoid floating-point rounding errors in your models and domain code.
r||s from some platforms (Android Keystore, WebAuthn authenticators) and as DER SEQUENCE from others. Supporting both is a library problem, not a product problem — this is the kind of thing that silently blocks an integration late in a release.Adopt (directly or knowingly as a transitive dependency) when:
sop/* family and this comes along for free — in that case the decision is "accept it," and the diligence is just version pinning.Look elsewhere when:
Crypt/Hash or libsodium. This package does nothing for you.web-token/jwt-library, lcobucci/jwt, or firebase/php-jwt instead; this is a layer beneath those.sop/x509 or a real PKI/CA service, not this.phpseclib has far broader adoption, its own ASN.1 handling, and a much larger support base. Prefer this package as a transitive dep rather than a direct one you're betting on.Sop\CryptoTypes\* classes directly, that's a smell — wrap it.For executives (one paragraph): This is not a feature; it's plumbing that lets us interoperate safely with other systems' cryptography without writing our own parsers. MIT-licensed, no cost, no vendor lock-in, negligible footprint. The reason to care is risk and speed: format-mismatch bugs near private keys are expensive, late-breaking, and security-sensitive, and this removes a class of them. The reason not to over-invest: it's a small, low-community library, so we should consume it through a well-maintained higher-level stack (the JWT Framework family) and keep it pinned and wrapped, not build product surface on it.
For engineering: Typed classes for AlgorithmIdentifier, SubjectPublicKeyInfo, RSAPublicKey, PrivateKeyInfo, and ECDSA signature structures — DER in, objects out, and back. It replaces ad-hoc base64_decode + substr key surgery with something reviewable. Zero Laravel integration cost: no provider, no config, no migrations. Two asks: (1) pin the version and treat upgrades as a security-relevant change, (2) put an internal KeyConverter/SignatureFormat interface in front of it so we can swap to phpseclib if maintenance stalls. If the requirement is genuinely just "sign and verify a token," prefer a higher-level library and let this arrive as a transitive dependency rather than a direct one.
How can I help you explore Laravel packages today?