Skip to content

Conversation

@lreowy
Copy link

@lreowy lreowy commented Jan 22, 2026

Deprecate BCrypt.gensalt(String, int) and modify BCryptPasswordEncoder constructors to create and reuse SecureRandom instances.

Closes gh-17824

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 22, 2026
Creating a new SecureRandom instance on every call causes
unnecessary performance overhead. This change:

- Deprecates BCrypt.gensalt(String, int) method
- Modifies BCryptPasswordEncoder constructors to create
  and reuse SecureRandom instances
- Maintains backward compatibility

All existing tests pass.

Closes spring-projectsgh-17824

Signed-off-by: Yerin Lee <rt8632@naver.com>
- Deprecates BCrypt.gensalt(int) method

Closes spring-projectsgh-17824

Signed-off-by: Yerin Lee <rt8632@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[spring-security/crypto/bcrypt] [performance] SecureRandom created every for single password encode

2 participants