pkg-auth-util-auth-crypto-library

Modify JWT utilities and password hashing while preserving compatibility in pkg-auth-util.

Updated Dec 11, 2025
One-click install
npx skills add https://github.com/CareCard-ca/pkg-auth-util --skill pkg-auth-util-auth-crypto-library
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pkg-auth-util-auth-crypto-library
Source: https://github.com/CareCard-ca/pkg-auth-util/tree/main/.agents/skills/pkg-auth-util-auth-crypto-library
Command: npx skills add https://github.com/CareCard-ca/pkg-auth-util --skill pkg-auth-util-auth-crypto-library

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents breakage and security regressions when you need to change authentication and cryptography behavior in the CareCard auth utility package.

Core Features & Use Cases

  • JWT primitives maintenance: Update JWT creation, verification, parsing, and service-to-service token formats (including header/payload timing semantics) with compatibility in mind.
  • Password hashing compatibility: Preserve the HMAC-based hashing behavior and the saved password hash string format ($1$base64(algorithm)$base64(hash)$base64(salt)$), including salt handling.
  • Crypto and key generation stability: Change signing/verification primitives and key pair generation (Ed25519 and RSA) while ensuring deterministic tests and strict error handling.
  • Use Case: You’re modifying how JWTs or password hashes are produced/validated in @carecard/auth-util and must update exports and types while keeping consumer compatibility and test coverage.

Quick Start

Use this skill when asked to update pkg-auth-util authentication or cryptographic behavior, then implement the change with matching Mocha runtime tests and TypeScript declaration/type tests.

Frequently Asked Questions about pkg-auth-util-auth-crypto-library

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update JWT utilities without breaking existing authentication behavior?

To update JWT utilities safely, modify creation, verification, and parsing while preserving existing failure modes like null or false returns. Ensure header and payload timing semantics remain intact and update index exports and TypeScript declarations to prevent consumer breakage.

What is the correct format for preserving password hashing compatibility?

Password hashing compatibility requires preserving the HMAC-based saved hash string format: $1$base64(algorithm)$base64(hash)$base64(salt)$. When modifying hashing behavior, maintain existing salt handling and strict error handling to avoid security regressions and authentication failures.

Can I change key generation primitives for Ed25519 and RSA while keeping tests deterministic?

Yes, you can change signing, verification, and key pair generation primitives for Ed25519 and RSA. To keep tests deterministic, ensure strict error handling is applied and update Mocha runtime tests alongside TypeScript type tests before final validation.

How do I prevent secrets from leaking when modifying cryptography behavior?

Preventing secret leaks when modifying cryptography behavior requires avoiding secrets in application logs. Maintain existing string and format contracts for crypto primitives and ensure timing semantics are preserved during validation to prevent security regressions.

What should I update before final validation of authentication and cryptography changes?

Before final validation of authentication and cryptography changes, update index exports, TypeScript declarations, and Mocha runtime tests. Ensure matching type tests are implemented to verify that consumer compatibility is maintained across all modified API surfaces.

Does modifying service-to-service token formats affect timing semantics?

Modifying service-to-service token formats can affect timing semantics if not handled carefully. Preserve existing header and payload timing contracts and ensure null or false failure modes are maintained to prevent authentication behavior regressions across consumers.