Skip to content

feat: implement scrypt#26

Merged
krakenhavoc merged 2 commits intomainfrom
feature/scrypt
Mar 27, 2026
Merged

feat: implement scrypt#26
krakenhavoc merged 2 commits intomainfrom
feature/scrypt

Conversation

@krakenhavoc
Copy link
Copy Markdown
Contributor

This pull request updates the API key hashing mechanism in the authentication service from HMAC-SHA256 to scrypt, enhancing security by making hashes more resistant to brute-force attacks. It also updates related environment variables, error handling, and test cases to reflect this change.

Security improvements (API key hashing):

  • Switched the API key hashing algorithm from HMAC-SHA256 to scrypt for stronger, more secure key derivation in AuthService (auth.service.ts), including updating the hashKey method and related documentation/comments.
  • Updated all references and tests to use scrypt instead of HMAC-SHA256, ensuring both key creation and validation use the new algorithm (auth.service.spec.ts). [1] [2] [3] [4]

Configuration and error handling:

  • Added KK_HMAC_SECRET to .env.example with instructions for generating a secure secret, and improved error/warning messages if the secret is missing during initialization or service key seeding (.env.example, auth.service.ts). [1] [2] [3]

These changes collectively improve the security and reliability of API key management in the authentication service.

@krakenhavoc krakenhavoc merged commit 277ac4d into main Mar 27, 2026
19 checks passed
@krakenhavoc krakenhavoc deleted the feature/scrypt branch March 27, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant