Skip to content

Use SecureRandom for cryptographic operations and remove SHA1PRNG dependency#1439

Open
jmestwa-coder wants to merge 1 commit intoapache:masterfrom
jmestwa-coder:secure-random-cryptographic-hardening
Open

Use SecureRandom for cryptographic operations and remove SHA1PRNG dependency#1439
jmestwa-coder wants to merge 1 commit intoapache:masterfrom
jmestwa-coder:secure-random-cryptographic-hardening

Conversation

@jmestwa-coder
Copy link
Copy Markdown

Summary

Replace java.util.Random with SecureRandom in cryptographic usage and remove hardcoded "SHA1PRNG".

Changes

  • Use SecureRandom for salt generation in SunJceCrypt
  • Replace "SHA1PRNG" with new SecureRandom() in DefaultSecureRandomSupplier

Why

  • Random is predictable and not suitable for cryptographic use
  • Salt generation requires high-entropy randomness
  • Avoid hardcoded PRNG and let JVM choose the appropriate provider

Impact

  • No API or behavior changes
  • Backward compatible
  • Improves randomness quality in security-sensitive paths

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