feat(format): rename default prefix from ak to ak_v1 for versioned key format#28
Merged
Merged
Conversation
…enumeration OWASP API2:2023: move hash verification before ensure_valid() so a caller with a wrong secret always receives 401 InvalidKey, regardless of whether the key is inactive or expired. Adds regression test and updates mermaid flow diagrams to reflect the STATE_CHECK step after COMPARE. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…re-hashing Bcrypt silently truncates input at 72 bytes. Concatenating key_secret (64 chars) with a pepper could push the combined string past that limit, causing the tail characters to be ignored — two distinct secrets could produce the same hash. Fix: _apply_pepper() now computes HMAC-SHA256(pepper, secret), producing a fixed 32-byte digest that is always well within bcrypt's input limit. The pepper remains cryptographically bound to the secret as the HMAC key. This is a breaking change: hashes stored under the old concatenation scheme will not verify with the new implementation; affected keys must be re-issued. Also updates README, docs/index.md, and docs/schema.mermaid to document the NIST SP 800-132 compliance entry, the OWASP API2:2023 bullet (missing from docs/index.md), the STATE_CHECK node (missing from the docs/index.md diagram), and the NOTE_ARGON annotation to cover both Argon2 and Bcrypt strategies. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.