Skip to content

Add self-validation method for CryptoSecrets#23

Merged
zHd4 merged 6 commits into
masterfrom
add-self-validation-method-for-crypto-secrets
Jul 16, 2026
Merged

Add self-validation method for CryptoSecrets#23
zHd4 merged 6 commits into
masterfrom
add-self-validation-method-for-crypto-secrets

Conversation

@zHd4

@zHd4 zHd4 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

This PR adds a validate() method to the CryptoSecrets class that performs comprehensive validation of cryptographic secrets, ensuring keys and passwords meet security requirements:

  • Key is not null/empty and exactly 384-bit (48 bytes) in size
  • Password is not null/empty and at least 4 characters long
  • Key is not all zeros (preventing nulled/destroyed keys from being used)
  • Password contains at least one non-zero character (preventing nulled/destroyed passwords)
  • The PR also includes helper utilities (KeyUtils.isKeyNulled() and CharUtils.hasNonZeroChars()), refactors the KEY_SIZE constant to be part of CryptoSecrets, and adds comprehensive unit tests for all new validation logic

@zHd4 zHd4 self-assigned this Jul 16, 2026
@zHd4
zHd4 merged commit 000d556 into master Jul 16, 2026
4 checks passed
@zHd4
zHd4 deleted the add-self-validation-method-for-crypto-secrets branch July 16, 2026 10:13
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